From a7e4f8237e73d4dd58e1d8097f951ba9505e7422 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 4 Apr 2016 02:34:07 -0400 Subject: [PATCH] Patched to compile on Linux, and cleaned out almost all compiler warnings. --- Sources/CMakeLists.txt | 56 ++++++++- Sources/Ecc/Main.h | 2 +- Sources/Ecc/Parser.y | 2 +- Sources/Engine/Base/CRCTable.cpp | 8 -- Sources/Engine/Base/ErrorReporting.cpp | 2 +- Sources/Engine/Base/ErrorReporting.h | 2 +- Sources/Engine/Base/ErrorTable.h | 4 +- Sources/Engine/Base/IFeel.cpp | 4 +- Sources/Engine/Base/IFeel.h | 4 +- Sources/Engine/Base/Memory.cpp | 1 - Sources/Engine/Base/ReplaceFile.cpp | 7 +- Sources/Engine/Base/ReplaceFile.h | 2 +- Sources/Engine/Base/SDL/SDLInput.cpp | 4 +- Sources/Engine/Base/Stream.cpp | 2 +- Sources/Engine/Base/Stream.h | 2 +- Sources/Engine/Base/Translation.cpp | 5 +- Sources/Engine/Base/Translation.h | 2 +- Sources/Engine/Brushes/BrushTriangularize.cpp | 4 +- Sources/Engine/GameAgent/GameAgent.cpp | 111 ++++++++++-------- Sources/Engine/GameAgent/MSLegacy.h | 2 +- Sources/Engine/Graphics/DrawPort.cpp | 4 +- Sources/Engine/Graphics/GfxLibrary.cpp | 5 +- Sources/Engine/Graphics/TextureEffects.h | 4 +- Sources/Engine/Math/ObjectSector.cpp | 2 +- Sources/Engine/Sound/Wave.cpp | 2 +- Sources/Engine/Sound/Wave.h | 2 +- Sources/EntitiesMP/Player.es | 2 +- Sources/GameMP/Game.cpp | 13 +- Sources/GameMP/Game.h | 6 +- Sources/GameMP/LCDDrawing.cpp | 2 +- Sources/GameMP/LCDDrawing.h | 2 +- Sources/SeriousSam/FileInfo.h | 3 +- Sources/SeriousSam/GUI/Components/MGArrow.cpp | 4 +- Sources/SeriousSam/GUI/Components/MGArrow.h | 4 +- .../SeriousSam/GUI/Components/MGButton.cpp | 18 +-- Sources/SeriousSam/GUI/Components/MGButton.h | 2 +- .../GUI/Components/MGChangePlayer.cpp | 8 +- .../GUI/Components/MGChangePlayer.h | 2 +- Sources/SeriousSam/GUI/Components/MGEdit.cpp | 4 +- Sources/SeriousSam/GUI/Components/MGEdit.h | 2 +- .../GUI/Components/MGFileButton.cpp | 8 +- .../SeriousSam/GUI/Components/MGFileButton.h | 2 +- .../SeriousSam/GUI/Components/MGHighScore.cpp | 10 +- .../SeriousSam/GUI/Components/MGHighScore.h | 2 +- .../GUI/Components/MGKeyDefinition.cpp | 8 +- .../GUI/Components/MGKeyDefinition.h | 2 +- .../GUI/Components/MGLevelButton.cpp | 4 +- .../SeriousSam/GUI/Components/MGLevelButton.h | 2 +- Sources/SeriousSam/GUI/Components/MGModel.cpp | 14 +-- Sources/SeriousSam/GUI/Components/MGModel.h | 2 +- .../GUI/Components/MGServerList.cpp | 4 +- .../SeriousSam/GUI/Components/MGServerList.h | 2 +- .../SeriousSam/GUI/Components/MGSlider.cpp | 8 +- Sources/SeriousSam/GUI/Components/MGSlider.h | 2 +- Sources/SeriousSam/GUI/Components/MGTitle.cpp | 6 +- Sources/SeriousSam/GUI/Components/MGTitle.h | 2 +- .../SeriousSam/GUI/Components/MGTrigger.cpp | 4 +- Sources/SeriousSam/GUI/Components/MGTrigger.h | 2 +- .../SeriousSam/GUI/Components/MGVarButton.cpp | 12 +- .../SeriousSam/GUI/Components/MGVarButton.h | 2 +- .../SeriousSam/GUI/Components/MenuGadget.cpp | 24 ++-- .../SeriousSam/GUI/Components/MenuGadget.h | 2 +- Sources/SeriousSam/GUI/Menus/GameMenu.cpp | 6 +- .../SeriousSam/GUI/Menus/MAudioOptions.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MAudioOptions.h | 10 +- Sources/SeriousSam/GUI/Menus/MConfirm.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MConfirm.h | 4 +- Sources/SeriousSam/GUI/Menus/MControls.cpp | 10 +- Sources/SeriousSam/GUI/Menus/MControls.h | 10 +- Sources/SeriousSam/GUI/Menus/MCredits.h | 2 +- .../SeriousSam/GUI/Menus/MCustomizeAxis.cpp | 8 +- Sources/SeriousSam/GUI/Menus/MCustomizeAxis.h | 8 +- .../GUI/Menus/MCustomizeKeyboard.cpp | 10 +- .../SeriousSam/GUI/Menus/MCustomizeKeyboard.h | 8 +- Sources/SeriousSam/GUI/Menus/MDisabled.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MDisabled.h | 6 +- Sources/SeriousSam/GUI/Menus/MHighScore.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MHighScore.h | 6 +- Sources/SeriousSam/GUI/Menus/MInGame.cpp | 6 +- Sources/SeriousSam/GUI/Menus/MInGame.h | 6 +- Sources/SeriousSam/GUI/Menus/MLevels.cpp | 6 +- Sources/SeriousSam/GUI/Menus/MLevels.h | 8 +- Sources/SeriousSam/GUI/Menus/MLoadSave.cpp | 8 +- Sources/SeriousSam/GUI/Menus/MLoadSave.h | 10 +- Sources/SeriousSam/GUI/Menus/MMain.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MMain.h | 4 +- Sources/SeriousSam/GUI/Menus/MNetwork.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MNetwork.h | 6 +- Sources/SeriousSam/GUI/Menus/MNetworkJoin.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MNetworkJoin.h | 6 +- Sources/SeriousSam/GUI/Menus/MNetworkOpen.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MNetworkOpen.h | 8 +- .../SeriousSam/GUI/Menus/MNetworkStart.cpp | 6 +- Sources/SeriousSam/GUI/Menus/MNetworkStart.h | 10 +- Sources/SeriousSam/GUI/Menus/MOptions.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MOptions.h | 6 +- .../SeriousSam/GUI/Menus/MPlayerProfile.cpp | 10 +- Sources/SeriousSam/GUI/Menus/MPlayerProfile.h | 12 +- .../SeriousSam/GUI/Menus/MRenderingOptions.h | 2 +- .../SeriousSam/GUI/Menus/MSelectPlayers.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MSelectPlayers.h | 10 +- Sources/SeriousSam/GUI/Menus/MServers.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MServers.h | 10 +- .../SeriousSam/GUI/Menus/MSinglePlayer.cpp | 6 +- Sources/SeriousSam/GUI/Menus/MSinglePlayer.h | 6 +- .../SeriousSam/GUI/Menus/MSinglePlayerNew.cpp | 4 +- .../SeriousSam/GUI/Menus/MSinglePlayerNew.h | 6 +- Sources/SeriousSam/GUI/Menus/MSplitScreen.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MSplitScreen.h | 6 +- Sources/SeriousSam/GUI/Menus/MSplitStart.cpp | 6 +- Sources/SeriousSam/GUI/Menus/MSplitStart.h | 8 +- Sources/SeriousSam/GUI/Menus/MVar.cpp | 8 +- Sources/SeriousSam/GUI/Menus/MVar.h | 10 +- .../SeriousSam/GUI/Menus/MVideoOptions.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MVideoOptions.h | 2 +- Sources/SeriousSam/GUI/Menus/Menu.cpp | 70 ++++++----- Sources/SeriousSam/GUI/Menus/Menu.h | 4 +- Sources/SeriousSam/GUI/Menus/MenuActions.cpp | 10 +- Sources/SeriousSam/GUI/Menus/MenuManager.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MenuPrinting.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MenuStarters.cpp | 6 +- .../SeriousSam/GUI/Menus/MenuStartersAF.cpp | 4 +- Sources/SeriousSam/GUI/Menus/MenuStuff.cpp | 38 +++--- Sources/SeriousSam/GUI/Menus/MenuStuff.h | 15 ++- Sources/SeriousSam/LevelInfo.cpp | 2 +- Sources/SeriousSam/SeriousSam.cpp | 27 +---- Sources/SeriousSam/VarList.cpp | 2 +- 127 files changed, 513 insertions(+), 450 deletions(-) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 58e93c6..d6382b6 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -69,6 +69,11 @@ if(LINUX OR MACOSX) #CXXFLAGS += -fexceptions -frtti endif() +if(CMAKE_COMPILER_IS_GNUCC) + # !!! FIXME: turn a bunch of these off, this is just for now. I hope. --ryan. + add_definitions(-Wno-invalid-offsetof) +endif() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # !!! FIXME: turn a bunch of these off, this is just for now. I hope. --ryan. add_definitions(-Wno-unused-value) @@ -587,13 +592,58 @@ add_executable(SeriousSam SeriousSam/SeriousSam.cpp SeriousSam/VarList.cpp SeriousSam/Credits.cpp - SeriousSam/Menu.cpp SeriousSam/GLSettings.cpp - SeriousSam/MenuGadgets.cpp SeriousSam/LCDDrawing.cpp - SeriousSam/MenuPrinting.cpp SeriousSam/SplashScreen.cpp SeriousSam/MainWindow.cpp + SeriousSam/GUI/Menus/GameMenu.cpp + SeriousSam/GUI/Menus/MAudioOptions.cpp + SeriousSam/GUI/Menus/MConfirm.cpp + SeriousSam/GUI/Menus/MControls.cpp + SeriousSam/GUI/Menus/MCustomizeAxis.cpp + SeriousSam/GUI/Menus/MCustomizeKeyboard.cpp + SeriousSam/GUI/Menus/MDisabled.cpp + SeriousSam/GUI/Menus/MenuActions.cpp + SeriousSam/GUI/Menus/Menu.cpp + SeriousSam/GUI/Menus/MenuManager.cpp + SeriousSam/GUI/Menus/MenuPrinting.cpp + SeriousSam/GUI/Menus/MenuStartersAF.cpp + SeriousSam/GUI/Menus/MenuStarters.cpp + SeriousSam/GUI/Menus/MenuStuff.cpp + SeriousSam/GUI/Menus/MHighScore.cpp + SeriousSam/GUI/Menus/MInGame.cpp + SeriousSam/GUI/Menus/MLevels.cpp + SeriousSam/GUI/Menus/MLoadSave.cpp + SeriousSam/GUI/Menus/MMain.cpp + SeriousSam/GUI/Menus/MNetwork.cpp + SeriousSam/GUI/Menus/MNetworkJoin.cpp + SeriousSam/GUI/Menus/MNetworkOpen.cpp + SeriousSam/GUI/Menus/MNetworkStart.cpp + SeriousSam/GUI/Menus/MOptions.cpp + SeriousSam/GUI/Menus/MPlayerProfile.cpp + SeriousSam/GUI/Menus/MSelectPlayers.cpp + SeriousSam/GUI/Menus/MServers.cpp + SeriousSam/GUI/Menus/MSinglePlayer.cpp + SeriousSam/GUI/Menus/MSinglePlayerNew.cpp + SeriousSam/GUI/Menus/MSplitScreen.cpp + SeriousSam/GUI/Menus/MSplitStart.cpp + SeriousSam/GUI/Menus/MVar.cpp + SeriousSam/GUI/Menus/MVideoOptions.cpp + SeriousSam/GUI/Components/MenuGadget.cpp + SeriousSam/GUI/Components/MGArrow.cpp + SeriousSam/GUI/Components/MGButton.cpp + SeriousSam/GUI/Components/MGChangePlayer.cpp + SeriousSam/GUI/Components/MGEdit.cpp + SeriousSam/GUI/Components/MGFileButton.cpp + SeriousSam/GUI/Components/MGHighScore.cpp + SeriousSam/GUI/Components/MGKeyDefinition.cpp + SeriousSam/GUI/Components/MGLevelButton.cpp + SeriousSam/GUI/Components/MGModel.cpp + SeriousSam/GUI/Components/MGServerList.cpp + SeriousSam/GUI/Components/MGSlider.cpp + SeriousSam/GUI/Components/MGTitle.cpp + SeriousSam/GUI/Components/MGTrigger.cpp + SeriousSam/GUI/Components/MGVarButton.cpp ) add_dependencies(SeriousSam ParseAllEntities) diff --git a/Sources/Ecc/Main.h b/Sources/Ecc/Main.h index 6dd57c8..143bf05 100644 --- a/Sources/Ecc/Main.h +++ b/Sources/Ecc/Main.h @@ -65,7 +65,7 @@ struct SType { iLine = other.iLine; return *this; }; - const SType &operator=(char *str) { + const SType &operator=(const char *str) { strString = strdup(str); bCrossesStates = 0; iLine = -1; diff --git a/Sources/Ecc/Parser.y b/Sources/Ecc/Parser.y index ac4bbea..e45be82 100644 --- a/Sources/Ecc/Parser.y +++ b/Sources/Ecc/Parser.y @@ -983,7 +983,7 @@ procedure_implementation sscanf($3.strString, "%s %s", strInputEventType, strInputEventName); char strStateID[256]; - char *strBaseStateID = "-1"; + const char *strBaseStateID = "-1"; if(strcmp(RemoveLineDirective(strProcedureName), "Main")==0){ strcpy(strStateID, "1"); if(strncmp(strInputEventType, "EVoid", 4)!=0 && _strCurrentThumbnail[2]!=0) { diff --git a/Sources/Engine/Base/CRCTable.cpp b/Sources/Engine/Base/CRCTable.cpp index b17cb06..f2bb77b 100644 --- a/Sources/Engine/Base/CRCTable.cpp +++ b/Sources/Engine/Base/CRCTable.cpp @@ -43,12 +43,6 @@ public: extern CDynamicStackArray _afnmNoCRC; extern BOOL FileMatchesList(CDynamicStackArray &afnm, const CTFileName &fnm); -#ifndef SE_INCL_CRCTABLE_CPP -#define SE_INCL_CRCTABLE_CPP -#ifdef PRAGMA_ONCE - #pragma once -#endif - #define TYPE CCRCEntry #define CNameTable_TYPE CNameTable_CCRCEntry #define CNameTableSlot_TYPE CNameTableSlot_CCRCEntry @@ -200,5 +194,3 @@ ULONG CRCT_MakeCRCForFiles_t(CTStream &strmFiles) // throw char * } -#endif /* include-once check. */ - diff --git a/Sources/Engine/Base/ErrorReporting.cpp b/Sources/Engine/Base/ErrorReporting.cpp index 550efc0..b1f282b 100644 --- a/Sources/Engine/Base/ErrorReporting.cpp +++ b/Sources/Engine/Base/ErrorReporting.cpp @@ -168,7 +168,7 @@ BOOL YesNoMessage(const char *strFormat, ...) /* * Throw an exception of formatted string. */ -void ThrowF_t(char *strFormat, ...) // throws char * +void ThrowF_t(const char *strFormat, ...) // throws char * { const SLONG slBufferSize = 256; //char strBuffer[slBufferSize+1]; // Can't throw from the stack like this! diff --git a/Sources/Engine/Base/ErrorReporting.h b/Sources/Engine/Base/ErrorReporting.h index b59c567..c4024d8 100644 --- a/Sources/Engine/Base/ErrorReporting.h +++ b/Sources/Engine/Base/ErrorReporting.h @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif /* Throw an exception of formatted string. */ -ENGINE_API extern void ThrowF_t(char *strFormat, ...); // throws char * +ENGINE_API extern void ThrowF_t(const char *strFormat, ...); // throws char * /* Report error and terminate program. */ ENGINE_API extern void FatalError(const char *strFormat, ...); /* Report warning without terminating program (stops program until user responds). */ diff --git a/Sources/Engine/Base/ErrorTable.h b/Sources/Engine/Base/ErrorTable.h index 45729ef..98091c9 100644 --- a/Sources/Engine/Base/ErrorTable.h +++ b/Sources/Engine/Base/ErrorTable.h @@ -21,8 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc., struct ErrorCode { SLONG ec_Code; // error code value - char *ec_Name; // error code constant name (in .h files) - char *ec_Description; // error description (in help files) + const char *ec_Name; // error code constant name (in .h files) + const char *ec_Description; // error description (in help files) }; struct ErrorTable { diff --git a/Sources/Engine/Base/IFeel.cpp b/Sources/Engine/Base/IFeel.cpp index 652c3d1..b61ea29 100644 --- a/Sources/Engine/Base/IFeel.cpp +++ b/Sources/Engine/Base/IFeel.cpp @@ -211,13 +211,13 @@ void IFeel_UnloadFile() if(immUnloadFile!=NULL) immUnloadFile(); } // plays effect from ifr file -void IFeel_PlayEffect(char *pstrEffectName) +void IFeel_PlayEffect(const char *pstrEffectName) { IFeel_ChangeGain(ifeel_fGain); if(immPlayEffect!=NULL) immPlayEffect(pstrEffectName); } // stops effect from ifr file -void IFeel_StopEffect(char *pstrEffectName) +void IFeel_StopEffect(const char *pstrEffectName) { if(immStopEffect!=NULL) immStopEffect(pstrEffectName); } diff --git a/Sources/Engine/Base/IFeel.h b/Sources/Engine/Base/IFeel.h index 1bd1464..f92da12 100644 --- a/Sources/Engine/Base/IFeel.h +++ b/Sources/Engine/Base/IFeel.h @@ -25,8 +25,8 @@ ENGINE_API CTString IFeel_GetProductName(); ENGINE_API CTString IFeel_GetProjectFileName(); ENGINE_API BOOL IFeel_LoadFile(CTFileName fnFile); ENGINE_API void IFeel_UnLoadFile(); -ENGINE_API void IFeel_PlayEffect(char *pstrEffectName); -ENGINE_API void IFeel_StopEffect(char *pstrEffectName); +ENGINE_API void IFeel_PlayEffect(const char *pstrEffectName); +ENGINE_API void IFeel_StopEffect(const char *pstrEffectName); ENGINE_API void IFeel_ChangeGain(FLOAT fGain); #endif /* include-once check. */ diff --git a/Sources/Engine/Base/Memory.cpp b/Sources/Engine/Base/Memory.cpp index 004e0bf..83145d6 100644 --- a/Sources/Engine/Base/Memory.cpp +++ b/Sources/Engine/Base/Memory.cpp @@ -68,7 +68,6 @@ void NewHandler(void) // terminate program FatalError(TRANS("Not enough memory!")); } -#define _CrtCheckMemory() #endif /* Static class used for initializing memory handlers. */ diff --git a/Sources/Engine/Base/ReplaceFile.cpp b/Sources/Engine/Base/ReplaceFile.cpp index 06967de..2aa6a18 100644 --- a/Sources/Engine/Base/ReplaceFile.cpp +++ b/Sources/Engine/Base/ReplaceFile.cpp @@ -52,7 +52,7 @@ BOOL _bFileReplacingApplied; extern INDEX wed_bUseBaseForReplacement; -static CTFileName CallFileRequester(char *achrTitle, char *achrSelectedFile, char *pFilter) +static CTFileName CallFileRequester(char *achrTitle, char *achrSelectedFile, const char *pFilter) { #ifdef PLATFORM_WIN32 typedef CTFileName FileRequester_t( @@ -75,7 +75,8 @@ static CTFileName CallFileRequester(char *achrTitle, char *achrSelectedFile, cha return CTString(""); } - return pFileRequester( achrTitle, pFilter, "Replace file directory", achrSelectedFile); + // !!! FIXME: make this const correct? --ryan. + return pFileRequester( achrTitle, (char *) pFilter, "Replace file directory", achrSelectedFile); #else @@ -86,7 +87,7 @@ static CTFileName CallFileRequester(char *achrTitle, char *achrSelectedFile, cha } BOOL GetReplacingFile(CTFileName fnSourceFile, CTFileName &fnReplacingFile, - char *pFilter) + const char *pFilter) { // don't replace files if this console variable is set if (!wed_bUseBaseForReplacement) { diff --git a/Sources/Engine/Base/ReplaceFile.h b/Sources/Engine/Base/ReplaceFile.h index 5776dee..59e2e7c 100644 --- a/Sources/Engine/Base/ReplaceFile.h +++ b/Sources/Engine/Base/ReplaceFile.h @@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., extern BOOL _bFileReplacingApplied; BOOL GetReplacingFile(CTFileName fnSourceTexture, CTFileName &fnReplacingTexture, - char *pFilter); + const char *pFilter); void SetTextureWithPossibleReplacing_t(CTextureObject &to, CTFileName &fnmTexture); // read/write a texture object diff --git a/Sources/Engine/Base/SDL/SDLInput.cpp b/Sources/Engine/Base/SDL/SDLInput.cpp index 58930c2..332fa72 100644 --- a/Sources/Engine/Base/SDL/SDLInput.cpp +++ b/Sources/Engine/Base/SDL/SDLInput.cpp @@ -70,8 +70,8 @@ NOTE: Two different types of key codes are used here: static struct KeyConversion { INDEX kc_iKID; INDEX kc_iVirtKey; - char *kc_strName; - char *kc_strNameTrans; + const char *kc_strName; + const char *kc_strNameTrans; } _akcKeys[] = { // reserved for 'no-key-pressed' diff --git a/Sources/Engine/Base/Stream.cpp b/Sources/Engine/Base/Stream.cpp index 5432536..aacf459 100644 --- a/Sources/Engine/Base/Stream.cpp +++ b/Sources/Engine/Base/Stream.cpp @@ -279,7 +279,7 @@ void CTStream::DisableStreamHandling(void) /* * Throw an exception of formatted string. */ -void CTStream::Throw_t(char *strFormat, ...) // throws char * +void CTStream::Throw_t(const char *strFormat, ...) // throws char * { const SLONG slBufferSize = 256; char strFormatBuffer[slBufferSize]; diff --git a/Sources/Engine/Base/Stream.h b/Sources/Engine/Base/Stream.h index 51c283c..49e3244 100644 --- a/Sources/Engine/Base/Stream.h +++ b/Sources/Engine/Base/Stream.h @@ -84,7 +84,7 @@ public: CDynamicStackArray strm_afnmDictionary; // dictionary is stored here /* Throw an exception of formatted string. */ - void Throw_t(char *strFormat, ...); // throw char * + void Throw_t(const char *strFormat, ...); // throw char * // read the dictionary from given offset in file (internal function) void ReadDictionary_intenal_t(SLONG slOffset); // copy filename dictionary from another stream diff --git a/Sources/Engine/Base/Translation.cpp b/Sources/Engine/Base/Translation.cpp index daa16bf..e98fc81 100644 --- a/Sources/Engine/Base/Translation.cpp +++ b/Sources/Engine/Base/Translation.cpp @@ -190,10 +190,11 @@ ENGINE_API void AddTranslationTablesDir_t(const CTFileName &fnmDir, const CTFile } } +// !!! FIXME: clean these out. // translate a string -ENGINE_API char *Translate(char *str, INDEX iOffset) +ENGINE_API char *Translate(const char *str, INDEX iOffset) { - return (char*)TranslateConst((const char*)str, iOffset); + return (char*)TranslateConst(str, iOffset); } ENGINE_API const char *TranslateConst(const char *str, INDEX iOffset) diff --git a/Sources/Engine/Base/Translation.h b/Sources/Engine/Base/Translation.h index b10c145..b00b1a7 100644 --- a/Sources/Engine/Base/Translation.h +++ b/Sources/Engine/Base/Translation.h @@ -33,7 +33,7 @@ ENGINE_API void ReadTranslationTable_t( CDynamicArray &atpPairs, const CTFileName &fnmTable); // throw char * // translate a string -ENGINE_API char * Translate(char *str, INDEX iOffset=0); +ENGINE_API char * Translate(const char *str, INDEX iOffset=0); ENGINE_API const char * TranslateConst(const char *str, INDEX iOffset=0); // macro for inserting a string for translation into executables diff --git a/Sources/Engine/Brushes/BrushTriangularize.cpp b/Sources/Engine/Brushes/BrushTriangularize.cpp index 6a2ee71..0e175f9 100644 --- a/Sources/Engine/Brushes/BrushTriangularize.cpp +++ b/Sources/Engine/Brushes/BrushTriangularize.cpp @@ -155,7 +155,7 @@ public: void AddBestTriangleToTriangles(void); /* Print a statement to debugging output file. */ - void DPrintF(char *strFormat, ...); + void DPrintF(const char *strFormat, ...); /* Dump triangle edges to debug output. */ void DumpEdges(void); @@ -584,7 +584,7 @@ void EdgeDir(const DOUBLE3D &vPoint0, const DOUBLE3D &vPoint1, /* * Print a statement to debugging output file. */ -void CTriangularizer::DPrintF(char *strFormat, ...) +void CTriangularizer::DPrintF(const char *strFormat, ...) { char strBuffer[256]; // format the message in buffer diff --git a/Sources/Engine/GameAgent/GameAgent.cpp b/Sources/Engine/GameAgent/GameAgent.cpp index 7fedfda..999ff64 100644 --- a/Sources/Engine/GameAgent/GameAgent.cpp +++ b/Sources/Engine/GameAgent/GameAgent.cpp @@ -26,7 +26,28 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include + +#if defined(PLATFORM_WIN32) +#pragma comment(lib, "wsock32.lib") +WSADATA* _wsaData = NULL; +typedef int socklen_t; +#else +#include +#include +#include +#include +#include +#include +#define INVALID_SOCKET -1 +#define SOCKET_ERROR -1 +#define closesocket close +typedef int SOCKET; +typedef struct hostent HOSTENT, *PHOSTENT; +typedef struct sockaddr_in SOCKADDR_IN; +typedef struct sockaddr SOCKADDR; +#define WSAGetLastError() (INDEX) errno +#define WSACleanup() +#endif #define MSPORT 28900 #define BUFFSZ 8192 @@ -102,26 +123,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define SERIOUSSAMKEY "AKbna4\0" #define SERIOUSSAMSTR "serioussamse" -#if defined(PLATFORM_WIN32) -#pragma comment(lib, "wsock32.lib") -WSADATA* _wsaData = NULL; -typedef int socklen_t; -#else -#include -#include -#include -#include -#include -#include -#define INVALID_SOCKET -1 -#define SOCKET_ERROR -1 -#define closesocket close -typedef int SOCKET; -typedef struct hostent HOSTENT; -typedef struct sockaddr_in SOCKADDR_IN; -typedef struct sockaddr SOCKADDR; -#define WSAGetLastError() (INDEX) errno -#endif +#include SOCKET _socket = INVALID_SOCKET; @@ -131,9 +133,9 @@ sockaddr_in _sinFrom; CHAR* _szBuffer = NULL; CHAR* _szIPPortBuffer = NULL; -INT _iIPPortBufferLen = 0; +LONG _iIPPortBufferLen = 0; CHAR* _szIPPortBufferLocal = NULL; -INT _iIPPortBufferLocalLen = 0; +LONG _iIPPortBufferLocalLen = 0; BOOL _bServer = FALSE; BOOL _bInitialized = FALSE; @@ -463,14 +465,14 @@ extern void GameAgent_ServerUpdate(void) strLocation = "Heartland"; } strPacket.PrintF( PCKQUERY, - _pShell->GetString("sam_strGameName"), + (const char *) _pShell->GetString("sam_strGameName"), _SE_VER_STRING, - //_pShell->GetString("net_strLocalHost"), - strLocation, - _pShell->GetString("gam_strSessionName"), + //(const char *) _pShell->GetString("net_strLocalHost"), + (const char *) strLocation, + (const char *) _pShell->GetString("gam_strSessionName"), _pShell->GetINDEX("net_iPort"), - _pNetwork->ga_World.wo_strName, - _getGameModeName(_getSP()->sp_gmGameMode), + (const char *) _pNetwork->ga_World.wo_strName, + (const char *) _getGameModeName(_getSP()->sp_gmGameMode), _pNetwork->ga_srvServer.GetPlayersCount(), _pNetwork->ga_sesSessionState.ses_ctMaxPlayers, _pShell->GetINDEX("gam_bFriendlyFire"), @@ -506,10 +508,10 @@ extern void GameAgent_ServerUpdate(void) CTString strPacket; strPacket.PrintF( PCKINFO, - _pShell->GetString("gam_strSessionName"), + (const char *) _pShell->GetString("gam_strSessionName"), _pShell->GetINDEX("net_iPort"), - _pNetwork->ga_World.wo_strName, - _getGameModeName(_getSP()->sp_gmGameMode), + (const char *) _pNetwork->ga_World.wo_strName, + (const char *) _getGameModeName(_getSP()->sp_gmGameMode), _pNetwork->ga_srvServer.GetPlayersCount(), _pNetwork->ga_sesSessionState.ses_ctMaxPlayers); _sendPacketTo(strPacket, &_sinFrom); @@ -523,10 +525,10 @@ extern void GameAgent_ServerUpdate(void) strLocation = "Heartland"; } strPacket.PrintF( PCKBASIC, - _pShell->GetString("sam_strGameName"), + (const char *) _pShell->GetString("sam_strGameName"), _SE_VER_STRING, - //_pShell->GetString("net_strLocalHost")); - strLocation); + //(const char *) _pShell->GetString("net_strLocalHost")); + (const char *) strLocation); _sendPacketTo(strPacket, &_sinFrom); } else if (sPch4){ @@ -597,13 +599,11 @@ extern void GameAgent_EnumTrigger(BOOL bInternet) // we're not a server _bServer = FALSE; _pNetwork->ga_strEnumerationStatus = "."; - - WORD _wsaRequested; - WSADATA wsaData; + PHOSTENT _phHostinfo; ULONG _uIP,*_pchIP = &_uIP; USHORT _uPort,*_pchPort = &_uPort; - INT _iLen; + LONG _iLen; char _cName[256],*_pch,_strFinal[8] = {0}; struct in_addr addr; @@ -613,9 +613,11 @@ extern void GameAgent_EnumTrigger(BOOL bInternet) return; } _szIPPortBufferLocal = new char[1024]; - + + #ifdef PLATFORM_WIN32 // start WSA - _wsaRequested = MAKEWORD( 2, 2 ); + WSADATA wsaData; + const WORD _wsaRequested = MAKEWORD( 2, 2 ); if( WSAStartup(_wsaRequested, &wsaData) != 0) { CPrintF("Error initializing winsock!\n"); if(_szIPPortBufferLocal != NULL) { @@ -629,6 +631,7 @@ extern void GameAgent_EnumTrigger(BOOL bInternet) WSACleanup(); return; } + #endif _pch = _szIPPortBufferLocal; _iLen = 0; @@ -691,7 +694,7 @@ extern void GameAgent_EnumTrigger(BOOL bInternet) struct sockaddr_in peer; - SOCKET _sock = NULL; + SOCKET _sock = INVALID_SOCKET; u_int uiMSIP; int iErr, iLen, @@ -704,21 +707,22 @@ extern void GameAgent_EnumTrigger(BOOL bInternet) *ucSec = NULL, *ucKey = NULL; - char *cFilter = "", - *cWhere = "", - cMS[128] = {0}, - *cResponse = NULL, - *cMsstring = NULL, - *cSec = NULL; - + const char *cFilter = ""; + const char *cWhere = ""; + char cMS[128] = {0}; + char *cResponse = NULL; + char *cMsstring = NULL; + char *cSec = NULL; strcpy(cMS,ga_strMSLegacy); + #if PLATFORM_WIN32 WSADATA wsadata; if(WSAStartup(MAKEWORD(2,2), &wsadata) != 0) { CPrintF("Error initializing winsock!\n"); return; } + #endif /* Open a socket and connect to the Master server */ @@ -1024,6 +1028,9 @@ extern void GameAgent_EnumUpdate(void) } } } else { + #ifndef PLATFORM_WIN32 + STUBBED("write me"); + #else /* MSLegacy */ if(_bActivated) { HANDLE _hThread; @@ -1045,7 +1052,8 @@ extern void GameAgent_EnumUpdate(void) } _bActivatedLocal = FALSE; } - } + #endif + } } /// Cancel the GameAgent serverlist enumeration. @@ -1058,6 +1066,7 @@ extern void GameAgent_EnumCancel(void) } } +#ifdef PLATFORM_WIN32 DWORD WINAPI _MS_Thread(LPVOID lpParam) { SOCKET _sockudp = NULL; struct _sIPPort { @@ -1468,3 +1477,5 @@ DWORD WINAPI _LocalNet_Thread(LPVOID lpParam) { WSACleanup(); return 0; } +#endif + diff --git a/Sources/Engine/GameAgent/MSLegacy.h b/Sources/Engine/GameAgent/MSLegacy.h index 7691d82..21ced21 100644 --- a/Sources/Engine/GameAgent/MSLegacy.h +++ b/Sources/Engine/GameAgent/MSLegacy.h @@ -175,7 +175,7 @@ u_int resolv(char *host) { if(host_ip == INADDR_NONE) { hp = gethostbyname(host); if(!hp) { - return (NULL); + return 0; } else host_ip = *(u_int *)(hp->h_addr); } return(host_ip); diff --git a/Sources/Engine/Graphics/DrawPort.cpp b/Sources/Engine/Graphics/DrawPort.cpp index b4c90ff..8af58ab 100644 --- a/Sources/Engine/Graphics/DrawPort.cpp +++ b/Sources/Engine/Graphics/DrawPort.cpp @@ -896,7 +896,7 @@ void CDrawPort::FillZBuffer( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight, FL HRESULT hr = _pGfx->gl_pd3dDevice->Clear( 1, &d3dRect, D3DCLEAR_ZBUFFER, 0,zval,0); D3D_CHECKERROR(hr); } -#endif SE1_D3D +#endif //SE1_D3D } @@ -923,7 +923,7 @@ void CDrawPort::FillZBuffer( FLOAT zval) const HRESULT hr = _pGfx->gl_pd3dDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, 0,zval,0); D3D_CHECKERROR(hr); } -#endif SE1_D3D +#endif //SE1_D3D } diff --git a/Sources/Engine/Graphics/GfxLibrary.cpp b/Sources/Engine/Graphics/GfxLibrary.cpp index df19a82..8eca746 100644 --- a/Sources/Engine/Graphics/GfxLibrary.cpp +++ b/Sources/Engine/Graphics/GfxLibrary.cpp @@ -1106,10 +1106,10 @@ void CGfxLibrary::Init(void) { ASSERT( this!=NULL); +#ifdef PLATFORM_WIN32 // we will never allow glide splash screen putenv( "FX_GLIDE_NO_SPLASH=1"); -#ifdef PLATFORM_WIN32 // report desktop settings CPrintF(TRANSV("Desktop settings...\n")); @@ -1126,6 +1126,9 @@ void CGfxLibrary::Init(void) #else + // we will never allow glide splash screen + setenv("FX_GLIDE_NO_SPLASH", "1", 1); + gfx_ctMonitors = 1; #endif diff --git a/Sources/Engine/Graphics/TextureEffects.h b/Sources/Engine/Graphics/TextureEffects.h index e99c4de..f192597 100644 --- a/Sources/Engine/Graphics/TextureEffects.h +++ b/Sources/Engine/Graphics/TextureEffects.h @@ -94,14 +94,14 @@ public: }; struct TextureEffectSourceType { - char *test_strName; // name used for browsing + const char *test_strName; // name used for browsing void (*test_Initialize)(CTextureEffectSource *ptes, PIX pixU0, PIX pixV0, PIX pixU1, PIX pixV1); // function for initalization of a new effect source void (*test_Animate)(CTextureEffectSource *ptes); // function for animation of one effect source }; struct TextureEffectGlobalType { - char *tegt_strName; // name used for browsing + const char *tegt_strName; // name used for browsing void (*tegt_Initialize)(void); void (*tegt_Animate)(void); diff --git a/Sources/Engine/Math/ObjectSector.cpp b/Sources/Engine/Math/ObjectSector.cpp index 6c451f2..de4fd62 100644 --- a/Sources/Engine/Math/ObjectSector.cpp +++ b/Sources/Engine/Math/ObjectSector.cpp @@ -825,7 +825,7 @@ bug: skipbug:; #endif //NDEBUG -#endif 0 +#endif //0 } /* diff --git a/Sources/Engine/Sound/Wave.cpp b/Sources/Engine/Sound/Wave.cpp index 40d1218..7cd7cac 100644 --- a/Sources/Engine/Sound/Wave.cpp +++ b/Sources/Engine/Sound/Wave.cpp @@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., */ // check wave format -void PCMWaveInput::CheckWaveFormat_t(WAVEFORMATEX wfeCheck, char *pcErrorString) +void PCMWaveInput::CheckWaveFormat_t(WAVEFORMATEX wfeCheck, const char *pcErrorString) { // check format tag if (wfeCheck.wFormatTag != 1) { diff --git a/Sources/Engine/Sound/Wave.h b/Sources/Engine/Sound/Wave.h index 4a52cff..9eec412 100644 --- a/Sources/Engine/Sound/Wave.h +++ b/Sources/Engine/Sound/Wave.h @@ -41,7 +41,7 @@ private: public: // Check wave format - static void CheckWaveFormat_t( WAVEFORMATEX SwfeCheck, char *pcErrorString); + static void CheckWaveFormat_t( WAVEFORMATEX SwfeCheck, const char *pcErrorString); /* Constructor */ inline PCMWaveInput(void) { pwi_bInfoLoaded = FALSE; pwi_bDataLoaded = FALSE; }; diff --git a/Sources/EntitiesMP/Player.es b/Sources/EntitiesMP/Player.es index 0717dce..d27068a 100644 --- a/Sources/EntitiesMP/Player.es +++ b/Sources/EntitiesMP/Player.es @@ -3191,7 +3191,7 @@ functions: if (GetFlags()&ENF_ALIVE) { // determine corresponding sound INDEX iSound; - char *strIFeel = NULL; + const char *strIFeel = NULL; if( m_fDamageAmmount<5.0f) { iSound = GenderSound(SOUND_WOUNDWEAK); strIFeel = "WoundWeak"; diff --git a/Sources/GameMP/Game.cpp b/Sources/GameMP/Game.cpp index 15bb0de..5d7a5e7 100644 --- a/Sources/GameMP/Game.cpp +++ b/Sources/GameMP/Game.cpp @@ -167,7 +167,7 @@ static INDEX ctl_iCurrentPlayerLocal = -1; static INDEX ctl_iCurrentPlayer = -1; static FLOAT gam_fChatSoundVolume = 0.25f; -extern BOOL map_bIsFirstEncounter = FALSE; +BOOL map_bIsFirstEncounter = FALSE; BOOL _bUserBreakEnabled = FALSE; // make sure that console doesn't show last lines if not playing in network @@ -353,7 +353,7 @@ CButtonAction::CButtonAction(void) } // Assignment operator. -CButtonAction &CButtonAction ::operator=(CButtonAction &baOriginal) +CButtonAction &CButtonAction ::operator=(const CButtonAction &baOriginal) { ba_iFirstKey = baOriginal.ba_iFirstKey; ba_iSecondKey = baOriginal.ba_iSecondKey; @@ -504,7 +504,12 @@ void CControls::RemoveButtonAction( CButtonAction &baButtonAction) delete &baButtonAction; } - +void CControls::DeleteAllButtonActions() +{ + FORDELETELIST(CButtonAction, ba_lnNode, this->ctrl_lhButtonActions, itAct) { + delete &itAct.Current(); + } +} // calculate some useful demo vars static void CalcDemoProfile( INDEX ctFrames, INDEX &ctFramesNoPeaks, @@ -2867,7 +2872,7 @@ void CGame::LCDSetDrawport(CDrawPort *pdp) ::_LCDSetDrawport(pdp); } -void CGame::LCDDrawBox(PIX pixUL, PIX pixDR, PIXaabbox2D &box, COLOR col) +void CGame::LCDDrawBox(PIX pixUL, PIX pixDR, const PIXaabbox2D &box, COLOR col) { col = SE_COL_BLUE_NEUTRAL|255; diff --git a/Sources/GameMP/Game.h b/Sources/GameMP/Game.h index b593b2e..f2289a1 100644 --- a/Sources/GameMP/Game.h +++ b/Sources/GameMP/Game.h @@ -76,6 +76,7 @@ class CButtonAction { public: // default constructor CButtonAction(); + ~CButtonAction() {} CListNode ba_lnNode; INDEX ba_iFirstKey; BOOL ba_bFirstKeyDown; @@ -85,7 +86,7 @@ public: CTString ba_strCommandLineWhenPressed; CTString ba_strCommandLineWhenReleased; // Assignment operator. - virtual CButtonAction &operator=(CButtonAction &baOriginal); + virtual CButtonAction &operator=(const CButtonAction &baOriginal); virtual void Read_t( CTStream &istrm); // throw char* virtual void Write_t( CTStream &ostrm); // throw char* }; @@ -126,6 +127,7 @@ public: virtual void RemoveButtonAction( CButtonAction &baButtonAction); virtual void Load_t( CTFileName fnFile); // throw char * virtual void Save_t( CTFileName fnFile); // throw char * + virtual void DeleteAllButtonActions(); }; class CLocalPlayer @@ -296,7 +298,7 @@ public: virtual void LCDEnd(void); virtual void LCDPrepare(FLOAT fFade); virtual void LCDSetDrawport(CDrawPort *pdp); - virtual void LCDDrawBox(PIX pixUL, PIX pixDR, PIXaabbox2D &box, COLOR col); + virtual void LCDDrawBox(PIX pixUL, PIX pixDR, const PIXaabbox2D &box, COLOR col); virtual void LCDScreenBox(COLOR col); virtual void LCDScreenBoxOpenLeft(COLOR col); virtual void LCDScreenBoxOpenRight(COLOR col); diff --git a/Sources/GameMP/LCDDrawing.cpp b/Sources/GameMP/LCDDrawing.cpp index 74d85ec..bce0f1c 100644 --- a/Sources/GameMP/LCDDrawing.cpp +++ b/Sources/GameMP/LCDDrawing.cpp @@ -69,7 +69,7 @@ void TiledTexture( PIXaabbox2D &_boxScreen, FLOAT fStretch, const MEX2D &vScreen boxTexture+=vScreen; } -extern void _LCDDrawBox(PIX pixUL, PIX pixDR, PIXaabbox2D &box, COLOR col) +extern void _LCDDrawBox(PIX pixUL, PIX pixDR, const PIXaabbox2D &box, COLOR col) { // up _pdp->DrawLine( diff --git a/Sources/GameMP/LCDDrawing.h b/Sources/GameMP/LCDDrawing.h index a024cdf..36601ed 100644 --- a/Sources/GameMP/LCDDrawing.h +++ b/Sources/GameMP/LCDDrawing.h @@ -23,7 +23,7 @@ extern void _LCDInit(void); extern void _LCDEnd(void); extern void _LCDPrepare(FLOAT fFade); extern void _LCDSetDrawport(CDrawPort *pdp); -extern void _LCDDrawBox(PIX pixUL, PIX pixDR, PIXaabbox2D &box, COLOR col); +extern void _LCDDrawBox(PIX pixUL, PIX pixDR, const PIXaabbox2D &box, COLOR col); extern void _LCDScreenBox(COLOR col); extern void _LCDScreenBoxOpenLeft(COLOR col); extern void _LCDScreenBoxOpenRight(COLOR col); diff --git a/Sources/SeriousSam/FileInfo.h b/Sources/SeriousSam/FileInfo.h index 30b70e0..8abd794 100644 --- a/Sources/SeriousSam/FileInfo.h +++ b/Sources/SeriousSam/FileInfo.h @@ -28,4 +28,5 @@ public: }; -#endif /* include-once check. */ \ No newline at end of file +#endif /* include-once check. */ + diff --git a/Sources/SeriousSam/GUI/Components/MGArrow.cpp b/Sources/SeriousSam/GUI/Components/MGArrow.cpp index 84f0956..1a5f61f 100644 --- a/Sources/SeriousSam/GUI/Components/MGArrow.cpp +++ b/Sources/SeriousSam/GUI/Components/MGArrow.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGArrow.h" +#include "SeriousSam/GUI/Components/MGArrow.h" void CMGArrow::Render(CDrawPort *pdp) diff --git a/Sources/SeriousSam/GUI/Components/MGArrow.h b/Sources/SeriousSam/GUI/Components/MGArrow.h index e5408e6..0e95369 100644 --- a/Sources/SeriousSam/GUI/Components/MGArrow.h +++ b/Sources/SeriousSam/GUI/Components/MGArrow.h @@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "ArrowDir.h" -#include "MGButton.h" +#include "SeriousSam/ArrowDir.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGArrow : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MGButton.cpp b/Sources/SeriousSam/GUI/Components/MGButton.cpp index ad1ccca..70e8b6b 100644 --- a/Sources/SeriousSam/GUI/Components/MGButton.cpp +++ b/Sources/SeriousSam/GUI/Components/MGButton.cpp @@ -13,13 +13,13 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "LevelInfo.h" -#include "VarList.h" -#include "MGButton.h" +#include "SeriousSam/LevelInfo.h" +#include "SeriousSam/VarList.h" +#include "SeriousSam/GUI/Components/MGButton.h" extern CSoundData *_psdPress; @@ -74,14 +74,14 @@ void CMGButton::Render(CDrawPort *pdp) PIXaabbox2D box = FloatBoxToPixBox(pdp, mg_boxOnScreen); COLOR col = GetCurrentColor(); if (mg_bEditing) { - col = LCDGetColor(C_GREEN | 0xFF, "editing"); + col = _pGame->LCDGetColor(C_GREEN | 0xFF, "editing"); } COLOR colRectangle = col; if (mg_bHighlighted) { - col = LCDGetColor(C_WHITE | 0xFF, "hilited"); + col = _pGame->LCDGetColor(C_WHITE | 0xFF, "hilited"); if (!mg_bFocused) { - colRectangle = LCDGetColor(C_WHITE | 0xFF, "hilited rectangle"); + colRectangle = _pGame->LCDGetColor(C_WHITE | 0xFF, "hilited rectangle"); } } if (mg_bMental) { @@ -119,7 +119,7 @@ void CMGButton::Render(CDrawPort *pdp) pixLeft = box.Min()(1) + box.Size()(1)*0.55f; pixWidth = box.Size()(1)*0.45f + 1; } - pdp->Fill(pixLeft, pixUp, pixWidth, pixHeight, LCDGetColor(C_dGREEN | 0x40, "edit fill")); + pdp->Fill(pixLeft, pixUp, pixWidth, pixHeight, _pGame->LCDGetColor(C_dGREEN | 0x40, "edit fill")); } @@ -163,7 +163,7 @@ void CMGButton::Render(CDrawPort *pdp) if (!pdp->dp_FontData->fd_bFixedWidth) { pixY -= pdp->dp_fTextScaling * 2; } - pdp->PutText("|", pixX, pixY, LCDGetColor(C_WHITE | 0xFF, "editing cursor")); + pdp->PutText("|", pixX, pixY, _pGame->LCDGetColor(C_WHITE | 0xFF, "editing cursor")); } } diff --git a/Sources/SeriousSam/GUI/Components/MGButton.h b/Sources/SeriousSam/GUI/Components/MGButton.h index 8d83f65..d9710d0 100644 --- a/Sources/SeriousSam/GUI/Components/MGButton.h +++ b/Sources/SeriousSam/GUI/Components/MGButton.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MenuGadget.h" +#include "SeriousSam/GUI/Components/MenuGadget.h" class CMGButton : public CMenuGadget { diff --git a/Sources/SeriousSam/GUI/Components/MGChangePlayer.cpp b/Sources/SeriousSam/GUI/Components/MGChangePlayer.cpp index 931c584..bb01518 100644 --- a/Sources/SeriousSam/GUI/Components/MGChangePlayer.cpp +++ b/Sources/SeriousSam/GUI/Components/MGChangePlayer.cpp @@ -13,12 +13,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGChangePlayer.h" -#include "GUI/Menus/MenuManager.h" +#include "SeriousSam/GUI/Components/MGChangePlayer.h" +#include "SeriousSam/GUI/Menus/MenuManager.h" extern CSoundData *_psdPress; @@ -48,6 +48,6 @@ void CMGChangePlayer::SetPlayerText(void) if (iPlayer<0 || iPlayer>7) { mg_strText = "????"; } else { - mg_strText.PrintF(TRANS("Player %d: %s\n"), mg_iLocalPlayer + 1, pc.GetNameForPrinting()); + mg_strText.PrintF(TRANS("Player %d: %s\n"), mg_iLocalPlayer + 1, (const char *) pc.GetNameForPrinting()); } } \ No newline at end of file diff --git a/Sources/SeriousSam/GUI/Components/MGChangePlayer.h b/Sources/SeriousSam/GUI/Components/MGChangePlayer.h index f571237..d4180f8 100644 --- a/Sources/SeriousSam/GUI/Components/MGChangePlayer.h +++ b/Sources/SeriousSam/GUI/Components/MGChangePlayer.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGButton.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGChangePlayer : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MGEdit.cpp b/Sources/SeriousSam/GUI/Components/MGEdit.cpp index 8375668..3fb308d 100644 --- a/Sources/SeriousSam/GUI/Components/MGEdit.cpp +++ b/Sources/SeriousSam/GUI/Components/MGEdit.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGEdit.h" +#include "SeriousSam/GUI/Components/MGEdit.h" extern CSoundData *_psdPress; diff --git a/Sources/SeriousSam/GUI/Components/MGEdit.h b/Sources/SeriousSam/GUI/Components/MGEdit.h index f995736..bab1538 100644 --- a/Sources/SeriousSam/GUI/Components/MGEdit.h +++ b/Sources/SeriousSam/GUI/Components/MGEdit.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGButton.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGEdit : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MGFileButton.cpp b/Sources/SeriousSam/GUI/Components/MGFileButton.cpp index cbf9d84..3afa6e3 100644 --- a/Sources/SeriousSam/GUI/Components/MGFileButton.cpp +++ b/Sources/SeriousSam/GUI/Components/MGFileButton.cpp @@ -13,12 +13,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGFileButton.h" -#include "GUI/Menus/MenuManager.h" +#include "SeriousSam/GUI/Components/MGFileButton.h" +#include "SeriousSam/GUI/Menus/MenuManager.h" extern CSoundData *_psdPress; @@ -237,7 +237,7 @@ void CMGFileButton::Render(CDrawPort *pdp) PIX pixI = box.Min()(1); PIX pixJ = box.Min()(2); - COLOR col = LCDGetColor(C_mlGREEN | 255, "file info"); + COLOR col = _pGame->LCDGetColor(C_mlGREEN | 255, "file info"); pdp->PutText(mg_strInfo, pixI, pixJ, col); } } \ No newline at end of file diff --git a/Sources/SeriousSam/GUI/Components/MGFileButton.h b/Sources/SeriousSam/GUI/Components/MGFileButton.h index a5d10dd..9cfbff0 100644 --- a/Sources/SeriousSam/GUI/Components/MGFileButton.h +++ b/Sources/SeriousSam/GUI/Components/MGFileButton.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGEdit.h" +#include "SeriousSam/GUI/Components/MGEdit.h" // file button states #define FBS_NORMAL 0 // normal active state diff --git a/Sources/SeriousSam/GUI/Components/MGHighScore.cpp b/Sources/SeriousSam/GUI/Components/MGHighScore.cpp index c6272dc..81d18e0 100644 --- a/Sources/SeriousSam/GUI/Components/MGHighScore.cpp +++ b/Sources/SeriousSam/GUI/Components/MGHighScore.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGHighScore.h" +#include "SeriousSam/GUI/Components/MGHighScore.h" #define HSCOLUMNS 6 CTString strHighScores[HIGHSCORE_COUNT + 1][HSCOLUMNS]; @@ -30,9 +30,9 @@ void CMGHighScore::Render(CDrawPort *pdp) { SetFontMedium(pdp); - COLOR colHeader = LCDGetColor(C_GREEN | 255, "hiscore header"); - COLOR colData = LCDGetColor(C_mdGREEN | 255, "hiscore data"); - COLOR colLastSet = LCDGetColor(C_mlGREEN | 255, "hiscore last set"); + COLOR colHeader = _pGame->LCDGetColor(C_GREEN | 255, "hiscore header"); + COLOR colData = _pGame->LCDGetColor(C_mdGREEN | 255, "hiscore data"); + COLOR colLastSet = _pGame->LCDGetColor(C_mlGREEN | 255, "hiscore last set"); INDEX iLastSet = _pGame->gm_iLastSetHighScore; CTString strText; diff --git a/Sources/SeriousSam/GUI/Components/MGHighScore.h b/Sources/SeriousSam/GUI/Components/MGHighScore.h index 469acd0..4a72629 100644 --- a/Sources/SeriousSam/GUI/Components/MGHighScore.h +++ b/Sources/SeriousSam/GUI/Components/MGHighScore.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MenuGadget.h" +#include "SeriousSam/GUI/Components/MenuGadget.h" class CMGHighScore : public CMenuGadget { diff --git a/Sources/SeriousSam/GUI/Components/MGKeyDefinition.cpp b/Sources/SeriousSam/GUI/Components/MGKeyDefinition.cpp index 4cc9e3f..5cfe3e3 100644 --- a/Sources/SeriousSam/GUI/Components/MGKeyDefinition.cpp +++ b/Sources/SeriousSam/GUI/Components/MGKeyDefinition.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGKeyDefinition.h" +#include "SeriousSam/GUI/Components/MGKeyDefinition.h" extern CSoundData *_psdSelect; extern CSoundData *_psdPress; @@ -63,7 +63,7 @@ void CMGKeyDefinition::SetBindingNames(BOOL bDefining) // find the button INDEX ict = 0; INDEX iDik = 0; - FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) { + FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itba) { if (ict == mg_iControlNumber) { CButtonAction &ba = *itba; // get the current bindings and names @@ -122,7 +122,7 @@ void CMGKeyDefinition::DefineKey(INDEX iDik) { // for each button in controls INDEX ict = 0; - FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itba) { + FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itba) { CButtonAction &ba = *itba; // if it is this one if (ict == mg_iControlNumber) { diff --git a/Sources/SeriousSam/GUI/Components/MGKeyDefinition.h b/Sources/SeriousSam/GUI/Components/MGKeyDefinition.h index 9291e65..0373007 100644 --- a/Sources/SeriousSam/GUI/Components/MGKeyDefinition.h +++ b/Sources/SeriousSam/GUI/Components/MGKeyDefinition.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MenuGadget.h" +#include "SeriousSam/GUI/Components/MenuGadget.h" class CMGKeyDefinition : public CMenuGadget { diff --git a/Sources/SeriousSam/GUI/Components/MGLevelButton.cpp b/Sources/SeriousSam/GUI/Components/MGLevelButton.cpp index 1077e28..601a3e1 100644 --- a/Sources/SeriousSam/GUI/Components/MGLevelButton.cpp +++ b/Sources/SeriousSam/GUI/Components/MGLevelButton.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGLevelButton.h" +#include "SeriousSam/GUI/Components/MGLevelButton.h" extern CSoundData *_psdPress; diff --git a/Sources/SeriousSam/GUI/Components/MGLevelButton.h b/Sources/SeriousSam/GUI/Components/MGLevelButton.h index a0f5e80..950f0a6 100644 --- a/Sources/SeriousSam/GUI/Components/MGLevelButton.h +++ b/Sources/SeriousSam/GUI/Components/MGLevelButton.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGButton.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGLevelButton : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MGModel.cpp b/Sources/SeriousSam/GUI/Components/MGModel.cpp index ee3583b..0c25809 100644 --- a/Sources/SeriousSam/GUI/Components/MGModel.cpp +++ b/Sources/SeriousSam/GUI/Components/MGModel.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGModel.h" +#include "SeriousSam/GUI/Components/MGModel.h" extern INDEX sam_bWideScreen; @@ -43,11 +43,11 @@ void CMGModel::Render(CDrawPort *pdp) dpModel.Lock(); dpModel.FillZBuffer(1.0f); - LCDSetDrawport(&dpModel); + _pGame->LCDSetDrawport(&dpModel); // clear menu here dpModel.Fill(C_BLACK | 255); - LCDRenderClouds1(); - LCDRenderClouds2(); + _pGame->LCDRenderClouds1(); + _pGame->LCDRenderClouds2(); // prepare projection CRenderModel rmRenderModel; @@ -106,13 +106,13 @@ void CMGModel::Render(CDrawPort *pdp) mg_moModel.RenderModel(rmRenderModel); EndModelRenderingView(); - LCDScreenBox(LCDGetColor(C_GREEN, "model box") | GetCurrentColor()); + _pGame->LCDScreenBox(_pGame->LCDGetColor(C_GREEN, "model box") | GetCurrentColor()); dpModel.Unlock(); pdp->Unlock(); pdp->Lock(); - LCDSetDrawport(pdp); + _pGame->LCDSetDrawport(pdp); // print the model name { diff --git a/Sources/SeriousSam/GUI/Components/MGModel.h b/Sources/SeriousSam/GUI/Components/MGModel.h index 9cdbc7d..74f675b 100644 --- a/Sources/SeriousSam/GUI/Components/MGModel.h +++ b/Sources/SeriousSam/GUI/Components/MGModel.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGButton.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGModel : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MGServerList.cpp b/Sources/SeriousSam/GUI/Components/MGServerList.cpp index 51a4c40..8a33c2c 100644 --- a/Sources/SeriousSam/GUI/Components/MGServerList.cpp +++ b/Sources/SeriousSam/GUI/Components/MGServerList.cpp @@ -13,12 +13,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include #include "MGServerList.h" -#include "MGEdit.h" +#include "SeriousSam/GUI/Components/MGEdit.h" extern CSoundData *_psdSelect; extern CSoundData *_psdPress; diff --git a/Sources/SeriousSam/GUI/Components/MGServerList.h b/Sources/SeriousSam/GUI/Components/MGServerList.h index 8932bb2..0df333e 100644 --- a/Sources/SeriousSam/GUI/Components/MGServerList.h +++ b/Sources/SeriousSam/GUI/Components/MGServerList.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGButton.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGServerList : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MGSlider.cpp b/Sources/SeriousSam/GUI/Components/MGSlider.cpp index 01a360a..1f919de 100644 --- a/Sources/SeriousSam/GUI/Components/MGSlider.cpp +++ b/Sources/SeriousSam/GUI/Components/MGSlider.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGSlider.h" +#include "SeriousSam/GUI/Components/MGSlider.h" extern PIX _pixCursorPosI; extern PIX _pixCursorPosJ; @@ -113,8 +113,8 @@ void CMGSlider::Render(CDrawPort *pdp) pdp->PutTextR(mg_strText, pixIL, pixJ, col); // draw box around slider - LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR + 1, pixJ), PIX2D(pixIR + pixISizeR - 2, pixJ + pixJSize - 2)), - LCDGetColor(C_GREEN | 255, "slider box")); + _pGame->LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR + 1, pixJ), PIX2D(pixIR + pixISizeR - 2, pixJ + pixJSize - 2)), + _pGame->LCDGetColor(C_GREEN | 255, "slider box")); // draw filled part of slider pdp->Fill(pixIR + 2, pixJ + 1, (pixISizeR - 5)*mg_fFactor, (pixJSize - 4), col); diff --git a/Sources/SeriousSam/GUI/Components/MGSlider.h b/Sources/SeriousSam/GUI/Components/MGSlider.h index eb582d4..1d14738 100644 --- a/Sources/SeriousSam/GUI/Components/MGSlider.h +++ b/Sources/SeriousSam/GUI/Components/MGSlider.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGButton.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGSlider : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MGTitle.cpp b/Sources/SeriousSam/GUI/Components/MGTitle.cpp index 76e0c01..6aad874 100644 --- a/Sources/SeriousSam/GUI/Components/MGTitle.cpp +++ b/Sources/SeriousSam/GUI/Components/MGTitle.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGTitle.h" +#include "SeriousSam/GUI/Components/MGTitle.h" void CMGTitle::Render(CDrawPort *pdp) @@ -28,5 +28,5 @@ void CMGTitle::Render(CDrawPort *pdp) PIX pixI = box.Center()(1); PIX pixJ = box.Min()(2); - pdp->PutTextC(mg_strText, pixI, pixJ, LCDGetColor(C_WHITE | CT_OPAQUE, "title")); + pdp->PutTextC(mg_strText, pixI, pixJ, _pGame->LCDGetColor(C_WHITE | CT_OPAQUE, "title")); } \ No newline at end of file diff --git a/Sources/SeriousSam/GUI/Components/MGTitle.h b/Sources/SeriousSam/GUI/Components/MGTitle.h index 7bb2658..b599e04 100644 --- a/Sources/SeriousSam/GUI/Components/MGTitle.h +++ b/Sources/SeriousSam/GUI/Components/MGTitle.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MenuGadget.h" +#include "SeriousSam/GUI/Components/MenuGadget.h" class CMGTitle : public CMenuGadget { diff --git a/Sources/SeriousSam/GUI/Components/MGTrigger.cpp b/Sources/SeriousSam/GUI/Components/MGTrigger.cpp index 8cd9a11..9480d0c 100644 --- a/Sources/SeriousSam/GUI/Components/MGTrigger.cpp +++ b/Sources/SeriousSam/GUI/Components/MGTrigger.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "MGTrigger.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" INDEX GetNewLoopValue(int iVKey, INDEX iCurrent, INDEX ctMembers) diff --git a/Sources/SeriousSam/GUI/Components/MGTrigger.h b/Sources/SeriousSam/GUI/Components/MGTrigger.h index 1a5e8f4..f018d72 100644 --- a/Sources/SeriousSam/GUI/Components/MGTrigger.h +++ b/Sources/SeriousSam/GUI/Components/MGTrigger.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MenuGadget.h" +#include "SeriousSam/GUI/Components/MenuGadget.h" class CMGTrigger : public CMenuGadget { diff --git a/Sources/SeriousSam/GUI/Components/MGVarButton.cpp b/Sources/SeriousSam/GUI/Components/MGVarButton.cpp index da00dc9..9251c47 100644 --- a/Sources/SeriousSam/GUI/Components/MGVarButton.cpp +++ b/Sources/SeriousSam/GUI/Components/MGVarButton.cpp @@ -13,12 +13,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "VarList.h" -#include "MGVarButton.h" +#include "SeriousSam/VarList.h" +#include "SeriousSam/GUI/Components/MGVarButton.h" extern PIX _pixCursorPosI; extern PIX _pixCursorPosJ; @@ -139,7 +139,7 @@ void CMGVarButton::Render(CDrawPort *pdp) if (mg_pvsVar->vs_bSeparator) { mg_bEnabled = FALSE; - COLOR col = LCDGetColor(C_WHITE | 255, "separator"); + COLOR col = _pGame->LCDGetColor(C_WHITE | 255, "separator"); CTString strText = mg_pvsVar->vs_strName; pdp->PutTextC(strText, pixIC, pixJ, col); } else if (mg_pvsVar->Validate()) { @@ -157,8 +157,8 @@ void CMGVarButton::Render(CDrawPort *pdp) // draw box around slider PIX pixISize = box.Size()(1)*0.13f; PIX pixJSize = box.Size()(2); - LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR, pixJ + 1), PIX2D(pixIR + pixISize - 4, pixJ + pixJSize - 6)), - LCDGetColor(C_GREEN | 255, "slider box")); + _pGame->LCDDrawBox(0, -1, PIXaabbox2D(PIX2D(pixIR, pixJ + 1), PIX2D(pixIR + pixISize - 4, pixJ + pixJSize - 6)), + _pGame->LCDGetColor(C_GREEN | 255, "slider box")); // draw filled part of slider if (mg_pvsVar->vs_iSlider == 1) { diff --git a/Sources/SeriousSam/GUI/Components/MGVarButton.h b/Sources/SeriousSam/GUI/Components/MGVarButton.h index ec22f83..378a4f4 100644 --- a/Sources/SeriousSam/GUI/Components/MGVarButton.h +++ b/Sources/SeriousSam/GUI/Components/MGVarButton.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MGButton.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMGVarButton : public CMGButton { diff --git a/Sources/SeriousSam/GUI/Components/MenuGadget.cpp b/Sources/SeriousSam/GUI/Components/MenuGadget.cpp index 22ea7fe..ad98fb1 100644 --- a/Sources/SeriousSam/GUI/Components/MenuGadget.cpp +++ b/Sources/SeriousSam/GUI/Components/MenuGadget.cpp @@ -13,19 +13,19 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include -#include "LevelInfo.h" -#include "VarList.h" -#include "MenuGadget.h" +#include "SeriousSam/LevelInfo.h" +#include "SeriousSam/VarList.h" +#include "SeriousSam/GUI/Components/MenuGadget.h" extern CSoundData *_psdSelect; -extern BOOL _bDefiningKey = FALSE; -extern BOOL _bEditingString = FALSE; -extern CMenuGadget *_pmgLastActivatedGadget = NULL; +BOOL _bDefiningKey = FALSE; +BOOL _bEditingString = FALSE; +CMenuGadget *_pmgLastActivatedGadget = NULL; CMenuGadget::CMenuGadget(void) @@ -107,17 +107,17 @@ void CMenuGadget::OnMouseOver(PIX pixI, PIX pixJ) COLOR CMenuGadget::GetCurrentColor(void) { // use normal colors - COLOR colUnselected = LCDGetColor(C_GREEN, "unselected"); - COLOR colSelected = LCDGetColor(C_WHITE, "selected"); + COLOR colUnselected = _pGame->LCDGetColor(C_GREEN, "unselected"); + COLOR colSelected = _pGame->LCDGetColor(C_WHITE, "selected"); // if disabled if (!mg_bEnabled) { // use a bit darker colors - colUnselected = LCDGetColor(C_dGREEN, "disabled unselected"); - colSelected = LCDGetColor(C_GRAY, "disabled selected"); + colUnselected = _pGame->LCDGetColor(C_dGREEN, "disabled unselected"); + colSelected = _pGame->LCDGetColor(C_GRAY, "disabled selected"); // if label if (mg_bLabel) { // use white - colUnselected = colSelected = LCDGetColor(C_WHITE, "label"); + colUnselected = colSelected = _pGame->LCDGetColor(C_WHITE, "label"); } } // use unselected color diff --git a/Sources/SeriousSam/GUI/Components/MenuGadget.h b/Sources/SeriousSam/GUI/Components/MenuGadget.h index 04b30a3..c0f742e 100644 --- a/Sources/SeriousSam/GUI/Components/MenuGadget.h +++ b/Sources/SeriousSam/GUI/Components/MenuGadget.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #define DOING_NOTHING 0 #define PRESS_KEY_WAITING 1 diff --git a/Sources/SeriousSam/GUI/Menus/GameMenu.cpp b/Sources/SeriousSam/GUI/Menus/GameMenu.cpp index 5c776db..3237594 100644 --- a/Sources/SeriousSam/GUI/Menus/GameMenu.cpp +++ b/Sources/SeriousSam/GUI/Menus/GameMenu.cpp @@ -13,10 +13,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" -#include "GameMenu.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" CGameMenu::CGameMenu(void) diff --git a/Sources/SeriousSam/GUI/Menus/MAudioOptions.cpp b/Sources/SeriousSam/GUI/Menus/MAudioOptions.cpp index adf9c34..cf71851 100644 --- a/Sources/SeriousSam/GUI/Menus/MAudioOptions.cpp +++ b/Sources/SeriousSam/GUI/Menus/MAudioOptions.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MAudioOptions.h" diff --git a/Sources/SeriousSam/GUI/Menus/MAudioOptions.h b/Sources/SeriousSam/GUI/Menus/MAudioOptions.h index 26d3c13..7761eac 100644 --- a/Sources/SeriousSam/GUI/Menus/MAudioOptions.h +++ b/Sources/SeriousSam/GUI/Menus/MAudioOptions.h @@ -19,11 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGSlider.h" -#include "GUI/Components/MGTrigger.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGSlider.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CAudioOptionsMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MConfirm.cpp b/Sources/SeriousSam/GUI/Menus/MConfirm.cpp index 9900950..08db0d1 100644 --- a/Sources/SeriousSam/GUI/Menus/MConfirm.cpp +++ b/Sources/SeriousSam/GUI/Menus/MConfirm.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MConfirm.h" void CConfirmMenu::Initialize_t(void) diff --git a/Sources/SeriousSam/GUI/Menus/MConfirm.h b/Sources/SeriousSam/GUI/Menus/MConfirm.h index a614cba..eb434d3 100644 --- a/Sources/SeriousSam/GUI/Menus/MConfirm.h +++ b/Sources/SeriousSam/GUI/Menus/MConfirm.h @@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CConfirmMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MControls.cpp b/Sources/SeriousSam/GUI/Menus/MControls.cpp index 747c78f..0a0e956 100644 --- a/Sources/SeriousSam/GUI/Menus/MControls.cpp +++ b/Sources/SeriousSam/GUI/Menus/MControls.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MControls.h" @@ -99,7 +99,7 @@ void CControlsMenu::StartMenu(void) ControlsMenuOn(); - gm_mgNameLabel.mg_strText.PrintF(TRANS("CONTROLS FOR: %s"), _pGame->gm_apcPlayers[iPlayer].GetNameForPrinting()); + gm_mgNameLabel.mg_strText.PrintF(TRANS("CONTROLS FOR: %s"), (const char *) _pGame->gm_apcPlayers[iPlayer].GetNameForPrinting()); ObtainActionSettings(); CGameMenu::StartMenu(); @@ -116,7 +116,7 @@ void CControlsMenu::EndMenu(void) void CControlsMenu::ObtainActionSettings(void) { - CControls &ctrls = _pGame->gm_ctrlControlsExtra; + CControls &ctrls = *_pGame->gm_ctrlControlsExtra; gm_mgSensitivity.mg_iMinPos = 0; gm_mgSensitivity.mg_iMaxPos = 50; @@ -137,7 +137,7 @@ void CControlsMenu::ObtainActionSettings(void) void CControlsMenu::ApplyActionSettings(void) { - CControls &ctrls = _pGame->gm_ctrlControlsExtra; + CControls &ctrls = *_pGame->gm_ctrlControlsExtra; FLOAT fSensitivity = FLOAT(gm_mgSensitivity.mg_iCurPos - gm_mgSensitivity.mg_iMinPos) / diff --git a/Sources/SeriousSam/GUI/Menus/MControls.h b/Sources/SeriousSam/GUI/Menus/MControls.h index 99b5794..f1b6ff3 100644 --- a/Sources/SeriousSam/GUI/Menus/MControls.h +++ b/Sources/SeriousSam/GUI/Menus/MControls.h @@ -19,11 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGSlider.h" -#include "GUI/Components/MGTitle.h" -#include "GUI/Components/MGTrigger.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGSlider.h" +#include "SeriousSam/GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" class CControlsMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MCredits.h b/Sources/SeriousSam/GUI/Menus/MCredits.h index f76ee91..543ca12 100644 --- a/Sources/SeriousSam/GUI/Menus/MCredits.h +++ b/Sources/SeriousSam/GUI/Menus/MCredits.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" class CCreditsMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.cpp b/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.cpp index 4a3b54e..d024060 100644 --- a/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.cpp +++ b/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MCustomizeAxis.h" @@ -84,7 +84,7 @@ CCustomizeAxisMenu::~CCustomizeAxisMenu(void) void CCustomizeAxisMenu::ObtainActionSettings(void) { ControlsMenuOn(); - CControls &ctrls = _pGame->gm_ctrlControlsExtra; + CControls &ctrls = *_pGame->gm_ctrlControlsExtra; INDEX iSelectedAction = gm_mgActionTrigger.mg_iSelected; INDEX iMountedAxis = ctrls.ctrl_aaAxisActions[iSelectedAction].aa_iAxisAction; @@ -113,7 +113,7 @@ void CCustomizeAxisMenu::ObtainActionSettings(void) void CCustomizeAxisMenu::ApplyActionSettings(void) { - CControls &ctrls = _pGame->gm_ctrlControlsExtra; + CControls &ctrls = *_pGame->gm_ctrlControlsExtra; INDEX iSelectedAction = gm_mgActionTrigger.mg_iSelected; INDEX iMountedAxis = gm_mgMountedTrigger.mg_iSelected; FLOAT fSensitivity = diff --git a/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.h b/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.h index 721bff0..79f29d5 100644 --- a/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.h +++ b/Sources/SeriousSam/GUI/Menus/MCustomizeAxis.h @@ -19,10 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGSlider.h" -#include "GUI/Components/MGTitle.h" -#include "GUI/Components/MGTrigger.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGSlider.h" +#include "SeriousSam/GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" class CCustomizeAxisMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.cpp b/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.cpp index 4a7a000..1ec3435 100644 --- a/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.cpp +++ b/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MCustomizeKeyboard.h" @@ -32,8 +32,8 @@ void CCustomizeKeyboardMenu::FillListItems(void) BOOL bHasLast = FALSE; // set diks to key buttons INDEX iLabel = 0; - INDEX ctLabels = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count(); - FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions, itAct) + INDEX ctLabels = _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions.Count(); + FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itAct) { INDEX iInMenu = iLabel - gm_iListOffset; if ((iLabel >= gm_iListOffset) && @@ -100,7 +100,7 @@ void CCustomizeKeyboardMenu::StartMenu(void) { ControlsMenuOn(); gm_iListOffset = 0; - gm_ctListTotal = _pGame->gm_ctrlControlsExtra.ctrl_lhButtonActions.Count(); + gm_ctListTotal = _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions.Count(); gm_iListWantedItem = 0; CGameMenu::StartMenu(); } diff --git a/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.h b/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.h index 877b40d..ac0257b 100644 --- a/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.h +++ b/Sources/SeriousSam/GUI/Menus/MCustomizeKeyboard.h @@ -19,10 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGArrow.h" -#include "GUI/Components/MGKeyDefinition.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGArrow.h" +#include "SeriousSam/GUI/Components/MGKeyDefinition.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CCustomizeKeyboardMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MDisabled.cpp b/Sources/SeriousSam/GUI/Menus/MDisabled.cpp index e97d0b1..b5a0cb9 100644 --- a/Sources/SeriousSam/GUI/Menus/MDisabled.cpp +++ b/Sources/SeriousSam/GUI/Menus/MDisabled.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MDisabled.h" diff --git a/Sources/SeriousSam/GUI/Menus/MDisabled.h b/Sources/SeriousSam/GUI/Menus/MDisabled.h index ef705c2..67fde31 100644 --- a/Sources/SeriousSam/GUI/Menus/MDisabled.h +++ b/Sources/SeriousSam/GUI/Menus/MDisabled.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CDisabledMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MHighScore.cpp b/Sources/SeriousSam/GUI/Menus/MHighScore.cpp index 4a14a2f..51d7e87 100644 --- a/Sources/SeriousSam/GUI/Menus/MHighScore.cpp +++ b/Sources/SeriousSam/GUI/Menus/MHighScore.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MHighScore.h" diff --git a/Sources/SeriousSam/GUI/Menus/MHighScore.h b/Sources/SeriousSam/GUI/Menus/MHighScore.h index 71408d4..85d9cfc 100644 --- a/Sources/SeriousSam/GUI/Menus/MHighScore.h +++ b/Sources/SeriousSam/GUI/Menus/MHighScore.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGHighScore.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGHighScore.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CHighScoreMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MInGame.cpp b/Sources/SeriousSam/GUI/Menus/MInGame.cpp index 7b7bf9c..3c23f3c 100644 --- a/Sources/SeriousSam/GUI/Menus/MInGame.cpp +++ b/Sources/SeriousSam/GUI/Menus/MInGame.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MInGame.h" @@ -136,7 +136,7 @@ void CInGameMenu::StartMenu(void) if (_gmRunningGameMode == GM_SINGLE_PLAYER) { CPlayerCharacter &pc = _pGame->gm_apcPlayers[_pGame->gm_iSinglePlayer]; - gm_mgLabel1.mg_strText.PrintF(TRANS("Player: %s"), pc.GetNameForPrinting()); + gm_mgLabel1.mg_strText.PrintF(TRANS("Player: %s"), (const char *) pc.GetNameForPrinting()); gm_mgLabel2.mg_strText = ""; } else { diff --git a/Sources/SeriousSam/GUI/Menus/MInGame.h b/Sources/SeriousSam/GUI/Menus/MInGame.h index a047ea6..613a3a8 100644 --- a/Sources/SeriousSam/GUI/Menus/MInGame.h +++ b/Sources/SeriousSam/GUI/Menus/MInGame.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CInGameMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MLevels.cpp b/Sources/SeriousSam/GUI/Menus/MLevels.cpp index 17fdac1..9d953c6 100644 --- a/Sources/SeriousSam/GUI/Menus/MLevels.cpp +++ b/Sources/SeriousSam/GUI/Menus/MLevels.cpp @@ -13,10 +13,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" -#include "LevelInfo.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" +#include "SeriousSam/LevelInfo.h" #include "MLevels.h" diff --git a/Sources/SeriousSam/GUI/Menus/MLevels.h b/Sources/SeriousSam/GUI/Menus/MLevels.h index d6b4957..76942a0 100644 --- a/Sources/SeriousSam/GUI/Menus/MLevels.h +++ b/Sources/SeriousSam/GUI/Menus/MLevels.h @@ -19,10 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGArrow.h" -#include "GUI/Components/MGLevelButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGArrow.h" +#include "SeriousSam/GUI/Components/MGLevelButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CLevelsMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MLoadSave.cpp b/Sources/SeriousSam/GUI/Menus/MLoadSave.cpp index db9ecbe..a82a936 100644 --- a/Sources/SeriousSam/GUI/Menus/MLoadSave.cpp +++ b/Sources/SeriousSam/GUI/Menus/MLoadSave.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MLoadSave.h" @@ -74,7 +74,7 @@ void CLoadSaveMenu::StartMenu(void) // list the directory CDynamicStackArray afnmDir; - MakeDirList(afnmDir, gm_fnmDirectory, "", 0); + MakeDirList(afnmDir, gm_fnmDirectory, CTString(""), 0); gm_iLastFile = -1; // for each file in the directory @@ -222,7 +222,7 @@ BOOL CLoadSaveMenu::ParseFile(const CTFileName &fnm, CTString &strName) INDEX iCtl = -1; strName.ScanF("Controls%d", &iCtl); if (iCtl >= 0 && iCtl <= 7) { - strName.PrintF(TRANS("From player: %s"), _pGame->gm_apcPlayers[iCtl].GetNameForPrinting()); + strName.PrintF(TRANS("From player: %s"), (const char *) _pGame->gm_apcPlayers[iCtl].GetNameForPrinting()); } } } diff --git a/Sources/SeriousSam/GUI/Menus/MLoadSave.h b/Sources/SeriousSam/GUI/Menus/MLoadSave.h index 243c1fe..5f6d0ff 100644 --- a/Sources/SeriousSam/GUI/Menus/MLoadSave.h +++ b/Sources/SeriousSam/GUI/Menus/MLoadSave.h @@ -19,11 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGArrow.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGFileButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGArrow.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGFileButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" #define SAVELOAD_BUTTONS_CT 14 diff --git a/Sources/SeriousSam/GUI/Menus/MMain.cpp b/Sources/SeriousSam/GUI/Menus/MMain.cpp index c7151be..c67a1f0 100644 --- a/Sources/SeriousSam/GUI/Menus/MMain.cpp +++ b/Sources/SeriousSam/GUI/Menus/MMain.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MMain.h" diff --git a/Sources/SeriousSam/GUI/Menus/MMain.h b/Sources/SeriousSam/GUI/Menus/MMain.h index 3816c8a..f2810ab 100644 --- a/Sources/SeriousSam/GUI/Menus/MMain.h +++ b/Sources/SeriousSam/GUI/Menus/MMain.h @@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" class CMainMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MNetwork.cpp b/Sources/SeriousSam/GUI/Menus/MNetwork.cpp index 09d7992..7750182 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetwork.cpp +++ b/Sources/SeriousSam/GUI/Menus/MNetwork.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MNetwork.h" diff --git a/Sources/SeriousSam/GUI/Menus/MNetwork.h b/Sources/SeriousSam/GUI/Menus/MNetwork.h index 25e9836..458c86c 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetwork.h +++ b/Sources/SeriousSam/GUI/Menus/MNetwork.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CNetworkMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MNetworkJoin.cpp b/Sources/SeriousSam/GUI/Menus/MNetworkJoin.cpp index fc53a54..cbb52ae 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetworkJoin.cpp +++ b/Sources/SeriousSam/GUI/Menus/MNetworkJoin.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MNetworkJoin.h" diff --git a/Sources/SeriousSam/GUI/Menus/MNetworkJoin.h b/Sources/SeriousSam/GUI/Menus/MNetworkJoin.h index fa0388a..3e592c7 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetworkJoin.h +++ b/Sources/SeriousSam/GUI/Menus/MNetworkJoin.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CNetworkJoinMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MNetworkOpen.cpp b/Sources/SeriousSam/GUI/Menus/MNetworkOpen.cpp index 3a9b0b9..0f57bf4 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetworkOpen.cpp +++ b/Sources/SeriousSam/GUI/Menus/MNetworkOpen.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MNetworkOpen.h" diff --git a/Sources/SeriousSam/GUI/Menus/MNetworkOpen.h b/Sources/SeriousSam/GUI/Menus/MNetworkOpen.h index e5d57b0..7a94660 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetworkOpen.h +++ b/Sources/SeriousSam/GUI/Menus/MNetworkOpen.h @@ -19,10 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGEdit.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGEdit.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CNetworkOpenMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MNetworkStart.cpp b/Sources/SeriousSam/GUI/Menus/MNetworkStart.cpp index 415dae7..6e85003 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetworkStart.cpp +++ b/Sources/SeriousSam/GUI/Menus/MNetworkStart.cpp @@ -13,10 +13,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" -#include "LevelInfo.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" +#include "SeriousSam/LevelInfo.h" #include "MenuStuff.h" #include "MNetworkStart.h" diff --git a/Sources/SeriousSam/GUI/Menus/MNetworkStart.h b/Sources/SeriousSam/GUI/Menus/MNetworkStart.h index b599a61..3ec7f3f 100644 --- a/Sources/SeriousSam/GUI/Menus/MNetworkStart.h +++ b/Sources/SeriousSam/GUI/Menus/MNetworkStart.h @@ -19,11 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGEdit.h" -#include "GUI/Components/MGTitle.h" -#include "GUI/Components/MGTrigger.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGEdit.h" +#include "SeriousSam/GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" class CNetworkStartMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MOptions.cpp b/Sources/SeriousSam/GUI/Menus/MOptions.cpp index 0462887..429d42c 100644 --- a/Sources/SeriousSam/GUI/Menus/MOptions.cpp +++ b/Sources/SeriousSam/GUI/Menus/MOptions.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MOptions.h" diff --git a/Sources/SeriousSam/GUI/Menus/MOptions.h b/Sources/SeriousSam/GUI/Menus/MOptions.h index e461237..3004cc6 100644 --- a/Sources/SeriousSam/GUI/Menus/MOptions.h +++ b/Sources/SeriousSam/GUI/Menus/MOptions.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class COptionsMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MPlayerProfile.cpp b/Sources/SeriousSam/GUI/Menus/MPlayerProfile.cpp index 42332e6..a9a5b72 100644 --- a/Sources/SeriousSam/GUI/Menus/MPlayerProfile.cpp +++ b/Sources/SeriousSam/GUI/Menus/MPlayerProfile.cpp @@ -13,12 +13,12 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MPlayerProfile.h" -#include "GUI/Menus/MenuManager.h" +#include "SeriousSam/GUI/Menus/MenuManager.h" #define ADD_SELECT_PLAYER_MG( index, mg, mgprev, mgnext, me)\ mg.mg_iIndex = index; \ @@ -70,7 +70,7 @@ void CPlayerProfileMenu::Initialize_t(void) gm_lhGadgets.AddTail(gm_mgNameLabel.mg_lnNode); // setup of player name button is done on start menu - gm_mgNameField.mg_strText = ""; + gm_mgNameField.mg_strText = "<\?\?\?>"; gm_mgNameField.mg_ctMaxStringLen = 25; gm_mgNameField.mg_boxOnScreen = BoxPlayerEdit(1.25); gm_mgNameField.mg_bfsFontSize = BFS_MEDIUM; @@ -88,7 +88,7 @@ void CPlayerProfileMenu::Initialize_t(void) gm_lhGadgets.AddTail(gm_mgTeamLabel.mg_lnNode); // setup of player name button is done on start menu - gm_mgTeam.mg_strText = ""; + gm_mgTeam.mg_strText = "<\?\?\?>"; gm_mgTeam.mg_ctMaxStringLen = 25; gm_mgTeam.mg_boxOnScreen = BoxPlayerEdit(2.25f); gm_mgTeam.mg_bfsFontSize = BFS_MEDIUM; diff --git a/Sources/SeriousSam/GUI/Menus/MPlayerProfile.h b/Sources/SeriousSam/GUI/Menus/MPlayerProfile.h index 92343e6..2bd6027 100644 --- a/Sources/SeriousSam/GUI/Menus/MPlayerProfile.h +++ b/Sources/SeriousSam/GUI/Menus/MPlayerProfile.h @@ -19,12 +19,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGEdit.h" -#include "GUI/Components/MGModel.h" -#include "GUI/Components/MGTitle.h" -#include "GUI/Components/MGTrigger.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGEdit.h" +#include "SeriousSam/GUI/Components/MGModel.h" +#include "SeriousSam/GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" class CPlayerProfileMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MRenderingOptions.h b/Sources/SeriousSam/GUI/Menus/MRenderingOptions.h index 4a1c6bd..8293991 100644 --- a/Sources/SeriousSam/GUI/Menus/MRenderingOptions.h +++ b/Sources/SeriousSam/GUI/Menus/MRenderingOptions.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" class CRenderingOptionsMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MSelectPlayers.cpp b/Sources/SeriousSam/GUI/Menus/MSelectPlayers.cpp index 48da973..8c4ad81 100644 --- a/Sources/SeriousSam/GUI/Menus/MSelectPlayers.cpp +++ b/Sources/SeriousSam/GUI/Menus/MSelectPlayers.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MSelectPlayers.h" diff --git a/Sources/SeriousSam/GUI/Menus/MSelectPlayers.h b/Sources/SeriousSam/GUI/Menus/MSelectPlayers.h index ea6d68e..67d3107 100644 --- a/Sources/SeriousSam/GUI/Menus/MSelectPlayers.h +++ b/Sources/SeriousSam/GUI/Menus/MSelectPlayers.h @@ -19,11 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGChangePlayer.h" -#include "GUI/Components/MGTitle.h" -#include "GUI/Components/MGTrigger.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGChangePlayer.h" +#include "SeriousSam/GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" class CSelectPlayersMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MServers.cpp b/Sources/SeriousSam/GUI/Menus/MServers.cpp index b03032d..efb9143 100644 --- a/Sources/SeriousSam/GUI/Menus/MServers.cpp +++ b/Sources/SeriousSam/GUI/Menus/MServers.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MServers.h" CTString _strServerFilter[7]; diff --git a/Sources/SeriousSam/GUI/Menus/MServers.h b/Sources/SeriousSam/GUI/Menus/MServers.h index f0d16dd..8a547e9 100644 --- a/Sources/SeriousSam/GUI/Menus/MServers.h +++ b/Sources/SeriousSam/GUI/Menus/MServers.h @@ -19,11 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGEdit.h" -#include "GUI/Components/MGServerList.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGEdit.h" +#include "SeriousSam/GUI/Components/MGServerList.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CServersMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MSinglePlayer.cpp b/Sources/SeriousSam/GUI/Menus/MSinglePlayer.cpp index a052e63..b11d350 100644 --- a/Sources/SeriousSam/GUI/Menus/MSinglePlayer.cpp +++ b/Sources/SeriousSam/GUI/Menus/MSinglePlayer.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MSinglePlayer.h" @@ -152,5 +152,5 @@ void CSinglePlayerMenu::StartMenu(void) CGameMenu::StartMenu(); CPlayerCharacter &pc = _pGame->gm_apcPlayers[_pGame->gm_iSinglePlayer]; - gm_mgPlayerLabel.mg_strText.PrintF(TRANS("Player: %s\n"), pc.GetNameForPrinting()); + gm_mgPlayerLabel.mg_strText.PrintF(TRANS("Player: %s\n"), (const char *) pc.GetNameForPrinting()); } diff --git a/Sources/SeriousSam/GUI/Menus/MSinglePlayer.h b/Sources/SeriousSam/GUI/Menus/MSinglePlayer.h index f49a6b9..f7b8508 100644 --- a/Sources/SeriousSam/GUI/Menus/MSinglePlayer.h +++ b/Sources/SeriousSam/GUI/Menus/MSinglePlayer.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CSinglePlayerMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.cpp b/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.cpp index de00420..86bdf6e 100644 --- a/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.cpp +++ b/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MSinglePlayerNew.h" diff --git a/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.h b/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.h index 7100bfb..417c83b 100644 --- a/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.h +++ b/Sources/SeriousSam/GUI/Menus/MSinglePlayerNew.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CSinglePlayerNewMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MSplitScreen.cpp b/Sources/SeriousSam/GUI/Menus/MSplitScreen.cpp index e7e8e5d..4d62740 100644 --- a/Sources/SeriousSam/GUI/Menus/MSplitScreen.cpp +++ b/Sources/SeriousSam/GUI/Menus/MSplitScreen.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MSplitScreen.h" diff --git a/Sources/SeriousSam/GUI/Menus/MSplitScreen.h b/Sources/SeriousSam/GUI/Menus/MSplitScreen.h index 173de31..efb82d3 100644 --- a/Sources/SeriousSam/GUI/Menus/MSplitScreen.h +++ b/Sources/SeriousSam/GUI/Menus/MSplitScreen.h @@ -19,9 +19,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" class CSplitScreenMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MSplitStart.cpp b/Sources/SeriousSam/GUI/Menus/MSplitStart.cpp index 62b955d..a0898ee 100644 --- a/Sources/SeriousSam/GUI/Menus/MSplitStart.cpp +++ b/Sources/SeriousSam/GUI/Menus/MSplitStart.cpp @@ -13,10 +13,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" -#include "LevelInfo.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" +#include "SeriousSam/LevelInfo.h" #include "MenuStuff.h" #include "MSplitStart.h" diff --git a/Sources/SeriousSam/GUI/Menus/MSplitStart.h b/Sources/SeriousSam/GUI/Menus/MSplitStart.h index c0f6618..bdb13a8 100644 --- a/Sources/SeriousSam/GUI/Menus/MSplitStart.h +++ b/Sources/SeriousSam/GUI/Menus/MSplitStart.h @@ -19,10 +19,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" -#include "GUI/Components/MGTrigger.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Components/MGTrigger.h" class CSplitStartMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MVar.cpp b/Sources/SeriousSam/GUI/Menus/MVar.cpp index 5b0a820..d8fb112 100644 --- a/Sources/SeriousSam/GUI/Menus/MVar.cpp +++ b/Sources/SeriousSam/GUI/Menus/MVar.cpp @@ -13,11 +13,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" -#include "VarList.h" -#include "MVar.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" +#include "SeriousSam/VarList.h" +#include "SeriousSam/GUI/Menus/MVar.h" extern BOOL _bVarChanged; diff --git a/Sources/SeriousSam/GUI/Menus/MVar.h b/Sources/SeriousSam/GUI/Menus/MVar.h index 1613d9f..00bb329 100644 --- a/Sources/SeriousSam/GUI/Menus/MVar.h +++ b/Sources/SeriousSam/GUI/Menus/MVar.h @@ -19,11 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" -#include "GUI/Components/MGArrow.h" -#include "GUI/Components/MGButton.h" -#include "GUI/Components/MGTitle.h" -#include "GUI/Components/MGVarButton.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" +#include "SeriousSam/GUI/Components/MGArrow.h" +#include "SeriousSam/GUI/Components/MGButton.h" +#include "SeriousSam/GUI/Components/MGTitle.h" +#include "SeriousSam/GUI/Components/MGVarButton.h" class CVarMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/MVideoOptions.cpp b/Sources/SeriousSam/GUI/Menus/MVideoOptions.cpp index fbe22d8..b5c0a6e 100644 --- a/Sources/SeriousSam/GUI/Menus/MVideoOptions.cpp +++ b/Sources/SeriousSam/GUI/Menus/MVideoOptions.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include -#include "MenuPrinting.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MVideoOptions.h" diff --git a/Sources/SeriousSam/GUI/Menus/MVideoOptions.h b/Sources/SeriousSam/GUI/Menus/MVideoOptions.h index 29db6be..d586d75 100644 --- a/Sources/SeriousSam/GUI/Menus/MVideoOptions.h +++ b/Sources/SeriousSam/GUI/Menus/MVideoOptions.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "GameMenu.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" class CVideoOptionsMenu : public CGameMenu { diff --git a/Sources/SeriousSam/GUI/Menus/Menu.cpp b/Sources/SeriousSam/GUI/Menus/Menu.cpp index 355a8c1..59150e0 100644 --- a/Sources/SeriousSam/GUI/Menus/Menu.cpp +++ b/Sources/SeriousSam/GUI/Menus/Menu.cpp @@ -13,19 +13,23 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include #include + +#ifdef PLATFORM_WIN32 #include -#include "MainWindow.h" +#endif + +#include "SeriousSam/MainWindow.h" #include #include #include -#include "MenuPrinting.h" -#include "LevelInfo.h" -#include "VarList.h" -#include "FileInfo.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" +#include "SeriousSam/LevelInfo.h" +#include "SeriousSam/VarList.h" +#include "SeriousSam/FileInfo.h" #include "MenuManager.h" #include "MenuActions.h" @@ -42,7 +46,7 @@ extern CTextureObject *_ptoLogoODI; extern CTextureObject *_ptoLogoEAX; INDEX _iLocalPlayer = -1; -extern BOOL _bPlayerMenuFromSinglePlayer = FALSE; +BOOL _bPlayerMenuFromSinglePlayer = FALSE; GameMode _gmMenuGameMode = GM_NONE; GameMode _gmRunningGameMode = GM_NONE; @@ -55,7 +59,7 @@ TIME _tmMenuLastTickDone = -1; // all possible menu entities CListHead lhMenuEntities; -extern CTString _strLastPlayerAppearance = ""; +CTString _strLastPlayerAppearance = ""; extern CTString sam_strNetworkSettings; // function to activate when level is chosen @@ -66,12 +70,13 @@ void (*_pAfterLevelChosen)(void); void FixupBackButton(CGameMenu *pgm); // mouse cursor position -extern PIX _pixCursorPosI = 0; -extern PIX _pixCursorPosJ = 0; -extern PIX _pixCursorExternPosI = 0; -extern PIX _pixCursorExternPosJ = 0; -extern BOOL _bMouseUsedLast = FALSE; -extern CMenuGadget *_pmgUnderCursor = NULL; +PIX _pixCursorPosI = 0; +PIX _pixCursorPosJ = 0; +PIX _pixCursorExternPosI = 0; +PIX _pixCursorExternPosJ = 0; +BOOL _bMouseUsedLast = FALSE; +CMenuGadget *_pmgUnderCursor = NULL; + extern BOOL _bDefiningKey; extern BOOL _bEditingString; @@ -111,7 +116,7 @@ CGameMenu *pgmCurrentMenu = NULL; CMGButton mgBack; // -------- console variable adjustment menu -extern BOOL _bVarChanged = FALSE; +BOOL _bVarChanged = FALSE; extern void PlayMenuSound(CSoundData *psd) { @@ -153,7 +158,7 @@ void ClearThumbnail(void) _pShell->Execute( "FreeUnusedStock();"); } -void StartMenus(char *str) +void StartMenus(const char *str) { _tmMenuLastTickDone=_pTimer->GetRealTimeTick(); // disable printing of last lines @@ -638,8 +643,8 @@ void RenderMouseCursor(CDrawPort *pdp) // don't render cursor return; } - LCDSetDrawport(pdp); - LCDDrawPointer(_pixCursorPosI, _pixCursorPosJ); + _pGame->LCDSetDrawport(pdp); + _pGame->LCDDrawPointer(_pixCursorPosI, _pixCursorPosJ); } @@ -695,13 +700,13 @@ BOOL DoMenu( CDrawPort *pdp) UBYTE ubH4 = (INDEX)(tmNow*35.4f) & 255; // clear screen with background texture - LCDPrepare(1.0f); - LCDSetDrawport(&dpMenu); + _pGame->LCDPrepare(1.0f); + _pGame->LCDSetDrawport(&dpMenu); // do not allow game to show through dpMenu.Fill(C_BLACK|255); - LCDRenderClouds1(); - LCDRenderGrid(); - LCDRenderClouds2(); + _pGame->LCDRenderClouds1(); + _pGame->LCDRenderGrid(); + _pGame->LCDRenderClouds2(); FLOAT fScaleW = (FLOAT)pixW / 640.0f; FLOAT fScaleH = (FLOAT)pixH / 480.0f; @@ -773,12 +778,12 @@ BOOL DoMenu( CDrawPort *pdp) { // show thumbnail with shadow and border dpMenu.Fill( pixI0+pixOfs, pixJ0+pixOfs, THUMBW*fThumbScaleW, THUMBH*fScaleH, C_BLACK|128); dpMenu.PutTexture( &_toThumbnail, PIXaabbox2D( PIX2D( pixI0, pixJ0), PIX2D( pixI1, pixJ1)), C_WHITE|255); - dpMenu.DrawBorder( pixI0,pixJ0, THUMBW*fThumbScaleW,THUMBH*fScaleH, LCDGetColor(C_mdGREEN|255, "thumbnail border")); + dpMenu.DrawBorder( pixI0,pixJ0, THUMBW*fThumbScaleW,THUMBH*fScaleH, _pGame->LCDGetColor(C_mdGREEN|255, "thumbnail border")); } else { dpMenu.SetFont( _pfdDisplayFont); dpMenu.SetTextScaling( fScaleW); dpMenu.SetTextAspect( 1.0f); - dpMenu.PutTextCXY( TRANS("no thumbnail"), (pixI0+pixI1)/2, (pixJ0+pixJ1)/2, LCDGetColor(C_GREEN|255, "no thumbnail")); + dpMenu.PutTextCXY( TRANS("no thumbnail"), (pixI0+pixI1)/2, (pixJ0+pixJ1)/2, _pGame->LCDGetColor(C_GREEN|255, "no thumbnail")); } } @@ -808,12 +813,12 @@ BOOL DoMenu( CDrawPort *pdp) PIXaabbox2D box = FloatBoxToPixBox(&dpMenu, BoxPopup()); CDrawPort dpPopup(pdp, box); dpPopup.Lock(); - LCDSetDrawport(&dpPopup); + _pGame->LCDSetDrawport(&dpPopup); dpPopup.Fill(C_BLACK|255); - LCDRenderClouds1(); - LCDRenderGrid(); - //LCDRenderClouds2(); - LCDScreenBox(LCDGetColor(C_GREEN|255, "popup box")); + _pGame->LCDRenderClouds1(); + _pGame->LCDRenderGrid(); + //_pGame->LCDRenderClouds2(); + _pGame->LCDScreenBox(_pGame->LCDGetColor(C_GREEN|255, "popup box")); dpPopup.Unlock(); dpMenu.Lock(); } @@ -873,7 +878,7 @@ BOOL DoMenu( CDrawPort *pdp) // print the tip SetFontMedium(&dpMenu); dpMenu.PutTextC(strTip, - pixW*0.5f, pixH*0.92f, LCDGetColor(C_WHITE|255, "tool tip")); + pixW*0.5f, pixH*0.92f, _pGame->LCDGetColor(C_WHITE|255, "tool tip")); } _pGame->ConsolePrintLastLines(&dpMenu); @@ -969,4 +974,5 @@ void ChangeToMenu( CGameMenu *pgmNewMenu) } FixupBackButton(pgmNewMenu); pgmCurrentMenu = pgmNewMenu; -} \ No newline at end of file +} + diff --git a/Sources/SeriousSam/GUI/Menus/Menu.h b/Sources/SeriousSam/GUI/Menus/Menu.h index aba8393..fe9f3b6 100644 --- a/Sources/SeriousSam/GUI/Menus/Menu.h +++ b/Sources/SeriousSam/GUI/Menus/Menu.h @@ -31,7 +31,7 @@ void MenuOnChar(MSG msg); void MenuOnMouseMove(PIX pixI, PIX pixJ); void MenuOnLMBDown(void); BOOL DoMenu( CDrawPort *pdp); // returns TRUE if still active, FALSE if should quit -void StartMenus( char *str=""); +void StartMenus( const char *str=""); void StopMenus(BOOL bGoToRoot =TRUE); BOOL IsMenusInRoot(void); void ChangeToMenu( class CGameMenu *pgmNew); @@ -59,7 +59,7 @@ extern GameMode _gmRunningGameMode; extern CGameMenu *pgmCurrentMenu; -#include "GameMenu.h" +#include "SeriousSam/GUI/Menus/GameMenu.h" #include "MLoadSave.h" #include "MPlayerProfile.h" diff --git a/Sources/SeriousSam/GUI/Menus/MenuActions.cpp b/Sources/SeriousSam/GUI/Menus/MenuActions.cpp index f1398f8..3e7c885 100644 --- a/Sources/SeriousSam/GUI/Menus/MenuActions.cpp +++ b/Sources/SeriousSam/GUI/Menus/MenuActions.cpp @@ -13,15 +13,15 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include "MenuManager.h" #include "MenuStarters.h" #include "MenuStuff.h" -#include "GUI/Components/MenuGadget.h" -#include "LevelInfo.h" -#include "VarList.h" +#include "SeriousSam/GUI/Components/MenuGadget.h" +#include "SeriousSam/LevelInfo.h" +#include "SeriousSam/VarList.h" ENGINE_API extern INDEX snd_iFormat; extern BOOL _bMouseUsedLast; @@ -171,7 +171,7 @@ extern void ModConnectConfirm(void) return; } - CPrintF(TRANS("Server is running a different MOD (%s).\nYou need to reload to connect.\n"), _fnmModSelected); + CPrintF(TRANS("Server is running a different MOD (%s).\nYou need to reload to connect.\n"), (const char *) _fnmModSelected); gmCurrent._pConfimedYes = &ModConnect; gmCurrent._pConfimedNo = NULL; gmCurrent.gm_mgConfirmLabel.mg_strText = TRANS("CHANGE THE MOD?"); diff --git a/Sources/SeriousSam/GUI/Menus/MenuManager.cpp b/Sources/SeriousSam/GUI/Menus/MenuManager.cpp index 4e2e81e..0c6a9f1 100644 --- a/Sources/SeriousSam/GUI/Menus/MenuManager.cpp +++ b/Sources/SeriousSam/GUI/Menus/MenuManager.cpp @@ -13,9 +13,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include "MenuManager.h" -extern CMenuManager* _pGUIM = NULL; \ No newline at end of file +CMenuManager* _pGUIM = NULL; diff --git a/Sources/SeriousSam/GUI/Menus/MenuPrinting.cpp b/Sources/SeriousSam/GUI/Menus/MenuPrinting.cpp index 50fbdde..689219a 100644 --- a/Sources/SeriousSam/GUI/Menus/MenuPrinting.cpp +++ b/Sources/SeriousSam/GUI/Menus/MenuPrinting.cpp @@ -15,8 +15,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "SeriousSam/StdH.h" -#include "MenuPrinting.h" -#include "ArrowDir.h" +#include "SeriousSam/GUI/Menus/MenuPrinting.h" +#include "SeriousSam/ArrowDir.h" static const FLOAT _fBigStartJ = 0.25f; static const FLOAT _fBigSizeJ = 0.066f; diff --git a/Sources/SeriousSam/GUI/Menus/MenuStarters.cpp b/Sources/SeriousSam/GUI/Menus/MenuStarters.cpp index 35921d9..9901d04 100644 --- a/Sources/SeriousSam/GUI/Menus/MenuStarters.cpp +++ b/Sources/SeriousSam/GUI/Menus/MenuStarters.cpp @@ -15,14 +15,14 @@ with this program; if not, write to the Free Software Foundation, Inc., /* This file contains starter fuctions for all menus. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include "MenuManager.h" #include "MenuStarters.h" #include "MenuStartersAF.h" #include "MenuStuff.h" -#include "LevelInfo.h" +#include "SeriousSam/LevelInfo.h" extern void(*_pAfterLevelChosen)(void); extern BOOL _bPlayerMenuFromSinglePlayer; @@ -329,7 +329,7 @@ void JoinNetworkGame(void) if (_strModURLSelected = "") { _strModURLSelected = "http://www.croteam.com/mods/Old"; } - _strModServerSelected.PrintF("%s:%s", _pGame->gam_strJoinAddress, _pShell->GetValue("net_iPort")); + _strModServerSelected.PrintF("%s:%s", (const char *) _pGame->gam_strJoinAddress, (const char *) _pShell->GetValue("net_iPort")); extern void ModConnectConfirm(void); ModConnectConfirm(); } diff --git a/Sources/SeriousSam/GUI/Menus/MenuStartersAF.cpp b/Sources/SeriousSam/GUI/Menus/MenuStartersAF.cpp index b4b96a0..80977e5 100644 --- a/Sources/SeriousSam/GUI/Menus/MenuStartersAF.cpp +++ b/Sources/SeriousSam/GUI/Menus/MenuStartersAF.cpp @@ -15,7 +15,7 @@ with this program; if not, write to the Free Software Foundation, Inc., /* This file contains additional functions called from starters. */ -#include "StdH.h" +#include "SeriousSam/StdH.h" #include #include "MenuManager.h" @@ -112,7 +112,7 @@ BOOL LSLoadControls(const CTFileName &fnm) { try { ControlsMenuOn(); - _pGame->gm_ctrlControlsExtra.Load_t(fnm); + _pGame->gm_ctrlControlsExtra->Load_t(fnm); ControlsMenuOff(); } catch (char *strError) { diff --git a/Sources/SeriousSam/GUI/Menus/MenuStuff.cpp b/Sources/SeriousSam/GUI/Menus/MenuStuff.cpp index 36fdaf3..d85241a 100644 --- a/Sources/SeriousSam/GUI/Menus/MenuStuff.cpp +++ b/Sources/SeriousSam/GUI/Menus/MenuStuff.cpp @@ -20,24 +20,24 @@ with this program; if not, write to the Free Software Foundation, Inc., #define RADIOTRANS(str) ("ETRS" str) -extern CTString astrNoYes[] = { +CTString astrNoYes[] = { RADIOTRANS("No"), RADIOTRANS("Yes"), }; -extern CTString astrComputerInvoke[] = { +CTString astrComputerInvoke[] = { RADIOTRANS("Use"), RADIOTRANS("Double-click use"), }; -extern CTString astrWeapon[] = { +CTString astrWeapon[] = { RADIOTRANS("Only if new"), RADIOTRANS("Never"), RADIOTRANS("Always"), RADIOTRANS("Only if stronger"), }; -extern PIX apixWidths[][2] = { +PIX apixWidths[][2] = { 320, 240, 400, 300, 512, 384, @@ -60,7 +60,7 @@ extern PIX apixWidths[][2] = { 2048, 1536, }; -extern CTString astrCrosshair[] = { +CTString astrCrosshair[] = { "", "Textures\\Interface\\Crosshairs\\Crosshair1.tex", "Textures\\Interface\\Crosshairs\\Crosshair2.tex", @@ -71,7 +71,7 @@ extern CTString astrCrosshair[] = { "Textures\\Interface\\Crosshairs\\Crosshair7.tex", }; -extern CTString astrMaxPlayersRadioTexts[] = { +CTString astrMaxPlayersRadioTexts[] = { RADIOTRANS("2"), RADIOTRANS("3"), RADIOTRANS("4"), @@ -90,16 +90,16 @@ extern CTString astrMaxPlayersRadioTexts[] = { }; // here, we just reserve space for up to 16 different game types // actual names are added later -extern CTString astrGameTypeRadioTexts[] = { +CTString astrGameTypeRadioTexts[] = { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", }; -extern INDEX ctGameTypeRadioTexts = 1; +INDEX ctGameTypeRadioTexts = 1; -extern CTString astrDifficultyRadioTexts[] = { +CTString astrDifficultyRadioTexts[] = { RADIOTRANS("Tourist"), RADIOTRANS("Easy"), RADIOTRANS("Normal"), @@ -108,41 +108,41 @@ extern CTString astrDifficultyRadioTexts[] = { RADIOTRANS("Mental"), }; -extern CTString astrSplitScreenRadioTexts[] = { +CTString astrSplitScreenRadioTexts[] = { RADIOTRANS("1"), RADIOTRANS("2 - split screen"), RADIOTRANS("3 - split screen"), RADIOTRANS("4 - split screen"), }; -extern CTString astrDisplayPrefsRadioTexts[] = { +CTString astrDisplayPrefsRadioTexts[] = { RADIOTRANS("Speed"), RADIOTRANS("Normal"), RADIOTRANS("Quality"), RADIOTRANS("Custom"), }; -extern CTString astrDisplayAPIRadioTexts[] = { +CTString astrDisplayAPIRadioTexts[] = { RADIOTRANS("OpenGL"), #ifdef SE1_D3D RADIOTRANS("Direct3D"), #endif }; -extern CTString astrBitsPerPixelRadioTexts[] = { +CTString astrBitsPerPixelRadioTexts[] = { RADIOTRANS("Desktop"), RADIOTRANS("16 BPP"), RADIOTRANS("32 BPP"), }; -extern CTString astrFrequencyRadioTexts[] = { +CTString astrFrequencyRadioTexts[] = { RADIOTRANS("No sound"), RADIOTRANS("11kHz"), RADIOTRANS("22kHz"), RADIOTRANS("44kHz"), }; -extern CTString astrSoundAPIRadioTexts[] = { +CTString astrSoundAPIRadioTexts[] = { #ifdef PLATFORM_WIN32 RADIOTRANS("WaveOut"), RADIOTRANS("DirectSound"), @@ -300,15 +300,15 @@ void ControlsMenuOff() { try { if (_pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions.Count()>0) { - _pGame->gm_ctrlControlsExtra.Save_t(_fnmControlsToCustomize); + _pGame->gm_ctrlControlsExtra->Save_t(_fnmControlsToCustomize); } } catch (char *strError) { FatalError(strError); } - FORDELETELIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itAct) { - delete &itAct.Current(); - } + + _pGame->gm_ctrlControlsExtra->DeleteAllButtonActions(); + _pGame->LoadPlayersAndControls(); } diff --git a/Sources/SeriousSam/GUI/Menus/MenuStuff.h b/Sources/SeriousSam/GUI/Menus/MenuStuff.h index 80a127d..dc89ae8 100644 --- a/Sources/SeriousSam/GUI/Menus/MenuStuff.h +++ b/Sources/SeriousSam/GUI/Menus/MenuStuff.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#include "FileInfo.h" +#include "SeriousSam/FileInfo.h" #define TRIGGER_MG(mg, y, up, down, text, astr) \ mg.mg_pmgUp = &up; \ @@ -44,10 +44,23 @@ extern CTString astrGameTypeRadioTexts[20]; extern CTString astrDifficultyRadioTexts[6]; extern CTString astrSplitScreenRadioTexts[4]; extern CTString astrDisplayPrefsRadioTexts[4]; + +// !!! FIXME: this sucks +#ifdef SE1_D3D extern CTString astrDisplayAPIRadioTexts[2]; +#else +extern CTString astrDisplayAPIRadioTexts[1]; +#endif + extern CTString astrBitsPerPixelRadioTexts[3]; extern CTString astrFrequencyRadioTexts[4]; + +// !!! FIXME: this sucks +#if PLATFORM_WIN32 extern CTString astrSoundAPIRadioTexts[3]; +#else +extern CTString astrSoundAPIRadioTexts[1]; +#endif extern PIX apixWidths[20][2]; diff --git a/Sources/SeriousSam/LevelInfo.cpp b/Sources/SeriousSam/LevelInfo.cpp index 5e9ac45..c74cbd6 100644 --- a/Sources/SeriousSam/LevelInfo.cpp +++ b/Sources/SeriousSam/LevelInfo.cpp @@ -14,7 +14,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "SeriousSam/StdH.h" -#include "LevelInfo.h" +#include "SeriousSam/LevelInfo.h" #ifdef PLATFORM_WIN32 #include diff --git a/Sources/SeriousSam/SeriousSam.cpp b/Sources/SeriousSam/SeriousSam.cpp index a86a00b..31ec35b 100644 --- a/Sources/SeriousSam/SeriousSam.cpp +++ b/Sources/SeriousSam/SeriousSam.cpp @@ -38,7 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "SplashScreen.h" #include "MainWindow.h" #include "GLSettings.h" -#include "LevelInfo.h" +#include "SeriousSam/LevelInfo.h" #include "LCDDrawing.h" #include "CmdLine.h" #include "Credits.h" @@ -1291,28 +1291,6 @@ int SubMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int _pInput->DisableInput(); _pGame->StopGame(); - if (_fnmModToLoad!="") { - - char strCmd [64] = {0}; - char strParam [128] = {0}; - STARTUPINFOA cif; - ZeroMemory(&cif,sizeof(STARTUPINFOA)); - PROCESS_INFORMATION pi; - - strcpy_s(strCmd,"SeriousSam.exe"); - strcpy_s(strParam," +game "); - strcat_s(strParam,_fnmModToLoad.FileName()); - if (_strModServerJoin!="") { - strcat_s(strParam," +connect "); - strcat_s(strParam,_strModServerJoin); - strcat_s(strParam," +quickjoin"); - } - - if (CreateProcessA(strCmd,strParam,NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE,NULL,NULL,&cif,&pi) == FALSE) - { - MessageBox(0, L"error launching the Mod!\n", L"Serious Sam", MB_OK|MB_ICONERROR); - } - } // invoke quit screen if needed if( _bQuitScreen && _fnmModToLoad=="") QuitScreenLoop(); @@ -1345,6 +1323,7 @@ void CheckModReload(void) } _execv(strCommand, argv); + MessageBoxA(0, "Error launching the Mod!\n", "Serious Sam", MB_OK|MB_ICONERROR); } #else STUBBED("reload ourself?"); @@ -1380,7 +1359,7 @@ int CommonMainline( HINSTANCE hInstance, HINSTANCE hPrevInstance, iResult = SubMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); } CTSTREAM_END; - //CheckModReload(); + CheckModReload(); CheckTeaser(); diff --git a/Sources/SeriousSam/VarList.cpp b/Sources/SeriousSam/VarList.cpp index 446c6b2..409c2f4 100644 --- a/Sources/SeriousSam/VarList.cpp +++ b/Sources/SeriousSam/VarList.cpp @@ -15,7 +15,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "SeriousSam/StdH.h" -#include "VarList.h" +#include "SeriousSam/VarList.h" CListHead _lhVarSettings;