diff --git a/CMakeLists.txt b/CMakeLists.txt index 41d74d404..f46b99933 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,10 @@ if(ADDRESS_SANITIZER) add_compile_options($,$>,-fsanitize=address,>) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_compile_options(-Wno-error=c++11-narrowing -Wno-error=non-pod-varargs -Wno-error=invalid-token-paste -Wno-error=out-of-line-declaration -Wno-everything) +endif() + # whether we are using MSBuild as a generator set(usingMsBuild $) diff --git a/Strategic/Facilities.cpp b/Strategic/Facilities.cpp index 52975d1a8..50bc61aa0 100644 --- a/Strategic/Facilities.cpp +++ b/Strategic/Facilities.cpp @@ -1821,7 +1821,10 @@ void HandleRisksForSoldierFacilityAssignment( SOLDIERTYPE *pSoldier, UINT8 ubFac } else { - INT16 sItemId = riskDrugItems[std::uniform_int_distribution<>(0, riskDrugItems.size() - 1)(std::mt19937{ std::random_device{}() })]; + std::random_device rd; + std::mt19937 gen{rd()}; + std::uniform_int_distribution<> distrib{0, riskDrugItems.size() - 1}; + INT16 sItemId = riskDrugItems[distrib(gen)]; CreateItem(sItemId, Item[sItemId].usPortionSize, &gTempObject); diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 9f2b21a4d..9f6d42597 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -5558,7 +5558,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 0 ] ); // Add option: "SHOW ALL" uiFlags = IC_MAPFILTER_ALL; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterSet, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterSet, uiFlags ) ); if (guiMapInventoryFilter == IC_MAPFILTER_ALL) { // Set this option off. @@ -5578,7 +5578,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 1 ] ); } uiFlags = IC_MAPFILTER_GUN; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); if (guiMapInventoryFilter & IC_MAPFILTER_AMMO) @@ -5592,7 +5592,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 2 ] ); } uiFlags = IC_MAPFILTER_AMMO; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); if (guiMapInventoryFilter & IC_MAPFILTER_EXPLOSV) @@ -5606,7 +5606,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 3 ] ); } uiFlags = IC_MAPFILTER_EXPLOSV; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); if (guiMapInventoryFilter & IC_MAPFILTER_MELEE) @@ -5620,7 +5620,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 4 ] ); } uiFlags = IC_MAPFILTER_MELEE; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); if (guiMapInventoryFilter & IC_MAPFILTER_ARMOR) @@ -5634,7 +5634,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 5 ] ); } uiFlags = IC_MAPFILTER_ARMOR; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); if (guiMapInventoryFilter & IC_MAPFILTER_LBE) @@ -5648,7 +5648,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 6 ] ); } uiFlags = IC_MAPFILTER_LBE; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); if (guiMapInventoryFilter & IC_MAPFILTER_KIT) @@ -5662,7 +5662,7 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 7 ] ); } uiFlags = IC_MAPFILTER_KIT; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); if (guiMapInventoryFilter & IC_MAPFILTER_MISC) @@ -5676,13 +5676,13 @@ void CreateMapInventoryFilterMenu( ) swprintf( pStr, gzMapInventoryFilterOptions[ 8 ] ); } uiFlags = IC_MAPFILTER_MISC; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterToggle, uiFlags ) ); gMapInventoryFilterPopup->addOption( *pOption ); swprintf( pStr, gzMapInventoryFilterOptions[ 9 ] ); // Add option: "HIDE ALL" uiFlags = 0; - pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterSet, uiFlags ) ); + pOption = new POPUP_OPTION(std::wstring( pStr ), new popupCallbackFunction( &MapInventoryFilterMenuPopup_FilterSet, uiFlags ) ); if (guiMapInventoryFilter == 0) { // Set this option off. diff --git a/Strategic/QuestText.h b/Strategic/QuestText.h index 268658f23..9b135ce2a 100644 --- a/Strategic/QuestText.h +++ b/Strategic/QuestText.h @@ -2,8 +2,6 @@ #define _QUEST_TEXT_H_ -STR16 QuestDescText[]; -STR16 FactDescText[]; #endif diff --git a/TileEngine/Render Dirty.cpp b/TileEngine/Render Dirty.cpp index 1e22feb64..bbac931b8 100644 --- a/TileEngine/Render Dirty.cpp +++ b/TileEngine/Render Dirty.cpp @@ -761,7 +761,7 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s // to the video buffer. // //***************************************************************************** -UINT16 gprintfdirty(INT16 x, INT16 y, STR16 pFontString, ...) +UINT16 gprintfdirty(INT16 x, INT16 y, const wchar_t * pFontString, ...) { va_list argptr; CHAR16 string[512]; diff --git a/TileEngine/Render Dirty.h b/TileEngine/Render Dirty.h index 113f0766f..d2fde5775 100644 --- a/TileEngine/Render Dirty.h +++ b/TileEngine/Render Dirty.h @@ -127,7 +127,7 @@ BOOLEAN EmptyBackgroundRects( void ); // GPRINTF DIRTY STUFF -UINT16 gprintfdirty(INT16 x, INT16 y, STR16 pFontString, ...); +UINT16 gprintfdirty(INT16 x, INT16 y, const wchar_t * pFontString, ...); UINT16 gprintfinvalidate(INT16 x, INT16 y, STR16 pFontString, ...); UINT16 gprintfRestore(INT16 x, INT16 y, STR16 pFontString, ...); diff --git a/TileEngine/tiledef.h b/TileEngine/tiledef.h index 0ca729264..7ba568bbb 100644 --- a/TileEngine/tiledef.h +++ b/TileEngine/tiledef.h @@ -177,7 +177,6 @@ typedef struct // Globals used extern TILE_ELEMENT gTileDatabase[ NUMBEROFTILES ]; extern UINT16 gTileDatabaseSize; -UINT8 gFullBaseTileValues[]; extern UINT16 gNumTilesPerType[ NUMBEROFTILETYPES ]; extern UINT16 gTileTypeStartIndex[ NUMBEROFTILETYPES ]; extern STR gTileSurfaceName[NUMBEROFTILETYPES]; diff --git a/Utils/Font Control.cpp b/Utils/Font Control.cpp index 87c140f54..a572e3012 100644 --- a/Utils/Font Control.cpp +++ b/Utils/Font Control.cpp @@ -342,7 +342,7 @@ UINT16 WFGetFontHeight( INT32 FontNum ) } -INT16 WFStringPixLength( STR16 string,INT32 UseFont ) +INT16 WFStringPixLength( const wchar_t * string,INT32 UseFont ) { return( StringPixLength( string, UseFont ) ); } diff --git a/Utils/Font Control.h b/Utils/Font Control.h index db5856cdd..4a9986c3d 100644 --- a/Utils/Font Control.h +++ b/Utils/Font Control.h @@ -16,7 +16,7 @@ extern INT32 giCurWinFont; // ATE: A few winfont wrappers.. UINT16 WFGetFontHeight( INT32 FontNum ); -INT16 WFStringPixLength( STR16 string,INT32 UseFont ); +INT16 WFStringPixLength( const wchar_t * string,INT32 UseFont ); diff --git a/Utils/STIConvert.cpp b/Utils/STIConvert.cpp index 09018200f..d51afd0cb 100644 --- a/Utils/STIConvert.cpp +++ b/Utils/STIConvert.cpp @@ -189,7 +189,7 @@ void WriteSTIFile( INT8 *pData, SGPPaletteEntry *pPalette, INT16 sWidth, INT16 s { if(Header.uiAppDataSize > 0) for(uiLoop=0; uiLoopwrite(str.c_str(), str.length() * sizeof(std::string::value_type)); return true; } diff --git a/Utils/popup_class.cpp b/Utils/popup_class.cpp index fec319e93..25a61056c 100644 --- a/Utils/popup_class.cpp +++ b/Utils/popup_class.cpp @@ -141,9 +141,9 @@ POPUP_OPTION::~POPUP_OPTION(void) } -POPUP_OPTION::POPUP_OPTION(std::wstring *newName, popupCallback * newFunction) +POPUP_OPTION::POPUP_OPTION(std::wstring newName, popupCallback * newFunction) { - this->name = *newName; + this->name = newName; this->action = newFunction; this->avail = 0; @@ -162,9 +162,9 @@ POPUP_OPTION::POPUP_OPTION(std::wstring *newName, popupCallback * newFunction) this->color_shade = FONT_GRAY7 ; } -BOOLEAN POPUP_OPTION::setName( std::wstring * newName ) +BOOLEAN POPUP_OPTION::setName( std::wstring newName ) { - this->name = *newName; + name = newName; return TRUE; } @@ -237,19 +237,19 @@ BOOLEAN POPUP_OPTION::forceRun() ////////////////////////////////////////////////////////////////// // constructor -POPUP_SUB_POPUP_OPTION::POPUP_SUB_POPUP_OPTION(void) : POPUP_OPTION(new wstring(L"Unnamed subPopup"),NULL) //TODO: possible memmory leak! +POPUP_SUB_POPUP_OPTION::POPUP_SUB_POPUP_OPTION(void) : POPUP_OPTION(wstring(L"Unnamed subPopup"),NULL) //TODO: possible memmory leak! { this->parent = NULL; this->initSubPopup(); } -POPUP_SUB_POPUP_OPTION::POPUP_SUB_POPUP_OPTION(wstring* name) : POPUP_OPTION(name, NULL) +POPUP_SUB_POPUP_OPTION::POPUP_SUB_POPUP_OPTION(wstring name) : POPUP_OPTION(name, NULL) { this->parent = NULL; this->initSubPopup(); } -POPUP_SUB_POPUP_OPTION::POPUP_SUB_POPUP_OPTION(wstring* newName, const POPUP * parent) : POPUP_OPTION(newName, NULL) +POPUP_SUB_POPUP_OPTION::POPUP_SUB_POPUP_OPTION(wstring newName, const POPUP * parent) : POPUP_OPTION(newName, NULL) { this->parent = parent; this->initSubPopup(); @@ -563,7 +563,7 @@ void POPUP::setInitialValues(void) // setup functions -POPUP_OPTION * POPUP::addOption(wstring * name, popupCallback* action) +POPUP_OPTION * POPUP::addOption(wstring name, popupCallback* action) { if (this->optionCount < POPUP_MAX_OPTIONS) { @@ -606,7 +606,7 @@ POPUP_OPTION * POPUP::getOption(UINT16 n) return NULL; } -POPUP * POPUP::addSubMenuOption(wstring * name) +POPUP * POPUP::addSubMenuOption(wstring name) { if (this->subPopupOptionCount < POPUP_MAX_SUB_POPUPS) { diff --git a/Utils/popup_class.h b/Utils/popup_class.h index 84a83f6aa..d6f1f1aff 100644 --- a/Utils/popup_class.h +++ b/Utils/popup_class.h @@ -67,10 +67,10 @@ { public: POPUP_OPTION::POPUP_OPTION(void); // default constructor - POPUP_OPTION(std::wstring* name, popupCallback* newFunction); // constructor + POPUP_OPTION(std::wstring name, popupCallback* newFunction); // constructor ~POPUP_OPTION(); // destructor // setup - BOOLEAN setName(std::wstring * name); + BOOLEAN setName(std::wstring name); BOOLEAN setAction(popupCallback*fun); BOOLEAN setAvail(popupCallback *fun); BOOLEAN setHover(popupCallback *fun); @@ -105,8 +105,8 @@ public: // constructor/destructor POPUP_SUB_POPUP_OPTION(void); - POPUP_SUB_POPUP_OPTION(std::wstring* name); - POPUP_SUB_POPUP_OPTION(std::wstring* newName, const POPUP * parent); + POPUP_SUB_POPUP_OPTION(std::wstring name); + POPUP_SUB_POPUP_OPTION(std::wstring newName, const POPUP * parent); ~POPUP_SUB_POPUP_OPTION(); void showPopup(); @@ -139,7 +139,7 @@ POPUP(CHAR* name); // constructor ~POPUP(void); // destructor // setup - POPUP_OPTION * addOption(std::wstring * name, popupCallback * action); + POPUP_OPTION * addOption(std::wstring name, popupCallback * action); /*INT16 findFreeOptionIndex();*/ BOOLEAN addOption(POPUP_OPTION &option); POPUP_OPTION * getOption(UINT16 n); @@ -147,7 +147,7 @@ BOOLEAN delOption(CHAR* name); // Another index to through and clean, aargh BOOLEAN delOption(UINT8 optIndex); - POPUP* addSubMenuOption(std::wstring * name); + POPUP* addSubMenuOption(std::wstring name); BOOL addSubMenuOption(POPUP_SUB_POPUP_OPTION* sub); /*INT16 findFreeSubMenuOptionIndex();*/ POPUP_SUB_POPUP_OPTION * getSubPopupOption(UINT8 n); diff --git a/Utils/popup_definition.cpp b/Utils/popup_definition.cpp index 261db649e..6e913991f 100644 --- a/Utils/popup_definition.cpp +++ b/Utils/popup_definition.cpp @@ -32,7 +32,7 @@ return TRUE; } - BOOL popupDef::addOption(std::wstring* name, UINT16 callbackId, UINT16 availId){ + BOOL popupDef::addOption(std::wstring name, UINT16 callbackId, UINT16 availId){ // TODO: check for vaid callbacl/avail ID this->content.push_back( new popupDefOption(name,callbackId,availId) ); @@ -40,7 +40,7 @@ return TRUE; } - popupDef * popupDef::addSubPopup(std::wstring* name){ + popupDef * popupDef::addSubPopup(std::wstring name){ popupDefSubPopupOption * sub = new popupDefSubPopupOption(name); @@ -108,7 +108,7 @@ POPUP_OPTION * opt = new POPUP_OPTION(); - opt->setName( this->name ); + opt->setName( name ); if ( !setPopupDefCallback(opt, this->callbackId) || !setPopupDefAvail(opt, this->availId) ) { @@ -169,7 +169,7 @@ switch(generatorId){ case popupGenerators::dummy: - popup->addOption(new std::wstring( L"Dummy generator" ),NULL); + popup->addOption(std::wstring( L"Dummy generator" ),NULL); break; case popupGenerators::addArmor: diff --git a/Utils/popup_definition.h b/Utils/popup_definition.h index 79a3e5bd5..672f66f12 100644 --- a/Utils/popup_definition.h +++ b/Utils/popup_definition.h @@ -39,9 +39,9 @@ class popupDef{ BOOL applyToBox(POPUP* popup); - BOOL addOption(std::wstring* name, UINT16 callbackId, UINT16 availId); + BOOL addOption(std::wstring name, UINT16 callbackId, UINT16 availId); - popupDef * addSubPopup(std::wstring* name); + popupDef * addSubPopup(std::wstring name); BOOL addSubPopup(popupDefSubPopupOption* sub); BOOL addGenerator(UINT16 id); @@ -60,15 +60,13 @@ class popupDefContent{ class popupDefOption : public popupDefContent{ public: - popupDefOption() : name( new std::wstring(L"Unnamed Option") ), callbackId(0), availId(0){}; - popupDefOption( std::wstring* name, UINT16 callbackId, UINT16 availId ) : name( name ), callbackId(callbackId), availId(availId){}; - - ~popupDefOption(){ delete this->name; }; + popupDefOption() : name( std::wstring(L"Unnamed Option") ), callbackId(0), availId(0){}; + popupDefOption( std::wstring name, UINT16 callbackId, UINT16 availId ) : name( name ), callbackId(callbackId), availId(availId){}; BOOL addToBox(POPUP * popup); protected: - std::wstring* name; + std::wstring name; UINT16 callbackId; UINT16 availId; @@ -76,20 +74,19 @@ class popupDefOption : public popupDefContent{ class popupDefSubPopupOption : public popupDefContent{ public: - popupDefSubPopupOption() : name( new std::wstring(L"Unnamed Submenu") ){ this->content = new popupDef(); }; - popupDefSubPopupOption( std::wstring* name ) : name( name ){ this->content = new popupDef(); }; + popupDefSubPopupOption() : name( std::wstring(L"Unnamed Submenu") ){ this->content = new popupDef(); }; + popupDefSubPopupOption( std::wstring name ) : name( name ){ this->content = new popupDef(); }; - ~popupDefSubPopupOption(){ delete this->name; delete this->content; }; + ~popupDefSubPopupOption(){ delete this->content; }; BOOL addToBox(POPUP * popup); - void rename( std::wstring* name ){ - delete this->name; // lets just hope nothing else was using this string. TODO: use smart pointer - this->name = name; + void rename( std::wstring name ){ + name = name; }; popupDef * getSubDef(){ return this->content; }; protected: - std::wstring* name; + std::wstring name; popupDef * content; }; diff --git a/ext/bfVFS/include/vfs/Core/vfs_debug.h b/ext/bfVFS/include/vfs/Core/vfs_debug.h index 70c22a71c..e8f9a15c4 100644 --- a/ext/bfVFS/include/vfs/Core/vfs_debug.h +++ b/ext/bfVFS/include/vfs/Core/vfs_debug.h @@ -29,7 +29,7 @@ #include #ifdef _MSC_VER -class VFS_API std::exception; +//class VFS_API std::exception; #endif namespace vfs diff --git a/ext/bfVFS/include/vfs/Tools/vfs_log.h b/ext/bfVFS/include/vfs/Tools/vfs_log.h index ff847aee4..3dc0426ae 100644 --- a/ext/bfVFS/include/vfs/Tools/vfs_log.h +++ b/ext/bfVFS/include/vfs/Tools/vfs_log.h @@ -78,7 +78,7 @@ namespace vfs Log& operator<<(vfs::Int8 const& t); #ifdef _MSC_VER - Log& operator<<(DWORD const& t); + //Log& operator<<(DWORD const& t); #endif Log& operator<<(float const& t); Log& operator<<(double const& t); diff --git a/ext/bfVFS/include/vfs/Tools/vfs_property_container.h b/ext/bfVFS/include/vfs/Tools/vfs_property_container.h index 32fc0e934..2fe014f9b 100644 --- a/ext/bfVFS/include/vfs/Tools/vfs_property_container.h +++ b/ext/bfVFS/include/vfs/Tools/vfs_property_container.h @@ -65,8 +65,8 @@ namespace vfs bool writeToIniFile (Path const& filename, bool create_new = false); // these methods are not implemented - bool initFromXMLFile (Path const& filename, TagMap& tagmap); - bool writeToXMLFile (Path const& filename, TagMap& tagmap); + bool initFromXMLFile (Path const& filename, TagMap tagmap); + bool writeToXMLFile (Path const& filename, TagMap tagmap); void printProperties (std::ostream &out); diff --git a/sgp/Font.cpp b/sgp/Font.cpp index 5caa433b7..f66d8c55c 100644 --- a/sgp/Font.cpp +++ b/sgp/Font.cpp @@ -584,7 +584,7 @@ INT16 StringNPixLength(STR16 string, UINT32 uiMaxCount, INT32 UseFont) // Returns the length of a string in pixels, depending on the font given. // //***************************************************************************** -INT16 StringPixLength(const STR16 string, INT32 UseFont) +INT16 StringPixLength(const wchar_t * string, INT32 UseFont) { UINT32 Cur; UINT16 *curletter,transletter; @@ -1001,7 +1001,7 @@ BOOLEAN SetFontDestBuffer(UINT32 DestBuffer, INT32 x1, INT32 y1, INT32 x2, INT32 // the parameters are identical to printf. The resulting string may be no longer // than 512 word-characters. Uses monochrome font color settings //***************************************************************************** -UINT32 mprintf(INT32 x, INT32 y, const STR16 pFontString, ...) +UINT32 mprintf(INT32 x, INT32 y, const wchar_t * pFontString, ...) { INT32 destx, desty; CHAR16 *curletter, transletter; @@ -1060,7 +1060,7 @@ UINT8 *pDestBuf; return(0); } -void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const STR16 pFontString, ... ) +void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const wchar_t * pFontString, ... ) { CHAR16 string[512]; va_list argptr; @@ -1072,7 +1072,7 @@ void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s FindFontRightCoordinates( sLeft, sTop, sWidth, sHeight, string, iFontIndex, psNewX, psNewY ); } -void VarFindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const STR16 pFontString, ... ) +void VarFindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const wchar_t * pFontString, ... ) { CHAR16 string[512]; va_list argptr; diff --git a/sgp/Font.h b/sgp/Font.h index 16802d614..a4c972cf8 100644 --- a/sgp/Font.h +++ b/sgp/Font.h @@ -104,7 +104,7 @@ extern BOOLEAN IsFontLoaded(INT32 iFont); extern HVOBJECT GetFontObject(INT32 iFont); extern UINT32 gprintf(INT32 x, INT32 y, const STR16 pFontString, ...); extern UINT32 gprintfDirty(INT32 x, INT32 y, const STR16 pFontString, ...); -extern UINT32 mprintf(INT32 x, INT32 y, const STR16 pFontString, ...); +extern UINT32 mprintf(INT32 x, INT32 y, const wchar_t * pFontString, ...); extern UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, const STR16 pFontString, ...); extern UINT32 mprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, const STR16 pFontString, ...); @@ -132,15 +132,15 @@ extern UINT32 GetWidth(HVOBJECT hSrcVObject, INT16 ssIndex); extern INT16 StringPixLengthArgFastHelp( INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, STR16 pFontString ); extern INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, STR16 pFontString, ...); -extern INT16 StringPixLength(const STR16 string,INT32 UseFont); +extern INT16 StringPixLength(const wchar_t * string,INT32 UseFont); extern INT16 SubstringPixLength(STR16 string, UINT32 iStart, UINT32 iEnd, INT32 UseFont); extern INT16 StringNPixLength(STR16 string, UINT32 uiMaxCount, INT32 UseFont); extern void SaveFontSettings(void); extern void RestoreFontSettings(void); -void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const STR16 pFontString, ... ); +void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const wchar_t * pFontString, ... ); -void VarFindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const STR16 pFontString, ... ); +void VarFindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, const wchar_t * pFontString, ... ); void FindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, const STR16 pStr, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY );