diff options
author | Paul Gilbert | 2012-05-04 21:40:44 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-04 21:40:44 +1000 |
commit | 557c43c2dbd6d830332be8c8b69c7660d53d665f (patch) | |
tree | 2765f08258989c21a34cd202b8169e0233bb6b2f | |
parent | a75b873fdedd2167b4b6a47b1dd2988ce2e5d11c (diff) | |
download | scummvm-rg350-557c43c2dbd6d830332be8c8b69c7660d53d665f.tar.gz scummvm-rg350-557c43c2dbd6d830332be8c8b69c7660d53d665f.tar.bz2 scummvm-rg350-557c43c2dbd6d830332be8c8b69c7660d53d665f.zip |
TONY: Converted anonymous structs to have explicit names
-rw-r--r-- | engines/tony/adv.h | 7 | ||||
-rw-r--r-- | engines/tony/custom.cpp | 23 | ||||
-rw-r--r-- | engines/tony/game.cpp | 8 | ||||
-rw-r--r-- | engines/tony/window.cpp | 8 | ||||
-rw-r--r-- | engines/tony/window.h | 2 |
5 files changed, 29 insertions, 19 deletions
diff --git a/engines/tony/adv.h b/engines/tony/adv.h index 9a5ecd5072..bcf62a0c24 100644 --- a/engines/tony/adv.h +++ b/engines/tony/adv.h @@ -66,6 +66,13 @@ namespace Tony { #define RM_SKIPY ((RM_BBY - RM_SY) / 2) #define RM_SKIPX 0 +// Name lengths +// FIXME: Some of these can likely be removed when refactoring is completed +#define MAX_DRIVE 10 +#define MAX_DIR 255 +#define MAX_FNAME 100 +#define MAX_EXT 10 + // Tony's actions enum RMTonyAction { TA_GOTO = 0, diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 6f6e7a1534..d710667db6 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -110,7 +110,7 @@ int tappeti[200]; #define T_MARE 6 #define T_MAREMETA 7 -char* tappetiFile[] = { +const char *tappetiFile[] = { "None", "1.ADP", // Grilli.WAV "2.ADP", // Grilli-Ovattati.WAV @@ -121,7 +121,7 @@ char* tappetiFile[] = { "6.ADP" // Mare1.WAV metà volume }; -struct { +struct CharacterStruct { uint32 code; RMItem *item; byte r, g, b; @@ -155,9 +155,10 @@ struct { endtalkpattern = f->readUint32LE(); numtexts = f->readUint32LE(); } -} Character[16]; +}; +CharacterStruct Character[16]; -struct { +struct MCharacterStruct { uint32 code; RMItem *item; byte r, g, b; @@ -202,7 +203,8 @@ struct { curTalk = f->readUint32LE(); bAlwaysBack = f->readByte(); } -} MCharacter[10]; +}; +MCharacterStruct MCharacter[10]; bool IsMChar[16]; @@ -216,7 +218,7 @@ bool bTonyIsSpeaking = false; int curChangedHotspot = 0; -struct { +struct ChangedHotspotStruct { uint32 dwCode; uint32 nX, nY; @@ -230,7 +232,8 @@ struct { nX = f->readUint32LE(); nY = f->readUint32LE(); } -} ChangedHotspot[256]; +}; +ChangedHotspotStruct ChangedHotspot[256]; void ReapplyChangedHotspot(void) { int i; @@ -2015,11 +2018,11 @@ DECLARE_CUSTOM_FUNCTION(DemuteStacchetto)(uint32, uint32, uint32, uint32) { _vm->SetMusicVolume(2, 64); } -struct { +struct MusicFileEntry { const char *name; int sync; -} musicFiles[] = -{ +}; +const MusicFileEntry musicFiles[] = { /* { "PREGAME1.ADP", 0 }, { "SONO1.ADP", 0 }, { "SONO2.ADP", 0 }, { "SONO3.ADP", 0 }, diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index 6853c53bf0..a1737cb089 100644 --- a/engines/tony/game.cpp +++ b/engines/tony/game.cpp @@ -93,10 +93,10 @@ bool bPatIrqFreeze; /****************************************/ static char path_buffer[_MAX_PATH]; -static char drive[_MAX_DRIVE]; -static char dir[_MAX_DIR]; -static char fname[_MAX_FNAME]; -static char ext[_MAX_EXT]; +static char drive[MAX_DRIVE]; +static char dir[MAX_DIR]; +static char fname[MAX_FNAME]; +static char ext[MAX_EXT]; HANDLE MainLoadLocation(int nLoc, RMPoint pt, RMPoint start) { return _vm->GetEngine()->LoadLocation(nLoc, pt,start); diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index a6dd20b875..248542ada6 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -1069,10 +1069,10 @@ DOFRAMERATE: * Metodi di RMSnapshot \****************************************************************************/ -char RMSnapshot::bufDrive[_MAX_DRIVE]; -char RMSnapshot::bufDir[_MAX_DIR]; -char RMSnapshot::bufName[_MAX_FNAME]; -char RMSnapshot::bufExt[_MAX_EXT]; +char RMSnapshot::bufDrive[MAX_DRIVE]; +char RMSnapshot::bufDir[MAX_DIR]; +char RMSnapshot::bufName[MAX_FNAME]; +char RMSnapshot::bufExt[MAX_EXT]; char RMSnapshot::filename[512]; byte RMSnapshot::rgb[RM_SX * RM_SY * 3]; diff --git a/engines/tony/window.h b/engines/tony/window.h index 25aef5c619..da8c5dc824 100644 --- a/engines/tony/window.h +++ b/engines/tony/window.h @@ -61,7 +61,7 @@ struct DDSURFACEDESC { class RMSnapshot { private: // Buffer per la creazione dei path - static char bufDrive[_MAX_DRIVE], bufDir[_MAX_DIR], bufName[_MAX_FNAME], bufExt[_MAX_EXT]; + static char bufDrive[MAX_DRIVE], bufDir[MAX_DIR], bufName[MAX_FNAME], bufExt[MAX_EXT]; static char filename[512]; // Buffer per la conversione a RGB |