Skip to content

Commit

Permalink
Fixed the LastWords screens saver build, ensure definition structure …
Browse files Browse the repository at this point in the history
…and references end up the same segment, moved both to code segment. Fixed a random token reference that prevents the bug initially reported. #514
  • Loading branch information
frehwagen committed Apr 20, 2024
1 parent c16e215 commit 585ebf2
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 73 deletions.
39 changes: 21 additions & 18 deletions Appl/Saver/LastWords/lastwords.goc
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ Boolean LWComputeGraphicBounds(optr oself,
word *height);
VMFileHandle LWVMFileOpen(void);

/*******************************************************************
App instance...
*******************************************************************/

@start AppResource;

/*******************************************************************
Code and Message Handlers
Expand All @@ -82,39 +77,46 @@ typedef struct {
SAOptionDesc LW_saod[LW_NUMBER_OF_OPTIONS];
} LWSAOptionTable;

@chunk LWSAOptionTable lastwordsOptionTable = {
{LW_INI_CATEGORY, LW_NUMBER_OF_OPTIONS},
const LWSAOptionTable lastwordsOptionTable = {
{(char __near*) LW_INI_CATEGORY, LW_NUMBER_OF_OPTIONS},
{ /* Table o' options: */
{LW_INI_KEY_TYPE,
{(char __near*) LW_INI_KEY_TYPE,
sizeof(LWFormatType),
word_offsetof(LWApplicationInstance, LWCI_format)},
{LW_INI_KEY_RANDOM_COLOR,
{(char __near*) LW_INI_KEY_RANDOM_COLOR,
sizeof(Boolean),
word_offsetof(LWApplicationInstance, LWCI_randomColor)},
{LW_INI_KEY_COLOR,
{(char __near*) LW_INI_KEY_COLOR,
sizeof(byte),
word_offsetof(LWApplicationInstance, LWCI_color)},
{LW_INI_KEY_MOTION,
{(char __near*) LW_INI_KEY_MOTION,
sizeof(SaverVectorReflectType),
word_offsetof(LWApplicationInstance, LWCI_motion)},
{LW_INI_KEY_SPEED,
{(char __near*) LW_INI_KEY_SPEED,
sizeof(LWSpeedType),
word_offsetof(LWApplicationInstance, LWCI_speed)},
{LW_INI_KEY_SIZE,
{(char __near*) LW_INI_KEY_SIZE,
sizeof(word),
word_offsetof(LWApplicationInstance, LWCI_size)},
{LW_INI_KEY_RANDOM_ANGLE,
{(char __near*) LW_INI_KEY_RANDOM_ANGLE,
sizeof(Boolean),
word_offsetof(LWApplicationInstance, LWCI_randomAngle)},
{LW_INI_KEY_ANGLE,
{(char __near*) LW_INI_KEY_ANGLE,
sizeof(sword),
word_offsetof(LWApplicationInstance, LWCI_angle)},
{LW_INI_KEY_FONT,
{(char __near*) LW_INI_KEY_FONT,
sizeof(FontID),
word_offsetof(LWApplicationInstance, LWCI_fontID)},
}
};


/*******************************************************************
App instance...
*******************************************************************/

@start AppResource;

@object LWApplicationClass LWApp = {
GI_visMoniker = list {@LWTextMoniker};
}
Expand Down Expand Up @@ -161,7 +163,7 @@ typedef struct {
* .ini file via the option table.
*/
SaverApplicationGetOptions((SAOptionTable *)
LMemDeref(@lastwordsOptionTable), oself);
&lastwordsOptionTable, oself);

@callsuper();
}
Expand Down Expand Up @@ -362,7 +364,7 @@ LWDraw(optr oself)
/*
* If there was an error somewhere, don't draw anything.
*/
if (pself->LWCI_format == LWFT_BOGUS) {
if ((pself->LWCI_format == LWFT_BOGUS) || (pself->LWCI_randomToken == 0)) {
return;
}

Expand Down Expand Up @@ -893,6 +895,7 @@ LWTimerStart(optr oself)
* Nuke the random number generator, too.
*/
SaverEndRandom(pself->LWCI_randomToken);
pself->LWCI_randomToken = 0;

/*
* Close down the VM file, if we're drawing something out of it.
Expand Down
24 changes: 24 additions & 0 deletions Appl/Saver/LastWords/local.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
##############################################################################
#
# Copyright (c) GlobalPC 2000 -- All Rights Reserved
#
# PROJECT: GEOS
# MODULE: LastWords -- special definitions
# FILE: local.mk
# AUTHOR: brianc, 02/17/00
#
# REVISION HISTORY:
# Name Date Description
# ---- ---- -----------
# brianc 02/17/00 Initial Revision
#
# DESCRIPTION:
# Special definitions for LastWords
#
# $Id$
#
###############################################################################

XCCOMFLAGS = -zc

#include <$(SYSMAKEFILE)>
52 changes: 26 additions & 26 deletions Installed/Appl/Saver/LastWords/Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#
# THIS FILE HAS BEEN GENERATED AUTOMATICALLY.
#
# If you edit it, you will lose your changes, should it be regenerated.
#
GEODE = lastwords
ASM_TO_OBJS =
UI_TO_RDFS =
SRCS = lastwords.goc lastwords.goh
OBJS = lastwords.obj
LOBJS =

SYSMAKEFILE = geode.mk

#include <geos.mk>
#include <gpath.mk>

#if exists(local.mk)
#include "local.mk"
#else
#include <$(SYSMAKEFILE)>
#endif

#if exists($(DEPFILE))
#include "$(DEPFILE)"
#endif
#
# THIS FILE HAS BEEN GENERATED AUTOMATICALLY.
#
# If you edit it, you will lose your changes, should it be regenerated.
#
GEODE = lastwords
ASM_TO_OBJS =
UI_TO_RDFS =
SRCS = lastwords.goc lastwords.goh
OBJS = lastwords.obj
LOBJS =

SYSMAKEFILE = geode.mk

#include <geos.mk>
#include <gpath.mk>

#if exists(local.mk)
#include "local.mk"
#else
#include <$(SYSMAKEFILE)>
#endif

#if exists($(DEPFILE))
#include "$(DEPFILE)"
#endif
58 changes: 29 additions & 29 deletions Installed/Appl/Saver/LastWords/dependencies.mk
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
lastwords.obj \
lastwords.eobj: stdapp.goh object.goh ui.goh Objects/metaC.goh \
Objects/inputC.goh Objects/clipbrd.goh \
Objects/uiInputC.goh iacp.goh Objects/winC.goh \
Objects/gProcC.goh alb.goh Objects/processC.goh \
Objects/visC.goh Objects/vCompC.goh Objects/vCntC.goh \
Objects/gAppC.goh Objects/genC.goh Objects/gInterC.goh \
Objects/gPrimC.goh Objects/gDispC.goh Objects/gTrigC.goh \
Objects/gViewC.goh Objects/gTextC.goh Objects/vTextC.goh \
Objects/gCtrlC.goh gcnlist.goh spool.goh \
Objects/gFSelC.goh Objects/gGlyphC.goh \
Objects/gDocCtrl.goh Objects/gDocGrpC.goh \
Objects/gDocC.goh Objects/gContC.goh Objects/gDCtrlC.goh \
Objects/gEditCC.goh Objects/gBoolGC.goh \
Objects/gItemGC.goh Objects/gDListC.goh \
Objects/gItemC.goh Objects/gBoolC.goh \
Objects/gGadgetC.goh Objects/gToolCC.goh \
Objects/gValueC.goh Objects/gToolGC.goh \
Objects/helpCC.goh saver.goh lastwords.goh
lastwords.obj \
lastwords.eobj: geos.h heap.h geode.h resource.h ec.h object.h lmem.h \
graphics.h fontID.h font.h color.h gstring.h timer.h vm.h \
dbase.h localize.h Ansi/ctype.h timedate.h file.h \
sllang.h system.h geoworks.h chunkarr.h Objects/helpCC.h \
disk.h drive.h input.h char.h hwr.h win.h uDialog.h \
Objects/gInterC.h Objects/Text/tCommon.h stylesh.h \
driver.h thread.h print.h Internal/spoolInt.h serialDr.h \
parallDr.h hugearr.h fileEnum.h initfile.h Ansi/string.h

lastwords.obj \
lastwords.eobj: stdapp.goh object.goh ui.goh Objects/metaC.goh \
Objects/inputC.goh Objects/clipbrd.goh \
Objects/uiInputC.goh iacp.goh Objects/winC.goh \
Objects/gProcC.goh alb.goh Objects/processC.goh \
Objects/visC.goh Objects/vCompC.goh Objects/vCntC.goh \
Objects/gAppC.goh Objects/genC.goh Objects/gInterC.goh \
Objects/gPrimC.goh Objects/gDispC.goh Objects/gTrigC.goh \
Objects/gViewC.goh Objects/gTextC.goh Objects/vTextC.goh \
Objects/gCtrlC.goh gcnlist.goh spool.goh \
Objects/gFSelC.goh Objects/gGlyphC.goh \
Objects/gDocCtrl.goh Objects/gDocGrpC.goh \
Objects/gDocC.goh Objects/gContC.goh Objects/gDCtrlC.goh \
Objects/gEditCC.goh Objects/gBoolGC.goh \
Objects/gItemGC.goh Objects/gDListC.goh \
Objects/gItemC.goh Objects/gBoolC.goh \
Objects/gGadgetC.goh Objects/gToolCC.goh \
Objects/gValueC.goh Objects/gToolGC.goh \
Objects/helpCC.goh saver.goh lastwords.goh
lastwords.obj \
lastwords.eobj: geos.h heap.h geode.h resource.h ec.h object.h lmem.h \
graphics.h fontID.h font.h color.h gstring.h timer.h vm.h \
dbase.h localize.h Ansi/ctype.h timedate.h file.h \
sllang.h system.h geoworks.h chunkarr.h Objects/helpCC.h \
disk.h drive.h input.h char.h hwr.h win.h uDialog.h \
Objects/gInterC.h Objects/Text/tCommon.h stylesh.h \
driver.h thread.h print.h Internal/spoolInt.h serialDr.h \
parallDr.h hugearr.h fileEnum.h initfile.h Ansi/string.h

lastwordsEC.geo lastwords.geo : saver.ldf ansic.ldf ui.ldf geos.ldf

0 comments on commit 585ebf2

Please sign in to comment.