From 3f37673034e43a9a3fa64ce58e469d0a08a65c14 Mon Sep 17 00:00:00 2001 From: lalien Date: Sat, 10 Mar 2007 18:46:57 +0000 Subject: [PATCH] - added VS2005 compability fix from Space Viking git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@766 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Editor/Editor Taskbar Utils.cpp | 4 +- Editor/Editor Taskbar Utils.h | 4 +- Editor/EditorBuildings.cpp | 4 +- Editor/EditorMapInfo.cpp | 8 +-- Editor/EditorMercs.cpp | 20 +++---- Editor/EditorMercs.h | 2 +- Editor/Item Statistics.cpp | 20 +++---- Editor/LoadScreen.cpp | 2 +- Editor/LoadScreen.h | 6 +-- Editor/Sector Summary.cpp | 20 +++---- Editor/Sector Summary.h | 2 +- Editor/editscreen.cpp | 2 +- Editor/messagebox.h | 2 +- Editor/popupmenu.h | 2 +- Editor/selectwin.h | 2 +- GameInitOptionsScreen.cpp | 14 ++--- GameVersion.cpp | 4 +- GameVersion.h | 4 +- JA2.vcproj | 2 +- Laptop/AimMembers.cpp | 4 +- Laptop/AimMembers.h | 2 +- Laptop/BobbyRGuns.cpp | 2 +- Laptop/finances.cpp | 2 +- Laptop/insurance Contract.cpp | 2 +- Laptop/laptop.cpp | 6 ++- Laptop/laptop.h | 2 +- Laptop/mercs.cpp | 2 +- Laptop/mercs.h | 2 +- MessageBoxScreen.cpp | 14 +++-- MessageBoxScreen.h | 14 ++--- Options Screen.cpp | 10 ++-- Options Screen.h | 2 +- SaveLoadScreen.cpp | 4 +- Standard Gaming Platform/Button System.cpp | 22 ++++---- Standard Gaming Platform/Button System.h | 14 ++--- Standard Gaming Platform/DEBUG.cpp | 17 +++++- Standard Gaming Platform/Font.cpp | 45 ++++++++++------ Standard Gaming Platform/Font.h | 14 ++--- Standard Gaming Platform/WinFont.cpp | 10 ++-- Standard Gaming Platform/WinFont.h | 8 +-- Standard Gaming Platform/mousesystem.cpp | 4 +- Standard Gaming Platform/mousesystem.h | 2 +- Strategic/AI Viewer.cpp | 8 +-- Strategic/Assignments.cpp | 2 +- Strategic/Auto Resolve.cpp | 6 +-- Strategic/Creature Spreading.cpp | 2 +- Strategic/Game Clock.cpp | 2 +- Strategic/Game Clock.h | 2 +- Strategic/Map Screen Interface Bottom.cpp | 2 +- .../Map Screen Interface Map Inventory.cpp | 12 ++--- Strategic/Map Screen Interface.cpp | 8 +-- Strategic/Map Screen Interface.h | 2 +- Strategic/Meanwhile.cpp | 2 +- Strategic/Merc Contract.cpp | 4 +- Strategic/PreBattle Interface.cpp | 12 ++--- Strategic/Queen Command.cpp | 8 +-- Strategic/Quest Debug System.cpp | 24 ++++----- Strategic/Strategic AI.cpp | 12 ++--- Strategic/Strategic Movement.cpp | 24 ++++----- Strategic/Strategic Town Loyalty.cpp | 4 +- Strategic/Town Militia.cpp | 14 ++--- Strategic/Town Militia.h | 2 +- Strategic/mapscreen.cpp | 32 +++++------ Strategic/strategicmap.cpp | 8 +-- Strategic/strategicmap.h | 2 +- Tactical/Dialogue Control.cpp | 24 ++++----- Tactical/Faces.cpp | 4 +- Tactical/Handle Items.cpp | 8 +-- Tactical/Handle UI.cpp | 2 +- Tactical/Interface Dialogue.cpp | 2 +- Tactical/Interface Items.cpp | 54 +++++++++---------- Tactical/Interface Items.h | 2 +- Tactical/Interface Panels.cpp | 2 +- Tactical/Interface.cpp | 50 ++++++++--------- Tactical/Interface.h | 12 ++--- Tactical/Items.cpp | 6 +-- Tactical/Militia Control.cpp | 2 +- Tactical/Overhead.h | 2 +- Tactical/ShopKeeper Interface.cpp | 2 +- Tactical/Soldier Control.h | 2 +- Tactical/Soldier Create.h | 2 +- Tactical/Soldier Init List.cpp | 4 +- Tactical/Strategic Exit GUI.cpp | 8 +-- Tactical/Turn Based Input.cpp | 2 +- Tactical/XML_AmmoStrings.cpp | 2 +- Tactical/faces.h | 2 +- Tactical/opplist.cpp | 12 ++--- Tactical/soldier profile type.h | 4 +- TileEngine/Render Dirty.cpp | 6 +-- TileEngine/Render Dirty.h | 8 +-- TileEngine/Tactical Placement GUI.cpp | 2 +- TileEngine/worlddef.cpp | 2 +- Utils/Animated ProgressBar.cpp | 6 +-- Utils/Animated ProgressBar.h | 4 +- Utils/Font Control.cpp | 2 +- Utils/Font Control.h | 2 +- Utils/MercTextBox.cpp | 2 +- Utils/Text Input.cpp | 24 ++++----- Utils/Text Input.h | 6 +-- Utils/Text Utils.cpp | 6 +-- Utils/Text.h | 38 ++++++------- Utils/Utilities.cpp | 6 +-- Utils/Utilities.h | 2 +- Utils/WordWrap.cpp | 2 +- Utils/XML_Items.cpp | 16 +++--- Utils/XML_Strings.cpp | 2 +- Utils/_EnglishText.cpp | 36 ++++++------- aniviewscreen.cpp | 2 +- gameloop.cpp | 8 +-- jascreens.cpp | 2 +- 110 files changed, 477 insertions(+), 439 deletions(-) diff --git a/Editor/Editor Taskbar Utils.cpp b/Editor/Editor Taskbar Utils.cpp index 79dc9a98..bef31186 100644 --- a/Editor/Editor Taskbar Utils.cpp +++ b/Editor/Editor Taskbar Utils.cpp @@ -475,7 +475,7 @@ void ClearTaskbarRegion( INT16 sLeft, INT16 sTop, INT16 sRight, INT16 sBottom ) //This is a new function which duplicates the older "yellow info boxes" that //are common throughout the editor. This draws the yellow box with the indentation //look. -void DrawEditorInfoBox( UINT16 *str, UINT32 uiFont, UINT16 x, UINT16 y, UINT16 w, UINT16 h ) +void DrawEditorInfoBox( wchar_t *str, UINT32 uiFont, UINT16 x, UINT16 y, UINT16 w, UINT16 h ) { UINT16 usFillColorDark, usFillColorLight, usFillColorBack; UINT16 x2, y2; @@ -727,7 +727,7 @@ void RenderDoorLockInfo() { INT16 i, xp, yp; INT16 sScreenX, sScreenY; - UINT16 str[ 50 ]; + wchar_t str[ 50 ]; for( i = 0; i < gubNumDoors; i++ ) { GetGridNoScreenPos( DoorTable[ i ].sGridNo, 0, &sScreenX, &sScreenY ); diff --git a/Editor/Editor Taskbar Utils.h b/Editor/Editor Taskbar Utils.h index 8a96a413..06fe4da0 100644 --- a/Editor/Editor Taskbar Utils.h +++ b/Editor/Editor Taskbar Utils.h @@ -53,9 +53,9 @@ void DisableEditorRegion( INT8 bRegionID ); //Rendering Utils -void mprintfEditor(INT16 x, INT16 y, UINT16 *pFontString, ...); +void mprintfEditor(INT16 x, INT16 y, wchar_t *pFontString, ...); void ClearTaskbarRegion( INT16 sLeft, INT16 sTop, INT16 sRight, INT16 sBottom ); -void DrawEditorInfoBox( UINT16 *str, UINT32 uiFont, UINT16 x, UINT16 y, UINT16 w, UINT16 h ); +void DrawEditorInfoBox( wchar_t *str, UINT32 uiFont, UINT16 x, UINT16 y, UINT16 w, UINT16 h ); extern INT32 giEditMercDirectionIcons[2]; extern UINT32 guiMercInventoryPanel; diff --git a/Editor/EditorBuildings.cpp b/Editor/EditorBuildings.cpp index 6441a109..63385d41 100644 --- a/Editor/EditorBuildings.cpp +++ b/Editor/EditorBuildings.cpp @@ -729,7 +729,7 @@ void RemoveLockedDoorCursors() void SetupTextInputForBuildings() { - UINT16 str[4]; + wchar_t str[4]; InitTextInputModeWithScheme( DEFAULT_SCHEME ); AddUserInputField( NULL ); //just so we can use short cut keys while not typing. swprintf( str, L"%d", gubMaxRoomNumber ); @@ -738,7 +738,7 @@ void SetupTextInputForBuildings() void ExtractAndUpdateBuildingInfo() { - UINT16 str[4]; + wchar_t str[4]; INT32 temp; //extract light1 colors temp = min( GetNumericStrictValueFromField( 1 ), 255 ); diff --git a/Editor/EditorMapInfo.cpp b/Editor/EditorMapInfo.cpp index 264c9c0d..b7dd56ec 100644 --- a/Editor/EditorMapInfo.cpp +++ b/Editor/EditorMapInfo.cpp @@ -68,7 +68,7 @@ BOOLEAN gfEditorForceShadeTableRebuild = FALSE; void SetupTextInputForMapInfo() { - UINT16 str[10]; + wchar_t str[10]; InitTextInputModeWithScheme( DEFAULT_SCHEME ); @@ -149,7 +149,7 @@ void UpdateMapInfo() void UpdateMapInfoFields() { - UINT16 str[10]; + wchar_t str[10]; //Update the text fields to reflect the validated values. //light rgb fields swprintf( str, L"%d", gEditorLightColor.peRed ); @@ -175,7 +175,7 @@ void UpdateMapInfoFields() void ExtractAndUpdateMapInfo() { - UINT16 str[10]; + wchar_t str[10]; INT32 temp; BOOLEAN fUpdateLight1 = FALSE; //extract light1 colors @@ -246,7 +246,7 @@ void ExtractAndUpdateMapInfo() BOOLEAN ApplyNewExitGridValuesToTextFields() { - UINT16 str[10]; + wchar_t str[10]; //exit grid input fields if( iCurrentTaskbar != TASK_MAPINFO ) return FALSE; diff --git a/Editor/EditorMercs.cpp b/Editor/EditorMercs.cpp index d67eb612..2d2dd257 100644 --- a/Editor/EditorMercs.cpp +++ b/Editor/EditorMercs.cpp @@ -185,7 +185,7 @@ void SetupTextInputForMercSchedule(); void ExtractAndUpdateMercAttributes(); void ExtractAndUpdateMercProfile(); void ExtractAndUpdateMercSchedule(); -void CalcStringForValue( UINT16 *str, INT32 iValue, UINT32 uiMax ); +void CalcStringForValue( wchar_t *str, INT32 iValue, UINT32 uiMax ); void ChangeBodyType( INT8 bOffset ); //+1 or -1 only //internal merc variables @@ -1719,7 +1719,7 @@ void DeleteSelectedMerc() void SetupTextInputForMercProfile() { - UINT16 str[4]; + wchar_t str[4]; INT16 sNum; InitTextInputModeWithScheme( DEFAULT_SCHEME ); @@ -1735,7 +1735,7 @@ void SetupTextInputForMercProfile() void SetupTextInputForMercAttributes() { - UINT16 str[4]; + wchar_t str[4]; InitTextInputModeWithScheme( DEFAULT_SCHEME ); @@ -1773,7 +1773,7 @@ void SetupTextInputForMercAttributes() //In the merc editing, all detailed placement values for generated attributes are set to -1. //When making a generated attribute static, we then set the value to its applicable value. //This function is similar to the itoa function except that -1 is converted to a null string. -void CalcStringForValue( UINT16 *str, INT32 iValue, UINT32 uiMax ) +void CalcStringForValue( wchar_t *str, INT32 iValue, UINT32 uiMax ) { if( iValue < 0 ) //a blank string is determined by a negative value. str[0] = '\0'; @@ -2388,7 +2388,7 @@ void SetMercEditingMode( UINT8 ubNewMode ) void DisplayBodyTypeInfo() { - UINT16 str[20]; + wchar_t str[20]; switch( gpSelected->pBasicPlacement->bBodyType ) { case RANDOM: swprintf( str, L"Random" ); break; @@ -2583,7 +2583,7 @@ void UpdateMercsInfo() mprintf( iScreenWidthOffset + 172, 2 * iScreenHeightOffset + 439, L"4)" ); if( gubScheduleInstructions ) { - UINT16 str[255]; + wchar_t str[255]; UINT16 keyword[10] = L""; ColorFillVideoSurfaceArea( FRAME_BUFFER, iScreenWidthOffset + 431, 2 * iScreenHeightOffset + 388, iScreenWidthOffset + 590, 2 * iScreenHeightOffset + 450, Get16BPPColor( FROMRGB( 32, 45, 72 ) ) ); switch( gCurrSchedule.ubAction[ gubCurrentScheduleActionIndex ] ) @@ -3112,7 +3112,7 @@ void RenderMercStrings() INT16 sX, sY; UINT16 *pStr; SOLDIERINITNODE *curr; - UINT16 str[50]; + wchar_t str[50]; curr = gSoldierInitHead; while( curr ) @@ -3306,7 +3306,7 @@ void CancelCurrentScheduleAction() void RegisterCurrentScheduleAction( INT32 iMapIndex ) { - UINT16 str[6]; + wchar_t str[6]; MarkWorldDirty(); swprintf( str, L"%d", iMapIndex ); if( gfUseScheduleData2 ) @@ -3498,7 +3498,7 @@ void RenderCurrentSchedule() INT16 sXMapPos, sYMapPos; INT16 sScreenX, sScreenY; INT16 sX, sY; - UINT16 str[ 3 ]; + wchar_t str[ 3 ]; for( i = 0; i < 8; i++ ) { if( i % 2 ) @@ -3542,7 +3542,7 @@ void UpdateScheduleInfo() { INT32 i; SCHEDULENODE *pSchedule; - UINT16 str[6]; + wchar_t str[6]; if( gpSelected->pSoldier->ubScheduleID ) { pSchedule = GetSchedule( gpSelected->pSoldier->ubScheduleID ); diff --git a/Editor/EditorMercs.h b/Editor/EditorMercs.h index 65aea52a..323b1dc0 100644 --- a/Editor/EditorMercs.h +++ b/Editor/EditorMercs.h @@ -49,7 +49,7 @@ extern UINT8 gubCurrMercMode, gubPrevMercMode; #define NUM_DIFF_LVLS 5 -extern UINT16 *zDiffNames[NUM_DIFF_LVLS]; +extern wchar_t *zDiffNames[NUM_DIFF_LVLS]; extern INT16 sCurBaseDiff; extern INT16 gsSelectedMercID; extern INT16 gsSelectedMercGridNo; diff --git a/Editor/Item Statistics.cpp b/Editor/Item Statistics.cpp index 0aaac0fe..4caeee76 100644 --- a/Editor/Item Statistics.cpp +++ b/Editor/Item Statistics.cpp @@ -642,7 +642,7 @@ void RemoveGameTypeFlags() void SetupGunGUI() { - UINT16 str[20]; + wchar_t str[20]; INT16 yp; memset( gfAttachment, 0, NUM_ATTACHMENT_BUTTONS ); swprintf( str, L"%d", gpItem->bGunStatus ); @@ -788,7 +788,7 @@ void ExtractAndUpdateGunGUI() void SetupAmmoGUI() { - UINT16 str[20]; + wchar_t str[20]; swprintf( str, L"%d", gpItem->ubNumberOfObjects ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 1, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->bTrap ); @@ -833,7 +833,7 @@ void ExtractAndUpdateAmmoGUI() void SetupArmourGUI() { - UINT16 str[20]; + wchar_t str[20]; swprintf( str, L"%d", gpItem->bStatus[0] ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->bTrap ); @@ -894,7 +894,7 @@ void ExtractAndUpdateArmourGUI() void SetupEquipGUI() { - UINT16 str[20]; + wchar_t str[20]; swprintf( str, L"%d", gpItem->bStatus[0] ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->bTrap ); @@ -938,7 +938,7 @@ void ExtractAndUpdateEquipGUI() void SetupExplosivesGUI() { - UINT16 str[20]; + wchar_t str[20]; INT16 yp; swprintf( str, L"%d", gpItem->bStatus[0] ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); @@ -1020,7 +1020,7 @@ void ExtractAndUpdateExplosivesGUI() void SetupMoneyGUI() { - UINT16 str[20]; + wchar_t str[20]; swprintf( str, L"%d", gpItem->uiMoneyAmount ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 380, 45, 15, MSYS_PRIORITY_NORMAL, str, 5, INPUTTYPE_NUMERICSTRICT ); if( gpEditingItemPool ) @@ -1058,7 +1058,7 @@ void RemoveMoneyGUI() void SetupOwnershipGUI() { - UINT16 str[20]; + wchar_t str[20]; swprintf( str, L"%d", gpItem->ubOwnerProfile ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 380, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); giOwnershipGroupButton = @@ -1104,7 +1104,7 @@ void RemoveOwnershipGUI() void SetupKeysGUI() { - UINT16 str[20]; + wchar_t str[20]; if( gpEditingItemPool ) { swprintf( str, L"%d", 100 - gWorldItems[ gpEditingItemPool->iItemIndex ].ubNonExistChance ); @@ -1130,7 +1130,7 @@ void RemoveKeysGUI() void SetupActionItemsGUI() { - UINT16 str[4]; + wchar_t str[4]; UINT16 *pStr; swprintf( str, L"%d", gpItem->bStatus[0] ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 365, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); @@ -1197,7 +1197,7 @@ void AlarmTriggerCheckboxCallback( GUI_BUTTON *btn, INT32 reason ) void SetupTriggersGUI() { - UINT16 str[4]; + wchar_t str[4]; swprintf( str, L"%d", gpItem->bTrap ); AddTextInputField( iScreenWidthOffset + 485, 2 * iScreenHeightOffset + 365, 25, 15, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_NUMERICSTRICT ); swprintf( str, L"%d", gpItem->ubTolerance ); diff --git a/Editor/LoadScreen.cpp b/Editor/LoadScreen.cpp index 59823c83..1769da0d 100644 --- a/Editor/LoadScreen.cpp +++ b/Editor/LoadScreen.cpp @@ -371,7 +371,7 @@ UINT32 LoadSaveScreenHandle(void) sprintf( gszCurrFilename, "MAPS\\%S", gzFilename ); if( GetFileFirst(gszCurrFilename, &FileInfo) ) { - UINT16 str[40]; + wchar_t str[40]; if( FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_HIDDEN|FILE_IS_SYSTEM) ) { swprintf( str, L" Delete READ-ONLY file %s? ", gzFilename ); diff --git a/Editor/LoadScreen.h b/Editor/LoadScreen.h index 88d6dd58..101ed48c 100644 --- a/Editor/LoadScreen.h +++ b/Editor/LoadScreen.h @@ -26,7 +26,7 @@ extern BOOLEAN gfDestroyFDlg; UINT32 WaitForFileName( void ); void RemoveFileDialog(void); -void CreateFileDialog( UINT16 *zTitle ); +void CreateFileDialog( wchar_t *zTitle ); void SelectFileDialogYPos( UINT16 usRelativeYPos ); @@ -37,8 +37,8 @@ BOOLEAN ExtractFilenameFromFields(); BOOLEAN ValidCoordinate(); BOOLEAN ValidFilename(); -BOOLEAN ExternalLoadMap( UINT16 *szFilename ); -BOOLEAN ExternalSaveMap( UINT16 *szFilename ); +BOOLEAN ExternalLoadMap( wchar_t *szFilename ); +BOOLEAN ExternalSaveMap( wchar_t *szFilename ); extern BOOLEAN gfErrorCatch; extern UINT16 gzErrorCatchString[ 256 ]; diff --git a/Editor/Sector Summary.cpp b/Editor/Sector Summary.cpp index 382f0fb8..5986c979 100644 --- a/Editor/Sector Summary.cpp +++ b/Editor/Sector Summary.cpp @@ -499,7 +499,7 @@ void DestroySummaryWindow() void RenderSectorInformation() { - //UINT16 str[ 100 ]; + //wchar_t str[ 100 ]; MAPCREATE_STRUCT *m; SUMMARYFILE *s; UINT8 ePoints = 0; @@ -677,7 +677,7 @@ void RenderItemDetails() FLOAT dAvgExistChance, dAvgStatus; OBJECTTYPE *pItem; INT32 index, i; - UINT16 str[100]; + wchar_t str[100]; UINT32 uiQuantity, uiExistChance, uiStatus; UINT32 uiTriggerQuantity[8], uiActionQuantity[8], uiTriggerExistChance[8], uiActionExistChance[8]; UINT32 xp, yp; @@ -1025,7 +1025,7 @@ void RenderSummaryWindow() SetFontShadow( FONT_NEARBLACK ); if( gfGlobalSummaryExists ) { - UINT16 str[100]; + wchar_t str[100]; BOOLEAN fSectorSummaryExists = FALSE; if( gusNumEntriesWithOutdatedOrNoSummaryInfo && !gfOutdatedDenied ) { @@ -1379,7 +1379,7 @@ void RenderSummaryWindow() } for( x = 1; x <= 16; x++ ) { - UINT16 str[3]; + wchar_t str[3]; swprintf( str, L"%d", x ); mprintf( MAP_LEFT+x*13-(13+StringPixLength( str, SMALLCOMPFONT ))/2, MAP_TOP-8, str ); } @@ -1402,7 +1402,7 @@ void RenderSummaryWindow() if( gfRenderProgress ) { UINT8 ubNumUndergroundLevels; - UINT16 str[2]; + wchar_t str[2]; for( y = 0; y < 16; y++ ) { ClipRect.iTop = MAP_TOP + y*13; @@ -1528,7 +1528,7 @@ void RenderSummaryWindow() void UpdateSectorSummary( UINT16 *gszFilename, BOOLEAN fUpdate ) { - UINT16 str[50]; + wchar_t str[50]; UINT8 szCoord[40]; UINT16 *ptr; INT16 x, y; @@ -2089,7 +2089,7 @@ void SummaryLoadMapCallback( GUI_BUTTON *btn, INT32 reason ) if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP ) { UINT16 *ptr; - UINT16 str[ 50 ]; + wchar_t str[ 50 ]; gfRenderSummary = TRUE; SetFont( FONT10ARIAL ); @@ -2623,7 +2623,7 @@ void UpdateMasterProgress() void ReportError( UINT8 *pSector, UINT8 ubLevel ) { static INT32 yp = iScreenHeightOffset + 180; - UINT16 str[40]; + wchar_t str[40]; UINT16 temp[10]; //Make sure the file exists... if not, then return false @@ -2751,7 +2751,7 @@ void SummaryUpdateCallback( GUI_BUTTON *btn, INT32 reason ) void ExtractTempFilename() { - UINT16 str[40]; + wchar_t str[40]; Get16BitStringFromField( 1, str ); if( wcscmp( gszTempFilename, str ) ) { @@ -2766,7 +2766,7 @@ void ExtractTempFilename() void ApologizeOverrideAndForceUpdateEverything() { INT32 x, y; - UINT16 str[ 50 ]; + wchar_t str[ 50 ]; UINT8 name[50]; SUMMARYFILE *pSF; //Create one huge assed button diff --git a/Editor/Sector Summary.h b/Editor/Sector Summary.h index 7d90fe12..21edc63f 100644 --- a/Editor/Sector Summary.h +++ b/Editor/Sector Summary.h @@ -14,7 +14,7 @@ void DestroySummaryWindow(); void RenderSummaryWindow(); void LoadWorldInfo(); -void UpdateSectorSummary( UINT16 *gszFilename, BOOLEAN fUpdate ); +void UpdateSectorSummary( wchar_t *gszFilename, BOOLEAN fUpdate ); void SaveGlobalSummary(); void LoadGlobalSummary(); diff --git a/Editor/editscreen.cpp b/Editor/editscreen.cpp index 8ce4e293..8ae1b184 100644 --- a/Editor/editscreen.cpp +++ b/Editor/editscreen.cpp @@ -3540,7 +3540,7 @@ void ProcessAreaSelection( BOOLEAN fWithLeftButton ) gubMaxRoomNumber++; if( iCurrentTaskbar == TASK_BUILDINGS && TextInputMode() ) { - UINT16 str[4]; + wchar_t str[4]; swprintf( str, L"%d", gubCurrRoomNumber ); SetInputFieldStringWith16BitString( 1, str ); SetActiveField( 0 ); diff --git a/Editor/messagebox.h b/Editor/messagebox.h index a3821a24..d13bfec0 100644 --- a/Editor/messagebox.h +++ b/Editor/messagebox.h @@ -14,7 +14,7 @@ enum extern UINT8 gubMessageBoxStatus; extern BOOLEAN gfMessageBoxResult; -void CreateMessageBox( UINT16 *wzString ); +void CreateMessageBox( wchar_t *wzString ); BOOLEAN MessageBoxHandled(); void RemoveMessageBox(); diff --git a/Editor/popupmenu.h b/Editor/popupmenu.h index 3b54f85a..3b4fde55 100644 --- a/Editor/popupmenu.h +++ b/Editor/popupmenu.h @@ -85,7 +85,7 @@ typedef struct currentPopupMenuInformation{ //A global var that keeps the popup menu information. extern CurrentPopupMenuInformation gPopup; -extern UINT16 *popupMenuStrings[5]; +extern wchar_t *popupMenuStrings[5]; //These are the two main functions that outside users would call. void InitPopupMenu( INT32 iButtonID, UINT8 ubPopupMenuID, UINT8 ubDirection ); diff --git a/Editor/selectwin.h b/Editor/selectwin.h index ff596467..4eb9cd21 100644 --- a/Editor/selectwin.h +++ b/Editor/selectwin.h @@ -86,7 +86,7 @@ typedef struct }; struct { - UINT16 * pString; + wchar_t * pString; }; }; } diff --git a/GameInitOptionsScreen.cpp b/GameInitOptionsScreen.cpp index 113b4e44..8392ac64 100644 --- a/GameInitOptionsScreen.cpp +++ b/GameInitOptionsScreen.cpp @@ -240,7 +240,7 @@ void DoneFadeOutForExitGameInitOptionScreen( void ); void DoneFadeInForExitGameInitOptionScreen( void ); // JA2Gold: no more timed turns setting //UINT8 GetCurrentTimedTurnsButtonSetting(); -BOOLEAN DoGioMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); +BOOLEAN DoGioMessageBox( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); void DisplayMessageToUserAboutGameDifficulty(); void ConfirmGioDifSettingMessageBoxCallBack( UINT8 bExitValue ); BOOLEAN DisplayMessageToUserAboutIronManMode(); @@ -1276,7 +1276,7 @@ void DoneFadeInForExitGameInitOptionScreen( void ) } -BOOLEAN DoGioMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) +BOOLEAN DoGioMessageBox( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 }; @@ -1299,16 +1299,16 @@ void DisplayMessageToUserAboutGameDifficulty() switch( ubDiffLevel ) { case 0: - DoGioMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zGioDifConfirmText[GIO_CFS_NOVICE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); + DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_NOVICE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); break; case 1: - DoGioMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zGioDifConfirmText[GIO_CFS_EXPERIENCED], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); + DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_EXPERIENCED], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); break; case 2: - DoGioMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zGioDifConfirmText[GIO_CFS_EXPERT], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); + DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_EXPERT], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); break; case 3: - DoGioMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zGioDifConfirmText[GIO_CFS_INSANE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); + DoGioMessageBox( MSG_BOX_BASIC_STYLE, zGioDifConfirmText[GIO_CFS_INSANE], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioDifSettingMessageBoxCallBack ); break; } } @@ -1330,7 +1330,7 @@ BOOLEAN DisplayMessageToUserAboutIronManMode() //if the user has selected IRON MAN mode if( ubIronManMode ) { - DoGioMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)gzIronManModeWarningText[ IMM__IRON_MAN_MODE_WARNING_TEXT ], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioIronManMessageBoxCallBack ); + DoGioMessageBox( MSG_BOX_BASIC_STYLE, gzIronManModeWarningText[ IMM__IRON_MAN_MODE_WARNING_TEXT ], GAME_INIT_OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmGioIronManMessageBoxCallBack ); return( TRUE ); } diff --git a/GameVersion.cpp b/GameVersion.cpp index 01077163..1cc89183 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,13 +23,13 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.765" }; + wchar_t zVersionLabel[256] = { L"Release v1.13.766" }; #endif INT8 czVersionNumber[16] = { "Build 07.03.04" }; //YY.MM.DD -INT16 zTrackingNumber[16] = { L"Z" }; +wchar_t zTrackingNumber[16] = { L"Z" }; // diff --git a/GameVersion.h b/GameVersion.h index 0ea506aa..a8e789aa 100644 --- a/GameVersion.h +++ b/GameVersion.h @@ -11,9 +11,9 @@ extern "C" { // Keeps track of the game version // -extern INT16 zVersionLabel[256]; +extern wchar_t zVersionLabel[256]; extern INT8 czVersionNumber[16]; -extern INT16 zTrackingNumber[16]; +extern wchar_t zTrackingNumber[16]; diff --git a/JA2.vcproj b/JA2.vcproj index 05f6be47..1d98d6b8 100644 --- a/JA2.vcproj +++ b/JA2.vcproj @@ -546,7 +546,7 @@ ubSecondCode ); diff --git a/Laptop/insurance Contract.cpp b/Laptop/insurance Contract.cpp index d3aa10f8..59fdd1b4 100644 --- a/Laptop/insurance Contract.cpp +++ b/Laptop/insurance Contract.cpp @@ -1625,7 +1625,7 @@ void PurchaseOrExtendInsuranceForSoldier( SOLDIERTYPE *pSoldier, UINT32 uiInsura if( guiCurrentScreen == LAPTOP_SCREEN ) DoLapTopMessageBox( MSG_BOX_RED_ON_WHITE, sText, LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); else - DoMapMessageBox( MSG_BOX_RED_ON_WHITE, (INT16 *)sText, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL); + DoMapMessageBox( MSG_BOX_RED_ON_WHITE, sText, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL); } else { diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index effad3eb..23d8d8c0 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -4439,6 +4439,8 @@ void LapTopScreenCallBack(MOUSE_REGION * pRegion, INT32 iReason ) return; } +template BOOLEAN DoLapTopMessageBox(UINT8, wchar_t *, UINT32, UINT8, MSGBOX_CALLBACK); +template BOOLEAN DoLapTopMessageBox(UINT8, wchar_t const *, UINT32, UINT8, MSGBOX_CALLBACK); template BOOLEAN DoLapTopMessageBox(UINT8, unsigned short *, UINT32, UINT8, MSGBOX_CALLBACK); template BOOLEAN DoLapTopMessageBox(UINT8, unsigned short const *, UINT32, UINT8, MSGBOX_CALLBACK); template @@ -4462,7 +4464,7 @@ BOOLEAN DoLapTopMessageBox( UINT8 ubStyle, string2 zString, UINT32 uiExitScreen } -BOOLEAN DoLapTopSystemMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) +BOOLEAN DoLapTopSystemMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { // reset exit mode fExitDueToMessageBox = TRUE; @@ -4474,7 +4476,7 @@ BOOLEAN DoLapTopSystemMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 return( ( iLaptopMessageBox != -1 ) ); } -BOOLEAN DoLapTopSystemMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) +BOOLEAN DoLapTopSystemMessageBox( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { SGPRect CenteringRect= {iScreenWidthOffset, iScreenHeightOffset, iScreenWidthOffset + 640, INV_INTERFACE_START_Y }; diff --git a/Laptop/laptop.h b/Laptop/laptop.h index aa48d416..482c10ba 100644 --- a/Laptop/laptop.h +++ b/Laptop/laptop.h @@ -37,7 +37,7 @@ void BlitTitleBarIcons( void ); void HandleKeyBoardShortCutsForLapTop( UINT16 usEvent, UINT32 usParam, UINT16 usKeyState ); BOOLEAN RenderWWWProgramTitleBar( void ); void DisplayProgramBoundingBox( BOOLEAN fMarkButtons ); -BOOLEAN DoLapTopSystemMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); +BOOLEAN DoLapTopSystemMessageBox( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); BOOLEAN RemoveBookMark( INT32 iBookId ); void CreateFileAndNewEmailIconFastHelpText( UINT32 uiHelpTextID, BOOLEAN fClearHelpText ); BOOLEAN InitLaptopAndLaptopScreens(); diff --git a/Laptop/mercs.cpp b/Laptop/mercs.cpp index 936a8922..603f6dee 100644 --- a/Laptop/mercs.cpp +++ b/Laptop/mercs.cpp @@ -1537,7 +1537,7 @@ void HandleTalkingSpeck() } } -void DisplayTextForSpeckVideoPopUp(INT16 * pString) +void DisplayTextForSpeckVideoPopUp(wchar_t * pString) { UINT16 usActualHeight; INT32 iOldMercPopUpBoxId = iMercPopUpBox; diff --git a/Laptop/mercs.h b/Laptop/mercs.h index 6b76aa6d..a13bc457 100644 --- a/Laptop/mercs.h +++ b/Laptop/mercs.h @@ -64,7 +64,7 @@ BOOLEAN RemoveMercBackGround(); void DailyUpdateOfMercSite( UINT16 usDate); UINT8 GetMercIDFromMERCArray(UINT8 ubMercID); -void DisplayTextForSpeckVideoPopUp(INT16 * pString); +void DisplayTextForSpeckVideoPopUp(wchar_t * pString); BOOLEAN IsMercMercAvailable( UINT8 ubMercID ); diff --git a/MessageBoxScreen.cpp b/MessageBoxScreen.cpp index 3024302b..3b20d4c3 100644 --- a/MessageBoxScreen.cpp +++ b/MessageBoxScreen.cpp @@ -76,6 +76,8 @@ CHAR16 gzUserDefinedButton2[ 128 ]; template INT32 DoMessageBox(UINT8, unsigned short *, UINT32, UINT16, MSGBOX_CALLBACK, SGPRect *); template INT32 DoMessageBox(UINT8, unsigned short const*, UINT32, UINT16, MSGBOX_CALLBACK, SGPRect *); +template INT32 DoMessageBox(UINT8, wchar_t *, UINT32, UINT16, MSGBOX_CALLBACK, SGPRect *); +template INT32 DoMessageBox(UINT8, wchar_t const*, UINT32, UINT16, MSGBOX_CALLBACK, SGPRect *); template INT32 DoMessageBox( UINT8 ubStyle, string2 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { @@ -1196,31 +1198,33 @@ UINT32 MessageBoxScreenShutdown( ) // a basic box that don't care what screen we came from +template void DoScreenIndependantMessageBox(wchar_t *, UINT16, MSGBOX_CALLBACK); +template void DoScreenIndependantMessageBox(wchar_t const *, UINT16, MSGBOX_CALLBACK); template void DoScreenIndependantMessageBox(unsigned short *, UINT16, MSGBOX_CALLBACK); template void DoScreenIndependantMessageBox(unsigned short const *, UINT16, MSGBOX_CALLBACK); template void DoScreenIndependantMessageBox( string1 zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { SGPRect CenteringRect= {0, 0, SCREEN_WIDTH, INV_INTERFACE_START_Y }; - DoScreenIndependantMessageBoxWithRect( (INT16 *) zString, usFlags, ReturnCallback, &CenteringRect ); + DoScreenIndependantMessageBoxWithRect( (wchar_t *) zString, usFlags, ReturnCallback, &CenteringRect ); } // a basic box that don't care what screen we came from -void DoUpperScreenIndependantMessageBox( INT16 *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) +void DoUpperScreenIndependantMessageBox( wchar_t *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { SGPRect CenteringRect= {0, 0, SCREEN_WIDTH, INV_INTERFACE_START_Y / 2 }; DoScreenIndependantMessageBoxWithRect( zString, usFlags, ReturnCallback, &CenteringRect ); } // a basic box that don't care what screen we came from -void DoLowerScreenIndependantMessageBox( UINT16 * zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) +void DoLowerScreenIndependantMessageBox( wchar_t * zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { SGPRect CenteringRect= {0, INV_INTERFACE_START_Y / 2, SCREEN_WIDTH, INV_INTERFACE_START_Y }; - DoScreenIndependantMessageBoxWithRect( (INT16 *)zString, usFlags, ReturnCallback, &CenteringRect ); + DoScreenIndependantMessageBoxWithRect( zString, usFlags, ReturnCallback, &CenteringRect ); } -void DoScreenIndependantMessageBoxWithRect( INT16 *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) +void DoScreenIndependantMessageBoxWithRect( wchar_t *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { /// which screen are we in? diff --git a/MessageBoxScreen.h b/MessageBoxScreen.h index 9b71a937..cec4dfd1 100644 --- a/MessageBoxScreen.h +++ b/MessageBoxScreen.h @@ -93,16 +93,16 @@ template INT32 DoMessageBox( UINT8 ubStyle, string2 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); template void DoScreenIndependantMessageBox( string1 zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); -void DoUpperScreenIndependantMessageBox( INT16 *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); +void DoUpperScreenIndependantMessageBox( wchar_t *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); -void DoLowerScreenIndependantMessageBox( UINT16 * zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); -void DoScreenIndependantMessageBoxWithRect( INT16 *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); +void DoLowerScreenIndependantMessageBox( wchar_t * zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); +void DoScreenIndependantMessageBoxWithRect( wchar_t *zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); //wrappers for other screens -BOOLEAN DoLapTopSystemMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); -INT32 DoMapMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); -BOOLEAN DoOptionsMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); -BOOLEAN DoSaveLoadMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); +BOOLEAN DoLapTopSystemMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); +INT32 DoMapMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); +BOOLEAN DoOptionsMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); +BOOLEAN DoSaveLoadMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ); #endif \ No newline at end of file diff --git a/Options Screen.cpp b/Options Screen.cpp index 55197e43..9ff43cbb 100644 --- a/Options Screen.cpp +++ b/Options Screen.cpp @@ -221,7 +221,7 @@ void SetOptionsExitScreen( UINT32 uiExitScreen ); void SoundFXSliderChangeCallBack( INT32 iNewValue ); void SpeechSliderChangeCallBack( INT32 iNewValue ); void MusicSliderChangeCallBack( INT32 iNewValue ); -//BOOLEAN DoOptionsMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ); +//BOOLEAN DoOptionsMessageBox( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ); void ConfirmQuitToMainMenuMessageBoxCallBack( UINT8 bExitValue ); void HandleSliderBarMovementSounds(); void HandleOptionToggle( UINT8 ubButton, BOOLEAN fState, BOOLEAN fDown, BOOLEAN fPlaySound ); @@ -973,7 +973,7 @@ void BtnOptQuitCallback(GUI_BUTTON *btn,INT32 reason) btn->uiFlags &= (~BUTTON_CLICKED_ON ); //Confirm the Exit to the main menu screen - DoOptionsMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zOptionsText[OPT_RETURN_TO_MAIN], OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmQuitToMainMenuMessageBoxCallBack ); + DoOptionsMessageBox( MSG_BOX_BASIC_STYLE, zOptionsText[OPT_RETURN_TO_MAIN], OPTIONS_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmQuitToMainMenuMessageBoxCallBack ); /// SetOptionsExitScreen( MAINMENU_SCREEN ); @@ -1084,7 +1084,7 @@ void HandleOptionToggle( UINT8 ubButton, BOOLEAN fState, BOOLEAN fDown, BOOLEAN ButtonList[ guiOptionsToggles[ ubButton ] ]->uiFlags |= BUTTON_CLICKED_ON; //Confirm the Exit to the main menu screen - DoOptionsMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zOptionsText[OPT_NEED_AT_LEAST_SPEECH_OR_SUBTITLE_OPTION_ON], OPTIONS_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoOptionsMessageBox( MSG_BOX_BASIC_STYLE, zOptionsText[OPT_NEED_AT_LEAST_SPEECH_OR_SUBTITLE_OPTION_ON], OPTIONS_SCREEN, MSG_BOX_FLAG_OK, NULL ); gfExitOptionsDueToMessageBox = FALSE; } } @@ -1136,7 +1136,7 @@ void MusicSliderChangeCallBack( INT32 iNewValue ) MusicSetVolume( iNewValue ); } -BOOLEAN DoOptionsMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) +BOOLEAN DoOptionsMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { // reset exit mode gfExitOptionsDueToMessageBox = TRUE; @@ -1148,7 +1148,7 @@ BOOLEAN DoOptionsMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExi return( ( giOptionsMessageBox != -1 ) ); } -BOOLEAN DoOptionsMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) +BOOLEAN DoOptionsMessageBox( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 }; diff --git a/Options Screen.h b/Options Screen.h index a515274a..0bed4b48 100644 --- a/Options Screen.h +++ b/Options Screen.h @@ -23,7 +23,7 @@ void SetOptionsScreenToggleBoxes(); void GetOptionsScreenToggleBoxes(); -BOOLEAN DoOptionsMessageBox( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); +BOOLEAN DoOptionsMessageBox( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); #endif diff --git a/SaveLoadScreen.cpp b/SaveLoadScreen.cpp index 83c458cb..baaaaa82 100644 --- a/SaveLoadScreen.cpp +++ b/SaveLoadScreen.cpp @@ -1114,7 +1114,7 @@ void SaveLoadGameNumber( INT8 bSaveGameID ) } -BOOLEAN DoSaveLoadMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) +BOOLEAN DoSaveLoadMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { // do message box and return giSaveLoadMessageBox = DoMessageBox( ubStyle, zString, uiExitScreen, ( UINT8 ) ( usFlags| MSG_BOX_FLAG_USE_CENTERING_RECT ), ReturnCallback, pCenteringRect ); @@ -2329,7 +2329,7 @@ BOOLEAN DoQuickSave() gTacticalStatus.uiFlags &= ~LOADING_SAVED_GAME; if( guiPreviousOptionScreen == MAP_SCREEN ) - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zSaveLoadText[SLG_SAVE_GAME_ERROR], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, zSaveLoadText[SLG_SAVE_GAME_ERROR], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); else DoMessageBox( MSG_BOX_BASIC_STYLE, zSaveLoadText[SLG_SAVE_GAME_ERROR], GAME_SCREEN, MSG_BOX_FLAG_OK, NULL, NULL ); } diff --git a/Standard Gaming Platform/Button System.cpp b/Standard Gaming Platform/Button System.cpp index 3ab40518..861977c9 100644 --- a/Standard Gaming Platform/Button System.cpp +++ b/Standard Gaming Platform/Button System.cpp @@ -1672,7 +1672,7 @@ INT32 CreateIconButton(INT16 Icon,INT16 IconIndex,INT16 GenImg,INT16 xloc,INT16 } //Creates a generic button with text on it. -INT32 CreateTextButton(UINT16 *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback) +INT32 CreateTextButton(wchar_t *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback) { GUI_BUTTON *b; INT32 ButtonNum; @@ -1716,7 +1716,7 @@ INT32 CreateTextButton(UINT16 *string, UINT32 uiFont, INT16 sForeColor, INT16 sS b->string = NULL; if ( string && wcslen( string ) ) { - b->string = (UINT16*)MemAlloc( (wcslen(string)+1)*sizeof(UINT16) ); + b->string = (wchar_t*)MemAlloc( (wcslen(string)+1)*sizeof(wchar_t) ); AssertMsg( b->string, "Out of memory error: Couldn't allocate string in CreateTextButton." ); wcscpy( b->string, string ); } @@ -2123,6 +2123,8 @@ INT32 CreateSimpleButton( INT32 x, INT32 y, string3 filename, INT32 Type, INT16 return( ButNum ); } +template INT32 CreateIconAndTextButton(INT32, wchar_t const *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK); +template INT32 CreateIconAndTextButton(INT32, wchar_t *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK); template INT32 CreateIconAndTextButton(INT32, unsigned short const *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK); template INT32 CreateIconAndTextButton(INT32, unsigned short *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK); template INT32 CreateIconAndTextButton(INT32, short *, UINT32, INT16, INT16, INT16, INT16, INT8, INT16, INT16, INT32, INT16, GUI_CALLBACK, GUI_CALLBACK); @@ -2190,7 +2192,7 @@ INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont, b->string = NULL; if ( string ) { - b->string = (UINT16*)MemAlloc( (wcslen((wchar_t *)string)+1)*sizeof(UINT16) ); + b->string = (wchar_t*)MemAlloc( (wcslen((wchar_t *)string)+1)*sizeof(wchar_t) ); AssertMsg( b->string, "Out of memory error: Couldn't allocate string in CreateIconAndTextButton." ); wcscpy( b->string, string ); } @@ -2263,7 +2265,7 @@ INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont, } //New functions -void SpecifyButtonText( INT32 iButtonID, UINT16 * string ) +void SpecifyButtonText( INT32 iButtonID, wchar_t * string ) { GUI_BUTTON *b; @@ -2280,7 +2282,7 @@ void SpecifyButtonText( INT32 iButtonID, UINT16 * string ) if( string && wcslen( string ) ) { //allocate memory for the new string - b->string = (UINT16*)MemAlloc( (wcslen(string)+1)*sizeof(UINT16) ); + b->string = (wchar_t*)MemAlloc( (wcslen(string)+1)*sizeof(wchar_t) ); Assert( b->string ); //copy the string to the button wcscpy( b->string, string ); @@ -2360,7 +2362,7 @@ void SpecifyButtonTextJustification( INT32 iButtonID, INT8 bJustification ) b->uiFlags |= BUTTON_DIRTY ; } -void SpecifyFullButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont, +void SpecifyFullButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 sForeColorDown, INT16 sShadowColorDown, INT8 bJustification ) { @@ -2383,7 +2385,7 @@ void SpecifyFullButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiF b->uiFlags |= BUTTON_DIRTY ; } -void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont, +void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont, INT16 sForeColor, INT16 sShadowColor ) { GUI_BUTTON *b; @@ -2540,7 +2542,7 @@ void AllowDisabledButtonFastHelp( INT32 iButtonID, BOOLEAN fAllow ) // // Set the text that will be displayed as the FastHelp // -void SetButtonFastHelpText(INT32 iButton, UINT16 * Text) +void SetButtonFastHelpText(INT32 iButton, wchar_t * Text) { GUI_BUTTON *b; if(iButton<0 || iButton>MAX_BUTTONS) @@ -3947,7 +3949,7 @@ BOOLEAN SetDialogAttributes( CreateDlgInfo *pDlgInfo, INT32 iAttrib, ... ) { va_list arg; INT32 iFont,iFontOptions; - UINT16 *zString; + wchar_t *zString; INT32 iX,iY,iW,iH; INT32 iIndex; HVOBJECT hVObj; @@ -3998,7 +4000,7 @@ BOOLEAN SetDialogAttributes( CreateDlgInfo *pDlgInfo, INT32 iAttrib, ... ) iFont = va_arg( arg, INT32 ); pDlgInfo->iTextFont = iFont; - zString = (UINT16 *)va_arg( arg, UINT32 ); + zString = (wchar_t *)va_arg( arg, UINT32 ); if ( pDlgInfo->zDlgText != NULL ) MemFree( pDlgInfo->zDlgText ); diff --git a/Standard Gaming Platform/Button System.h b/Standard Gaming Platform/Button System.h index a3d87362..af416c02 100644 --- a/Standard Gaming Platform/Button System.h +++ b/Standard Gaming Platform/Button System.h @@ -116,7 +116,7 @@ typedef struct _GUI_BUTTON { //Button disabled style INT8 bDisabledStyle; //For buttons with text - UINT16 *string; //the string + wchar_t *string; //the string UINT16 usFont; //font for text BOOLEAN fMultiColor; //font is a multi-color font INT16 sForeColor; //text colors if there is text @@ -184,7 +184,7 @@ INT16 FindFreeIconSlot(void); INT32 GetNextButtonNumber(void); // Now used by Wizardry -- DB -void SetButtonFastHelpText(INT32 iButton, UINT16 * Text); +void SetButtonFastHelpText(INT32 iButton, wchar_t * Text); #ifdef _JA2_RENDER_DIRTY void SetBtnHelpEndCallback( INT32 iButton, MOUSE_HELPTEXT_DONE_CALLBACK CallbackFxn ); @@ -265,7 +265,7 @@ INT32 CreateCheckBoxButton( INT16 x, INT16 y, string3 filename, INT16 Priority, INT32 CreateIconButton(INT16 Icon,INT16 IconIndex,INT16 GenImg,INT16 xloc,INT16 yloc,INT16 w,INT16 h,INT32 Type,INT16 Priority,GUI_CALLBACK MoveCallback,GUI_CALLBACK ClickCallback); INT32 CreateHotSpot(INT16 xloc, INT16 yloc, INT16 Width, INT16 Height,INT16 Priority,GUI_CALLBACK MoveCallback,GUI_CALLBACK ClickCallback); -INT32 CreateTextButton(UINT16 *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback); +INT32 CreateTextButton(wchar_t *string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 GenImg, INT16 xloc, INT16 yloc, INT16 w, INT16 h, INT32 Type, INT16 Priority,GUI_CALLBACK MoveCallback, GUI_CALLBACK ClickCallback); template INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont, INT16 sForeColor, INT16 sShadowColor, @@ -275,19 +275,19 @@ INT32 CreateIconAndTextButton( INT32 Image, string2 string, UINT32 uiFont, GUI_CALLBACK MoveCallback,GUI_CALLBACK ClickCallback); //New functions -void SpecifyButtonText( INT32 iButtonID, UINT16 * string ); +void SpecifyButtonText( INT32 iButtonID, wchar_t * string ); void SpecifyButtonFont( INT32 iButtonID, UINT32 uiFont ); void SpecifyButtonMultiColorFont(INT32 iButtonID, BOOLEAN fMultiColor); void SpecifyButtonUpTextColors( INT32 iButtonID, INT16 sForeColor, INT16 sShadowColor ); void SpecifyButtonDownTextColors( INT32 iButtonID, INT16 sForeColorDown, INT16 sShadowColorDown ); void SpecifyButtonHilitedTextColors( INT32 iButtonID, INT16 sForeColorHilited, INT16 sShadowColorHilited ); void SpecifyButtonTextJustification( INT32 iButtonID, INT8 bJustification ); -void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont, +void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont, INT16 sForeColor, INT16 sShadowColor ); -void SpecifyFullButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont, +void SpecifyFullButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont, INT16 sForeColor, INT16 sShadowColor, INT16 sForeColorDown, INT16 sShadowColorDown, INT8 bJustification ); -void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, UINT16 *string, INT32 uiFont, +void SpecifyGeneralButtonTextAttributes( INT32 iButtonID, wchar_t *string, INT32 uiFont, INT16 sForeColor, INT16 sShadowColor ); void SpecifyButtonTextOffsets( INT32 iButtonID, INT8 bTextXOffset, INT8 bTextYOffset, BOOLEAN fShiftText ); void SpecifyButtonTextSubOffsets( INT32 iButtonID, INT8 bTextXOffset, INT8 bTextYOffset, BOOLEAN fShiftText ); diff --git a/Standard Gaming Platform/DEBUG.cpp b/Standard Gaming Platform/DEBUG.cpp index ab9d062a..4e0c9edc 100644 --- a/Standard Gaming Platform/DEBUG.cpp +++ b/Standard Gaming Platform/DEBUG.cpp @@ -17,6 +17,10 @@ // Because we're in a library, define SGP_DEBUG here - the client may not always // use the code to write text, because the header switches on the define #define SGP_DEBUG +//#undef _DEBUG + +// WDS: Note: To compile with VS2005 in release mode you might have to not define SGP_DEBUG and +// undefine _DEBUG or you get linker errors. #ifdef JA2_PRECOMPILED_HEADERS @@ -70,8 +74,16 @@ UINT8 gubAssertString[128]; UINT8 gbTmpDebugString[8][MAX_MSG_LENGTH2]; UINT8 gubStringIndex = 0; +#ifdef __cplusplus +} +#endif + #ifdef SGP_DEBUG +#ifdef __cplusplus +extern "C" { +#endif + //************************************************************************** // // Defines @@ -501,9 +513,9 @@ template void _FailMessage(unsigned char *, unsig template void _FailMessage( type1 pString, UINT32 uiLineNum, type2 pSourceFile ) { - MSG Message; UINT8 ubOutputString[512]; #ifndef _NO_DEBUG_TXT + MSG Message; FILE *DebugFile; #endif BOOLEAN fDone = FALSE; @@ -613,6 +625,9 @@ void _FailMessage(UINT8 *pString, UINT32 uiLineNum, UINT8 *pSourceFile) #endif +#else +BOOLEAN DbgInitialize(void) { return true; }; +void DbgShutdown(void) {}; #endif // This is NOT a _DEBUG only function! It is also needed in diff --git a/Standard Gaming Platform/Font.cpp b/Standard Gaming Platform/Font.cpp index 8c73ce63..70099dab 100644 --- a/Standard Gaming Platform/Font.cpp +++ b/Standard Gaming Platform/Font.cpp @@ -419,7 +419,7 @@ UINT32 GetWidth(HVOBJECT hSrcVObject, INT16 ssIndex) // evaluate to is 512. // 'uiCharCount' specifies how many characters of the string are counted. //***************************************************************************** -INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, UINT16 *pFontString, ...) +INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, wchar_t *pFontString, ...) { va_list argptr; wchar_t string[512]; @@ -457,12 +457,12 @@ wchar_t string[512]; // 'uiCharCount' specifies how many characters of the string are counted. // YOU HAVE TO PREBUILD THE FAST HELP STRING! //***************************************************************************** -INT16 StringPixLengthArgFastHelp(INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, UINT16 *pFontString ) +INT16 StringPixLengthArgFastHelp(INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, wchar_t *pFontString ) { wchar_t string[512]; UINT32 i, index; INT16 sBoldDiff = 0; - UINT16 str[2]; + wchar_t str[2]; Assert(pFontString!=NULL); @@ -518,10 +518,10 @@ INT16 StringPixLengthArgFastHelp(INT32 usUseFont, INT32 usBoldFont, UINT32 uiCha // Created on: 12/1/99 // //***************************************************************************************** -INT16 StringNPixLength(UINT16 *string, UINT32 uiMaxCount, INT32 UseFont) +INT16 StringNPixLength(wchar_t *string, UINT32 uiMaxCount, INT32 UseFont) { UINT32 Cur, uiCharCount; - UINT16 *curletter,transletter; + wchar_t *curletter,transletter; Cur = 0; uiCharCount = 0; @@ -545,6 +545,7 @@ INT16 StringNPixLength(UINT16 *string, UINT32 uiMaxCount, INT32 UseFont) //***************************************************************************** template INT16 StringPixLength(short *, INT32); template INT16 StringPixLength(unsigned short const *, INT32); +template INT16 StringPixLength(wchar_t const *, INT32); template INT16 StringPixLength(type1 string, INT32 UseFont) { @@ -730,6 +731,8 @@ 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 //***************************************************************************** +template UINT32 mprintf(INT32, INT32, wchar_t *, ...); +template UINT32 mprintf(INT32, INT32, wchar_t const *, ...); template UINT32 mprintf(INT32, INT32, short *, ...); template UINT32 mprintf(INT32, INT32, unsigned short *, ...); template UINT32 mprintf(INT32, INT32, unsigned short const *, ...); @@ -737,7 +740,7 @@ template UINT32 mprintf(INT32 x, INT32 y, type3 pFontString, ...) { INT32 destx, desty; -UINT16 *curletter, transletter; +wchar_t *curletter, transletter; va_list argptr; wchar_t string[512]; UINT32 uiDestPitchBYTES; @@ -787,6 +790,8 @@ UINT8 *pDestBuf; template void VarFindFontRightCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, short *, ...); template void VarFindFontRightCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, unsigned short *, ...); +template void VarFindFontRightCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t *, ...); +template void VarFindFontRightCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t const *, ...); template void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT32 iFontIndex, INT16 *psNewX, INT16 *psNewY, type8 pFontString, ... ) { @@ -800,6 +805,8 @@ void VarFindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s FindFontRightCoordinates( sLeft, sTop, sWidth, sHeight, string, iFontIndex, psNewX, psNewY ); } +template void VarFindFontCenterCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t *, ...); +template void VarFindFontCenterCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, wchar_t const*, ...); template void VarFindFontCenterCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, short *, ...); template void VarFindFontCenterCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, unsigned short *, ...); template void VarFindFontCenterCoordinates(INT16, INT16, INT16, INT16, INT32, INT16 *, INT16 *, unsigned short const*, ...); @@ -816,10 +823,12 @@ void VarFindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, string, iFontIndex, psNewX, psNewY ); } +template void FindFontRightCoordinates(INT16, INT16, INT16, INT16, wchar_t *, INT32, unsigned short *, unsigned short *); template void FindFontRightCoordinates(INT16, INT16, INT16, INT16, short *, INT32, unsigned short *, unsigned short *); template void FindFontRightCoordinates(INT16, INT16, INT16, INT16, short *, INT32, short *, unsigned short *); template void FindFontRightCoordinates(INT16, INT16, INT16, INT16, unsigned short *, INT32, short *, short *); template void FindFontRightCoordinates(INT16, INT16, INT16, INT16, unsigned short *, INT32, unsigned short *, unsigned short *); +template void FindFontRightCoordinates(INT16, INT16, INT16, INT16, wchar_t *, INT32, wchar_t *, wchar_t *); template void FindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, string5 pStr, INT32 iFontIndex, string7 psNewX, string8 psNewY ) { @@ -833,10 +842,12 @@ void FindFontRightCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHei *psNewY = yp; } +template void FindFontCenterCoordinates(INT16, INT16, INT16, INT16, wchar_t *, INT32, unsigned short *, unsigned short *); template void FindFontCenterCoordinates(INT16, INT16, INT16, INT16, short *, INT32, unsigned short *, unsigned short *); template void FindFontCenterCoordinates(INT16, INT16, INT16, INT16, unsigned short *, INT32, unsigned short *, unsigned short *); template void FindFontCenterCoordinates(INT16, INT16, INT16, INT16, unsigned short *, INT32, short *, short *); template void FindFontCenterCoordinates(INT16, INT16, INT16, INT16, short *, INT32, short *, short *); +template void FindFontCenterCoordinates(INT16, INT16, INT16, INT16, wchar_t *, INT32, wchar_t *, wchar_t *); template void FindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, string5 pStr, INT32 iFontIndex, string7 psNewX, string8 psNewY ) { @@ -858,10 +869,10 @@ void FindFontCenterCoordinates( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHe // the parameters are identical to printf. The resulting string may be no longer // than 512 word-characters. //***************************************************************************** -UINT32 gprintf(INT32 x, INT32 y, UINT16 *pFontString, ...) +UINT32 gprintf(INT32 x, INT32 y, wchar_t *pFontString, ...) { INT32 destx, desty; -UINT16 *curletter, transletter; +wchar_t *curletter, transletter; va_list argptr; wchar_t string[512]; UINT32 uiDestPitchBYTES; @@ -909,10 +920,10 @@ UINT8 *pDestBuf; return(0); } -UINT32 gprintfDirty(INT32 x, INT32 y, UINT16 *pFontString, ...) +UINT32 gprintfDirty(INT32 x, INT32 y, wchar_t *pFontString, ...) { INT32 destx, desty; -UINT16 *curletter, transletter; +wchar_t *curletter, transletter; va_list argptr; wchar_t string[512]; UINT32 uiDestPitchBYTES; @@ -978,10 +989,10 @@ UINT8 *pDestBuf; // the parameters are identical to printf. The resulting string may be no longer // than 512 word-characters. //***************************************************************************** -UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, UINT16 *pFontString, ...) +UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, wchar_t *pFontString, ...) { INT32 destx, desty; -UINT16 *curletter, transletter; +wchar_t *curletter, transletter; va_list argptr; wchar_t string[512]; @@ -1025,11 +1036,13 @@ wchar_t string[512]; template UINT32 mprintf_buffer(UINT8 *, UINT32, UINT32, INT32, INT32, short *, ...); template UINT32 mprintf_buffer(UINT8 *, UINT32, UINT32, INT32, INT32, unsigned short *, ...); template UINT32 mprintf_buffer(UINT8 *, UINT32, UINT32, INT32, INT32, unsigned short const*, ...); +template UINT32 mprintf_buffer(UINT8 *, UINT32, UINT32, INT32, INT32, wchar_t *, ...); +template UINT32 mprintf_buffer(UINT8 *, UINT32, UINT32, INT32, INT32, wchar_t const*, ...); template UINT32 mprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...) { INT32 destx, desty; -UINT16 *curletter, transletter; +wchar_t *curletter, transletter; va_list argptr; wchar_t string[512]; @@ -1074,7 +1087,7 @@ template UINT32 mprintf_buffer_coded( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...) { INT32 destx, desty; -UINT16 *curletter, transletter; +wchar_t *curletter, transletter; va_list argptr; wchar_t string[512]; UINT16 usOldForeColor; @@ -1131,10 +1144,10 @@ UINT16 usOldForeColor; } -UINT32 mprintf_coded( INT32 x, INT32 y, UINT16 *pFontString, ...) +UINT32 mprintf_coded( INT32 x, INT32 y, wchar_t *pFontString, ...) { INT32 destx, desty; -UINT16 *curletter, transletter; +wchar_t *curletter, transletter; va_list argptr; wchar_t string[512]; UINT16 usOldForeColor; diff --git a/Standard Gaming Platform/Font.h b/Standard Gaming Platform/Font.h index 241786f1..6052c079 100644 --- a/Standard Gaming Platform/Font.h +++ b/Standard Gaming Platform/Font.h @@ -123,11 +123,11 @@ UINT16 *GetFontObjectPalette16BPP(INT32 iFont); void DestroyEnglishTransTable( void ); extern HVOBJECT GetFontObject(INT32 iFont); -extern UINT32 gprintf(INT32 x, INT32 y, UINT16 *pFontString, ...); -extern UINT32 gprintfDirty(INT32 x, INT32 y, UINT16 *pFontString, ...); +extern UINT32 gprintf(INT32 x, INT32 y, wchar_t *pFontString, ...); +extern UINT32 gprintfDirty(INT32 x, INT32 y, wchar_t *pFontString, ...); template extern UINT32 mprintf(INT32 x, INT32 y, type3 pFontString, ...); -extern UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, UINT16 *pFontString, ...); +extern UINT32 gprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, wchar_t *pFontString, ...); template extern UINT32 mprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...); @@ -137,7 +137,7 @@ extern UINT32 mprintf_buffer( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 F template UINT32 mprintf_buffer_coded( UINT8 *pDestBuf, UINT32 uiDestPitchBYTES, UINT32 FontType, INT32 x, INT32 y, string6 pFontString, ...); -UINT32 mprintf_coded( INT32 x, INT32 y, UINT16 *pFontString, ...); +UINT32 mprintf_coded( INT32 x, INT32 y, wchar_t *pFontString, ...); extern BOOLEAN SetFontDestBuffer(UINT32 DestBuffer, INT32 x1, INT32 y1, INT32 x2, INT32 y2, BOOLEAN wrap); @@ -155,12 +155,12 @@ extern FontTranslationTable *CreateEnglishTransTable( ); extern INT16 GetIndex(UINT16 siChar); extern UINT32 GetWidth(HVOBJECT hSrcVObject, INT16 ssIndex); -extern INT16 StringPixLengthArgFastHelp( INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, UINT16 *pFontString ); -extern INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, UINT16 *pFontString, ...); +extern INT16 StringPixLengthArgFastHelp( INT32 usUseFont, INT32 usBoldFont, UINT32 uiCharCount, wchar_t *pFontString ); +extern INT16 StringPixLengthArg(INT32 usUseFont, UINT32 uiCharCount, wchar_t *pFontString, ...); template extern INT16 StringPixLength(type1 string,INT32 UseFont); -extern INT16 StringNPixLength(UINT16 *string, UINT32 uiMaxCount, INT32 UseFont); +extern INT16 StringNPixLength(wchar_t *string, UINT32 uiMaxCount, INT32 UseFont); extern void SaveFontSettings(void); extern void RestoreFontSettings(void); diff --git a/Standard Gaming Platform/WinFont.cpp b/Standard Gaming Platform/WinFont.cpp index 0f97d774..d24857bc 100644 --- a/Standard Gaming Platform/WinFont.cpp +++ b/Standard Gaming Platform/WinFont.cpp @@ -108,7 +108,7 @@ HWINFONT *GetWinFont( INT32 iFont ) } } -UINT16 gzFontName[32]; +wchar_t gzFontName[32]; INT32 CreateWinFont( INT32 iHeight, INT32 iWidth, INT32 iEscapement, INT32 iWeight, BOOLEAN fItalic, BOOLEAN fUnderline, BOOLEAN fStrikeOut, STR16 szFontName, INT32 iCharSet ) @@ -191,7 +191,7 @@ void SetWinFontBackColor( INT32 iFont, COLORVAL *pColor ) } -void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...) +void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...) { va_list argptr; wchar_t string2[512]; @@ -240,7 +240,7 @@ void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, UINT16 *pFon } -INT16 WinFontStringPixLength( UINT16 *string2, INT32 iFont ) +INT16 WinFontStringPixLength( wchar_t *string2, INT32 iFont ) { HWINFONT *pWinFont; HDC hdc; @@ -269,7 +269,7 @@ INT16 WinFontStringPixLength( UINT16 *string2, INT32 iFont ) } -INT16 GetWinFontHeight( UINT16 *string2, INT32 iFont ) +INT16 GetWinFontHeight( wchar_t *string2, INT32 iFont ) { HWINFONT *pWinFont; HDC hdc; @@ -297,7 +297,7 @@ INT16 GetWinFontHeight( UINT16 *string2, INT32 iFont ) return( (INT16)RectSize.cy ); } -UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...) +UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...) { va_list argptr; wchar_t string[512]; diff --git a/Standard Gaming Platform/WinFont.h b/Standard Gaming Platform/WinFont.h index 29f79843..be2efea8 100644 --- a/Standard Gaming Platform/WinFont.h +++ b/Standard Gaming Platform/WinFont.h @@ -11,11 +11,11 @@ void DeleteWinFont( INT32 iFont ); void SetWinFontBackColor( INT32 iFont, COLORVAL *pColor ); void SetWinFontForeColor( INT32 iFont, COLORVAL *pColor ); -void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...); +void PrintWinFont( UINT32 uiDestBuf, INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...); -INT16 WinFontStringPixLength( UINT16 *string, INT32 iFont ); -INT16 GetWinFontHeight( UINT16 *string, INT32 iFont ); -UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, UINT16 *pFontString, ...); +INT16 WinFontStringPixLength( wchar_t *string, INT32 iFont ); +INT16 GetWinFontHeight( wchar_t *string, INT32 iFont ); +UINT32 WinFont_mprintf( INT32 iFont, INT32 x, INT32 y, wchar_t *pFontString, ...); BOOLEAN DoesWinFontExistOnSystem( STR16 pTypeFaceName, INT32 iCharSet ); diff --git a/Standard Gaming Platform/mousesystem.cpp b/Standard Gaming Platform/mousesystem.cpp index b3a56b5b..285adada 100644 --- a/Standard Gaming Platform/mousesystem.cpp +++ b/Standard Gaming Platform/mousesystem.cpp @@ -1234,6 +1234,8 @@ void RefreshMouseRegions( ) } +template void SetRegionFastHelpText(MOUSE_REGION *, wchar_t *); +template void SetRegionFastHelpText(MOUSE_REGION *, wchar_t const*); template void SetRegionFastHelpText(MOUSE_REGION *, short *); template void SetRegionFastHelpText(MOUSE_REGION *, unsigned short *); template void SetRegionFastHelpText(MOUSE_REGION *, unsigned short const*); @@ -1257,7 +1259,7 @@ void SetRegionFastHelpText( MOUSE_REGION *region, type2 szText ) return; //blank (or clear) // Allocate memory for the button's FastHelp text string... - region->FastHelpText = (UINT16*)MemAlloc( (wcslen( (wchar_t *)szText ) + 1) * sizeof(UINT16) ); + region->FastHelpText = (wchar_t*)MemAlloc( (wcslen( (wchar_t *)szText ) + 1) * sizeof(wchar_t) ); Assert( region->FastHelpText ); wcscpy( region->FastHelpText, szText ); diff --git a/Standard Gaming Platform/mousesystem.h b/Standard Gaming Platform/mousesystem.h index 2aa53e8c..c6254450 100644 --- a/Standard Gaming Platform/mousesystem.h +++ b/Standard Gaming Platform/mousesystem.h @@ -54,7 +54,7 @@ typedef struct _MOUSE_REGION { //Fast help vars. INT16 FastHelpTimer; // Countdown timer for FastHelp text - UINT16 *FastHelpText; // Text string for the FastHelp (describes buttons if left there a while) + wchar_t *FastHelpText; // Text string for the FastHelp (describes buttons if left there a while) INT32 FastHelpRect; MOUSE_HELPTEXT_DONE_CALLBACK HelpDoneCallback; diff --git a/Strategic/AI Viewer.cpp b/Strategic/AI Viewer.cpp index 9591d7ba..9367db57 100644 --- a/Strategic/AI Viewer.cpp +++ b/Strategic/AI Viewer.cpp @@ -223,7 +223,7 @@ UINT16 gwGroupTypeString[ NUM_ENEMY_INTENTIONS ][ 20 ] = }; -void StringFromValue( UINT16 *str, INT32 iValue, UINT32 uiMax ) +void StringFromValue( wchar_t *str, INT32 iValue, UINT32 uiMax ) { if( iValue < 0 ) //a blank string is determined by a negative value. str[0] = '\0'; @@ -236,7 +236,7 @@ void StringFromValue( UINT16 *str, INT32 iValue, UINT32 uiMax ) BOOLEAN CreateAIViewer() { VOBJECT_DESC VObjectDesc; - UINT16 str[6]; + wchar_t str[6]; //Kaiden: Loading INI file to read Values... // Here's another one of those INI reads @@ -447,7 +447,7 @@ void RenderStationaryGroups() HVOBJECT hVObject; SECTORINFO *pSector; INT32 x, y, xp, yp; - UINT16 str[20]; + wchar_t str[20]; INT32 iSector = 0; UINT8 ubIconColor; UINT8 ubGroupSize = 0; @@ -851,7 +851,7 @@ void RenderViewer() } for( x = 1; x <= 16; x++ ) { - UINT16 str[3]; + wchar_t str[3]; if( x == gsSelSectorX ) SetFontForeground( FONT_RED ); else if( x == gsHiSectorX ) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 41b4f5c6..924909f2 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -7078,7 +7078,7 @@ void ContractMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) } else { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)gzLateLocalizedString[ 48 ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, MercDismissConfirmCallBack ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, gzLateLocalizedString[ 48 ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, MercDismissConfirmCallBack ); } fOkToClose = TRUE; diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index 43fd8578..2e862fdc 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -1654,7 +1654,7 @@ void RenderAutoResolve() INT32 xp, yp; SOLDIERCELL *pCell = NULL; INT32 index = 0; - UINT16 str[100]; + wchar_t str[100]; UINT8 bTownId = 0; UINT8 ubGood, ubBad; @@ -3293,8 +3293,8 @@ void RenderSoldierCellHealth( SOLDIERCELL *pCell ) { INT32 cnt, cntStart; INT32 xp, yp; - UINT16 *pStr; - UINT16 str[20]; + wchar_t *pStr; + wchar_t str[20]; UINT8 *pDestBuf, *pSrcBuf; UINT32 uiSrcPitchBYTES, uiDestPitchBYTES; UINT16 usColor; diff --git a/Strategic/Creature Spreading.cpp b/Strategic/Creature Spreading.cpp index 9c59f59b..3c4ac40c 100644 --- a/Strategic/Creature Spreading.cpp +++ b/Strategic/Creature Spreading.cpp @@ -407,7 +407,7 @@ void InitCreatureQuest() default: #ifdef JA2BETAVERSION { - UINT16 str[512]; + wchar_t str[512]; swprintf( str, L"Creature quest never chose a lair and won't infect any mines. Infectible mines = %d, iRandom = %d. " L"This isn't a bug if you are not receiving income from any mines.", iNumMinesInfectible, iOrigRandom ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL ); diff --git a/Strategic/Game Clock.cpp b/Strategic/Game Clock.cpp index ee0a37a6..7982f0bd 100644 --- a/Strategic/Game Clock.cpp +++ b/Strategic/Game Clock.cpp @@ -82,7 +82,7 @@ INT32 iPausedPopUpBox = -1; UINT32 guiDay; UINT32 guiHour; UINT32 guiMin; -UINT16 gswzWorldTimeStr[20]; +wchar_t gswzWorldTimeStr[20]; INT32 giTimeCompressSpeeds[ NUM_TIME_COMPRESS_SPEEDS ] = { 0, 1, 5 * 60, 30 * 60, 60 * 60 }; UINT16 usPausedActualWidth; UINT16 usPausedActualHeight; diff --git a/Strategic/Game Clock.h b/Strategic/Game Clock.h index a586b9dc..6d96aa8c 100644 --- a/Strategic/Game Clock.h +++ b/Strategic/Game Clock.h @@ -123,7 +123,7 @@ void AdvanceToNextDay(); void UpdateClock(); -extern UINT16 gswzWorldTimeStr[ 20 ]; //Day 99, 23:55 +extern wchar_t gswzWorldTimeStr[ 20 ]; //Day 99, 23:55 extern UINT32 guiDay; extern UINT32 guiHour; diff --git a/Strategic/Map Screen Interface Bottom.cpp b/Strategic/Map Screen Interface Bottom.cpp index 11bf4b50..a08d6156 100644 --- a/Strategic/Map Screen Interface Bottom.cpp +++ b/Strategic/Map Screen Interface Bottom.cpp @@ -1618,7 +1618,7 @@ void RequestTriggerExitFromMapscreen( INT8 bExitToWhere ) if( !CanGameBeSaved() ) { //Display a message saying the player cant save now - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); return; } } diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 9cf57e2f..59af9b4f 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -463,7 +463,7 @@ void UpdateHelpTextForInvnentoryStashSlots( void ) { if( pInventoryPoolList[ iCounter + iFirstSlotOnPage ].o.ubNumberOfObjects > 0 ) { - GetHelpTextForItem( (INT16 *)pStr , &( pInventoryPoolList[ iCounter + iFirstSlotOnPage ].o ), NULL ); + GetHelpTextForItem( pStr , &( pInventoryPoolList[ iCounter + iFirstSlotOnPage ].o ), NULL ); SetRegionFastHelpText( &(MapInventoryPoolSlots[ iCounter ] ), pStr ); /* @@ -836,7 +836,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) if ( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].o.usItem != NOTHING ) { // not reachable - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)gzLateLocalizedString[38], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, gzLateLocalizedString[38], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); return; } } @@ -847,7 +847,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) // valid character? if( gCharactersList[ bSelectedInfoChar ].fValid == FALSE ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapInventoryErrorString[ 1 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 1 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); return; } @@ -869,7 +869,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) { swprintf( sString, pMapInventoryErrorString[ 5 ], Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ].name ); } - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); return; } } @@ -888,7 +888,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) // if( ( ( gTacticalStatus.fEnemyInSector ) ||( ( sSelMapX == gWorldSectorX ) && ( sSelMapY == gWorldSectorY ) && ( iCurrentMapSectorZ == gbWorldSectorZ ) && ( gTacticalStatus.uiFlags & INCOMBAT ) ) ) ) if( !CanPlayerUseSectorInventory( &Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ] ) ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapInventoryErrorString[ 3 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 3 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); return; } @@ -921,7 +921,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) // if( ( gTacticalStatus.fEnemyInSector ) ||( ( sSelMapX == gWorldSectorX ) && ( sSelMapY == gWorldSectorY ) && ( iCurrentMapSectorZ == gbWorldSectorZ ) && ( gTacticalStatus.uiFlags & INCOMBAT ) ) ) if( !CanPlayerUseSectorInventory( &Menptr[ gCharactersList[ bSelectedInfoChar ].usSolID ] ) ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapInventoryErrorString[ 4 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapInventoryErrorString[ 4 ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); return; } diff --git a/Strategic/Map Screen Interface.cpp b/Strategic/Map Screen Interface.cpp index 12cf4b05..57c186de 100644 --- a/Strategic/Map Screen Interface.cpp +++ b/Strategic/Map Screen Interface.cpp @@ -1149,14 +1149,14 @@ void ActivateSoldierPopup( SOLDIERTYPE *pSoldier, UINT8 ubPopupType, INT16 xp, I -INT32 DoMapMessageBoxWithRect( UINT8 ubStyle, INT16 *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) +INT32 DoMapMessageBoxWithRect( UINT8 ubStyle, wchar_t *zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect ) { // reset the highlighted line giHighLine = -1; return DoMessageBox( ubStyle, zString, uiExitScreen, ( UINT16 ) ( usFlags | MSG_BOX_FLAG_USE_CENTERING_RECT ), ReturnCallback, pCenteringRect ); } -INT32 DoMapMessageBox( UINT8 ubStyle, INT16 * zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) +INT32 DoMapMessageBox( UINT8 ubStyle, wchar_t * zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { // WANNE 2 SGPRect CenteringRect= {0, 0, SCREEN_WIDTH, INV_INTERFACE_START_Y }; @@ -6142,11 +6142,11 @@ void ReportMapScreenMovementError( INT8 bErrorNumber ) if ( bErrorNumber == -99 ) { // - 99 is a special message # indicating a customized message - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)gsCustomErrorString, MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, gsCustomErrorString, MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } else { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapErrorString[ bErrorNumber ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapErrorString[ bErrorNumber ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } } diff --git a/Strategic/Map Screen Interface.h b/Strategic/Map Screen Interface.h index bafe7b55..6369e294 100644 --- a/Strategic/Map Screen Interface.h +++ b/Strategic/Map Screen Interface.h @@ -391,7 +391,7 @@ void EnableTeamInfoPanels( void ); void ActivateSoldierPopup( SOLDIERTYPE *pSoldier, UINT8 ubPopupType, INT16 xp, INT16 yp ); // do mapscreen message box -INT32 DoMapMessageBox( UINT8 ubStyle, INT16 * zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); +INT32 DoMapMessageBox( UINT8 ubStyle, wchar_t * zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ); // hop up one leve,l int he map screen level interface void GoUpOneLevelInMap( void ); diff --git a/Strategic/Meanwhile.cpp b/Strategic/Meanwhile.cpp index acda0bb5..5c72c504 100644 --- a/Strategic/Meanwhile.cpp +++ b/Strategic/Meanwhile.cpp @@ -350,7 +350,7 @@ BOOLEAN BeginMeanwhile( UINT8 ubMeanwhileID ) void BringupMeanwhileBox( ) { - INT16 zStr[256]; + wchar_t zStr[256]; #ifdef JA2TESTVERSION swprintf( (wchar_t *)zStr, (wchar_t *)L"Meanwhile..... ( %S : Remember to make sure towns are controlled if required by script )", gzMeanwhileStr[ gCurrentMeanwhileDef.ubMeanwhileID ] ); diff --git a/Strategic/Merc Contract.cpp b/Strategic/Merc Contract.cpp index 7bb358a2..1439946f 100644 --- a/Strategic/Merc Contract.cpp +++ b/Strategic/Merc Contract.cpp @@ -1138,11 +1138,11 @@ void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldi if( fInSector == FALSE ) { // set up for mapscreen - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)sString, MAP_SCREEN, ( UINT16 )( ( fAddRehireButton ? MSG_BOX_FLAG_GENERICCONTRACT : MSG_BOX_FLAG_GENERIC ) ), MercDepartEquipmentBoxCallBack ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, ( UINT16 )( ( fAddRehireButton ? MSG_BOX_FLAG_GENERICCONTRACT : MSG_BOX_FLAG_GENERIC ) ), MercDepartEquipmentBoxCallBack ); } else { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)sString, MAP_SCREEN, ( UINT16 )( ( fAddRehireButton ? MSG_BOX_FLAG_OKCONTRACT : MSG_BOX_FLAG_OK ) ), MercDepartEquipmentBoxCallBack ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, ( UINT16 )( ( fAddRehireButton ? MSG_BOX_FLAG_OKCONTRACT : MSG_BOX_FLAG_OK ) ), MercDepartEquipmentBoxCallBack ); } } diff --git a/Strategic/PreBattle Interface.cpp b/Strategic/PreBattle Interface.cpp index 94f038de..5892f73c 100644 --- a/Strategic/PreBattle Interface.cpp +++ b/Strategic/PreBattle Interface.cpp @@ -89,7 +89,7 @@ void AutoResolveBattleCallback( GUI_BUTTON *btn, INT32 reason ); void GoToSectorCallback( GUI_BUTTON *btn, INT32 reason ); void RetreatMercsCallback( GUI_BUTTON *btn, INT32 reason ); -void GetSoldierConditionInfo( SOLDIERTYPE *pSoldier, UINT16 *szCondition, UINT8 *pubHPPercent, UINT8 *pubBPPercent ); +void GetSoldierConditionInfo( SOLDIERTYPE *pSoldier, wchar_t *szCondition, UINT8 *pubHPPercent, UINT8 *pubBPPercent ); void CheckForRobotAndIfItsControlled( void ); @@ -213,7 +213,7 @@ void ValidateAndCorrectInBattleCounters( GROUP *pLocGroup ) if( ubInvalidGroups || pSector->ubAdminsInBattle || pSector->ubTroopsInBattle || pSector->ubElitesInBattle || pSector->ubCreaturesInBattle ) { - UINT16 str[ 512 ]; + wchar_t str[ 512 ]; swprintf( str, L"Strategic info warning: Sector 'in battle' counters are not clear when they should be. " L"If you can provide information on how a previous battle was resolved here or nearby patrol " L"(auto resolve, tactical battle, cheat keys, or retreat)," @@ -904,7 +904,7 @@ void KillPreBattleInterface() void RenderPBHeader( INT32 *piX, INT32 *piWidth) { - UINT16 str[100]; + wchar_t str[100]; INT32 x, width; SetFont( FONT10ARIALBOLD ); if( gfBlinkHeader ) @@ -967,8 +967,8 @@ void RenderPreBattleInterface() GROUP *pGroup; HVOBJECT hVObject; INT32 i, x, y, line, width; - UINT16 str[100]; - UINT16 pSectorName[ 128 ]; + wchar_t str[100]; + wchar_t pSectorName[ 128 ]; UINT8 ubHPPercent, ubBPPercent; BOOLEAN fMouseInRetreatButtonArea; UINT8 ubJunk; @@ -1417,7 +1417,7 @@ enum COND_DEAD }; -void GetSoldierConditionInfo( SOLDIERTYPE *pSoldier, UINT16 *szCondition, UINT8 *pubHPPercent, UINT8 *pubBPPercent ) +void GetSoldierConditionInfo( SOLDIERTYPE *pSoldier, wchar_t *szCondition, UINT8 *pubHPPercent, UINT8 *pubBPPercent ) { Assert( pSoldier ); *pubHPPercent = (UINT8)(pSoldier->bLife * 100 / pSoldier->bLifeMax); diff --git a/Strategic/Queen Command.cpp b/Strategic/Queen Command.cpp index b11bb590..eebdceb4 100644 --- a/Strategic/Queen Command.cpp +++ b/Strategic/Queen Command.cpp @@ -81,7 +81,7 @@ void ValidateEnemiesHaveWeapons() // do message box and return if( iNumInvalid ) { - UINT16 str[ 100 ]; + wchar_t str[ 100 ]; swprintf( str, L"%d enemies have been added without any weapons! KM:0. Please note sector.", iNumInvalid ); iErrorDialog = DoMessageBox( MSG_BOX_BASIC_STYLE, str, GAME_SCREEN, MSG_BOX_FLAG_OK, NULL, &CenteringRect ); } @@ -713,7 +713,7 @@ void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier ) { INT32 iNumEnemiesInSector; SECTORINFO *pSector; -// UINT16 str[128]; +// wchar_t str[128]; INT32 iMaxEnemyGroupSize = gGameExternalOptions.iMaxEnemyGroupSize; DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand"); @@ -766,7 +766,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand"); if( !pGroup ) { #ifdef JA2BETAVERSION - UINT16 str[256]; + wchar_t str[256]; swprintf( str, L"Enemy soldier killed with ubGroupID of %d, and the group doesn't exist!", pSoldier->ubGroupID ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL ); #endif @@ -775,7 +775,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"QueenCommand"); if( pGroup->fPlayer ) { #ifdef JA2BETAVERSION - UINT16 str[256]; + wchar_t str[256]; swprintf( str, L"Attempting to process player group thinking it's an enemy group in ProcessQueenCmdImplicationsOfDeath()", pSoldier->ubGroupID ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL ); #endif diff --git a/Strategic/Quest Debug System.cpp b/Strategic/Quest Debug System.cpp index e057ffe0..772228d8 100644 --- a/Strategic/Quest Debug System.cpp +++ b/Strategic/Quest Debug System.cpp @@ -626,7 +626,7 @@ void ChangeFactState( INT32 iNumber ); void DisplayCurrentGridNo(); void EnableQDSButtons(); -BOOLEAN DoQDSMessageBox( UINT8 ubStyle, INT16 * zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ); +BOOLEAN DoQDSMessageBox( UINT8 ubStyle, wchar_t * zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ); void IncrementActiveDropDownBox( INT16 sIncrementValue ); INT16 IsMercInTheSector( UINT16 usMercID ); void RefreshAllNPCInventory(); @@ -1038,7 +1038,7 @@ BOOLEAN EnterQuestDebugSystem() if( giHaveSelectedNPC != -1 ) { - UINT16 zItemDesc[ SIZE_ITEM_INFO ]; + wchar_t zItemDesc[ SIZE_ITEM_INFO ]; if( gfUseLocalNPCs ) swprintf( zItemDesc, L"%d - %s", gubCurrentNpcInSector[ giHaveSelectedNPC ], gMercProfiles[ gubCurrentNpcInSector[ giHaveSelectedNPC ] ].zNickname ); @@ -1053,8 +1053,8 @@ BOOLEAN EnterQuestDebugSystem() if( giHaveSelectedItem != -1 ) { - UINT16 zItemName[ SIZE_ITEM_NAME ]; - UINT16 zItemDesc[ SIZE_ITEM_INFO ]; + wchar_t zItemName[ SIZE_ITEM_NAME ]; + wchar_t zItemDesc[ SIZE_ITEM_INFO ]; wcscpy( zItemName, ShortItemNames[ giHaveSelectedItem ] ); @@ -1388,7 +1388,7 @@ void GetUserInput() // toggle whether dropped items are damaged or not gfDropDamagedItems ^= 1; swprintf( zTemp, L"Items dropped will be in %s condition", gfDropDamagedItems ? L"DAMAGED" : L"PERFECT" ); - DoQDSMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zTemp, QUEST_DEBUG_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoQDSMessageBox( MSG_BOX_BASIC_STYLE, zTemp, QUEST_DEBUG_SCREEN, MSG_BOX_FLAG_OK, NULL ); } break; } @@ -2045,8 +2045,8 @@ void DisplaySelectedItem() UINT16 i; UINT16 usPosX, usPosY; UINT16 usFontHeight = GetFontHeight( QUEST_DBS_FONT_LISTBOX_TEXT ) + 2; - UINT16 zItemName[ SIZE_ITEM_NAME ]; -// UINT16 zItemDesc[ SIZE_ITEM_INFO ]; + wchar_t zItemName[ SIZE_ITEM_NAME ]; +// wchar_t zItemDesc[ SIZE_ITEM_INFO ]; wchar_t zButtonName[ 256 ]; @@ -2661,7 +2661,7 @@ void BtnQuestDebugNPCRefreshButtonButtonCallback(GUI_BUTTON *btn,INT32 reason) swprintf( zTemp, L"%s %s", QuestDebugText[ QUEST_DBS_REFRESH_FAILED ], gMercProfiles[ ubMercID ].zNickname ); } - DoQDSMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zTemp, QUEST_DEBUG_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoQDSMessageBox( MSG_BOX_BASIC_STYLE, zTemp, QUEST_DEBUG_SCREEN, MSG_BOX_FLAG_OK, NULL ); btn->uiFlags &= (~BUTTON_CLICKED_ON ); InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY); @@ -3120,8 +3120,8 @@ void CreateDestroyDisplayNPCInventoryPopup( UINT8 ubAction ) case QD_DROP_DOWN_DISPLAY: { - UINT16 zItemName[ SIZE_ITEM_NAME ]; -// UINT16 zItemDesc[ SIZE_ITEM_INFO ]; + wchar_t zItemName[ SIZE_ITEM_NAME ]; +// wchar_t zItemDesc[ SIZE_ITEM_INFO ]; UINT16 usFontHeight = GetFontHeight( QUEST_DBS_FONT_LISTBOX_TEXT ) + 2; @@ -3565,7 +3565,7 @@ void EnableQDSButtons() */ } -BOOLEAN DoQDSMessageBox( UINT8 ubStyle, INT16 * zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ) +BOOLEAN DoQDSMessageBox( UINT8 ubStyle, wchar_t * zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ) { SGPRect pCenteringRect= {0, 0, 639, 479 }; @@ -3706,7 +3706,7 @@ void StartMercTalkingFromQuoteNum( INT32 iQuoteToStartTalkingFrom ) if( iQuoteToStartTalkingFrom < 0 || iQuoteToStartTalkingFrom > uiMaxNumberOfQuotes ) { swprintf( zTemp, L"Please enter a value between 0 and %d", uiMaxNumberOfQuotes ); - DoQDSMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zTemp, QUEST_DEBUG_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoQDSMessageBox( MSG_BOX_BASIC_STYLE, zTemp, QUEST_DEBUG_SCREEN, MSG_BOX_FLAG_OK, NULL ); } else { diff --git a/Strategic/Strategic AI.cpp b/Strategic/Strategic AI.cpp index 726c9b88..24014eb1 100644 --- a/Strategic/Strategic AI.cpp +++ b/Strategic/Strategic AI.cpp @@ -707,7 +707,7 @@ void ValidatePendingGroups() } if( iErrorsForInvalidPendingGroup ) { - UINT16 str[256]; + wchar_t str[256]; swprintf( str, L"Strategic AI: Internal error -- %d pending groups were discovered to be invalid. Please report error and send save." L"You can continue playing, as this has been auto-corrected. No need to send any debug files.", iErrorsForInvalidPendingGroup ); SAIReportError( str ); @@ -742,7 +742,7 @@ void ValidateWeights( INT32 iID ) if( giReinforcementPoints != iSumReinforcementPoints || giRequestPoints != iSumRequestPoints ) { - UINT16 str[256]; + wchar_t str[256]; swprintf( str, L"Strategic AI: Internal error #%02d (total request/reinforcement points). Please report error including error#. " L"You can continue playing, as the points have been auto-corrected. No need to send any save/debug files.", iID ); //Correct the misalignment. @@ -770,7 +770,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic2"); { #ifdef JA2BETAVERSION { - UINT16 str[256]; + wchar_t str[256]; swprintf( str, L"Strategic AI: Internal error (invalid enemy group #%d location at %c%d, destination %c%d). Please send PRIOR save file and Strategic Decisions.txt.", pGroup->ubGroupID, pGroup->ubSectorY + 'A' - 1, pGroup->ubSectorX, pGroup->ubNextY + 'A' - 1, pGroup->ubNextX ); SAIReportError( str ); @@ -811,7 +811,7 @@ void ValidateLargeGroup( GROUP *pGroup ) #ifdef JA2BETAVERSION if( pGroup->ubGroupSize > 25 ) { - UINT16 str[ 512 ]; + wchar_t str[ 512 ]; swprintf( str, L"Strategic AI warning: Enemy group containing %d soldiers " L"(%d admins, %d troops, %d elites) in sector %c%d. This message is a temporary test message " L"to evaluate a potential problems with very large enemy groups.", @@ -868,7 +868,7 @@ void ValidatePlayersAreInOneGroupOnly() GROUP *pGroup, *pOtherGroup; PLAYERGROUP *pPlayer; SOLDIERTYPE *pSoldier; - UINT16 str[ 1024 ]; + wchar_t str[ 1024 ]; UINT8 ubGroupID; //Go through each merc slot in the player team iNumErrors = 0; @@ -2090,7 +2090,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Strategic5"); { UINT8 ubCut; #ifdef JA2BETAVERSION - UINT16 str[512]; + wchar_t str[512]; swprintf( str, L"Patrol group #%d in %c%d received too many reinforcements from group #%d that was created in %c%d. Size truncated from %d to %d." L"Please send Strategic Decisions.txt and PRIOR save.", pPatrolGroup->ubGroupID, pPatrolGroup->ubSectorY + 'A' - 1, pPatrolGroup->ubSectorX, diff --git a/Strategic/Strategic Movement.cpp b/Strategic/Strategic Movement.cpp index 49065614..47ff6fd3 100644 --- a/Strategic/Strategic Movement.cpp +++ b/Strategic/Strategic Movement.cpp @@ -698,7 +698,7 @@ GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmin #ifdef JA2BETAVERSION { - UINT16 str[ 512 ]; + wchar_t str[ 512 ]; if( PlayerMercsInSector( pNew->ubSectorX, pNew->ubSectorY, 0 ) || CountAllMilitiaInSector( pNew->ubSectorX, pNew->ubSectorY ) ) { swprintf( str, L"Attempting to send enemy troops from player occupied location. " @@ -1150,7 +1150,7 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup ) if( GetTownIdForSector( pGroup->ubSectorX, pGroup->ubSectorY ) == BLANK_SECTOR) { -// UINT16 str[ 256 ]; +// wchar_t str[ 256 ]; // UINT16 uiSectorC = L'A' + pGroup->ubSectorY - 1; // swprintf( str, gpStrategicString[ STR_DIALOG_ENEMIES_ATTACK_MILITIA ], uiSectorC, pGroup->ubSectorX ); // DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, TriggerPrebattleInterface ); @@ -1159,8 +1159,8 @@ BOOLEAN CheckConditionsForBattle( GROUP *pGroup ) } else { - UINT16 str[ 256 ]; - UINT16 pSectorStr[ 128 ]; + wchar_t str[ 256 ]; + wchar_t pSectorStr[ 128 ]; GetSectorIDString( pGroup->ubSectorX, pGroup->ubSectorY, pGroup->ubSectorZ , pSectorStr, TRUE ); swprintf( str, gpStrategicString[ STR_DIALOG_ENEMIES_ATTACK_UNCONCIOUSMERCS ], pSectorStr ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, TriggerPrebattleInterface ); @@ -2228,8 +2228,8 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup ) if( ubNumNearbyGroups ) { //postpone the battle until the user answers the dialog. - UINT16 str[255]; - UINT16 *pStr, *pEnemyType; + wchar_t str[255]; + wchar_t *pStr, *pEnemyType; InterruptTime(); PauseGame(); LockPauseState( 13 ); @@ -2264,7 +2264,7 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup ) //Kris August 03, 1999 Bug fix: Changed 1st line to 2nd line to fix game breaking if this dialog came up while in tactical. // It would kick you to mapscreen, where things would break... //DoMapMessageBox( MSG_BOX_BASIC_STYLE, str, MAP_SCREEN, MSG_BOX_FLAG_YESNO, PlanSimultaneousGroupArrivalCallback ); - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)str, guiCurrentScreen, MSG_BOX_FLAG_YESNO, PlanSimultaneousGroupArrivalCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, str, guiCurrentScreen, MSG_BOX_FLAG_YESNO, PlanSimultaneousGroupArrivalCallback ); gfWaitingForInput = TRUE; return TRUE; @@ -4488,7 +4488,7 @@ void AddFuelToVehicle( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle ) if( !Item[pItem->usItem].gascan ) { #ifdef JA2BETAVERSION - UINT16 str[ 100 ]; + wchar_t str[ 100 ]; swprintf( str, L"%s is supposed to have gas can in hand. ATE:0", pSoldier->name ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL ); #endif @@ -4519,7 +4519,7 @@ void AddFuelToVehicle( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle ) void ReportVehicleOutOfGas( INT32 iVehicleID, UINT8 ubSectorX, UINT8 ubSectorY ) { - UINT16 str[255]; + wchar_t str[255]; //Report that the vehicle that just arrived is out of gas. swprintf( str, gzLateLocalizedString[ 5 ], pVehicleStrings[ pVehicleList[ iVehicleID ].ubVehicleType ], @@ -4747,8 +4747,8 @@ BOOLEAN TestForBloodcatAmbush( GROUP *pGroup ) void NotifyPlayerOfBloodcatBattle( UINT8 ubSectorX, UINT8 ubSectorY ) { - UINT16 str[ 256 ]; - UINT16 zTempString[ 128 ]; + wchar_t str[ 256 ]; + wchar_t zTempString[ 128 ]; if( gubEnemyEncounterCode == BLOODCAT_AMBUSH_CODE ) { GetSectorIDString( ubSectorX, ubSectorY, 0, zTempString, TRUE ); @@ -5149,7 +5149,7 @@ void ValidateGroups( GROUP *pGroup ) if( !pGroup->fPlayer && !pGroup->ubGroupSize ) { //report error - UINT16 str[ 512 ]; + wchar_t str[ 512 ]; if( pGroup->ubSectorIDOfLastReassignment == 255 ) { swprintf( str, L"Enemy group found with 0 troops in it. This is illegal and group will be deleted." diff --git a/Strategic/Strategic Town Loyalty.cpp b/Strategic/Strategic Town Loyalty.cpp index 3e45ee6a..138eb3ee 100644 --- a/Strategic/Strategic Town Loyalty.cpp +++ b/Strategic/Strategic Town Loyalty.cpp @@ -1550,8 +1550,8 @@ void AdjustLoyaltyForCivsEatenByMonsters( INT16 sSectorX, INT16 sSectorY, UINT8 { INT8 bTownId = 0; UINT32 uiLoyaltyChange = 0; - UINT16 str[256]; - UINT16 pSectorString[128]; + wchar_t str[256]; + wchar_t pSectorString[128]; // get town id diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp index 5ce3c646..a86e5ba8 100644 --- a/Strategic/Town Militia.cpp +++ b/Strategic/Town Militia.cpp @@ -647,17 +647,17 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia2"); // if we are in mapscreen, make a pop up if( guiCurrentScreen == MAP_SCREEN ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)sString, MAP_SCREEN, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback ); } else { - DoMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)sString, GAME_SCREEN, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback, &pCenteringRect ); + DoMessageBox( MSG_BOX_BASIC_STYLE, sString, GAME_SCREEN, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback, &pCenteringRect ); } return; } -void DoContinueMilitiaTrainingMessageBox( INT16 sSectorX, INT16 sSectorY, UINT16 *str, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) +void DoContinueMilitiaTrainingMessageBox( INT16 sSectorX, INT16 sSectorY, wchar_t *str, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback ) { if( sSectorX <= 10 && sSectorY >= 6 && sSectorY <= 11 ) { @@ -780,7 +780,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia3"); // ask player whether he'd like to continue training //DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback ); - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)sString, MAP_SCREEN, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_YESNO, PayMilitiaTrainingYesNoBoxCallback ); } @@ -821,7 +821,7 @@ void PayMilitiaTrainingYesNoBoxCallback( UINT8 bExitValue ) StopTimeCompression(); swprintf( sString, L"%s", pMilitiaConfirmStrings[ 2 ] ); - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)sString, MAP_SCREEN, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback ); } } else if( bExitValue == MSG_BOX_RETURN_NO ) @@ -1456,9 +1456,9 @@ BOOLEAN MilitiaTrainingAllowedInTown( INT8 bTownId ) return( gfMilitiaAllowedInTown[bTownId] ); } -void BuildMilitiaPromotionsString( UINT16 *str ) +void BuildMilitiaPromotionsString( wchar_t *str ) { - UINT16 pStr[256]; + wchar_t pStr[256]; BOOLEAN fAddSpace = FALSE; swprintf( str, L"" ); diff --git a/Strategic/Town Militia.h b/Strategic/Town Militia.h index 9735ca00..42f4b4f9 100644 --- a/Strategic/Town Militia.h +++ b/Strategic/Town Militia.h @@ -37,7 +37,7 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI // this will check for promotions and handle them for you UINT8 CheckOneMilitiaForPromotion(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT8 ubRecentKillPts); -void BuildMilitiaPromotionsString( UINT16 *str ); +void BuildMilitiaPromotionsString( wchar_t *str ); // call this if the player attacks his own militia void HandleMilitiaDefections(INT16 sMapX, INT16 sMapY); diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index fe05b6ae..1f4e13dc 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -3528,7 +3528,7 @@ UINT32 MapScreenHandle(void) RenderTeamRegionBackground( ); // now do the warning box - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapErrorString[ 4 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapErrorString[ 4 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } @@ -4917,7 +4917,7 @@ UINT32 HandleMapUI( ) else { // no strategic movement is possible from underground sectors - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapErrorString[ 1 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapErrorString[ 1 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); return( MAP_SCREEN ); } } @@ -5732,7 +5732,7 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent ) else { //Display a message saying the player cant save now - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, zNewTacticalMessages[ TCTL_MSG__IRON_MAN_CANT_SAVE_NOW ], MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); } } } @@ -6622,7 +6622,7 @@ void PollRightButtonInMapView( UINT32 *puiNewEvent ) -void PopupText( UINT16 *pFontString, ... ) +void PopupText( wchar_t *pFontString, ... ) { UINT8 *pDestBuf; UINT32 uiDestPitchBYTES; @@ -9841,11 +9841,11 @@ void TrashCanBtnCallback( MOUSE_REGION *pRegion, INT32 iReason) // set up for mapscreen if( gpItemPointer -> ubMission ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pTrashItemText[ 1 ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, TrashItemMessageBoxCallBack ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pTrashItemText[ 1 ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, TrashItemMessageBoxCallBack ); } else { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pTrashItemText[ 0 ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, TrashItemMessageBoxCallBack ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pTrashItemText[ 0 ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, TrashItemMessageBoxCallBack ); } } } @@ -10830,17 +10830,17 @@ void TellPlayerWhyHeCantCompressTime( void ) else if( gfAtLeastOneMercWasHired == FALSE ) { // no mercs hired, ever - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapScreenJustStartedHelpText[ 0 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapScreenJustStartedHelpText[ 0 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } else if ( !AnyUsableRealMercenariesOnTeam() ) { // no usable mercs left on team - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pMapErrorString[ 39 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMapErrorString[ 39 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } else if ( ActiveTimedBombExists() ) { // can't time compress when a bomb is about to go off! - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)gzLateLocalizedString[ 2 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, gzLateLocalizedString[ 2 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } else if ( gfContractRenewalSquenceOn ) { @@ -10868,7 +10868,7 @@ void TellPlayerWhyHeCantCompressTime( void ) } else if( fShowMapInventoryPool ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)gzLateLocalizedString[ 55 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, gzLateLocalizedString[ 55 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } // ARM: THIS TEST SHOULD BE THE LAST ONE, BECAUSE IT ACTUALLY RESULTS IN SOMETHING HAPPENING NOW. // KM: Except if we are in a creature lair and haven't loaded the sector yet (no battle yet) @@ -10876,11 +10876,11 @@ void TellPlayerWhyHeCantCompressTime( void ) { if( OnlyHostileCivsInSector() ) { - UINT16 str[ 256 ]; - UINT16 pSectorString[ 128 ]; + wchar_t str[ 256 ]; + wchar_t pSectorString[ 128 ]; GetSectorIDString( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, pSectorString, TRUE ); swprintf( str, gzLateLocalizedString[ 27 ], pSectorString ); - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)str, MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, str, MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } else { @@ -10890,7 +10890,7 @@ void TellPlayerWhyHeCantCompressTime( void ) } else if( PlayerGroupIsInACreatureInfestedMine() ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)gzLateLocalizedString[ 28 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, gzLateLocalizedString[ 28 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } } @@ -12181,7 +12181,7 @@ BOOLEAN RequestGiveSkyriderNewDestination( void ) ( GetNumberOfPassengersInHelicopter() == 0 ) && ( PlayerMercsInHelicopterSector() > 0 ) ) { - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)pSkyriderText[ 6 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pSkyriderText[ 6 ], MAP_SCREEN, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); gfSkyriderEmptyHelpGiven = TRUE; return( FALSE ); } @@ -12602,7 +12602,7 @@ void HandlePostAutoresolveMessages() } else if( gbMilitiaPromotions ) { - UINT16 str[ 512 ]; + wchar_t str[ 512 ]; BuildMilitiaPromotionsString( str ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, MapScreenDefaultOkBoxCallback ); } diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index c27cd47a..bff92efe 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -1313,7 +1313,7 @@ void EndLoadScreen( ) #ifdef JA2TESTVERSION //Report the time it took to load the map. This is temporary until we are satisfied with the time //it takes to load the map. - UINT16 str[60]; + wchar_t str[60]; FILE *fp; UINT32 uiSeconds; UINT32 uiHundreths; @@ -2677,8 +2677,8 @@ void UpdateMercInSector( SOLDIERTYPE *pSoldier, INT16 sSectorX, INT16 sSectorY, if( fError ) { //strategic insertion failed because it expected to find an entry point. This is likely //a missing part of the map or possible fault in strategic movement costs, traversal logic, etc. - UINT16 szEntry[10]; - UINT16 szSector[10]; + wchar_t szEntry[10]; + wchar_t szSector[10]; INT16 sGridNo; GetLoadedSectorString( szSector ); if( gMapInformation.sNorthGridNo != -1 ) @@ -5253,7 +5253,7 @@ INT16 PickGridNoToWalkIn( SOLDIERTYPE *pSoldier, UINT8 ubInsertionDirection, UIN } -void GetLoadedSectorString( UINT16 *pString ) +void GetLoadedSectorString( wchar_t *pString ) { if( !gfWorldLoaded ) { diff --git a/Strategic/strategicmap.h b/Strategic/strategicmap.h index 9ae4f543..53bd953a 100644 --- a/Strategic/strategicmap.h +++ b/Strategic/strategicmap.h @@ -93,7 +93,7 @@ void GetShortSectorString( INT16 sMapX,INT16 sMapY, STR16 sString ); //Examples: A9 // A10_B1 // J9_B2_A ( >= BETAVERSION ) else J9_B2 (release equivalent) -void GetLoadedSectorString( UINT16 *pString ); +void GetLoadedSectorString( wchar_t *pString ); // This will get an ID string like A9- OMERTA... void GetSectorIDString( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ , CHAR16 * zString, BOOLEAN fDetailed ); diff --git a/Tactical/Dialogue Control.cpp b/Tactical/Dialogue Control.cpp index a7041db9..1ddf2a17 100644 --- a/Tactical/Dialogue Control.cpp +++ b/Tactical/Dialogue Control.cpp @@ -142,7 +142,7 @@ UINT16 gusSubtitleBoxHeight; INT32 giTextBoxOverlay = -1; BOOLEAN gfFacePanelActive = FALSE; UINT32 guiScreenIDUsedWhenUICreated; -INT16 gzQuoteStr[ QUOTE_MESSAGE_SIZE ]; +wchar_t gzQuoteStr[ QUOTE_MESSAGE_SIZE ]; MOUSE_REGION gTextBoxMouseRegion; MOUSE_REGION gFacePopupMouseRegion; BOOLEAN gfUseAlternateDialogueFile = FALSE; @@ -187,12 +187,12 @@ void FaceOverlayClickCallback( MOUSE_REGION * pRegion, INT32 iReason ); // Handler functions for tactical ui diaplay -void HandleTacticalTextUI( INT32 iFaceIndex, SOLDIERTYPE *pSoldier, INT16 *zQuoteStr ); -void HandleTacticalNPCTextUI( UINT8 ubCharacterNum, INT16 *zQuoteStr ); +void HandleTacticalTextUI( INT32 iFaceIndex, SOLDIERTYPE *pSoldier, wchar_t *zQuoteStr ); +void HandleTacticalNPCTextUI( UINT8 ubCharacterNum, wchar_t *zQuoteStr ); void HandleTacticalSpeechUI( UINT8 ubCharacterNum, INT32 iFaceIndex ); void DisplayTextForExternalNPC( UINT8 ubCharacterNum, STR16 zQuoteStr ); -void CreateTalkingUI( INT8 bUIHandlerID, INT32 iFaceIndex, UINT8 ubCharacterNum, SOLDIERTYPE *pSoldier, INT16 *zQuoteStr ); +void CreateTalkingUI( INT8 bUIHandlerID, INT32 iFaceIndex, UINT8 ubCharacterNum, SOLDIERTYPE *pSoldier, wchar_t *zQuoteStr ); void HandleExternNPCSpeechFace( INT32 iIndex ); @@ -1184,7 +1184,7 @@ void HandleDialogue( ) MemFree( QItem ); } -BOOLEAN GetDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, UINT32 iDataSize, UINT16 * zDialogueText, UINT32 *puiSoundID, CHAR8 *zSoundString ); +BOOLEAN GetDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, UINT32 iDataSize, wchar_t * zDialogueText, UINT32 *puiSoundID, CHAR8 *zSoundString ); BOOLEAN DelayedTacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNum ) @@ -1621,7 +1621,7 @@ BOOLEAN ExecuteCharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32 CHECKF( iFaceIndex != -1 ); if ( !GetDialogue( ubCharacterNum, - usQuoteNum, DIALOGUESIZE, (UINT16 *)gzQuoteStr, &uiSoundID, zSoundString) ) + usQuoteNum, DIALOGUESIZE, gzQuoteStr, &uiSoundID, zSoundString) ) { return( FALSE ); } @@ -1648,7 +1648,7 @@ BOOLEAN ExecuteCharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32 } -void CreateTalkingUI( INT8 bUIHandlerID, INT32 iFaceIndex, UINT8 ubCharacterNum, SOLDIERTYPE *pSoldier, INT16 *zQuoteStr ) +void CreateTalkingUI( INT8 bUIHandlerID, INT32 iFaceIndex, UINT8 ubCharacterNum, SOLDIERTYPE *pSoldier, wchar_t *zQuoteStr ) { // Show text, if on @@ -1823,7 +1823,7 @@ BOOLEAN DialogueDataFileExistsForProfile( UINT8 ubCharacterNum, UINT16 usQuoteNu return( FileExists( (STR)pFilename ) ); } -BOOLEAN GetDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, UINT32 iDataSize, UINT16 * zDialogueText, UINT32 *puiSoundID, CHAR8 *zSoundString ) +BOOLEAN GetDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, UINT32 iDataSize, wchar_t * zDialogueText, UINT32 *puiSoundID, CHAR8 *zSoundString ) { UINT8 *pFilename; @@ -1890,9 +1890,9 @@ BOOLEAN GetDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, UINT32 iDataSize, // Handlers for tactical UI stuff -void HandleTacticalNPCTextUI( UINT8 ubCharacterNum, INT16 *zQuoteStr ) +void HandleTacticalNPCTextUI( UINT8 ubCharacterNum, wchar_t *zQuoteStr ) { - INT16 zText[ QUOTE_MESSAGE_SIZE ]; + wchar_t zText[ QUOTE_MESSAGE_SIZE ]; // Setup dialogue text box if ( guiCurrentScreen != MAP_SCREEN ) @@ -1952,9 +1952,9 @@ void DisplayTextForExternalNPC( UINT8 ubCharacterNum, STR16 zQuoteStr ) } -void HandleTacticalTextUI( INT32 iFaceIndex, SOLDIERTYPE *pSoldier, INT16 *zQuoteStr ) +void HandleTacticalTextUI( INT32 iFaceIndex, SOLDIERTYPE *pSoldier, wchar_t *zQuoteStr ) { - INT16 zText[ QUOTE_MESSAGE_SIZE ]; + wchar_t zText[ QUOTE_MESSAGE_SIZE ]; INT16 sLeft = 0; //BUild text diff --git a/Tactical/Faces.cpp b/Tactical/Faces.cpp index f77e7e39..8e8d4fa2 100644 --- a/Tactical/Faces.cpp +++ b/Tactical/Faces.cpp @@ -1387,12 +1387,12 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE if ( pFace->fDisplayTextOver == FACE_DRAW_TEXT_OVER ) { - gprintfinvalidate( sFontX, sFontY, (UINT16 *)pFace->zDisplayText ); + gprintfinvalidate( sFontX, sFontY, pFace->zDisplayText ); mprintf( sFontX, sFontY, pFace->zDisplayText ); } else if ( pFace->fDisplayTextOver == FACE_ERASE_TEXT_OVER ) { - gprintfRestore( sFontX, sFontY, (UINT16 *)pFace->zDisplayText ); + gprintfRestore( sFontX, sFontY, pFace->zDisplayText ); pFace->fDisplayTextOver = FACE_NO_TEXT_OVER; } diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 77d534ce..e9c2bc7b 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -3209,7 +3209,7 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT16 sGridNo, UINT8 bCommand, I INT16 sY; INVTYPE *pItem; ITEM_POOL *pTempItemPool; - INT16 pStr[ 100 ]; + wchar_t pStr[ 100 ]; INT16 cnt = 0, sHeight = 0; INT16 sLargeLineWidth = 0, sLineWidth; BOOLEAN fRecalcNumListed = FALSE; @@ -3380,7 +3380,7 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT16 sGridNo, UINT8 bCommand, I SetFontForeground( FONT_MCOLOR_DKGRAY ); } swprintf( (wchar_t *)pStr, (wchar_t *)TacticalStr[ ITEMPOOL_POPUP_PREV_STR ] ); - gprintfdirty( sFontX, sY, (UINT16 *)pStr ); + gprintfdirty( sFontX, sY, pStr ); mprintf( sFontX, sY, pStr ); sY += GetFontHeight( SMALLFONT1 ) - 2; cnt++; @@ -3416,7 +3416,7 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT16 sGridNo, UINT8 bCommand, I swprintf( (wchar_t *)pStr, (wchar_t *)L"%s", ShortItemNames[ gWorldItems[ pItemPool->iItemIndex ].o.usItem ] ); } - gprintfdirty( sFontX, sY, (UINT16 *)pStr ); + gprintfdirty( sFontX, sY, pStr ); mprintf( sFontX, sY, pStr ); sY += GetFontHeight( SMALLFONT1 ) - 2; @@ -3448,7 +3448,7 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT16 sGridNo, UINT8 bCommand, I SetFontForeground( FONT_MCOLOR_DKGRAY ); } swprintf( (wchar_t *)pStr, (wchar_t *)TacticalStr[ ITEMPOOL_POPUP_MORE_STR ] ); - gprintfdirty( sFontX, sY, (UINT16 *)pStr ); + gprintfdirty( sFontX, sY, pStr ); mprintf( sFontX, sY, pStr ); } } diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index 3b0f8ce5..4475cb51 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -2554,7 +2554,7 @@ UINT32 UIHandleCAMercShoot( UI_EVENT *pUIEvent ) // If this is one of our own guys.....pop up requiester... if ( ( pTSoldier->bTeam == gbPlayerNum || pTSoldier->bTeam == MILITIA_TEAM ) && Item[ pSoldier->inv[ HANDPOS ].usItem ].usItemClass != IC_MEDKIT && !Item[pSoldier->inv[ HANDPOS ].usItem].gascan && gTacticalStatus.ubLastRequesterTargetID != pTSoldier->ubProfile && ( pTSoldier->ubID != pSoldier->ubID ) ) { - INT16 zStr[200]; + wchar_t zStr[200]; gpRequesterMerc = pSoldier; gpRequesterTargetMerc = pTSoldier; diff --git a/Tactical/Interface Dialogue.cpp b/Tactical/Interface Dialogue.cpp index b6c327bc..9cff5b0b 100644 --- a/Tactical/Interface Dialogue.cpp +++ b/Tactical/Interface Dialogue.cpp @@ -4378,7 +4378,7 @@ BOOLEAN PlayerTeamHasTwoSpotsLeft( ) void StartDialogueMessageBox( UINT8 ubProfileID, UINT16 usMessageBoxType ) { INT32 iTemp; - UINT16 zTemp[256], zTemp2[256]; + wchar_t zTemp[256], zTemp2[256]; gusDialogueMessageBoxType = usMessageBoxType; switch( gusDialogueMessageBoxType ) diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index d3e12236..67d876e1 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -257,13 +257,13 @@ BOOLEAN gfInItemDescBox = FALSE; UINT32 guiCurrentItemDescriptionScreen=0; OBJECTTYPE *gpItemDescObject = NULL; BOOLEAN gfItemDescObjectIsAttachment = FALSE; -UINT16 gzItemName[ SIZE_ITEM_NAME ]; -UINT16 gzItemDesc[ SIZE_ITEM_INFO ]; -UINT16 gzItemPros[ SIZE_ITEM_PROS ]; -UINT16 gzItemCons[ SIZE_ITEM_CONS ]; -UINT16 gzFullItemPros[ SIZE_ITEM_PROS ]; -UINT16 gzFullItemCons[ SIZE_ITEM_PROS ]; -UINT16 gzFullItemTemp[ SIZE_ITEM_PROS ]; // necessary, unfortunately +wchar_t gzItemName[ SIZE_ITEM_NAME ]; +wchar_t gzItemDesc[ SIZE_ITEM_INFO ]; +wchar_t gzItemPros[ SIZE_ITEM_PROS ]; +wchar_t gzItemCons[ SIZE_ITEM_CONS ]; +wchar_t gzFullItemPros[ SIZE_ITEM_PROS ]; +wchar_t gzFullItemCons[ SIZE_ITEM_PROS ]; +wchar_t gzFullItemTemp[ SIZE_ITEM_PROS ]; // necessary, unfortunately void ItemDescCallback( MOUSE_REGION * pRegion, INT32 iReason ); INT16 gsInvDescX; INT16 gsInvDescY; @@ -590,10 +590,10 @@ BOOLEAN AttemptToAddSubstring( STR16 zDest, STR16 zTemp, UINT32 * puiStringLengt } } -void GenerateProsString( UINT16 * zItemPros, OBJECTTYPE * pObject, UINT32 uiPixLimit ) +void GenerateProsString( wchar_t * zItemPros, OBJECTTYPE * pObject, UINT32 uiPixLimit ) { UINT32 uiStringLength = 0; - UINT16 * zTemp; + wchar_t * zTemp; UINT16 usItem = pObject->usItem; UINT8 ubWeight; @@ -714,10 +714,10 @@ void GenerateProsString( UINT16 * zItemPros, OBJECTTYPE * pObject, UINT32 uiPixL } } -void GenerateConsString( UINT16 * zItemCons, OBJECTTYPE * pObject, UINT32 uiPixLimit ) +void GenerateConsString( wchar_t * zItemCons, OBJECTTYPE * pObject, UINT32 uiPixLimit ) { UINT32 uiStringLength = 0; - UINT16 * zTemp; + wchar_t * zTemp; UINT8 ubWeight; UINT16 usItem = pObject->usItem; @@ -1058,7 +1058,7 @@ void RenderInvBodyPanel( SOLDIERTYPE *pSoldier, INT16 sX, INT16 sY ) void HandleRenderInvSlots( SOLDIERTYPE *pSoldier, UINT8 fDirtyLevel ) { INT32 cnt; - static INT16 pStr[ 150 ]; + static wchar_t pStr[ 150 ]; if ( InItemDescriptionBox( ) || InItemStackPopup( ) || InKeyRingPopup( ) ) { @@ -1999,7 +1999,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec INT16 sFontX2, sFontY2; INT16 sFontX, sFontY; - static INT16 pStr[ 100 ], pStr2[ 100 ]; + static wchar_t pStr[ 100 ], pStr2[ 100 ]; if ( pObject->usItem == NOTHING ) { @@ -2090,13 +2090,13 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec //} - swprintf( (wchar_t *)pStr, L"%d", pObject->ubGunShotsLeft ); + swprintf( pStr, L"%d", pObject->ubGunShotsLeft ); if ( uiBuffer == guiSAVEBUFFER ) { RestoreExternBackgroundRect( sNewX, sNewY, 20, 15 ); } mprintf( sNewX, sNewY, pStr ); - gprintfinvalidate( sNewX, sNewY, (UINT16 *)pStr ); + gprintfinvalidate( sNewX, sNewY, pStr ); SetFontForeground( FONT_MCOLOR_DKGRAY ); @@ -2117,7 +2117,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec VarFindFontCenterCoordinates( sX, sY, sWidth, sHeight , ITEM_FONT, &sNewX, &sNewY, pStr ); mprintf( sNewX, sNewY, pStr ); - gprintfinvalidate( sNewX, sNewY, (UINT16 *)pStr ); + gprintfinvalidate( sNewX, sNewY, pStr ); } } else @@ -2142,7 +2142,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec RestoreExternBackgroundRect( sNewX, sNewY, 15, 15 ); } mprintf( sNewX, sNewY, pStr ); - gprintfinvalidate( sNewX, sNewY, (UINT16 *)pStr ); + gprintfinvalidate( sNewX, sNewY, pStr ); } } @@ -2172,7 +2172,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec RestoreExternBackgroundRect( sNewX, sNewY, 15, 15 ); } mprintf( sNewX, sNewY, pStr ); - gprintfinvalidate( sNewX, sNewY, (UINT16 *)pStr ); + gprintfinvalidate( sNewX, sNewY, pStr ); } @@ -2215,7 +2215,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec RestoreExternBackgroundRect( sNewX, sNewY, 15, 15 ); } mprintf( sNewX, sNewY, pStr ); - gprintfinvalidate( sNewX, sNewY, (UINT16 *)pStr ); + gprintfinvalidate( sNewX, sNewY, pStr ); } @@ -2246,13 +2246,13 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec VarFindFontCenterCoordinates( sX, sY, sWidth, sHeight , ITEM_FONT, &sFontX, &sFontY, pStr ); sFontY = sY + 1; - gprintfinvalidate( sFontX, sFontY, (UINT16 *)pStr ); + gprintfinvalidate( sFontX, sFontY, pStr ); if ( fLineSplit ) { VarFindFontCenterCoordinates( sX, sY, sWidth, sHeight , ITEM_FONT, &sFontX2, &sFontY2, pStr2 ); sFontY2 = sY + 13; - gprintfinvalidate( sFontX2, sFontY2, (UINT16 *)pStr2 ); + gprintfinvalidate( sFontX2, sFontY2, pStr2 ); } } @@ -2269,11 +2269,11 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec else if ( *pubHighlightCounter == 1 ) { *pubHighlightCounter = 0; - gprintfRestore( sFontX, sFontY, (UINT16 *)pStr ); + gprintfRestore( sFontX, sFontY, pStr ); if ( fLineSplit ) { - gprintfRestore( sFontX2, sFontY2, (UINT16 *)pStr2 ); + gprintfRestore( sFontX2, sFontY2, pStr2 ); } } } @@ -2797,7 +2797,7 @@ BOOLEAN ReloadItemDesc( ) void ItemDescAmmoCallback(GUI_BUTTON *btn,INT32 reason) { static BOOLEAN fRightDown = FALSE; - INT16 pStr[10]; + wchar_t pStr[10]; /* region gets disabled in SKI for shopkeeper boxes. It now works normally for merc's inventory boxes! //if we are currently in the shopkeeper interface, return; @@ -2830,7 +2830,7 @@ void ItemDescAmmoCallback(GUI_BUTTON *btn,INT32 reason) gpItemPointerSoldier = gpItemDescSoldier; swprintf( (wchar_t *)pStr, L"0" ); - SpecifyButtonText( giItemDescAmmoButton, (UINT16 *)pStr ); + SpecifyButtonText( giItemDescAmmoButton, pStr ); // Set mouse guiExternVo = GetInterfaceGraphicForItem( &(Item[ gpItemPointer->usItem ]) ); @@ -2862,7 +2862,7 @@ void ItemDescAmmoCallback(GUI_BUTTON *btn,INT32 reason) fInterfacePanelDirty = DIRTYLEVEL2; swprintf( (wchar_t *)pStr, L"0" ); - SpecifyButtonText( giItemDescAmmoButton, (UINT16 *)pStr ); + SpecifyButtonText( giItemDescAmmoButton, pStr ); fItemDescDelete = TRUE; } @@ -7383,7 +7383,7 @@ BOOLEAN AttemptToApplyCamo( SOLDIERTYPE *pSoldier, UINT16 usItemIndex ) -void GetHelpTextForItem( INT16 * pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier ) +void GetHelpTextForItem( wchar_t * pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier ) { INT16 pStr[ 250 ]; UINT16 usItem = pObject->usItem; diff --git a/Tactical/Interface Items.h b/Tactical/Interface Items.h index ea29084e..3c502698 100644 --- a/Tactical/Interface Items.h +++ b/Tactical/Interface Items.h @@ -134,7 +134,7 @@ UINT32 GetInterfaceGraphicForItem( INVTYPE *pItem ); UINT16 GetTileGraphicForItem( INVTYPE *pItem ); BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo ); -void GetHelpTextForItem( INT16 * pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier ); +void GetHelpTextForItem( wchar_t * pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier ); BOOLEAN AttemptToApplyCamo( SOLDIERTYPE *pSoldier, UINT16 usItemIndex ); diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index be47a1e3..a58e39ef 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -3795,7 +3795,7 @@ void RenderTEAMPanel( BOOLEAN fDirty ) INT16 sFontX, sFontY; UINT32 cnt, posIndex; SOLDIERTYPE *pSoldier; - static INT16 pStr[ 200 ], pMoraleStr[ 20 ]; + static wchar_t pStr[ 200 ], pMoraleStr[ 20 ]; // WANNE 2 if ( fDirty == DIRTYLEVEL2 ) diff --git a/Tactical/Interface.cpp b/Tactical/Interface.cpp index 2fc3df4f..ce2452f6 100644 --- a/Tactical/Interface.cpp +++ b/Tactical/Interface.cpp @@ -111,7 +111,7 @@ typedef struct TOP_MESSAGE gTopMessage; BOOLEAN gfTopMessageDirty = FALSE; -void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, UINT16 * psString ); +void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, wchar_t * psString ); extern UINT16 GetAnimStateForInteraction( SOLDIERTYPE *pSoldier, BOOLEAN fDoor, UINT16 usAnimState ); @@ -681,7 +681,7 @@ void PopupMovementMenu( UI_EVENT *pUIEvent ) SOLDIERTYPE *pSoldier = NULL; INT32 iMenuAnchorX, iMenuAnchorY; UINT32 uiActionImages; - INT16 zActionString[ 50 ]; + wchar_t zActionString[ 50 ]; BOOLEAN fDisableAction = FALSE; // Erase other menus.... @@ -920,7 +920,7 @@ void PopupMovementMenu( UI_EVENT *pUIEvent ) return; } //SetButtonSavedRect( iActionIcons[ ACTIONC_ICON ] ); - SetButtonFastHelpText( iActionIcons[ ACTIONC_ICON ], (UINT16 *)zActionString ); + SetButtonFastHelpText( iActionIcons[ ACTIONC_ICON ], zActionString ); ButtonList[ iActionIcons[ ACTIONC_ICON ] ]->UserData[0] = (UINT32)pUIEvent; if ( fDisableAction ) @@ -1489,8 +1489,8 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID ) INT16 sX, sY; INT32 iBack; TILE_ELEMENT TileElem; - UINT16 *pStr; - UINT16 NameStr[ 50 ]; + wchar_t *pStr; + wchar_t NameStr[ 50 ]; UINT16 usGraphicToUse = THIRDPOINTERS1; BOOLEAN fRaiseName = FALSE; BOOLEAN fDoName = TRUE; @@ -1836,7 +1836,7 @@ void RenderOverlayMessage( VIDEO_OVERLAY *pBlitter ) } -void BeginOverlayMessage( UINT32 uiFont, UINT16 *pFontString, ... ) +void BeginOverlayMessage( UINT32 uiFont, wchar_t *pFontString, ... ) { va_list argptr; VIDEO_OVERLAY_DESC VideoOverlayDesc; @@ -2215,7 +2215,7 @@ BOOLEAN InitDoorOpenMenu( SOLDIERTYPE *pSoldier, STRUCTURE *pStructure, UINT8 ub void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { INT32 iMenuAnchorX, iMenuAnchorY; - INT16 zDisp[ 100 ]; + wchar_t zDisp[ 100 ]; iMenuAnchorX = gOpenDoorMenu.sX; iMenuAnchorY = gOpenDoorMenu.sY; @@ -2250,7 +2250,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ USE_KEYRING_ICON ], AP_UNLOCK_DOOR ); } - SetButtonFastHelpText( iActionIcons[ USE_KEYRING_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ USE_KEYRING_ICON ], zDisp ); if ( !EnoughPoints( gOpenDoorMenu.pSoldier, AP_UNLOCK_DOOR, BP_UNLOCK_DOOR, FALSE ) || fClosingDoor || AM_AN_EPC( gOpenDoorMenu.pSoldier ) ) { @@ -2281,7 +2281,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ USE_CROWBAR_ICON ], AP_USE_CROWBAR ); } - SetButtonFastHelpText( iActionIcons[ USE_CROWBAR_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ USE_CROWBAR_ICON ], zDisp ); // Greyout if no crowbar found... if ( FindUsableCrowbar ( gOpenDoorMenu.pSoldier ) == NO_SLOT || fClosingDoor ) @@ -2311,7 +2311,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ LOCKPICK_DOOR_ICON ], AP_PICKLOCK ); } - SetButtonFastHelpText( iActionIcons[ LOCKPICK_DOOR_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ LOCKPICK_DOOR_ICON ], zDisp ); if ( !EnoughPoints( gOpenDoorMenu.pSoldier, AP_PICKLOCK, BP_PICKLOCK, FALSE ) || fClosingDoor || AM_AN_EPC( gOpenDoorMenu.pSoldier ) ) { @@ -2343,7 +2343,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ EXPLOSIVE_DOOR_ICON ], AP_EXPLODE_DOOR ); } - SetButtonFastHelpText( iActionIcons[ EXPLOSIVE_DOOR_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ EXPLOSIVE_DOOR_ICON ], zDisp ); if ( !EnoughPoints( gOpenDoorMenu.pSoldier, AP_EXPLODE_DOOR, BP_EXPLODE_DOOR, FALSE ) || fClosingDoor || AM_AN_EPC( gOpenDoorMenu.pSoldier ) ) { @@ -2389,7 +2389,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ OPEN_DOOR_ICON ], AP_OPEN_DOOR ); } } - SetButtonFastHelpText( iActionIcons[ OPEN_DOOR_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ OPEN_DOOR_ICON ], zDisp ); if ( !EnoughPoints( gOpenDoorMenu.pSoldier, AP_OPEN_DOOR, BP_OPEN_DOOR, FALSE ) ) { @@ -2415,7 +2415,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ EXAMINE_DOOR_ICON ], AP_EXAMINE_DOOR ); } - SetButtonFastHelpText( iActionIcons[ EXAMINE_DOOR_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ EXAMINE_DOOR_ICON ], zDisp ); if ( !EnoughPoints( gOpenDoorMenu.pSoldier, AP_EXAMINE_DOOR, BP_EXAMINE_DOOR, FALSE ) || fClosingDoor || AM_AN_EPC( gOpenDoorMenu.pSoldier ) ) { @@ -2439,7 +2439,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ BOOT_DOOR_ICON ], AP_BOOT_DOOR ); } - SetButtonFastHelpText( iActionIcons[ BOOT_DOOR_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ BOOT_DOOR_ICON ], zDisp ); if ( !EnoughPoints( gOpenDoorMenu.pSoldier, AP_BOOT_DOOR, BP_BOOT_DOOR, FALSE ) || fClosingDoor || AM_AN_EPC( gOpenDoorMenu.pSoldier ) ) { @@ -2464,7 +2464,7 @@ void PopupDoorOpenMenu( BOOLEAN fClosingDoor ) { swprintf( (wchar_t *)zDisp, L"%s ( %d )", pTacticalPopupButtonStrings[ UNTRAP_DOOR_ICON ], AP_UNTRAP_DOOR ); } - SetButtonFastHelpText( iActionIcons[ UNTRAP_DOOR_ICON ], (UINT16 *)zDisp ); + SetButtonFastHelpText( iActionIcons[ UNTRAP_DOOR_ICON ], zDisp ); if ( !EnoughPoints( gOpenDoorMenu.pSoldier, AP_UNTRAP_DOOR, BP_UNTRAP_DOOR, FALSE ) || fClosingDoor || AM_AN_EPC( gOpenDoorMenu.pSoldier ) ) { @@ -2752,7 +2752,7 @@ void RenderUIMessage( VIDEO_OVERLAY *pBlitter ) } -void InternalBeginUIMessage( BOOLEAN fUseSkullIcon, UINT16 *pFontString, ... ) +void InternalBeginUIMessage( BOOLEAN fUseSkullIcon, wchar_t *pFontString, ... ) { va_list argptr; VIDEO_OVERLAY_DESC VideoOverlayDesc; @@ -2812,7 +2812,7 @@ void InternalBeginUIMessage( BOOLEAN fUseSkullIcon, UINT16 *pFontString, ... ) gfUseSkullIconMessage = fUseSkullIcon; } -void BeginUIMessage( UINT16 *pFontString, ... ) +void BeginUIMessage( wchar_t *pFontString, ... ) { va_list argptr; wchar_t MsgString[512]; @@ -2825,7 +2825,7 @@ void BeginUIMessage( UINT16 *pFontString, ... ) } -void BeginMapUIMessage( UINT8 ubPosition, UINT16 *pFontString, ... ) +void BeginMapUIMessage( UINT8 ubPosition, wchar_t *pFontString, ... ) { va_list argptr; VIDEO_OVERLAY_DESC VideoOverlayDesc; @@ -2919,7 +2919,7 @@ void EndUIMessage( ) #define PLAYER_TEAM_TIMER_TICKS_PER_ENEMY ( 2000 / PLAYER_TEAM_TIMER_SEC_PER_TICKS ) -BOOLEAN AddTopMessage( UINT8 ubType, UINT16 * pzString ) +BOOLEAN AddTopMessage( UINT8 ubType, wchar_t * pzString ) { UINT32 cnt; BOOLEAN fFound = FALSE; @@ -2956,7 +2956,7 @@ BOOLEAN AddTopMessage( UINT8 ubType, UINT16 * pzString ) return( FALSE ); } -void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, UINT16 * psString ) +void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, wchar_t * psString ) { UINT32 uiBAR, uiPLAYERBAR, uiINTBAR; VOBJECT_DESC VObjectDesc; @@ -3260,7 +3260,7 @@ void HandleTopMessages( ) if ( !gTopMessage.fCreated ) { gfTopMessageDirty = TRUE; - AddTopMessage( gTacticalStatus.ubTopMessageType, (UINT16 *)gTacticalStatus.zTopMessageString ); + AddTopMessage( gTacticalStatus.ubTopMessageType, gTacticalStatus.zTopMessageString ); } if ( gTacticalStatus.ubTopMessageType == COMPUTER_TURN_MESSAGE || @@ -3285,7 +3285,7 @@ void HandleTopMessages( ) gTacticalStatus.usTactialTurnLimitCounter = ( ( gubProgCurEnemy ) * PLAYER_TEAM_TIMER_TICKS_PER_ENEMY ); } - CreateTopMessage( gTopMessage.uiSurface, gTacticalStatus.ubTopMessageType, (UINT16 *)gTacticalStatus.zTopMessageString ); + CreateTopMessage( gTopMessage.uiSurface, gTacticalStatus.ubTopMessageType, gTacticalStatus.zTopMessageString ); } } else if ( gGameOptions.fTurnTimeLimit ) @@ -3329,7 +3329,7 @@ void HandleTopMessages( ) gTacticalStatus.usTactialTurnLimitCounter++; } - CreateTopMessage( gTopMessage.uiSurface, gTacticalStatus.ubTopMessageType, (UINT16 *)gTacticalStatus.zTopMessageString ); + CreateTopMessage( gTopMessage.uiSurface, gTacticalStatus.ubTopMessageType, gTacticalStatus.zTopMessageString ); // Have we reached max? if ( gTacticalStatus.usTactialTurnLimitCounter == ( gTacticalStatus.usTactialTurnLimitMax - 1) ) @@ -3501,7 +3501,7 @@ void UpdateEnemyUIBar( ) if ( gTacticalStatus.ubTopMessageType == COMPUTER_TURN_MESSAGE ) { // Update message! - CreateTopMessage( gTopMessage.uiSurface, COMPUTER_TURN_MESSAGE, (UINT16 *)gTacticalStatus.zTopMessageString ); + CreateTopMessage( gTopMessage.uiSurface, COMPUTER_TURN_MESSAGE, gTacticalStatus.zTopMessageString ); } } } @@ -3598,7 +3598,7 @@ void DoorMenuBackregionCallback( MOUSE_REGION * pRegion, INT32 iReason ) } } -UINT16 *GetSoldierHealthString( SOLDIERTYPE *pSoldier ) +wchar_t *GetSoldierHealthString( SOLDIERTYPE *pSoldier ) { INT32 cnt, cntStart; if( pSoldier->bLife == pSoldier->bLifeMax ) diff --git a/Tactical/Interface.h b/Tactical/Interface.h index 091ce2a7..b2290517 100644 --- a/Tactical/Interface.h +++ b/Tactical/Interface.h @@ -146,7 +146,7 @@ void CancelOpenDoorMenu( ); void HandleInterfaceBackgrounds( ); -void BeginOverlayMessage( UINT32 uiFont, UINT16 *pFontString, ... ); +void BeginOverlayMessage( UINT32 uiFont, wchar_t *pFontString, ... ); void EndOverlayMessage( ); @@ -177,12 +177,12 @@ void DirtyMercPanelInterface( SOLDIERTYPE *pSoldier, UINT8 ubDirtyLevel ); void EndUIMessage( ); -void BeginUIMessage( UINT16 *pFontString, ... ); -void InternalBeginUIMessage( BOOLEAN fUseSkullIcon, UINT16 *pFontString, ... ); +void BeginUIMessage( wchar_t *pFontString, ... ); +void InternalBeginUIMessage( BOOLEAN fUseSkullIcon, wchar_t *pFontString, ... ); // map screen version, for centering over the map area -void BeginMapUIMessage( UINT8 fPosition, UINT16 *pFontString, ... ); +void BeginMapUIMessage( UINT8 fPosition, wchar_t *pFontString, ... ); extern UINT16 gusUIOldSelectedSoldier; @@ -204,7 +204,7 @@ enum MESSAGE_TYPES void HandleTopMessages( ); -BOOLEAN AddTopMessage( UINT8 ubType, UINT16 * pzString ); +BOOLEAN AddTopMessage( UINT8 ubType, wchar_t * pzString ); BOOLEAN InTopMessageBarAnimation( ); void EndTopMessage( ); @@ -213,7 +213,7 @@ void PauseRT( BOOLEAN fPause ); void InitEnemyUIBar( UINT8 ubNumEnemies, UINT8 ubDoneEnemies ); -UINT16 *GetSoldierHealthString( SOLDIERTYPE *pSoldier ); +wchar_t *GetSoldierHealthString( SOLDIERTYPE *pSoldier ); void GetLaunchItemParamsFromUI( ); diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index bd0d0440..046a7096 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -1866,7 +1866,7 @@ BOOLEAN ValidItemAttachment( OBJECTTYPE * pObj, UINT16 usAttachment, BOOLEAN fAt if ( fAttemptingAttachment && ValidAttachmentClass( usAttachment, pObj->usItem ) ) { // well, maybe the player thought he could - UINT16 zTemp[ 100 ]; + wchar_t zTemp[ 100 ]; swprintf( zTemp, Message[ STR_CANT_ATTACH ], ItemNames[ usAttachment ], ItemNames[ pObj->usItem ] ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, zTemp ); @@ -3790,7 +3790,7 @@ BOOLEAN PlaceObject( SOLDIERTYPE * pSoldier, INT8 bPos, OBJECTTYPE * pObj ) { if ( !CompatibleFaceItem( pObj->usItem, pSoldier->inv[ HEAD2POS ].usItem ) ) { - UINT16 zTemp[ 150 ]; + wchar_t zTemp[ 150 ]; swprintf( zTemp, Message[ STR_CANT_USE_TWO_ITEMS ], ItemNames[ pObj->usItem ], ItemNames[ pSoldier->inv[ HEAD2POS ].usItem ] ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, zTemp ); @@ -3801,7 +3801,7 @@ BOOLEAN PlaceObject( SOLDIERTYPE * pSoldier, INT8 bPos, OBJECTTYPE * pObj ) { if ( !CompatibleFaceItem( pObj->usItem, pSoldier->inv[ HEAD1POS ].usItem ) ) { - UINT16 zTemp[ 150 ]; + wchar_t zTemp[ 150 ]; swprintf( zTemp, Message[ STR_CANT_USE_TWO_ITEMS ], ItemNames[ pObj->usItem ], ItemNames[ pSoldier->inv[ HEAD1POS ].usItem ] ); ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, zTemp ); diff --git a/Tactical/Militia Control.cpp b/Tactical/Militia Control.cpp index 19f3daf4..df06f7ff 100644 --- a/Tactical/Militia Control.cpp +++ b/Tactical/Militia Control.cpp @@ -233,7 +233,7 @@ void HandleMilitiaPromotions( void ) { // ATE: Problems here with bringing up message box... - // UINT16 str[ 512 ]; + // wchar_t str[ 512 ]; // BuildMilitiaPromotionsString( str ); // DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL ); } diff --git a/Tactical/Overhead.h b/Tactical/Overhead.h index f80c442e..d4e09083 100644 --- a/Tactical/Overhead.h +++ b/Tactical/Overhead.h @@ -121,7 +121,7 @@ typedef struct UINT16 usTactialTurnLimitCounter; BOOLEAN fInTopMessage; UINT8 ubTopMessageType; - INT16 zTopMessageString[20]; + wchar_t zTopMessageString[20]; UINT16 usTactialTurnLimitMax; UINT32 uiTactialTurnLimitClock; BOOLEAN fTactialTurnLimitStartedBeep; diff --git a/Tactical/ShopKeeper Interface.cpp b/Tactical/ShopKeeper Interface.cpp index 500705c5..3576ee75 100644 --- a/Tactical/ShopKeeper Interface.cpp +++ b/Tactical/ShopKeeper Interface.cpp @@ -7759,7 +7759,7 @@ void BuildItemHelpTextString( wchar_t sString[], INVENTORY_IN_SLOT *pInv, UINT8 if( pInv != NULL ) { - GetHelpTextForItem( (INT16 *)zHelpText, &( pInv->ItemObject ), NULL ); + GetHelpTextForItem( zHelpText, &( pInv->ItemObject ), NULL ); // add repair time for items in a repairman's offer area if ( ( ubScreenArea == ARMS_DEALER_OFFER_AREA ) && diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h index 2c8a3795..263cecd8 100644 --- a/Tactical/Soldier Control.h +++ b/Tactical/Soldier Control.h @@ -378,7 +378,7 @@ typedef struct INT8 bScientific; // traits INT16 sWeightCarriedAtTurnStart; - UINT16 name[ 10 ]; + wchar_t name[ 10 ]; INT8 bVisible; // to render or not to render... diff --git a/Tactical/Soldier Create.h b/Tactical/Soldier Create.h index 2fe1d6c6..d48f5d45 100644 --- a/Tactical/Soldier Create.h +++ b/Tactical/Soldier Create.h @@ -109,7 +109,7 @@ typedef struct //Kris: Additions November 16, 1997 (padding down to 129 from 150) BOOLEAN fVisible; - UINT16 name[ 10 ]; + wchar_t name[ 10 ]; UINT8 ubSoldierClass; //army, administrator, elite diff --git a/Tactical/Soldier Init List.cpp b/Tactical/Soldier Init List.cpp index 52855e06..821ee02f 100644 --- a/Tactical/Soldier Init List.cpp +++ b/Tactical/Soldier Init List.cpp @@ -1865,7 +1865,7 @@ void AddSoldierInitListBloodcats() ubSectorID != SEC_I16 && ubSectorID != SEC_N5 ) { #ifdef JA2BETAVERSION - UINT16 str[200]; + wchar_t str[200]; swprintf( str, L"Table specifies that there are %d bloodcat placements in sector %c%d, but the map actually has %d bloodcat placements. Map value takes precedence. KM,LC:1", pSector->bBloodCatPlacements, gWorldSectorY + 'A' - 1, gWorldSectorX, bBloodCatPlacements ); DoScreenIndependantMessageBox( str, MSG_BOX_FLAG_OK, NULL ); @@ -2101,7 +2101,7 @@ BOOLEAN ValidateSoldierInitLinks( UINT8 ubCode ) { SOLDIERINITNODE *curr; UINT32 uiNumInvalids = 0; - UINT16 str[512]; + wchar_t str[512]; curr = gSoldierInitHead; while( curr ) { diff --git a/Tactical/Strategic Exit GUI.cpp b/Tactical/Strategic Exit GUI.cpp index 24e6f9ff..c2dc6110 100644 --- a/Tactical/Strategic Exit GUI.cpp +++ b/Tactical/Strategic Exit GUI.cpp @@ -522,7 +522,7 @@ void UpdateSectorExitMenu( ) MSYS_DisableRegion(&(gExitDialog.SingleRegion) ); if( gExitDialog.fSelectedMercIsEPC ) { //EPCs cannot leave the sector alone and must be escorted - UINT16 str[ 256 ]; + wchar_t str[ 256 ]; swprintf( str, pExitingSectorHelpText[ EXIT_GUI_ESCORTED_CHARACTERS_MUST_BE_ESCORTED_HELPTEXT ], MercPtrs[ gusSelectedSoldier ]->name ); SetButtonFastHelpText( gExitDialog.uiSingleMoveButton, str ); SetRegionFastHelpText( &gExitDialog.SingleRegion, str ); @@ -531,7 +531,7 @@ void UpdateSectorExitMenu( ) { //It has been previously determined that there are only two mercs in the squad, the selected merc //isn't an EPC, but the other merc is. That means that this merc cannot leave the sector alone //as he would isolate the EPC. - UINT16 str[ 256 ]; + wchar_t str[ 256 ]; if( !gExitDialog.fSquadHasMultipleEPCs ) { if( gMercProfiles[ MercPtrs[ gusSelectedSoldier ]->ubProfile ].bSex == MALE ) @@ -562,7 +562,7 @@ void UpdateSectorExitMenu( ) } else { - UINT16 str[ 256 ]; + wchar_t str[ 256 ]; EnableButton( gExitDialog.uiSingleMoveButton ); MSYS_EnableRegion(&(gExitDialog.SingleRegion) ); swprintf( str, pExitingSectorHelpText[ EXIT_GUI_SINGLE_TRAVERSAL_WILL_SEPARATE_SQUADS_HELPTEXT ], MercPtrs[ gusSelectedSoldier ]->name ); @@ -698,7 +698,7 @@ BOOLEAN HandleSectorExitMenu( ) void RemoveSectorExitMenu( BOOLEAN fOk ) { - INT16 Str[ 50 ]; + wchar_t Str[ 50 ]; if ( gfInSectorExitMenu ) { diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 7ccd8bea..6bdbc6aa 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -3832,7 +3832,7 @@ BOOLEAN HandleCheckForExitArrowsInput( BOOLEAN fAdjustConfirm ) } else if( gubLoneMercAttemptingToAbandonEPCs ) { - UINT16 str[256]; + wchar_t str[256]; if( gubLoneMercAttemptingToAbandonEPCs == 1 ) { //Use the singular version of the string if( gMercProfiles[ MercPtrs[ gusSelectedSoldier ]->ubProfile ].bSex == MALE ) diff --git a/Tactical/XML_AmmoStrings.cpp b/Tactical/XML_AmmoStrings.cpp index 9f40e913..35262c78 100644 --- a/Tactical/XML_AmmoStrings.cpp +++ b/Tactical/XML_AmmoStrings.cpp @@ -239,7 +239,7 @@ BOOLEAN WriteAmmoStats() { FilePrintf(hFile,"\t\r\n"); - UINT16 * szRemainder = AmmoCaliber[cnt]; //the remaining string to be output (for making valid XML) + wchar_t * szRemainder = AmmoCaliber[cnt]; //the remaining string to be output (for making valid XML) FilePrintf(hFile,"\t\t"); while(szRemainder[0] != '\0') diff --git a/Tactical/faces.h b/Tactical/faces.h index 93bcd240..a1c2e4ac 100644 --- a/Tactical/faces.h +++ b/Tactical/faces.h @@ -97,7 +97,7 @@ typedef struct BOOLEAN fDisplayTextOver; // Boolean indicating to display text on face BOOLEAN fOldDisplayTextOver; // OLD Boolean indicating to display text on face BOOLEAN fCanHandleInactiveNow; - INT16 zDisplayText[ 30 ]; // String of text that can be displayed + wchar_t zDisplayText[ 30 ]; // String of text that can be displayed UINT16 usEyesX; UINT16 usEyesY; diff --git a/Tactical/opplist.cpp b/Tactical/opplist.cpp index fc28a5e5..28364769 100644 --- a/Tactical/opplist.cpp +++ b/Tactical/opplist.cpp @@ -4313,7 +4313,7 @@ void DebugSoldierPage3( ) } -void AppendAttachmentCode( UINT16 usItem, UINT16 *str ) +void AppendAttachmentCode( UINT16 usItem, wchar_t *str ) { switch( usItem ) { @@ -4334,7 +4334,7 @@ void AppendAttachmentCode( UINT16 usItem, UINT16 *str ) void WriteQuantityAndAttachments( OBJECTTYPE *pObject, INT32 yp ) { - UINT16 szAttach[30]; + wchar_t szAttach[30]; BOOLEAN fAttachments; //100% Qty: 2 Attach: //100% Qty: 2 @@ -4360,8 +4360,8 @@ void WriteQuantityAndAttachments( OBJECTTYPE *pObject, INT32 yp ) { //ammo if( pObject->ubNumberOfObjects > 1 ) { - UINT16 str[50]; - UINT16 temp[5]; + wchar_t str[50]; + wchar_t temp[5]; UINT8 i; swprintf( str, L"Clips: %d (%d", pObject->ubNumberOfObjects, pObject->bStatus[0] ); for( i = 1; i < pObject->ubNumberOfObjects; i++ ) @@ -4400,8 +4400,8 @@ void DebugSoldierPage4( ) { SOLDIERTYPE *pSoldier; UINT32 uiMercFlags; - UINT16 szOrders[20]; - UINT16 szAttitude[20]; + wchar_t szOrders[20]; + wchar_t szAttitude[20]; UINT16 usSoldierIndex; UINT8 ubLine; diff --git a/Tactical/soldier profile type.h b/Tactical/soldier profile type.h index de3a90ca..4eb52453 100644 --- a/Tactical/soldier profile type.h +++ b/Tactical/soldier profile type.h @@ -161,8 +161,8 @@ typedef enum{ typedef struct { - UINT16 zName[ NAME_LENGTH ]; - UINT16 zNickname[ NICKNAME_LENGTH ]; + wchar_t zName[ NAME_LENGTH ]; + wchar_t zNickname[ NICKNAME_LENGTH ]; UINT32 uiAttnSound; UINT32 uiCurseSound; UINT32 uiDieSound; diff --git a/TileEngine/Render Dirty.cpp b/TileEngine/Render Dirty.cpp index 865923ee..4e610778 100644 --- a/TileEngine/Render Dirty.cpp +++ b/TileEngine/Render Dirty.cpp @@ -746,7 +746,7 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s // to the video buffer. // //***************************************************************************** -UINT16 gprintfdirty(INT16 x, INT16 y, UINT16 * pFontString, ...) +UINT16 gprintfdirty(INT16 x, INT16 y, wchar_t * pFontString, ...) { va_list argptr; wchar_t string[512]; @@ -783,7 +783,7 @@ INT32 iBack; return(uiStringLength); } -UINT16 gprintfinvalidate(INT16 x, INT16 y, UINT16 * pFontString, ...) +UINT16 gprintfinvalidate(INT16 x, INT16 y, wchar_t * pFontString, ...) { va_list argptr; wchar_t string[512]; @@ -807,7 +807,7 @@ UINT16 uiStringLength, uiStringHeight; // explicit instantiating work around MSVC not supporting export templated functions/classes (jonathanl) -UINT16 gprintfRestore(INT16 x, INT16 y, UINT16 * pFontString, ...) +UINT16 gprintfRestore(INT16 x, INT16 y, wchar_t * pFontString, ...) { va_list argptr; wchar_t string[512]; diff --git a/TileEngine/Render Dirty.h b/TileEngine/Render Dirty.h index 71060374..c7f5fda7 100644 --- a/TileEngine/Render Dirty.h +++ b/TileEngine/Render Dirty.h @@ -83,7 +83,7 @@ typedef struct INT16 sY; UINT8 ubFontBack; UINT8 ubFontFore; - INT16 pzText[ 200 ]; + wchar_t pzText[ 200 ]; OVERLAY_CALLBACK BltCallback; } VIDEO_OVERLAY_DESC; @@ -124,9 +124,9 @@ BOOLEAN EmptyBackgroundRects( void ); // GPRINTF DIRTY STUFF -UINT16 gprintfdirty(INT16 x, INT16 y, UINT16 * pFontString, ...); -UINT16 gprintfinvalidate(INT16 x, INT16 y, UINT16 * pFontString, ...); -UINT16 gprintfRestore(INT16 x, INT16 y, UINT16 * pFontString, ...); +UINT16 gprintfdirty(INT16 x, INT16 y, wchar_t * pFontString, ...); +UINT16 gprintfinvalidate(INT16 x, INT16 y, wchar_t * pFontString, ...); +UINT16 gprintfRestore(INT16 x, INT16 y, wchar_t * pFontString, ...); // VIDEO OVERLAY STUFF diff --git a/TileEngine/Tactical Placement GUI.cpp b/TileEngine/Tactical Placement GUI.cpp index 8b73e549..0bb92a02 100644 --- a/TileEngine/Tactical Placement GUI.cpp +++ b/TileEngine/Tactical Placement GUI.cpp @@ -440,7 +440,7 @@ void RenderTacticalPlacementGUI() SOLDIERTYPE *pSoldier; UINT32 uiDestPitchBYTES; UINT16 usHatchColor; - UINT16 str[ 128 ]; + wchar_t str[ 128 ]; UINT8 *pDestBuf; UINT8 ubColor; diff --git a/TileEngine/worlddef.cpp b/TileEngine/worlddef.cpp index 1f03ddcd..e9e5a7d5 100644 --- a/TileEngine/worlddef.cpp +++ b/TileEngine/worlddef.cpp @@ -2229,7 +2229,7 @@ BOOLEAN EvaluateWorld( UINT8 * pSector, UINT8 ubLevel ) INT32 cnt; INT32 i; INT32 iTilesetID; - UINT16 str[40]; + wchar_t str[40]; UINT8 bCounts[ WORLD_MAX ][8]; UINT8 ubCombine; UINT8 szDirFilename[ 50 ]; diff --git a/Utils/Animated ProgressBar.cpp b/Utils/Animated ProgressBar.cpp index 401dc93d..da661245 100644 --- a/Utils/Animated ProgressBar.cpp +++ b/Utils/Animated ProgressBar.cpp @@ -128,7 +128,7 @@ void DefineProgressBarPanel( UINT32 ubID, UINT8 r, UINT8 g, UINT8 b, //Assigning a title for the panel will automatically position the text horizontally centered on the //panel and vertically centered from the top of the panel, to the top of the progress bar. -void SetProgressBarTitle( UINT32 ubID, UINT16 *pString, UINT32 usFont, UINT8 ubForeColor, UINT8 ubShadowColor ) +void SetProgressBarTitle( UINT32 ubID, wchar_t *pString, UINT32 usFont, UINT8 ubForeColor, UINT8 ubShadowColor ) { PROGRESSBAR *pCurr; Assert( ubID < MAX_PROGRESSBARS ); @@ -142,7 +142,7 @@ void SetProgressBarTitle( UINT32 ubID, UINT16 *pString, UINT32 usFont, UINT8 ubF } if( pString && wcslen( pString ) ) { - pCurr->swzTitle = (UINT16*)MemAlloc( sizeof( UINT16 ) * ( wcslen( pString ) + 1 ) ); + pCurr->swzTitle = (wchar_t*)MemAlloc( sizeof( wchar_t ) * ( wcslen( pString ) + 1 ) ); swprintf( pCurr->swzTitle, pString ); } pCurr->usTitleFont = (UINT16)usFont; @@ -186,7 +186,7 @@ void RemoveProgressBar( UINT8 ubID ) //As the process animates using UpdateProgressBar( 0 to 100 ), the total progress bar will only reach 30% //at the 100% mark within UpdateProgressBar. At that time, you would go onto the next step, resetting the //relative start and end percentage from 30 to whatever, until your done. -void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32 uiRelEndPerc, UINT16 *str) +void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32 uiRelEndPerc, wchar_t *str) { PROGRESSBAR *pCurr; UINT16 usStartX, usStartY; diff --git a/Utils/Animated ProgressBar.h b/Utils/Animated ProgressBar.h index 01929d29..69d15cb3 100644 --- a/Utils/Animated ProgressBar.h +++ b/Utils/Animated ProgressBar.h @@ -12,7 +12,7 @@ typedef struct PROGRESSBAR BOOLEAN fPanel; UINT16 usPanelLeft, usPanelTop, usPanelRight, usPanelBottom; UINT16 usColor, usLtColor, usDkColor; - UINT16 *swzTitle; + wchar_t *swzTitle; UINT16 usTitleFont; UINT8 ubTitleFontForeColor, ubTitleFontShadowColor; UINT16 usMsgFont; @@ -61,7 +61,7 @@ void RemoveProgressBar( UINT8 ubID ); //As the process animates using UpdateProgressBar( 0 to 100 ), the total progress bar will only reach 30% //at the 100% mark within UpdateProgressBar. At that time, you would go onto the next step, resetting the //relative start and end percentage from 30 to whatever, until your done. -void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32 uiRelEndPerc, UINT16 *str); +void SetRelativeStartAndEndPercentage( UINT8 ubID, UINT32 uiRelStartPerc, UINT32 uiRelEndPerc, wchar_t *str); //This part renders the progress bar at the percentage level that you specify. If you have set relative //percentage values in the above function, then the uiPercentage will be reflected based off of the relative diff --git a/Utils/Font Control.cpp b/Utils/Font Control.cpp index 76a964f6..3f2b8391 100644 --- a/Utils/Font Control.cpp +++ b/Utils/Font Control.cpp @@ -354,7 +354,7 @@ UINT16 WFGetFontHeight( INT32 FontNum ) } -INT16 WFStringPixLength( UINT16 *string,INT32 UseFont ) +INT16 WFStringPixLength( wchar_t *string,INT32 UseFont ) { if ( USE_WINFONTS( ) ) { diff --git a/Utils/Font Control.h b/Utils/Font Control.h index ab95bccc..1d016a88 100644 --- a/Utils/Font Control.h +++ b/Utils/Font Control.h @@ -22,7 +22,7 @@ extern INT32 giCurWinFont; // ATE: A few winfont wrappers.. UINT16 WFGetFontHeight( INT32 FontNum ); -INT16 WFStringPixLength( UINT16 *string,INT32 UseFont ); +INT16 WFStringPixLength( wchar_t *string,INT32 UseFont ); diff --git a/Utils/MercTextBox.cpp b/Utils/MercTextBox.cpp index d9c82378..e58fc5c6 100644 --- a/Utils/MercTextBox.cpp +++ b/Utils/MercTextBox.cpp @@ -392,7 +392,7 @@ INT32 PrepareMercPopupBox( INT32 iBoxId, UINT8 ubBackgroundIndex, UINT8 ubBorde // reset flags guiFlags = 0; - usStringPixLength = WFStringPixLength( (UINT16 *) pString, TEXT_POPUP_FONT); + usStringPixLength = WFStringPixLength( pString, TEXT_POPUP_FONT); if( usStringPixLength < ( usWidth - ( MERC_TEXT_POPUP_WINDOW_TEXT_OFFSET_X ) * 2 ) ) { diff --git a/Utils/Text Input.cpp b/Utils/Text Input.cpp index 574389c5..3401a95f 100644 --- a/Utils/Text Input.cpp +++ b/Utils/Text Input.cpp @@ -32,7 +32,7 @@ void AddChar( UINT32 uiKey ); void RemoveChar( UINT8 ubArrayIndex ); void DeleteHilitedText(); -void DoublePercentileCharacterFromStringIntoString( UINT16 *pSrcString, UINT16 *pDstString ); +void DoublePercentileCharacterFromStringIntoString( wchar_t *pSrcString, wchar_t *pDstString ); //All exclusive input types are handled in this function. void HandleExclusiveInput( UINT32 uiKey ); @@ -63,7 +63,7 @@ typedef struct TEXTINPUTNODE{ UINT8 ubID; UINT16 usInputType; UINT8 ubMaxChars; - UINT16 *szString; + wchar_t *szString; UINT8 ubStrLen; BOOLEAN fEnabled; BOOLEAN fUserField; @@ -238,7 +238,7 @@ void KillAllTextInputModes() //of calls to this function dictate the TAB order from traversing from one field to the next. This //function adds mouse regions and processes them for you, as well as deleting them when you are done. void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT8 bPriority, - UINT16 *szInitText, UINT8 ubMaxChars, UINT16 usInputType ) + wchar_t *szInitText, UINT8 ubMaxChars, UINT16 usInputType ) { TEXTINPUTNODE *pNode; pNode = (TEXTINPUTNODE*)MemAlloc(sizeof(TEXTINPUTNODE)); @@ -266,7 +266,7 @@ void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, IN if( usInputType == INPUTTYPE_EXCLUSIVE_24HOURCLOCK ) ubMaxChars = 6; //Allocate and copy the string. - pNode->szString = (UINT16*)MemAlloc( (ubMaxChars+1)*sizeof(UINT16) ); + pNode->szString = (wchar_t*)MemAlloc( (ubMaxChars+1)*sizeof(wchar_t) ); Assert( pNode->szString ); if( szInitText ) { @@ -383,7 +383,7 @@ INT16 GetActiveFieldID() //This is a useful call made from an external user input field. Using the previous file dialog example, this //call would be made when the user selected a different filename in the list via clicking or scrolling with //the arrows, or even using alpha chars to jump to the appropriate filename. -void SetInputFieldStringWith16BitString( UINT8 ubField, UINT16 *szNewText ) +void SetInputFieldStringWith16BitString( UINT8 ubField, wchar_t *szNewText ) { TEXTINPUTNODE *curr; curr = gpTextInputHead; @@ -458,7 +458,7 @@ void Get8BitStringFromField( UINT8 ubField, UINT8 *szString ) szString[0] = '\0'; } -void Get16BitStringFromField( UINT8 ubField, UINT16 *szString ) +void Get16BitStringFromField( UINT8 ubField, wchar_t *szString ) { TEXTINPUTNODE *curr; curr = gpTextInputHead; @@ -478,8 +478,8 @@ void Get16BitStringFromField( UINT8 ubField, UINT16 *szString ) //returns -1 if blank or invalid. Only works for positive numbers. INT32 GetNumericStrictValueFromField( UINT8 ubField ) { - UINT16 *ptr; - UINT16 str[20]; + wchar_t *ptr; + wchar_t str[20]; INT32 total; Get16BitStringFromField( ubField, str ); //Blank string, so return -1 @@ -1242,7 +1242,7 @@ void RenderActiveTextField() { UINT32 uiCursorXPos; UINT16 usOffset; - UINT16 str[ 256 ]; + wchar_t str[ 256 ]; if( !gpActive || !gpActive->szString ) return; @@ -1320,7 +1320,7 @@ void RenderInactiveTextField( UINT8 ubID ) { UINT16 usOffset; TEXTINPUTNODE* pNode, *curr; - UINT16 str[ 256 ]; + wchar_t str[ 256 ]; curr = gpTextInputHead; pNode = NULL; while( curr ) @@ -1348,7 +1348,7 @@ void RenderInactiveTextField( UINT8 ubID ) void RenderInactiveTextFieldNode( TEXTINPUTNODE *pNode ) { UINT16 usOffset; - UINT16 str[ 256 ]; + wchar_t str[ 256 ]; if( !pNode || !pNode->szString ) return; SaveFontSettings(); @@ -1747,7 +1747,7 @@ void SetExclusive24HourTimeValue( UINT8 ubField, UINT16 usTime ) } } -void DoublePercentileCharacterFromStringIntoString( UINT16 *pSrcString, UINT16 *pDstString ) +void DoublePercentileCharacterFromStringIntoString( wchar_t *pSrcString, wchar_t *pDstString ) { INT32 iSrcIndex = 0, iDstIndex = 0; while( pSrcString[ iSrcIndex ] != 0 ) diff --git a/Utils/Text Input.h b/Utils/Text Input.h index 58f024ce..6bd28892 100644 --- a/Utils/Text Input.h +++ b/Utils/Text Input.h @@ -90,7 +90,7 @@ UINT16 GetTextInputCursor(); //of calls to this function dictate the TAB order from traversing from one field to the next. This //function adds mouse regions and processes them for you, as well as deleting them when you are done. void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, INT8 bPriority, - UINT16 *szInitText, UINT8 ubMaxChars, UINT16 usInputType ); + wchar_t *szInitText, UINT8 ubMaxChars, UINT16 usInputType ); //This allows you to insert special processing functions and modes that can't be determined here. An example //would be a file dialog where there would be a file list. This file list would be accessed using the Win95 @@ -113,13 +113,13 @@ void RemoveTextInputField( UINT8 ubField ); //This is a useful call made from an external user input field. Using the previous file dialog example, this //call would be made when the user selected a different filename in the list via clicking or scrolling with //the arrows, or even using alpha chars to jump to the appropriate filename. -void SetInputFieldStringWith16BitString( UINT8 ubField, UINT16 *szNewText ); +void SetInputFieldStringWith16BitString( UINT8 ubField, wchar_t *szNewText ); void SetInputFieldStringWith8BitString( UINT8 ubField, UINT8 * szNewText ); //Allows external functions to access the strings within the fields at anytime. void Get8BitStringFromField( UINT8 ubField, UINT8 *szString ); -void Get16BitStringFromField( UINT8 ubField, UINT16 *szString ); +void Get16BitStringFromField( UINT8 ubField, wchar_t *szString ); //Utility functions for the INPUTTYPE_EXCLUSIVE_24HOURCLOCK input type. UINT16 GetExclusive24HourTimeValueFromField( UINT8 ubField ); diff --git a/Utils/Text Utils.cpp b/Utils/Text Utils.cpp index 840d4de6..3efdf720 100644 --- a/Utils/Text Utils.cpp +++ b/Utils/Text Utils.cpp @@ -504,15 +504,15 @@ void LoadAllExternalText( void ) LoadAllItemNames(); } -INT16* GetWeightUnitString( void ) +wchar_t* GetWeightUnitString( void ) { if ( gGameSettings.fOptions[ TOPTION_USE_METRIC_SYSTEM ] ) // metric { - return(INT16 *)( pMessageStrings[ MSG_KILOGRAM_ABBREVIATION ] ); + return( pMessageStrings[ MSG_KILOGRAM_ABBREVIATION ] ); } else { - return(INT16 *)( pMessageStrings[ MSG_POUND_ABBREVIATION ] ); + return( pMessageStrings[ MSG_POUND_ABBREVIATION ] ); } } diff --git a/Utils/Text.h b/Utils/Text.h index 7d4c269e..d665a478 100644 --- a/Utils/Text.h +++ b/Utils/Text.h @@ -8,14 +8,14 @@ #define STRING_LENGTH 255 extern STR16 pCreditsJA2113[]; -extern UINT16 ShortItemNames[MAXITEMS][80]; -extern UINT16 ItemNames[MAXITEMS][80]; -extern UINT16 AmmoCaliber[MAXITEMS][20]; -extern UINT16 BobbyRayAmmoCaliber[MAXITEMS][20]; -extern UINT16 WeaponType[MAXITEMS][30]; +extern wchar_t ShortItemNames[MAXITEMS][80]; +extern wchar_t ItemNames[MAXITEMS][80]; +extern wchar_t AmmoCaliber[MAXITEMS][20]; +extern wchar_t BobbyRayAmmoCaliber[MAXITEMS][20]; +extern wchar_t WeaponType[MAXITEMS][30]; -extern UINT16 Message[][STRING_LENGTH]; -extern UINT16 TeamTurnString[][STRING_LENGTH]; +extern wchar_t Message[][STRING_LENGTH]; +extern wchar_t TeamTurnString[][STRING_LENGTH]; extern STR16 pMilitiaControlMenuStrings[]; //lal //extern STR16 pTalkToAllMenuStrings[]; extern STR16 pAssignMenuStrings[]; @@ -261,7 +261,7 @@ enum }; extern STR16 pMessageStrings[]; -extern UINT16 ItemPickupHelpPopup[][40]; +extern wchar_t ItemPickupHelpPopup[][40]; enum { @@ -383,20 +383,20 @@ enum #define MED_STRING_LENGTH 80 #define SMALL_STRING_LENGTH 20 -extern UINT16 TacticalStr[][MED_STRING_LENGTH]; -extern UINT16 LargeTacticalStr[][ LARGE_STRING_LENGTH ]; +extern wchar_t TacticalStr[][MED_STRING_LENGTH]; +extern wchar_t LargeTacticalStr[][ LARGE_STRING_LENGTH ]; -extern UINT16 zDialogActions[][ SMALL_STRING_LENGTH ]; -extern UINT16 zDealerStrings[][ SMALL_STRING_LENGTH ]; -extern UINT16 zTalkMenuStrings[][ SMALL_STRING_LENGTH ]; +extern wchar_t zDialogActions[][ SMALL_STRING_LENGTH ]; +extern wchar_t zDealerStrings[][ SMALL_STRING_LENGTH ]; +extern wchar_t zTalkMenuStrings[][ SMALL_STRING_LENGTH ]; extern STR16 gzMoneyAmounts[6]; -extern INT16 gzProsLabel[10]; -extern INT16 gzConsLabel[10]; -extern INT16 gMoneyStatsDesc[][ 13 ]; -extern INT16 gWeaponStatsDesc[][ 14 ]; +extern wchar_t gzProsLabel[10]; +extern wchar_t gzConsLabel[10]; +extern wchar_t gMoneyStatsDesc[][ 13 ]; +extern wchar_t gWeaponStatsDesc[][ 14 ]; extern STR16 sKeyDescriptionStrings[2]; -extern UINT16 zHealthStr[][13]; +extern wchar_t zHealthStr[][13]; extern STR16 zVehicleName[ 6 ]; enum @@ -1522,7 +1522,7 @@ STR16 gzCreditNameTitle[]; STR16 gzCreditNameFunny[]; -extern INT16 * GetWeightUnitString( void ); +extern wchar_t * GetWeightUnitString( void ); FLOAT GetWeightBasedOnMetricOption( UINT32 uiObjectWeight ); diff --git a/Utils/Utilities.cpp b/Utils/Utilities.cpp index 4c74cb0a..6b99979a 100644 --- a/Utils/Utilities.cpp +++ b/Utils/Utilities.cpp @@ -197,17 +197,17 @@ BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UIN } -BOOLEAN WrapString( INT16 *pStr, INT16 *pStr2, UINT16 usWidth, INT32 uiFont ) +BOOLEAN WrapString( wchar_t *pStr, wchar_t *pStr2, UINT16 usWidth, INT32 uiFont ) { UINT32 Cur, uiLet, uiNewLet, uiHyphenLet; - UINT16 *curletter,transletter; + wchar_t *curletter,transletter; BOOLEAN fLineSplit = FALSE; HVOBJECT hFont; // CHECK FOR WRAP Cur=0; uiLet = 0; - curletter = (UINT16 *)pStr; + curletter = pStr; // GET FONT hFont = GetFontObject( uiFont ); diff --git a/Utils/Utilities.h b/Utils/Utilities.h index 02fbff7c..55357c0d 100644 --- a/Utils/Utilities.h +++ b/Utils/Utilities.h @@ -15,7 +15,7 @@ BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UIN void FilenameForBPP(STR pFilename, STR pDestination); -BOOLEAN WrapString( INT16 *pStr, INT16 *pStr2, UINT16 usWidth, INT32 uiFont ); +BOOLEAN WrapString( wchar_t *pStr, wchar_t *pStr2, UINT16 usWidth, INT32 uiFont ); BOOLEAN IfWinNT(void); BOOLEAN IfWin95(void); diff --git a/Utils/WordWrap.cpp b/Utils/WordWrap.cpp index 6a9df1cb..abdaaf32 100644 --- a/Utils/WordWrap.cpp +++ b/Utils/WordWrap.cpp @@ -1973,7 +1973,7 @@ BOOLEAN ReduceStringLength( STR16 pString, UINT32 uiWidthToFitIn, UINT32 uiFont UINT32 uiSrcStringCntr = 0; UINT32 uiOneCharWidth = 0; - uiStringPixWidth = WFStringPixLength( (UINT16 *)pString, uiFont ); + uiStringPixWidth = WFStringPixLength( pString, uiFont ); OneChar[1] = L'\0'; zTemp[0] = L'\0'; diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp index 53250564..5fa1b05a 100644 --- a/Utils/XML_Items.cpp +++ b/Utils/XML_Items.cpp @@ -1076,8 +1076,8 @@ BOOLEAN WriteItemStats() { UINT32 cnt; - UINT16 str[100]; - UINT16 strDesc[500]; + wchar_t str[100]; + wchar_t strDesc[500]; FilePrintf(hFile,"\r\n"); for(cnt = 0;cnt < 351;cnt++)//just do the old limit for now @@ -1085,7 +1085,7 @@ BOOLEAN WriteItemStats() LoadShortNameItemInfo( (UINT16)cnt, str ); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"writeitemstats: itemname"); - UINT16 * szRemainder = str; //the remaining string to be output (for making valid XML) + wchar_t * szRemainder = str; //the remaining string to be output (for making valid XML) FilePrintf(hFile,"\t\r\n"); FilePrintf(hFile,"\t\t%d\r\n", cnt); @@ -1094,7 +1094,7 @@ BOOLEAN WriteItemStats() while(szRemainder[0] != '\0') { UINT32 uiCharLoc = strcspn(szRemainder,"&<>\'\"\0"); - UINT16 invChar = szRemainder[uiCharLoc]; + wchar_t invChar = szRemainder[uiCharLoc]; if(uiCharLoc) { @@ -1146,7 +1146,7 @@ BOOLEAN WriteItemStats() while(szRemainder[0] != '\0') { UINT32 uiCharLoc = strcspn(szRemainder,"&<>\'\"\0"); - UINT16 invChar = szRemainder[uiCharLoc]; + wchar_t invChar = szRemainder[uiCharLoc]; if(uiCharLoc) { @@ -1197,7 +1197,7 @@ BOOLEAN WriteItemStats() while(szRemainder[0] != '\0') { UINT32 uiCharLoc = strcspn(szRemainder,"&<>\'\"\0"); - UINT16 invChar = szRemainder[uiCharLoc]; + wchar_t invChar = szRemainder[uiCharLoc]; //DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"writeitemstats: characters set"); @@ -1268,7 +1268,7 @@ BOOLEAN WriteItemStats() while(szRemainder[0] != '\0') { UINT32 uiCharLoc = strcspn(szRemainder,"&<>\'\"\0"); - UINT16 invChar = szRemainder[uiCharLoc]; + wchar_t invChar = szRemainder[uiCharLoc]; if(uiCharLoc) { @@ -1324,7 +1324,7 @@ BOOLEAN WriteItemStats() while(szRemainder[0] != '\0') { UINT32 uiCharLoc = strcspn(szRemainder,"&<>\'\"\0"); - UINT16 invChar = szRemainder[uiCharLoc]; + wchar_t invChar = szRemainder[uiCharLoc]; if(uiCharLoc) { diff --git a/Utils/XML_Strings.cpp b/Utils/XML_Strings.cpp index 486ec591..35cdf48d 100644 --- a/Utils/XML_Strings.cpp +++ b/Utils/XML_Strings.cpp @@ -207,7 +207,7 @@ BOOLEAN WriteStringArray() { FilePrintf(hFile,"\t"); - UINT16 * szRemainder = AmmoCaliber[cnt]; //the remaining string to be output (for making valid XML) + wchar_t * szRemainder = AmmoCaliber[cnt]; //the remaining string to be output (for making valid XML) while(szRemainder[0] != '\0') { diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index 958f23c5..e7f094dc 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -118,13 +118,13 @@ STR16 pCreditsJA2113[] = L"@};(All other community members who contributed input and feedback!)", }; -UINT16 ItemNames[MAXITEMS][80] = +wchar_t ItemNames[MAXITEMS][80] = { L"", }; -UINT16 ShortItemNames[MAXITEMS][80] = +wchar_t ShortItemNames[MAXITEMS][80] = { L"", }; @@ -134,7 +134,7 @@ UINT16 ShortItemNames[MAXITEMS][80] = // NATO is the North Atlantic Treaty Organization // WP is Warsaw Pact // cal is an abbreviation for calibre -UINT16 AmmoCaliber[MAXITEMS][20];// = +wchar_t AmmoCaliber[MAXITEMS][20];// = //{ // L"0", // L".38 cal", @@ -164,7 +164,7 @@ UINT16 AmmoCaliber[MAXITEMS][20];// = // NATO is the North Atlantic Treaty Organization // WP is Warsaw Pact // cal is an abbreviation for calibre -UINT16 BobbyRayAmmoCaliber[MAXITEMS][20] ;//= +wchar_t BobbyRayAmmoCaliber[MAXITEMS][20] ;//= //{ // L"0", // L".38 cal", @@ -188,7 +188,7 @@ UINT16 BobbyRayAmmoCaliber[MAXITEMS][20] ;//= //}; -UINT16 WeaponType[MAXITEMS][30] = +wchar_t WeaponType[MAXITEMS][30] = { L"Other", L"Pistol", @@ -201,7 +201,7 @@ UINT16 WeaponType[MAXITEMS][30] = L"Shotgun", }; -UINT16 TeamTurnString[][STRING_LENGTH] = +wchar_t TeamTurnString[][STRING_LENGTH] = { L"Player's Turn", // player's turn L"Opponents' Turn", @@ -211,7 +211,7 @@ UINT16 TeamTurnString[][STRING_LENGTH] = // planning turn }; -UINT16 Message[][STRING_LENGTH] = +wchar_t Message[][STRING_LENGTH] = { L"", @@ -1079,7 +1079,7 @@ STR16 sKeyDescriptionStrings[2] = //The headers used to describe various weapon statistics. -INT16 gWeaponStatsDesc[][ 14 ] = +wchar_t gWeaponStatsDesc[][ 14 ] = { L"Weight (%s):", L"Status:", @@ -1102,7 +1102,7 @@ INT16 gWeaponStatsDesc[][ 14 ] = //The headers used for the merc's money. -INT16 gMoneyStatsDesc[][ 13 ] = +wchar_t gMoneyStatsDesc[][ 13 ] = { L"Amount", L"Remaining:", //this is the overall balance @@ -1118,7 +1118,7 @@ INT16 gMoneyStatsDesc[][ 13 ] = //The health of various creatures, enemies, characters in the game. The numbers following each are for comment //only, but represent the precentage of points remaining. -UINT16 zHealthStr[][13] = +wchar_t zHealthStr[][13] = { L"DYING", // >= 0 L"CRITICAL", // >= 15 @@ -1140,18 +1140,18 @@ STR16 gzMoneyAmounts[6] = }; // short words meaning "Advantages" for "Pros" and "Disadvantages" for "Cons." -INT16 gzProsLabel[10] = +wchar_t gzProsLabel[10] = { L"Pros:", }; -INT16 gzConsLabel[10] = +wchar_t gzConsLabel[10] = { L"Cons:", }; //Conversation options a player has when encountering an NPC -UINT16 zTalkMenuStrings[6][ SMALL_STRING_LENGTH ] = +wchar_t zTalkMenuStrings[6][ SMALL_STRING_LENGTH ] = { L"Come Again?", //meaning "Repeat yourself" L"Friendly", //approach in a friendly @@ -1162,7 +1162,7 @@ UINT16 zTalkMenuStrings[6][ SMALL_STRING_LENGTH ] = }; //Some NPCs buy, sell or repair items. These different options are available for those NPCs as well. -UINT16 zDealerStrings[4][ SMALL_STRING_LENGTH ]= +wchar_t zDealerStrings[4][ SMALL_STRING_LENGTH ]= { L"Buy/Sell", L"Buy", @@ -1170,7 +1170,7 @@ UINT16 zDealerStrings[4][ SMALL_STRING_LENGTH ]= L"Repair", }; -UINT16 zDialogActions[1][ SMALL_STRING_LENGTH ] = +wchar_t zDialogActions[1][ SMALL_STRING_LENGTH ] = { L"Done", }; @@ -1211,7 +1211,7 @@ STR16 zVehicleName[] = //These are messages Used in the Tactical Screen -UINT16 TacticalStr[][ MED_STRING_LENGTH ] = +wchar_t TacticalStr[][ MED_STRING_LENGTH ] = { L"Air Raid", L"Apply first aid automatically?", @@ -2550,7 +2550,7 @@ STR16 pUpdatePanelButtons[] = // Text which appears when everyone on your team is incapacitated and incapable of battle -UINT16 LargeTacticalStr[][ LARGE_STRING_LENGTH ] = +wchar_t LargeTacticalStr[][ LARGE_STRING_LENGTH ] = { L"You have been defeated in this sector!", L"The enemy, having no mercy for the team's soul, devours each and every one of you!", @@ -3792,7 +3792,7 @@ STR16 pMessageStrings[] = }; -UINT16 ItemPickupHelpPopup[][40] = +wchar_t ItemPickupHelpPopup[][40] = { L"OK", L"Scroll Up", diff --git a/aniviewscreen.cpp b/aniviewscreen.cpp index 50887f95..eab29191 100644 --- a/aniviewscreen.cpp +++ b/aniviewscreen.cpp @@ -350,7 +350,7 @@ void BuildListFile( ) int numEntries = 0; int cnt; UINT16 usState; - INT16 zError[128]; + wchar_t zError[128]; //Verify the existance of the header text file. diff --git a/gameloop.cpp b/gameloop.cpp index a512567e..b5a2816c 100644 --- a/gameloop.cpp +++ b/gameloop.cpp @@ -261,7 +261,7 @@ void GameLoop(void) swprintf( zText, pMessageStrings[ MSG_LOWDISKSPACE_WARNING ], zSpaceOnDrive, zSizeNeeded ); if( guiPreviousOptionScreen == MAP_SCREEN ) - DoMapMessageBox( MSG_BOX_BASIC_STYLE, (INT16 *)zText, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, zText, MAP_SCREEN, MSG_BOX_FLAG_OK, NULL ); else DoMessageBox( MSG_BOX_BASIC_STYLE, zText, GAME_SCREEN, MSG_BOX_FLAG_OK, NULL, NULL ); } @@ -424,17 +424,17 @@ void HandleShortCutExitState( void ) if ( (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) ) { // set up for mapscreen - DoMapMessageBox( MSG_BOX_BASIC_STYLE,(INT16 *) pMessageStrings[ MSG_EXITGAME ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, EndGameMessageBoxCallBack ); + DoMapMessageBox( MSG_BOX_BASIC_STYLE, pMessageStrings[ MSG_EXITGAME ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, EndGameMessageBoxCallBack ); } else if( guiCurrentScreen == LAPTOP_SCREEN ) { // set up for laptop - DoLapTopSystemMessageBox( MSG_BOX_LAPTOP_DEFAULT, (INT16 *) pMessageStrings[ MSG_EXITGAME ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, EndGameMessageBoxCallBack ); + DoLapTopSystemMessageBox( MSG_BOX_LAPTOP_DEFAULT, pMessageStrings[ MSG_EXITGAME ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, EndGameMessageBoxCallBack ); } else if( guiCurrentScreen == SHOPKEEPER_SCREEN ) { - DoSkiMessageBox( MSG_BOX_BASIC_STYLE, (STR16)pMessageStrings[ MSG_EXITGAME ], SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, EndGameMessageBoxCallBack ); + DoSkiMessageBox( MSG_BOX_BASIC_STYLE, pMessageStrings[ MSG_EXITGAME ], SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, EndGameMessageBoxCallBack ); } else { diff --git a/jascreens.cpp b/jascreens.cpp index f367bef6..39889e1f 100644 --- a/jascreens.cpp +++ b/jascreens.cpp @@ -266,7 +266,7 @@ UINT32 ErrorScreenHandle(void) InputAtom InputEvent; static BOOLEAN fFirstTime = FALSE; #ifdef JA2BETAVERSION - UINT16 str[256]; + wchar_t str[256]; #endif // For quick setting of new video stuff / to be changed