LAB: Cleanup

This commit is contained in:
Eugene Sandulenko 2014-12-26 00:32:42 +01:00
parent fefb78457e
commit 58182bd77a
17 changed files with 137 additions and 126 deletions

View File

@ -45,7 +45,7 @@ const char *CurFileName = " ";
bool LongWinInFront = false;
struct TextFont *MsgFont;
TextFont *MsgFont;
extern bool DoBlack, waiteffect, EffectPlaying, stopsound, DoNotDrawMessage, IsHiRes, nopalchange, DoMusic;
@ -131,13 +131,13 @@ static uint32 BUFFERSIZE = BIGBUFFERSIZE;
static byte *MovePanelBuffer, *InvPanelBuffer;
static uint32 MovePanelBufferSize, InvPanelBufferSize;
static struct Image *MoveImages[20],
static Image *MoveImages[20],
#if defined(DOSCODE)
*InvImages[6];
#else
*InvImages[10];
#endif
static struct Gadget *MoveGadgetList, *InvGadgetList;
static Gadget *MoveGadgetList, *InvGadgetList;
static char initcolors[] = { '\x00', '\x00', '\x00', '\x30',
@ -251,7 +251,7 @@ static uint16 OldMode;
bool setUpScreens(void) {
uint16 counter;
byte *bufferstorage, **buffer = &bufferstorage;
struct Gadget *curgad;
Gadget *curgad;
uint16 y;
if (!createScreen(IsHiRes))
@ -395,8 +395,8 @@ uint16 curmousex = 0, curmousey = 0;
/* Permanently flips the imagry of a gadget. */
/******************************************************************************/
static void perFlipGadget(uint16 GadID) {
struct Image *Temp;
struct Gadget *TopGad;
Image *Temp;
Gadget *TopGad;
TopGad = MoveGadgetList;
@ -424,7 +424,7 @@ static void perFlipGadget(uint16 GadID) {
/* Eats all the available messages. */
/******************************************************************************/
void eatMessages(void) {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
do {
Msg = getMsg();
@ -722,7 +722,7 @@ static bool novesa = false, noaudio = false;
/* Processes user input events. */
/******************************************************************************/
static void process(void) {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
uint32 Class;
uint16 Code, Qualifier, MouseX, MouseY, ActionMode = 4, CurInv = MAPNUM, /* Lab: Labyrinth specific initialization */
@ -1801,8 +1801,8 @@ int followCrumbs() {
byte dropCrumbs[] = { 0x00 };
byte dropCrumbsOff[] = { 0x00 };
struct Image DropCrumbsImage = { 24, 24, dropCrumbs };
struct Image DropCrumbsOffImage = { 24, 24, dropCrumbsOff };
Image DropCrumbsImage = { 24, 24, dropCrumbs };
Image DropCrumbsOffImage = { 24, 24, dropCrumbsOff };
void mayShowCrumbIndicator() {
if (DroppingCrumbs && MainDisplay) {

View File

@ -39,10 +39,10 @@
namespace Lab {
struct BitMap bit1, bit2, *DispBitMap = &bit1, *DrawBitMap = &bit1;
BitMap bit1, bit2, *DispBitMap = &bit1, *DrawBitMap = &bit1;
extern struct BitMap RawDiffBM;
extern BitMap RawDiffBM;
extern char diffcmap[256 * 3], lastcmap[256 * 3];
extern bool IsBM, NoFlip, nopalchange, ContMusic;
@ -50,7 +50,7 @@ extern int32 ReadSoFar;
extern bool ReadIsDone, ReadIsError;
extern bool DoBlack, EffectPlaying, stopsound;
extern bool IsHiRes;
extern struct TextFont *MsgFont;
extern TextFont *MsgFont;
extern const char *CurFileName;
@ -229,7 +229,7 @@ static void getWord(char *WordBuffer, const char *MainBuffer, uint16 *WordWidth)
/* Gets a line of text for flowText; makes sure that its length is less than */
/* or equal to the maximum width. */
/******************************************************************************/
static void getLine(struct TextFont *tf, char *LineBuffer, const char **MainBuffer, uint16 LineWidth) {
static void getLine(TextFont *tf, char *LineBuffer, const char **MainBuffer, uint16 LineWidth) {
uint16 CurWidth = 0, WordWidth;
char WordBuffer[100];
bool doit = true;
@ -256,8 +256,6 @@ static void getLine(struct TextFont *tf, char *LineBuffer, const char **MainBuff
} else
doit = false;
}
/* NYI: Would add code here to break up words in case they were longer than a line */
}
@ -281,7 +279,7 @@ uint32 flowText(void *font, /* the TextAttr pointer */
bool output, /* Whether to output any text */
uint16 x1, /* Cords */
uint16 y1, uint16 x2, uint16 y2, const char *str) { /* The text itself */
struct TextFont *msgfont = (TextFont *)font;
TextFont *msgfont = (TextFont *)font;
char linebuffer[256];
const char *temp;
uint16 numlines, actlines, fontheight, width;
@ -343,7 +341,7 @@ extern byte *VGABASEADDRESS;
/******************************************************************************/
/* Calls flowText, but flows it to memory. Same restrictions as flowText. */
/******************************************************************************/
uint32 flowTextToMem(struct Image *DestIm, void *font, /* the TextAttr pointer */
uint32 flowTextToMem(Image *DestIm, void *font, /* the TextAttr pointer */
uint16 spacing, /* How much vertical spacing between the lines */
uint16 pencolor, /* pen number to use for text */
uint16 backpen, /* the background color */
@ -527,7 +525,7 @@ void copyLong64(uint32 *Dest, uint32 *Source, uint32 Many64) {
/*****************************************************************************/
static void doScrollBlack(void) {
byte *mem, *tempmem;
struct Image Im;
Image Im;
uint16 width, height, by, nheight, CurPage;
uint32 size, copysize;
uint32 *BaseAddr;
@ -619,7 +617,7 @@ static void doScrollBlack(void) {
extern struct BitMap RawDiffBM;
extern BitMap RawDiffBM;
extern DIFFHeader headerdata;
@ -768,7 +766,7 @@ static void doScrollBounce(void) {
/*****************************************************************************/
static void doTransWipe(CloseDataPtr *CPtr, char *filename) {
uint16 LastY, CurY, counter, linesdone = 0, lineslast;
struct Image ImSource, ImDest;
Image ImSource, ImDest;
if (IsHiRes) {
lineslast = 3;

View File

@ -41,16 +41,14 @@ extern bool IsHiRes;
Common::KeyState _keyPressed;
struct Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt) {
Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt) {
Gadget *gptr;
if ((gptr = (Gadget *)calloc(sizeof(struct Gadget), 1))) {
if ((gptr = new Gadget())) {
gptr->x = x;
gptr->y = y;
gptr->GadgetID = id;
#if !defined(DOSCODE)
gptr->KeyEquiv = key;
#endif
gptr->Im = im;
gptr->ImAlt = imalt;
gptr->NextGadget = NULL;
@ -64,7 +62,7 @@ struct Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im
void freeButtonList(Gadget *gptrlist) {
struct Gadget *gptr, *next = gptrlist;
Gadget *gptr, *next = gptrlist;
while (next) {
gptr = next;
@ -80,7 +78,7 @@ void freeButtonList(Gadget *gptrlist) {
/*****************************************************************************/
/* Draws a gadget list to the screen. */
/*****************************************************************************/
void drawGadgetList(struct Gadget *gadlist) {
void drawGadgetList(Gadget *gadlist) {
while (gadlist) {
drawImage(gadlist->Im, gadlist->x, gadlist->y);
@ -95,7 +93,7 @@ void drawGadgetList(struct Gadget *gadlist) {
/*****************************************************************************/
/* Ghoasts a gadget, and makes it unavailable for using. */
/*****************************************************************************/
void ghoastGadget(struct Gadget *curgad, uint16 pencolor) {
void ghoastGadget(Gadget *curgad, uint16 pencolor) {
ghoastRect(pencolor, curgad->x, curgad->y, curgad->x + curgad->Im->Width - 1, curgad->y + curgad->Im->Height - 1);
curgad->GadgetFlags |= GADGETOFF;
}
@ -105,7 +103,7 @@ void ghoastGadget(struct Gadget *curgad, uint16 pencolor) {
/*****************************************************************************/
/* Unghoasts a gadget, and makes it available again. */
/*****************************************************************************/
void unGhoastGadget(struct Gadget *curgad) {
void unGhoastGadget(Gadget *curgad) {
drawImage(curgad->Im, curgad->x, curgad->y);
curgad->GadgetFlags &= !(GADGETOFF);
}
@ -114,20 +112,18 @@ void unGhoastGadget(struct Gadget *curgad) {
/*****************************************************************************/
/* Make a key press have the right case for a gadget KeyEquiv value. */
/*****************************************************************************/
#if !defined(DOSCODE)
uint16 makeGadgetKeyEquiv(uint16 key) {
if (Common::isAlnum(key))
key = tolower(key);
return key;
}
#endif
/*****************************************************************************/
/* Checks whether or not the cords fall within one of the gadgets in a list */
/* of gadgets. */
/*****************************************************************************/
static struct Gadget *checkNumGadgetHit(struct Gadget *gadlist, uint16 key) {
static Gadget *checkNumGadgetHit(Gadget *gadlist, uint16 key) {
#if !defined(DOSCODE)
uint16 gkey = key - '0';
#else
@ -177,17 +173,16 @@ static bool keyPress(uint16 *KeyCode) {
}
struct IntuiMessage IMessage;
extern struct Gadget *ScreenGadgetList;
IntuiMessage IMessage;
extern Gadget *ScreenGadgetList;
struct IntuiMessage *getMsg(void) {
struct Gadget *curgad;
IntuiMessage *getMsg(void) {
Gadget *curgad;
int Qualifiers;
updateMouse();
#if !defined(DOSCODE)
Qualifiers = _keyPressed.flags;
#endif
if ((curgad = mouseGadget()) != NULL) {
updateMouse();
@ -196,21 +191,15 @@ struct IntuiMessage *getMsg(void) {
IMessage.GadgetID = curgad->GadgetID;
IMessage.Qualifier = Qualifiers;
return &IMessage;
}
else if (mouseButton(&IMessage.MouseX, &IMessage.MouseY, true)) { /* Left Button */
} else if (mouseButton(&IMessage.MouseX, &IMessage.MouseY, true)) { /* Left Button */
IMessage.Qualifier = IEQUALIFIER_LEFTBUTTON | Qualifiers;
IMessage.Class = MOUSEBUTTONS;
return &IMessage;
}
else if (mouseButton(&IMessage.MouseX, &IMessage.MouseY, false)) { /* Right Button */
} else if (mouseButton(&IMessage.MouseX, &IMessage.MouseY, false)) { /* Right Button */
IMessage.Qualifier = IEQUALIFIER_RBUTTON | Qualifiers;
IMessage.Class = MOUSEBUTTONS;
return &IMessage;
}
else if (keyPress(&IMessage.Code)) { /* Keyboard key */
} else if (keyPress(&IMessage.Code)) { /* Keyboard key */
curgad = checkNumGadgetHit(ScreenGadgetList, IMessage.Code);
if (curgad) {

View File

@ -49,8 +49,8 @@ struct Gadget {
uint16 KeyEquiv; // if not zero, a key that activates gadget
#endif
uint32 GadgetFlags;
struct Image *Im, *ImAlt;
struct Gadget *NextGadget;
Image *Im, *ImAlt;
Gadget *NextGadget;
};
extern Common::KeyState _keyPressed;
@ -119,21 +119,17 @@ extern Common::KeyState _keyPressed;
struct Gadget *createButton(uint16 x, uint16 y, uint16 id,
#if !defined(DOSCODE)
uint16 key,
#endif
struct Image *im, struct Image *imalt);
Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt);
void freeButtonList(void *gptrlist);
void drawGadgetList(struct Gadget *gadlist);
void drawGadgetList(Gadget *gadlist);
void ghoastGadget(struct Gadget *curgad, uint16 pencolor);
void ghoastGadget(Gadget *curgad, uint16 pencolor);
void unGhoastGadget(struct Gadget *curgad);
void unGhoastGadget(Gadget *curgad);
struct IntuiMessage *getMsg(void);
IntuiMessage *getMsg(void);
void replyMsg(void *Msg);

View File

@ -37,7 +37,7 @@
namespace Lab {
static struct TextFont filler, *msgfont = &filler;
static TextFont filler, *msgfont = &filler;
extern bool nopalchange, noscreenchange, hidemouse, DoBlack, NoFlip, IsHiRes;
@ -63,7 +63,7 @@ extern int32 longcharsdrawn;
/* the message port. */
/******************************************************************************/
void introEatMessages(void) {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
while (1) {
Msg = getMsg();
@ -88,7 +88,7 @@ void introEatMessages(void) {
/*****************************************************************************/
static void doPictText(const char *Filename, bool isscreen) {
uint32 lastsecs = 0L, lastmicros = 0L, secs = 0L, micros = 0L;
struct IntuiMessage *Msg;
IntuiMessage *Msg;
char filename[50] = "Lab:rooms/Intro/";
byte *curplace, **tfile;
bool DrawNextText = true, End = false, Begin = true;

View File

@ -86,10 +86,10 @@ uint32 sizeOfFile(const char *name) {
typedef struct {
struct FileMarker {
char name[32];
void *Start, *End;
} FileMarker;
};

View File

@ -52,6 +52,7 @@ typedef struct {
struct Image;
struct TextFont;
struct Gadget;
/*----------------------------*/
/*------ From Audioi.c -------*/
@ -101,7 +102,7 @@ uint32 flowText(void *font, /* the TextAttr pointer */
uint16 x1, /* Cords */
uint16 y1, uint16 x2, uint16 y2, const char *text); /* The text itself */
uint32 flowTextToMem(struct Image *DestIm, void *font, /* the TextAttr pointer */
uint32 flowTextToMem(Image *DestIm, void *font, /* the TextAttr pointer */
uint16 spacing, /* How much vertical spacing between the lines */
uint16 pencolor, /* pen number to use for text */
uint16 backpen, /* the background color */
@ -136,7 +137,7 @@ void flipViews(void *scrPtr);
/*----- From Interface.c -----*/
/*----------------------------*/
struct Gadget *addGadButton(uint16 x, uint16 y, void *UpImage, void *DownImage, uint16 id);
Gadget *addGadButton(uint16 x, uint16 y, void *UpImage, void *DownImage, uint16 id);
void gadgetsOnOff(void *gptr, void *win, int32 num, bool on);

View File

@ -42,8 +42,8 @@
namespace Lab {
static struct TextFont *BigMsgFont;
static struct TextFont bmf;
static TextFont *BigMsgFont;
static TextFont bmf;
extern uint16 Direction;
@ -87,8 +87,7 @@ void setAmigaPal(uint16 *pal, uint16 numcolors) {
bool getFont(const char *filename, TextFont *textfont) {
byte *fontbuffer;
fontbuffer = (byte *)stealBufMem(sizeOfFile(filename) -
(sizeof(struct TextFont) + 4));
fontbuffer = (byte *)stealBufMem(sizeOfFile(filename) - (sizeof(TextFont) + 4));
g_music->checkMusic();
if (fontbuffer == NULL)
@ -227,7 +226,7 @@ static uint16 mapScaleY(uint16 y) {
static bool loadMapData(void) {
byte **buffer, Temp[5];
int32 Size;
struct Gadget *gptr;
Gadget *gptr;
uint16 counter;
BigMsgFont = &bmf;
@ -736,7 +735,7 @@ void processMap(uint16 CurRoom) {
char *sptr;
byte newcolor[3];
bool drawmap;
struct IntuiMessage *Msg;
IntuiMessage *Msg;
CurMsg = CurRoom;
CurFloor = Maps[CurRoom].PageNumber;

View File

@ -41,7 +41,7 @@ char g_PathSeperator[4];
#define SAVEVERSION "LBS3"
int getSaveGameList(struct SaveGameInfo *info, int maxNum) {
int getSaveGameList(SaveGameInfo *info, int maxNum) {
warning("STUB: getSaveGameList");
return 0;
@ -112,7 +112,7 @@ int getSaveGameList(struct SaveGameInfo *info, int maxNum) {
#endif
}
void freeSaveGameList(struct SaveGameInfo *info, int count) {
void freeSaveGameList(SaveGameInfo *info, int count) {
int i;
for (i = 0; i < count; i++) {

View File

@ -46,8 +46,8 @@ struct SaveGameInfo {
char SaveGameDate[128];
};
int getSaveGameList(struct SaveGameInfo *info, int maxNum);
void freeSaveGameList(struct SaveGameInfo *info, int count);
int getSaveGameList(SaveGameInfo *info, int maxNum);
void freeSaveGameList(SaveGameInfo *info, int count);
} // End of namespace Lab

View File

@ -50,8 +50,8 @@ static bool MouseHidden = true, QuitMouseHandler = false;
static int32 NumHidden = 1;
static uint16 CurMouseX, CurMouseY;
static uint16 MouseImageWidth = 10, MouseImageHeight = 15;
static struct Gadget *LastGadgetHit = NULL;
struct Gadget *ScreenGadgetList = NULL;
static Gadget *LastGadgetHit = NULL;
Gadget *ScreenGadgetList = NULL;
static byte MouseData[] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 7, 1, 0, 0, 0, 0, 0, 0, 0,
1, 7, 7, 1, 0, 0, 0, 0, 0, 0,
@ -69,12 +69,12 @@ static byte MouseData[] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 0, 0};
static struct Image MouseImage, BackImage;
static Image MouseImage, BackImage;
static byte BackImageBuffer[256];
static uint16 backx, backy;
static bool drawmouse = false, gadhit = false;
static struct Gadget *hitgad = NULL;
static Gadget *hitgad = NULL;
void mouseShowXY(uint16 CurMouseX, uint16 CurMouseY);
@ -82,7 +82,7 @@ void mouseShowXY(uint16 CurMouseX, uint16 CurMouseY);
/* Checks whether or not the cords fall within one of the gadgets in a list */
/* of gadgets. */
/*****************************************************************************/
static Gadget *checkGadgetHit(struct Gadget *gadlist, uint16 x, uint16 y) {
static Gadget *checkGadgetHit(Gadget *gadlist, uint16 x, uint16 y) {
uint16 counter;
while (gadlist != NULL) {
@ -121,7 +121,7 @@ static Gadget *checkGadgetHit(struct Gadget *gadlist, uint16 x, uint16 y) {
void attachGadgetList(struct Gadget *GadList) {
void attachGadgetList(Gadget *GadList) {
if (ScreenGadgetList != GadList)
LastGadgetHit = NULL;
@ -165,7 +165,7 @@ static void restoreBackMouse(void) {
}
static struct Gadget *TempGad;
static Gadget *TempGad;
void mouse_handler(int32 max, int32 mcx, int32 mdx) {

View File

@ -55,7 +55,7 @@ bool mouseButton(uint16 *x, uint16 *y, bool leftbutton);
Gadget *mouseGadget(void);
void attachGadgetList(struct Gadget *GadList);
void attachGadgetList(Gadget *GadList);
void mouse_handler(int32 max, int32 mcx, int32 mdx);

View File

@ -37,7 +37,7 @@
namespace Lab {
extern struct BitMap *DispBitMap, *DrawBitMap;
extern BitMap *DispBitMap, *DrawBitMap;
extern uint32 VGABytesPerPage;
/*
@ -88,7 +88,7 @@ static bool continuous,
char diffcmap[256 * 3], lastcmap[256 * 3];
struct BitMap RawDiffBM;
BitMap RawDiffBM;

View File

@ -54,7 +54,7 @@ int g_IsRegistered;
extern bool nopalchange, DoBlack, IsHiRes;
extern struct BitMap *DispBitMap, *DrawBitMap;
extern BitMap *DispBitMap, *DrawBitMap;
extern char diffcmap[3 * 256];
extern uint32 VGAScreenWidth, VGAScreenHeight;
@ -106,7 +106,7 @@ static byte *loadBackPict(const char *fileName, bool tomem) {
static struct Image *Images[10];
static Image *Images[10];
uint16 combination[6] = {0, 0, 0, 0, 0, 0}, solution[] = {0, 4, 0, 8, 7, 2};
@ -161,7 +161,7 @@ void showCombination(const char *filename) {
/* Changes the combination number of one of the slots */
/*****************************************************************************/
static void changeCombination(uint16 number) {
struct Image display;
Image display;
uint16 counter, combnum;
bool unlocked = true;
@ -251,7 +251,7 @@ void mouseCombination(uint16 x, uint16 y) {
struct Image *Tiles[16];
Image *Tiles[16];
int16 CurTile[4] [4] = {
{ 1, 5, 9, 13 },
{ 2, 6, 10, 14 },
@ -513,9 +513,9 @@ void mouseTile(uint16 x, uint16 y) {
/*------------------------ Does the detective notes. ------------------------*/
/*---------------------------------------------------------------------------*/
extern struct TextFont *MsgFont;
static struct TextFont *BigMsgFont;
static struct TextFont bmfont;
extern TextFont *MsgFont;
static TextFont *BigMsgFont;
static TextFont bmfont;
/*****************************************************************************/
@ -631,10 +631,10 @@ static uint16 JPage = 0;
static bool lastpage = false;
static struct Image *JCancel, *JCancelAlt, *JLeft, *JLeftAlt, *JRight, *JRightAlt, JBackImage, ScreenImage;
static Image *JCancel, *JCancelAlt, *JLeft, *JLeftAlt, *JRight, *JRightAlt, JBackImage, ScreenImage;
static uint16 JGadX[3] = {80, 144, 194}, JGadY[3] = {162, 164, 162};
static struct Gadget ForwardG, CancelG, BackG;
static Gadget ForwardG, CancelG, BackG;
@ -645,7 +645,7 @@ static struct Gadget ForwardG, CancelG, BackG;
static bool loadJournalData() {
byte **buffer;
char filename[20];
struct Gadget *TopGadget = &BackG;
Gadget *TopGadget = &BackG;
uint16 counter;
bool bridge, dirty, news, clean;
@ -863,13 +863,13 @@ static void drawJournal(uint16 wipenum, bool needFade) {
/* Processes user input. */
/*****************************************************************************/
static void processJournal() {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
uint32 Class;
uint16 Qualifier, GadID;
while (1) {
g_music->checkMusic(); /* Make sure we check the music at least after every message */
Msg = (struct IntuiMessage *) getMsg();
Msg = (IntuiMessage *) getMsg();
if (Msg == NULL) {
g_music->newCheckMusic();
@ -970,7 +970,7 @@ void doJournal() {
/*---------------------------------------------------------------------------*/
struct Image *Arrow1, *NoArrow1, *DriveButton;
Image *Arrow1, *NoArrow1, *DriveButton;
extern InventoryData *Inventory;
@ -1084,7 +1084,7 @@ void getRoomMessage(int MyRoomNum, int MyDirection, char *msg);
extern char g_SaveGamePath[512];
extern char g_PathSeperator[4];
struct SaveGameInfo g_SaveGameInfo[MAX_SAVED_GAMES];
SaveGameInfo g_SaveGameInfo[MAX_SAVED_GAMES];
int g_TotalSavedGames;
char g_CommonPalette[3 * 256];
int g_LastSaveGameNumber = 0;
@ -1093,7 +1093,19 @@ int g_CurSaveSet = 0;
int g_PendingNewSave = 0;
enum UI_Ident {
ID_SAVE, ID_LOAD, ID_NEWSLOT, ID_1_TO_5, ID_6_TO_10, ID_11_TO_15, ID_SLOT_A, ID_SLOT_B, ID_SLOT_C, ID_SLOT_D, ID_SLOT_E, ID_CANCEL, ID_LAST
ID_SAVE,
ID_LOAD,
ID_NEWSLOT,
ID_1_TO_5,
ID_6_TO_10,
ID_11_TO_15,
ID_SLOT_A,
ID_SLOT_B,
ID_SLOT_C,
ID_SLOT_D,
ID_SLOT_E,
ID_CANCEL,
ID_LAST
};
struct ModernUI {
@ -1101,12 +1113,27 @@ struct ModernUI {
int x, y, w, h;
};
struct ModernUI theUI[ID_LAST] = {
{ ID_LOAD, 491, 182, 128, 54 }, { ID_SAVE, 491, 255, 128, 54 }, { ID_NEWSLOT, 491, 328, 128, 54 }, { ID_1_TO_5, 27, 40, 146, 25 }, { ID_6_TO_10, 175, 40, 146, 25 }, { ID_11_TO_15, 323, 40, 146, 25 }, { ID_SLOT_A, 27, 67, 442, 72 }, { ID_SLOT_B, 27, 142, 442, 72 }, { ID_SLOT_C, 27, 217, 442, 72 }, { ID_SLOT_D, 27, 292, 442, 72 }, { ID_SLOT_E, 27, 367, 442, 72 }, { ID_CANCEL, 531, 405, 52, 52 }
ModernUI theUI[ID_LAST] = {
{ ID_LOAD, 491, 182, 128, 54 },
{ ID_SAVE, 491, 255, 128, 54 },
{ ID_NEWSLOT, 491, 328, 128, 54 },
{ ID_1_TO_5, 27, 40, 146, 25 },
{ ID_6_TO_10, 175, 40, 146, 25 },
{ ID_11_TO_15, 323, 40, 146, 25 },
{ ID_SLOT_A, 27, 67, 442, 72 },
{ ID_SLOT_B, 27, 142, 442, 72 },
{ ID_SLOT_C, 27, 217, 442, 72 },
{ ID_SLOT_D, 27, 292, 442, 72 },
{ ID_SLOT_E, 27, 367, 442, 72 },
{ ID_CANCEL, 531, 405, 52, 52 }
};
enum {
SG_BLACK = 1, SG_TAN = 14, SG_DKTAN = 38, SG_WHITE = 105, SG_YELLOW = 118
SG_BLACK = 1,
SG_TAN = 14,
SG_DKTAN = 38,
SG_WHITE = 105,
SG_YELLOW = 118
};
/*****************************************************************************/
@ -1178,7 +1205,7 @@ static void drawSaveLoad() {
for (i = 0, j = 5 * g_CurSaveSet; i < 5; i++, j++) {
uint16 hue, y;
char num_text[4];
struct Image thumbnail, screen;
Image thumbnail, screen;
if (j < g_TotalSavedGames + g_PendingNewSave) {
char msg[256];
@ -1224,7 +1251,7 @@ static void drawSaveLoad() {
WSDL_UpdateScreen();
}
static void makeThumbnail(struct SaveGameInfo *info) {
static void makeThumbnail(SaveGameInfo *info) {
char *pictName;
CloseDataPtr CPtr = NULL;
byte *BitMapMem;
@ -1260,7 +1287,7 @@ static void makeThumbnail(struct SaveGameInfo *info) {
}
static void addSaveSlot() {
struct SaveGameInfo *info;
SaveGameInfo *info;
if (g_PendingNewSave || g_TotalSavedGames == MAX_SAVED_GAMES)
return;
@ -1370,7 +1397,7 @@ static bool doLoadGame() {
/* Processes user input. */
/*****************************************************************************/
static bool processSaveLoad() {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
uint32 Class;
uint16 Qualifier, MouseX, MouseY, Code;
@ -1700,7 +1727,7 @@ static void checkFiles(void) {
/* Processes user input. */
/*****************************************************************************/
static uint16 processSaveRestore(uint16 type) {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
uint32 Class;
uint16 Qualifier, MouseX, MouseY, Code, Temp;
@ -1913,7 +1940,8 @@ static uint16 monpage;
static const char *TextFileName;
struct Image *MonButton, *AltMonButton, *MonQuit, *AltMonQuit, *MonBack, *AltMonBack, *MonDown, *AltMonDown, *MonUp, *AltMonUp;
Image *MonButton, *AltMonButton, *MonQuit, *AltMonQuit, *MonBack, *AltMonBack,
*MonDown, *AltMonDown, *MonUp, *AltMonUp;
@ -2004,7 +2032,7 @@ static void drawMonText(char *text, uint16 x1, uint16 y1, uint16 x2, uint16 y2,
/* Processes user input. */
/*****************************************************************************/
static void processMonitor(char *ntext, bool isinteractive, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
uint32 Class;
uint16 Qualifier, Code, MouseX, MouseY;
const char *Test = " ", *StartFileName = TextFileName;
@ -2158,7 +2186,7 @@ void doMonitor(char *background, char *textfile, bool isinteractive, uint16 x1,
#if defined(LABDEMO)
void doTrialBlock() {
struct IntuiMessage *Msg;
IntuiMessage *Msg;
uint32 Class;
uint16 Qualifier, MouseX, MouseY, Code, Temp;

View File

@ -52,17 +52,17 @@ struct TextFont {
#pragma pack(pop)
#endif
bool openFontMem(const char *TextFontPath, struct TextFont *tf, byte *fontbuffer);
bool openFontMem(const char *TextFontPath, TextFont *tf, byte *fontbuffer);
bool openFont(const char *TextFontPath, struct TextFont **tf);
bool openFont(const char *TextFontPath, TextFont **tf);
void closeFont(struct TextFont *tf);
void closeFont(TextFont *tf);
uint16 textLength(struct TextFont *tf, const char *text, uint16 numchars);
uint16 textLength(TextFont *tf, const char *text, uint16 numchars);
uint16 textHeight(struct TextFont *tf);
uint16 textHeight(TextFont *tf);
void text(struct TextFont *tf, uint16 x, uint16 y, uint16 color, const char *text, uint16 numchars);
void text(TextFont *tf, uint16 x, uint16 y, uint16 color, const char *text, uint16 numchars);
} // End of namespace Lab

View File

@ -342,7 +342,7 @@ void getMode(uint16 *Mode) {
/*****************************************************************************/
/* Draws an image to the screen. */
/*****************************************************************************/
void drawImage(struct Image *Im, uint16 x, uint16 y) {
void drawImage(Image *Im, uint16 x, uint16 y) {
#if !defined(DOSCODE)
int sx, sy, dx, dy, w, h;
@ -458,7 +458,7 @@ void drawImage(struct Image *Im, uint16 x, uint16 y) {
/*****************************************************************************/
/* Draws an image to the screen. */
/*****************************************************************************/
void drawMaskImage(struct Image *Im, uint16 x, uint16 y) {
void drawMaskImage(Image *Im, uint16 x, uint16 y) {
#if !defined(DOSCODE)
int sx, sy, dx, dy, w, h;
@ -588,7 +588,7 @@ void drawMaskImage(struct Image *Im, uint16 x, uint16 y) {
/*****************************************************************************/
/* Reads an image from the screen. */
/*****************************************************************************/
void readScreenImage(struct Image *Im, uint16 x, uint16 y) {
void readScreenImage(Image *Im, uint16 x, uint16 y) {
#if !defined(DOSCODE)
int sx, sy, dx, dy, w, h;
@ -839,7 +839,7 @@ byte *TempScrollData;
/* function will fail. */
/*****************************************************************************/
void scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
struct Image Im;
Image Im;
uint16 temp;
Im.ImageData = TempScrollData;
@ -885,7 +885,7 @@ void scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
/* Scrolls the display in the y direction by blitting. */
/*****************************************************************************/
void scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
struct Image Im;
Image Im;
uint16 temp;
Im.ImageData = TempScrollData;

View File

@ -73,13 +73,13 @@ void VGASetPal(void *cmap, uint16 numcolors);
/*---------- Drawing Routines ----------*/
void drawImage(struct Image *Im, uint16 x, uint16 y);
void drawImage(Image *Im, uint16 x, uint16 y);
void drawMaskImage(struct Image *Im, uint16 x, uint16 y);
void drawMaskImage(Image *Im, uint16 x, uint16 y);
void readScreenImage(struct Image *Im, uint16 x, uint16 y);
void readScreenImage(Image *Im, uint16 x, uint16 y);
void bltBitMap(struct Image *ImSource, uint16 xs, uint16 ys, struct Image *ImDest, uint16 xd, uint16 yd, uint16 width, uint16 height);
void bltBitMap(Image *ImSource, uint16 xs, uint16 ys, Image *ImDest, uint16 xd, uint16 yd, uint16 width, uint16 height);
void scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint16 y2);