diff --git a/Laptop/BobbyRAmmo.cpp b/Laptop/BobbyRAmmo.cpp index b761998c..d94c04c0 100644 --- a/Laptop/BobbyRAmmo.cpp +++ b/Laptop/BobbyRAmmo.cpp @@ -95,8 +95,9 @@ void RenderBobbyRAmmo() MarkButtonsDirty( ); RenderWWWProgramTitleBar( ); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); - fReDrawScreenFlag = TRUE; - fPausedReDrawScreenFlag = TRUE; + //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h + // fReDrawScreenFlag = TRUE; + //fPausedReDrawScreenFlag = TRUE; } diff --git a/Laptop/BobbyRArmour.cpp b/Laptop/BobbyRArmour.cpp index 2ff07e2d..30a084d8 100644 --- a/Laptop/BobbyRArmour.cpp +++ b/Laptop/BobbyRArmour.cpp @@ -97,8 +97,9 @@ void RenderBobbyRArmour() MarkButtonsDirty( ); RenderWWWProgramTitleBar( ); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); - fReDrawScreenFlag = TRUE; - fPausedReDrawScreenFlag = TRUE; + //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h + // fReDrawScreenFlag = TRUE; + //fPausedReDrawScreenFlag = TRUE; } diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp index cf615971..e040c7a0 100644 --- a/Laptop/BobbyRGuns.cpp +++ b/Laptop/BobbyRGuns.cpp @@ -467,8 +467,9 @@ void RenderBobbyRGuns() RenderWWWProgramTitleBar( ); //InvalidateRegion(0,0,SCREEN_WIDTH, SCREEN_HEIGHT); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); - fReDrawScreenFlag = TRUE; - fPausedReDrawScreenFlag = TRUE; + //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h + // fReDrawScreenFlag = TRUE; + //fPausedReDrawScreenFlag = TRUE; } diff --git a/Laptop/BobbyRMisc.cpp b/Laptop/BobbyRMisc.cpp index 47333715..7059e421 100644 --- a/Laptop/BobbyRMisc.cpp +++ b/Laptop/BobbyRMisc.cpp @@ -97,8 +97,9 @@ void RenderBobbyRMisc() MarkButtonsDirty( ); RenderWWWProgramTitleBar( ); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); - fReDrawScreenFlag = TRUE; - fPausedReDrawScreenFlag = TRUE; + //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h + // fReDrawScreenFlag = TRUE; + //fPausedReDrawScreenFlag = TRUE; } diff --git a/Laptop/BobbyRUsed.cpp b/Laptop/BobbyRUsed.cpp index 386962d0..8a48c740 100644 --- a/Laptop/BobbyRUsed.cpp +++ b/Laptop/BobbyRUsed.cpp @@ -93,8 +93,9 @@ void RenderBobbyRUsed() MarkButtonsDirty( ); RenderWWWProgramTitleBar( ); InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y); - fReDrawScreenFlag = TRUE; - fPausedReDrawScreenFlag = TRUE; + //Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h + // fReDrawScreenFlag = TRUE; + //fPausedReDrawScreenFlag = TRUE; } diff --git a/Laptop/BrokenLink.cpp b/Laptop/BrokenLink.cpp index 9c55c677..c0c15267 100644 --- a/Laptop/BrokenLink.cpp +++ b/Laptop/BrokenLink.cpp @@ -61,7 +61,7 @@ void RenderBrokenLink() void DrawBrokenLinkWhiteBackground() { - ColorFillVideoSurfaceArea( FRAME_BUFFER, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y - 55, Get16BPPColor( FROMRGB( 255, 255, 255) ) ); + ColorFillVideoSurfaceArea( FRAME_BUFFER, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y /*- 55*/, Get16BPPColor( FROMRGB( 255, 255, 255) ) ); } diff --git a/Laptop/aim.h b/Laptop/aim.h index 15d933aa..930c4b07 100644 --- a/Laptop/aim.h +++ b/Laptop/aim.h @@ -78,7 +78,8 @@ extern AIM_AVAILABLE gAimAvailability[ NUM_PROFILES ]; #define BOTTOM_BUTTON_START_HEIGHT 18 #define BOTTOM_BUTTON_START_X LAPTOP_SCREEN_UL_X + 25 -#define BOTTOM_BUTTON_START_Y LAPTOP_SCREEN_WEB_LR_Y - BOTTOM_BUTTON_START_HEIGHT - 57 +//#define BOTTOM_BUTTON_START_Y LAPTOP_SCREEN_WEB_LR_Y - BOTTOM_BUTTON_START_HEIGHT - 57 +#define BOTTOM_BUTTON_START_Y (LAPTOP_SCREEN_WEB_LR_Y - BOTTOM_BUTTON_START_HEIGHT - 3) #define BOTTOM_BUTTON_AMOUNT NUM_AIM_SCREENS #define BOTTOM_BUTTON_GAP 0 #define BOTTOM_BUTTON_TEXT_Y BOTTOM_BUTTON_START_Y + 6 diff --git a/Laptop/laptop.h b/Laptop/laptop.h index e97c8451..e154d90b 100644 --- a/Laptop/laptop.h +++ b/Laptop/laptop.h @@ -173,22 +173,22 @@ enum{ #define LAPTOP_X iScreenWidthOffset #define LAPTOP_Y iScreenHeightOffset - -#define LAPTOP_SCREEN_UL_X iScreenWidthOffset + 111 -#define LAPTOP_SCREEN_UL_Y iScreenHeightOffset + 27 +//Moa: added brackets around definitions below to make them work. Especialy LAPTOP_SCREEN_HEIGHT and all its references resulted in wrong regions for invalidating screen which in return forced to redraw the screen emidiatly after render as invalidate did not work. Removed those redraw flags from all render functions I found (f.i.RenderBobbyRUsed()), but most likely missed some of them. +#define LAPTOP_SCREEN_UL_X (iScreenWidthOffset + 111) +#define LAPTOP_SCREEN_UL_Y (iScreenHeightOffset + 27) -#define LAPTOP_SCREEN_LR_X iScreenWidthOffset + 613 -#define LAPTOP_SCREEN_LR_Y iScreenHeightOffset + 427 -#define LAPTOP_UL_X iScreenWidthOffset + 24 -#define LAPTOP_UL_Y iScreenHeightOffset + 27 +#define LAPTOP_SCREEN_LR_X (iScreenWidthOffset + 613) +#define LAPTOP_SCREEN_LR_Y (iScreenHeightOffset + 427) +#define LAPTOP_UL_X (iScreenWidthOffset + 24) +#define LAPTOP_UL_Y (iScreenHeightOffset + 27) -#define LAPTOP_SCREEN_WIDTH LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X -#define LAPTOP_SCREEN_HEIGHT LAPTOP_SCREEN_LR_Y - LAPTOP_SCREEN_UL_Y +#define LAPTOP_SCREEN_WIDTH (LAPTOP_SCREEN_LR_X - LAPTOP_SCREEN_UL_X) +#define LAPTOP_SCREEN_HEIGHT (LAPTOP_SCREEN_LR_Y - LAPTOP_SCREEN_UL_Y) // new positions for web browser -#define LAPTOP_SCREEN_WEB_UL_Y LAPTOP_SCREEN_UL_Y + 19 -#define LAPTOP_SCREEN_WEB_LR_Y LAPTOP_SCREEN_WEB_UL_Y + LAPTOP_SCREEN_HEIGHT +#define LAPTOP_SCREEN_WEB_UL_Y (LAPTOP_SCREEN_UL_Y + 19) +#define LAPTOP_SCREEN_WEB_LR_Y (LAPTOP_SCREEN_WEB_UL_Y + LAPTOP_SCREEN_HEIGHT) #define LAPTOP_SCREEN_WEB_DELTA_Y 19 //LAPTOP_SCREEN_WEB_UL_Y - LAPTOP_SCREEN_UL_Y // the laptop on/off button diff --git a/MainMenuScreen.cpp b/MainMenuScreen.cpp index a15dd30c..6933a115 100644 --- a/MainMenuScreen.cpp +++ b/MainMenuScreen.cpp @@ -28,6 +28,7 @@ #include "Multi Language Graphic Utils.h" #include "Encrypted File.h" #include "ja2 splash.h" + #include "GameVersion.h" #endif #include "gamesettings.h" diff --git a/Standard Gaming Platform/Button System.cpp b/Standard Gaming Platform/Button System.cpp index aad234aa..d7a47a98 100644 --- a/Standard Gaming Platform/Button System.cpp +++ b/Standard Gaming Platform/Button System.cpp @@ -152,6 +152,11 @@ UINT16 GetWidthOfButtonPic( UINT16 usButtonPicID, INT32 iSlot ) return ButtonPictures[ usButtonPicID ].vobj->pETRLEObject[ iSlot ].usWidth; } +UINT16 GetHeightOfButtonPic( UINT16 usButtonPicID, INT32 iSlot ) +{ + return ButtonPictures[ usButtonPicID ].vobj->pETRLEObject[ iSlot ].usHeight; +} + HVOBJECT GenericButtonGrayed[MAX_GENERIC_PICS]; HVOBJECT GenericButtonOffNormal[MAX_GENERIC_PICS]; HVOBJECT GenericButtonOffHilite[MAX_GENERIC_PICS]; diff --git a/Standard Gaming Platform/Button System.h b/Standard Gaming Platform/Button System.h index 1970b131..dad12835 100644 --- a/Standard Gaming Platform/Button System.h +++ b/Standard Gaming Platform/Button System.h @@ -360,6 +360,7 @@ void DrawCheckBoxButtonOn( INT32 iButtonID ); void DrawCheckBoxButtonOff( INT32 iButtonID ); extern UINT16 GetWidthOfButtonPic( UINT16 usButtonPicID, INT32 iSlot ); +extern UINT16 GetHeightOfButtonPic( UINT16 usButtonPicID, INT32 iSlot ); #endif diff --git a/Standard Gaming Platform/MemMan.cpp b/Standard Gaming Platform/MemMan.cpp index c9f79d90..fb18d692 100644 --- a/Standard Gaming Platform/MemMan.cpp +++ b/Standard Gaming Platform/MemMan.cpp @@ -510,8 +510,8 @@ PTR MemAllocXDebug( UINT32 size, const STR8 szCodeString, INT32 iLineNum, void * { PTR ptr; UINT16 usLength; - UINT8 str[70]; - UINT8 *pStr; + CHAR8 str[70]; + STR8 pStr; if( !size ) { @@ -553,7 +553,7 @@ PTR MemAllocXDebug( UINT32 size, const STR8 szCodeString, INT32 iLineNum, void * usLength = strlen( str ) + 1; gpMemoryTail->pCode = (UINT8*)malloc( usLength ); memset( gpMemoryTail->pCode, 0, usLength ); - strcpy( gpMemoryTail->pCode, str ); + strcpy( (STR8)gpMemoryTail->pCode, str ); //record the size gpMemoryTail->uiSize = size; @@ -617,8 +617,8 @@ PTR MemReallocXDebug( PTR ptr, UINT32 size, const STR8 szCodeString, INT32 iLine MEMORY_NODE *curr; PTR ptrNew; UINT16 usLength; - UINT8 str[70]; - UINT8 *pStr; + CHAR8 str[70]; + STR8 pStr; if( !ptr && size ) { @@ -654,7 +654,7 @@ PTR MemReallocXDebug( PTR ptr, UINT32 size, const STR8 szCodeString, INT32 iLine usLength = strlen( str ) + 1; curr->pCode = (UINT8*)malloc( usLength ); memset( curr->pCode, 0, usLength ); - strcpy( curr->pCode, str ); + strcpy( (STR8)curr->pCode, str ); } else { @@ -672,13 +672,13 @@ typedef struct DUMPFILENAME UINT8 str[70]; }DUMPFILENAME; -void DumpMemoryInfoIntoFile( UINT8 *filename, BOOLEAN fAppend ) +void DumpMemoryInfoIntoFile( CHAR8 *filename, BOOLEAN fAppend ) { MEMORY_NODE *curr; FILE *fp; DUMPFILENAME *pCode; UINT32 *puiCounter, *puiSize; - UINT8 tempCode[ 70 ]; + CHAR8 tempCode[ 70 ]; UINT32 i, uiUniqueID, uiTotalKbWasted = 0, uiBytesRemainder = 0; BOOLEAN fFound; @@ -712,11 +712,11 @@ void DumpMemoryInfoIntoFile( UINT8 *filename, BOOLEAN fAppend ) curr = gpMemoryHead; while( curr ) { - strcpy( tempCode, curr->pCode ); + strcpy( tempCode, (CHAR8*)curr->pCode ); fFound = FALSE; for( i = 0; i < uiUniqueID; i++ ) { - if( !_stricmp( tempCode, pCode[i].str ) ) + if( !_stricmp( tempCode, (CHAR8*)pCode[i].str ) ) { //same string fFound = TRUE; (puiCounter[ i ])++; @@ -726,7 +726,7 @@ void DumpMemoryInfoIntoFile( UINT8 *filename, BOOLEAN fAppend ) } if( !fFound ) { - strcpy( pCode[i].str, tempCode ); + strcpy( (CHAR8*)pCode[i].str, tempCode ); (puiSize[ i ]) += curr->uiSize; (puiCounter[ i ])++; uiUniqueID++; diff --git a/Standard Gaming Platform/MemMan.h b/Standard Gaming Platform/MemMan.h index 9460986a..f6341387 100644 --- a/Standard Gaming Platform/MemMan.h +++ b/Standard Gaming Platform/MemMan.h @@ -58,7 +58,7 @@ extern void ShutdownMemoryManager( void ); //This is the most effective way to debug memory leaks. Each memory leak will be recorded in a linked //list containing a string referring to the location in code the memory was allocated in addition to //the number of occurrences. The shutdown code will report all unhandled memory with exact location allocated. - void DumpMemoryInfoIntoFile( UINT8 *filename, BOOLEAN fAppend ); + void DumpMemoryInfoIntoFile( CHAR8 *filename, BOOLEAN fAppend ); BOOLEAN _AddAndRecordMemAlloc( UINT32 size, UINT32 uiLineNum, UINT8 *pSourceFile ); #define MemAlloc( size ) MemAllocXDebug( (size), __FILE__, __LINE__, NULL ) #define MemFree( ptr ) MemFreeXDebug( (ptr), __FILE__, __LINE__, NULL ) diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 8000b784..0c9b4e80 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -2138,7 +2138,7 @@ BOOLEAN HandleGotoNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving, BOOLE // CHECK IF THIS TILE IS A GOOD ONE! if ( !HandleNextTile( pSoldier, (INT8)pSoldier->pathing.usPathingData[ pSoldier->pathing.usPathIndex ], usNewGridNo, pSoldier->pathing.sFinalDestination ) ) { - DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "HandleGotoNewGridNo() Failed: Tile %d Was blocked", sNewGridNo ) ); + DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "HandleGotoNewGridNo() Failed: Tile %d Was blocked", usNewGridNo ) ); // ATE: If our own guy and an initial move.. display message //if ( fInitialMove && pSoldier->bTeam == gbPlayerNum ) diff --git a/Tactical/Points.cpp b/Tactical/Points.cpp index e25fc31f..90232ac9 100644 --- a/Tactical/Points.cpp +++ b/Tactical/Points.cpp @@ -188,7 +188,7 @@ INT16 TerrainActionPoints( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, INT8 default: - DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Calc AP: Unrecongnized MP type %d in %d, direction %d", sSwitchValue, sGridno, bDir ) ); + DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Calc AP: Unrecongnized MP type %d in %d, direction %d", sSwitchValue, sGridNo, bDir ) ); break; diff --git a/Tactical/Soldier Tile.cpp b/Tactical/Soldier Tile.cpp index 02998791..58727f43 100644 --- a/Tactical/Soldier Tile.cpp +++ b/Tactical/Soldier Tile.cpp @@ -82,7 +82,7 @@ void OutputDebugInfoForTurnBasedNextTileWaiting( SOLDIERTYPE * pSoldier ) if ( uiLoop > pSoldier->pathing.usPathIndex ) { usTemp = NewGridNo( usTemp, DirectionInc( (UINT8)pSoldier->pathing.usPathingData[ uiLoop ] ) ); - DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String(" Soldier path[%d]: %d == gridno %d", uiLoop, pSoldier->pathing.usPathingData[uiLoop], sTemp ) ); + DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String(" Soldier path[%d]: %d == gridno %d", uiLoop, pSoldier->pathing.usPathingData[uiLoop], usTemp ) ); } else if ( uiLoop == pSoldier->pathing.usPathIndex ) { diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index a33eb467..c50906c5 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -466,7 +466,7 @@ INT8 DecideActionSchedule( SOLDIERTYPE * pSoldier ) break; case SCHEDULE_ACTION_ENTERSECTOR: - if ( pSoldier->ubProfile != NO_PROFILE && gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags & PROFILE_MISC_FLAG2_DONT_ADD_TO_SECTOR ) + if ( pSoldier->ubProfile != NO_PROFILE && gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags2 & PROFILE_MISC_FLAG2_DONT_ADD_TO_SECTOR )//Moa: changed 'ubMiscFlags' to 'ubMiscFlags2' { // ignore. DoneScheduleAction( pSoldier ); @@ -7007,7 +7007,7 @@ void DecideAlertStatus( SOLDIERTYPE *pSoldier ) case ATTACKSLAYONLY:bSeekPts += +1; bHelpPts += 0; bWatchPts += 0; break; } - DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("decideactionred: hide = %d, seek = %d, watch = %d, help = %d",bHidePts,bSeekPts,bWatchPts,bHelpPts)); + DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("decideactionred: hide = %d, seek = %d, watch = %d, help = %d",0,bSeekPts,bWatchPts,bHelpPts)); // while one of the three main RED REACTIONS remains viable while ((bSeekPts > -90) || (bHelpPts > -90) ) { diff --git a/XML_Layout_MainMenu.cpp b/XML_Layout_MainMenu.cpp index 75fb2fcc..8d7d4451 100644 --- a/XML_Layout_MainMenu.cpp +++ b/XML_Layout_MainMenu.cpp @@ -209,7 +209,7 @@ BOOLEAN ReadInMainMenu(MAIN_MENU_VALUES *pMainMenu, STR fileName) mainMenuParseData pData; - DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Layout\LayoutMainMenu.xml" ); + DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Layout:LayoutMainMenu.xml" ); // Open file hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );