diff --git a/Editor/Editor_2005Express.vcproj b/Editor/Editor_2005Express.vcproj new file mode 100644 index 00000000..2d4c00e1 --- /dev/null +++ b/Editor/Editor_2005Express.vcproj @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Laptop/Laptop_2005Express.vcproj b/Laptop/Laptop_2005Express.vcproj new file mode 100644 index 00000000..7e97c6e4 --- /dev/null +++ b/Laptop/Laptop_2005Express.vcproj @@ -0,0 +1,634 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SaveLoadScreen.cpp b/SaveLoadScreen.cpp index 99f3f891..36da417e 100644 --- a/SaveLoadScreen.cpp +++ b/SaveLoadScreen.cpp @@ -1511,7 +1511,7 @@ BOOLEAN LoadSavedGameHeader( INT8 bEntry, SAVED_GAME_HEADER *pSaveGameHeader ) } else { - memset( &pSaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) ); + memset( pSaveGameHeader, 0, sizeof( SAVED_GAME_HEADER ) ); #ifdef JA2BETAVERSION wcscpy( pSaveGameHeader->sSavedGameDesc, L"ERROR loading saved game header, file doesn't exist!!" ); #endif diff --git a/Standard Gaming Platform/Button System.cpp b/Standard Gaming Platform/Button System.cpp index b20e2dbe..1b0ba415 100644 --- a/Standard Gaming Platform/Button System.cpp +++ b/Standard Gaming Platform/Button System.cpp @@ -2791,6 +2791,10 @@ void QuickButtonCallbackMButn( MOUSE_REGION *reg, INT32 reason ) { StateAfter = (b->uiFlags & BUTTON_CLICKED_ON) ? (TRUE) : (FALSE); } + else + { + StateAfter = !( reason & MSYS_CALLBACK_REASON_LBUTTON_UP ); + } // Play sounds for this enabled button (disabled sounds have already been done) if( b->ubSoundSchemeID && b->uiFlags & BUTTON_ENABLED ) diff --git a/Standard Gaming Platform/Compression.h b/Standard Gaming Platform/Compression.h index 4cee9e44..3f0fb7ad 100644 --- a/Standard Gaming Platform/Compression.h +++ b/Standard Gaming Platform/Compression.h @@ -23,7 +23,7 @@ // // 3) call DecompressFini() with the decompression pointer when you're done -PTR DecompressInit( BYTE * pCompressedData, UINT32 uiDataSize ); +PTR DecompressInit( PTR pCompressedData, UINT32 uiDataSize ); UINT32 Decompress( PTR pDecompPtr, BYTE * pBuffer, UINT32 uiBufferLen ); void DecompressFini( PTR pDecompPtr ); diff --git a/Standard Gaming Platform/ExceptionHandling.cpp b/Standard Gaming Platform/ExceptionHandling.cpp index 2cf7b86c..06314143 100644 --- a/Standard Gaming Platform/ExceptionHandling.cpp +++ b/Standard Gaming Platform/ExceptionHandling.cpp @@ -7,6 +7,7 @@ #include #include #include + #include "FileMan.h" #endif #include "ExceptionHandling.h" diff --git a/Standard Gaming Platform/FileCat.cpp b/Standard Gaming Platform/FileCat.cpp index 95bd9a91..d18e72af 100644 --- a/Standard Gaming Platform/FileCat.cpp +++ b/Standard Gaming Platform/FileCat.cpp @@ -73,6 +73,8 @@ size_t TFileCat::RemoveDir(std::string dir, bool pathIncludesRoot) void TFileCat::TraverseDir(std::string dir, int depth) { using std::string; + static string dot( "."); + static string dotdot( ".."); if (!dir.empty()) dir += '\\'; @@ -82,7 +84,7 @@ void TFileCat::TraverseDir(std::string dir, int depth) unsigned attrib; while ( readDir.NextFile(fileName, attrib) ) { - if (string(".") == fileName || string("..") == fileName) continue; + if (dot == fileName || dotdot == fileName) continue; string fullPath = dir + fileName; diff --git a/Standard Gaming Platform/SGP_2005Express.vcproj b/Standard Gaming Platform/SGP_2005Express.vcproj new file mode 100644 index 00000000..75bbff32 --- /dev/null +++ b/Standard Gaming Platform/SGP_2005Express.vcproj @@ -0,0 +1,566 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Standard Gaming Platform/himage.cpp b/Standard Gaming Platform/himage.cpp index 98c83414..dcbc133d 100644 --- a/Standard Gaming Platform/himage.cpp +++ b/Standard Gaming Platform/himage.cpp @@ -346,7 +346,7 @@ BOOLEAN Copy8BPPCompressedImageTo8BPPBuffer( HIMAGE hImage, BYTE *pDestBuf, UINT CHECKF( pDecompPtr ); // Allocate memory for one scanline - pScanLine = MemAlloc( hImage->usWidth ); + pScanLine = (UINT8*) MemAlloc( hImage->usWidth ); CHECKF( pScanLine ); // go past all the scanlines we don't need to process diff --git a/Standard Gaming Platform/stringicmp.cpp b/Standard Gaming Platform/stringicmp.cpp index 032b3187..89a6e259 100644 --- a/Standard Gaming Platform/stringicmp.cpp +++ b/Standard Gaming Platform/stringicmp.cpp @@ -12,6 +12,7 @@ bool TStringiLess::operator() (std::string const& s1, std::string const& s2) con // An MSVC compliance issue... //using std::toupper; +#if 0 std::string::const_iterator p1 = s1.begin(); std::string::const_iterator p2 = s2.begin(); @@ -24,4 +25,18 @@ bool TStringiLess::operator() (std::string const& s1, std::string const& s2) con if (p2 == s2.end()) return false; return toupper(*p1) < toupper(*p2); +#else + const char *p1 = s1.c_str(); + const char *p2 = s2.c_str(); + + while (*p1 && *p2 && toupper(*p1) == toupper(*p2)) { + ++p1; + ++p2; + } + + if (!*p1) return *p2; + if (!*p2) return false; + + return toupper(*p1) < toupper(*p2); +#endif } diff --git a/Strategic/Strategic_2005Express.vcproj b/Strategic/Strategic_2005Express.vcproj new file mode 100644 index 00000000..f8b8576b --- /dev/null +++ b/Strategic/Strategic_2005Express.vcproj @@ -0,0 +1,506 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tactical/Boxing.cpp b/Tactical/Boxing.cpp index 37041b95..01528c31 100644 --- a/Tactical/Boxing.cpp +++ b/Tactical/Boxing.cpp @@ -313,9 +313,10 @@ BOOLEAN CheckOnBoxers( void ) // WANNE: Safty check! if (ubID < TOTAL_SOLDIERS) { - if ( FindObjClass( MercPtrs[ ubID ], IC_WEAPON ) == NO_SLOT ) + if ( FindObjClass( MercPtrs[ ubID ], IC_WEAPON ) == NO_SLOT && + IS_MERC_BODY_TYPE( MercPtrs[ ubID ] ) ) { - // no weapon so this guy is a boxer + // no weapon and not a civilian so this guy is a boxer gubBoxerID[ uiLoop ] = ubID; } } diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 2e5cacc3..9be7c8b0 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -5439,6 +5439,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet InitializeStealItemPickupMenu( pSoldier, pOpponent, pItemPool, ubCount); guiPendingOverrideEvent = G_GETTINGITEM; + HandleTacticalUI(); // 0verhaul: Added to keep this event from going out of style before it is acted on return( ubCount ); } diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index 4f61868f..3a888502 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -475,7 +475,7 @@ void PreventFromTheFreezingBug(SOLDIERTYPE* pSoldier) { gfUIInterfaceSetBusy = FALSE; UnSetUIBusy( pSoldier->ubID ); - gTacticalStatus.ubAttackBusyCount = 0; +// gTacticalStatus.ubAttackBusyCount = 0; // 0verhaul: I know commenting this may not be a good idea, but then neither is this kludgy routine. guiPendingOverrideEvent = LU_ENDUILOCK; UIHandleLUIEndLock( NULL ); } @@ -5817,7 +5817,7 @@ void SetUIBusy( UINT8 ubID ) void UnSetUIBusy( UINT8 ubID ) { - if ( (gTacticalStatus.uiFlags & INCOMBAT ) && ( gTacticalStatus.uiFlags & TURNBASED ) && ( gTacticalStatus.ubCurrentTeam == gbPlayerNum ) ) + if ( gfUserTurnRegionActive && (gTacticalStatus.uiFlags & INCOMBAT ) && ( gTacticalStatus.uiFlags & TURNBASED ) && ( gTacticalStatus.ubCurrentTeam == gbPlayerNum ) ) { if ( !gTacticalStatus.fUnLockUIAfterHiddenInterrupt ) { diff --git a/Tactical/Interface Dialogue.cpp b/Tactical/Interface Dialogue.cpp index 4789557d..e6ecfa78 100644 --- a/Tactical/Interface Dialogue.cpp +++ b/Tactical/Interface Dialogue.cpp @@ -77,6 +77,7 @@ #include "BobbyRMailOrder.h" #include "end game.h" #include "Map Screen Helicopter.h" + #include "Cheats.h" #endif INT16 sBasementEnterGridNos[ ] = { 13362, 13363, 13364, 13365, 13525, 13524 }; diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index ef760831..36f52690 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -6992,7 +6992,7 @@ void ItemPickupOK( GUI_BUTTON *btn, INT32 reason ) if ((gpOpponent->inv[HANDPOS].usItem == NOTHING ) && (usLastItem!=NOTHING)) ReLoadSoldierAnimationDueToHandItemChange( gpOpponent, usLastItem, NOTHING ); - PreventFromTheFreezingBug(gItemPickupMenu.pSoldier); +// PreventFromTheFreezingBug(gItemPickupMenu.pSoldier); } else { @@ -7026,7 +7026,7 @@ void ItemPickupCancel( GUI_BUTTON *btn, INT32 reason ) { DeletePool(gItemPickupMenu.pItemPool); - PreventFromTheFreezingBug(gItemPickupMenu.pSoldier); +// PreventFromTheFreezingBug(gItemPickupMenu.pSoldier); } } else if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE ) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index a5af06b3..1f7dc904 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -2617,6 +2617,8 @@ BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo INT8 bReloadType; UINT16 usNewAmmoItem; + bAPs = 0; + if ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) ) { bAPs = GetAPsToReloadGunWithAmmo( pGun, pAmmo ); diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 8b214bad..e7ff93b4 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -1506,7 +1506,7 @@ BOOLEAN ExecuteOverhead( ) if ( pSoldier->usPathDataSize != MAX_PATH_LIST_SIZE ) { #ifdef JA2BETAVERSION - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Path for %s ( %d ) did not make merc get to dest .", pSoldier->name, pSoldier->ubID ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_TESTVERSION, L"Path for %s ( %d ) did not make merc get to dest (%d spaces away).", pSoldier->name, pSoldier->ubID, PythSpacesAway( pSoldier->sFinalDestination, pSoldier->sGridNo) ); #endif } @@ -1534,6 +1534,7 @@ BOOLEAN ExecuteOverhead( ) if ( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT) { ActionDone( pSoldier); + SoldierGotoStationaryStance( pSoldier ); continue; } else diff --git a/Tactical/PATHAI.cpp b/Tactical/PATHAI.cpp index dc0e0a45..7fe85a06 100644 --- a/Tactical/PATHAI.cpp +++ b/Tactical/PATHAI.cpp @@ -918,6 +918,21 @@ INT32 FindBestPath(SOLDIERTYPE *s , INT16 sDestination, INT8 ubLevel, INT16 usMo //DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "PATHAI %d", curLoc ) ); + // 0verhaul: Cannot change direction over a fence! + if (prevCost == TRAVELCOST_FENCE) + { + iLoopStart = trailTree[pCurrPtr->sPathNdx].stepDir; + if (bLoopState == LOOPING_CLOCKWISE) { + iLoopEnd = gOneCCDirection[ iLoopStart]; + } else { + iLoopEnd = gOneCDirection[ iLoopStart]; + } + } + else + { + iLoopStart = iLoopEnd = 0; + } + if (fContinuousTurnNeeded) { if (trailTreeNdx < 2) @@ -942,7 +957,6 @@ INT32 FindBestPath(SOLDIERTYPE *s , INT16 sDestination, INT8 ubLevel, INT16 usMo //for ( iCnt = iLoopStart; iCnt != iLoopEnd; iCnt = (iCnt + iLoopIncrement) % MAXDIR ) for ( iCnt = iLoopStart; ; ) { - #ifdef VEHICLE /* if (fTurnSlow) diff --git a/Tactical/ShopKeeper Interface.cpp b/Tactical/ShopKeeper Interface.cpp index 057e4cf7..62230911 100644 --- a/Tactical/ShopKeeper Interface.cpp +++ b/Tactical/ShopKeeper Interface.cpp @@ -2625,8 +2625,8 @@ UINT32 DisplayInvSlot( UINT8 ubSlotNum, UINT16 usItemIndex, UINT16 usPosX, UINT1 usHeight = (UINT32)pTrav->usHeight; usWidth = (UINT32)pTrav->usWidth; - sCenX = usPosX + 7 + (INT16)( abs( SKI_INV_WIDTH - 3.0 - usWidth ) / 2 ) - pTrav->sOffsetX; - sCenY = usPosY + (INT16)( abs( SKI_INV_HEIGHT - (double)usHeight ) / 2 ) - pTrav->sOffsetY; + sCenX = usPosX + 7 + (INT16)( abs( (long) (SKI_INV_WIDTH - 3 - usWidth) ) / 2 ) - pTrav->sOffsetX; + sCenY = usPosY + (INT16)( abs( (long) (SKI_INV_HEIGHT - usHeight) ) / 2 ) - pTrav->sOffsetY; //Restore the background region @@ -7878,4 +7878,4 @@ void HatchOutInvSlot( UINT16 usPosX, UINT16 usPosY ) //Hatch it out DrawHatchOnInventory( guiRENDERBUFFER, usSlotX, usSlotY, usSlotWidth, usSlotHeight ); InvalidateRegion( usSlotX, usSlotY, usSlotX + usSlotWidth, usSlotY + usSlotHeight ); -} \ No newline at end of file +} diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index d7d4fb29..40de2eda 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -1475,13 +1475,14 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier ) case 485: // CODE: Try steal..... +// UnSetUIBusy( pSoldier->ubID); UseHandToHand( pSoldier, pSoldier->sPendingActionData2, TRUE ); //jackaians: //if we are not waiting for the pickup menu to be displayed - if (guiPendingOverrideEvent != G_GETTINGITEM) - { - PreventFromTheFreezingBug(pSoldier); - } +// if (guiPendingOverrideEvent != G_GETTINGITEM) +// { +// PreventFromTheFreezingBug(pSoldier); +// } break; case 486: diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index da6fe843..ed5d1663 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -11229,6 +11229,7 @@ void PickDropItemAnimation( SOLDIERTYPE *pSoldier ) SoldierHandleDropItem( pSoldier ); SoldierGotoStationaryStance( pSoldier ); + ActionDone( pSoldier); break; } } @@ -11535,6 +11536,7 @@ void MercStealFromMerc( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pTarget ) { // SEND PENDING ACTION pSoldier->ubPendingAction = MERC_STEAL; + pSoldier->bTargetLevel = pTarget->bLevel; // 0verhaul: Update the level too! pSoldier->sPendingActionData2 = pTarget->sGridNo; pSoldier->bPendingActionData3 = ubDirection; pSoldier->ubPendingActionAnimCount = 0; diff --git a/Tactical/Tactical_2005Express.vcproj b/Tactical/Tactical_2005Express.vcproj new file mode 100644 index 00000000..d3bced3e --- /dev/null +++ b/Tactical/Tactical_2005Express.vcproj @@ -0,0 +1,854 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TacticalAI/AIMain.cpp b/TacticalAI/AIMain.cpp index 0dd2d76f..1490558a 100644 --- a/TacticalAI/AIMain.cpp +++ b/TacticalAI/AIMain.cpp @@ -2040,6 +2040,10 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier) DebugAI( String( "%d does %s (a.d. %d) at time %ld", pSoldier->ubID, gzActionStr[pSoldier->bAction], pSoldier->usActionData, GetJA2Clock() ) ); + // 0verhaul: The decideaction stage does so many path plots and overrides that + // relying on a stored path from there is a bad idea. + pSoldier->usPathDataSize = pSoldier->usPathIndex = pSoldier->bPathStored = 0; + switch (pSoldier->bAction) { case AI_ACTION_NONE: // maintain current position & facing diff --git a/TacticalAI/DecideAction.cpp b/TacticalAI/DecideAction.cpp index 78bf0cb2..190cb7a2 100644 --- a/TacticalAI/DecideAction.cpp +++ b/TacticalAI/DecideAction.cpp @@ -2805,6 +2805,10 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK) action = AI_ACTION_FLANK_RIGHT ; break; } + + if (action == AI_ACTION_SEEK_OPPONENT) { + return action; + } } else return AI_ACTION_SEEK_OPPONENT ; @@ -4602,9 +4606,13 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier) if ( sClosestOpponent != NOWHERE ) { // temporarily make boxer have orders of CLOSEPATROL rather than STATIONARY + // And make him patrol the ring, not his usual place // so he has a good roaming range + USHORT tgrd = pSoldier->usPatrolGrid[0]; + pSoldier->usPatrolGrid[0] = pSoldier->sGridNo; pSoldier->bOrders = CLOSEPATROL; pSoldier->usActionData = GoAsFarAsPossibleTowards( pSoldier, sClosestOpponent, AI_ACTION_GET_CLOSER ); + pSoldier->usPatrolGrid[0] = tgrd; pSoldier->bOrders = STATIONARY; if ( pSoldier->usActionData != NOWHERE ) { diff --git a/TacticalAI/FindLocations.cpp b/TacticalAI/FindLocations.cpp index c1f6fd8c..b3ecc0cc 100644 --- a/TacticalAI/FindLocations.cpp +++ b/TacticalAI/FindLocations.cpp @@ -2477,6 +2477,8 @@ INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction ) case AI_ACTION_WITHDRAW: sDesiredDir = sDir + 4; break; + default: + sDesiredDir = sDir; } if ( sDesiredDir < 0 ) diff --git a/TacticalAI/Movement.cpp b/TacticalAI/Movement.cpp index 18541801..84edbeb4 100644 --- a/TacticalAI/Movement.cpp +++ b/TacticalAI/Movement.cpp @@ -451,6 +451,10 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN INT8 bAPsLeft, fPathFlags; UINT8 ubRoomRequired = 0, ubTempRoom; + // 0verhaul: Make sure to clear the stored path since this always calculates a new one. + // This is needed if the path cannot be found. + pSoldier->bPathStored = FALSE; + if ( bReserveAPs == -1 ) { // default reserve points @@ -539,6 +543,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN if ( CREATURE_OR_BLOODCAT( pSoldier ) ) { // we tried to get close, failed; abort! + pSoldier->usPathIndex = pSoldier->usPathDataSize = 0; return( NOWHERE ); } else @@ -593,6 +598,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN AINumMessage("Couldn't find OK destination around grid #",sDesGrid); #endif + pSoldier->usPathIndex = pSoldier->usPathDataSize = 0; return(NOWHERE); } @@ -739,6 +745,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN AIPopMessage(tempstr); #endif + pSoldier->usPathIndex = pSoldier->usPathDataSize = 0; return(NOWHERE); // then go nowhere } else diff --git a/TacticalAI/TacticalAI_2005Express.vcproj b/TacticalAI/TacticalAI_2005Express.vcproj new file mode 100644 index 00000000..bd16ebf1 --- /dev/null +++ b/TacticalAI/TacticalAI_2005Express.vcproj @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index 6a1a2291..7ee32068 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -2051,6 +2051,7 @@ void GetRayStopInfo( UINT32 uiNewSpot, UINT8 ubDir, INT8 bLevel, BOOLEAN fSmokeE } // ATE: For smoke, don't let it go over roof.... + // 0verhaul: Why not? if ( fSmokeEffect ) { if ( bLevel ) diff --git a/TileEngine/SmokeEffects.cpp b/TileEngine/SmokeEffects.cpp index 1be1a1d1..265fba79 100644 --- a/TileEngine/SmokeEffects.cpp +++ b/TileEngine/SmokeEffects.cpp @@ -185,7 +185,8 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner ) pSmoke->uiTimeOfLastUpdate = GetWorldTotalSeconds( ); // Are we indoors? - if ( GetTerrainType( sGridNo ) == FLAT_FLOOR ) + // 0verhaul: Are we on the floor level? + if ( GetTerrainType( sGridNo ) == FLAT_FLOOR && bLevel) { pSmoke->bFlags |= SMOKE_EFFECT_INDOORS; } @@ -579,7 +580,7 @@ void DecaySmokeEffects( UINT32 uiTime ) else { // damage anyone standing in cloud - SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, REDO_SPREAD_EFFECT, 0, cnt ); + SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, REDO_SPREAD_EFFECT, bLevel, cnt ); } } } diff --git a/TileEngine/TileEngine_2005Express.vcproj b/TileEngine/TileEngine_2005Express.vcproj new file mode 100644 index 00000000..26e9329c --- /dev/null +++ b/TileEngine/TileEngine_2005Express.vcproj @@ -0,0 +1,458 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TileEngine/worlddef.cpp b/TileEngine/worlddef.cpp index d9026c75..eb1966db 100644 --- a/TileEngine/worlddef.cpp +++ b/TileEngine/worlddef.cpp @@ -2480,7 +2480,7 @@ BOOLEAN EvaluateWorld( STR8 pSector, UINT8 ubLevel ) { //skip static priority placement // WDS - Clean up inventory handling LOADDATA( &priority, pBuffer, SIZEOF_SOLDIERCREATE_STRUCT_POD); //SIZEOF_SOLDIERCREATE_STRUCT ); - priority.CopyOldDataToNew(); + priority.CopyOldInventoryToNew(); if( priority.ubProfile != NO_PROFILE ) pTeam->ubProfile++; else diff --git a/Utils/Animated ProgressBar.cpp b/Utils/Animated ProgressBar.cpp index 4bb490ea..eeea9c20 100644 --- a/Utils/Animated ProgressBar.cpp +++ b/Utils/Animated ProgressBar.cpp @@ -144,7 +144,7 @@ void SetProgressBarTitle( UINT32 ubID, STR16 pString, UINT32 usFont, UINT8 ubFor } if( pString && wcslen( pString ) ) { - pCurr->swzTitle = (STR16) MemAlloc( sizeof( CHAR16 ) * ( wcslen( pString ) + 1 ) ); + pCurr->swzTitle = (STR16) MemAlloc( (UINT32) ( sizeof( CHAR16 ) * ( wcslen( pString ) + 1 ) ) ); swprintf( pCurr->swzTitle, pString ); } pCurr->usTitleFont = (UINT16)usFont; diff --git a/Utils/Multi Language Graphic Utils.cpp b/Utils/Multi Language Graphic Utils.cpp index 56b1ec3b..09d58e1e 100644 --- a/Utils/Multi Language Graphic Utils.cpp +++ b/Utils/Multi Language Graphic Utils.cpp @@ -253,7 +253,7 @@ BOOLEAN GetMLGFilename( SGPFILENAME filename, UINT16 usMLGGraphicID ) #elif defined( POLISH ) sprintf( zLanguage, "POLISH" ); #elif defined( RUSSIAN ) - sprintf( (char*)zLanguage, "RUSSIAN" ); + sprintf( zLanguage, "RUSSIAN" ); #elif defined( SPANISH ) sprintf( zLanguage, "SPANISH" ); #elif defined( TAIWANESE ) diff --git a/Utils/Utils_2005Express.vcproj b/Utils/Utils_2005Express.vcproj new file mode 100644 index 00000000..1c71a90c --- /dev/null +++ b/Utils/Utils_2005Express.vcproj @@ -0,0 +1,446 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Utils/Win Util.cpp b/Utils/Win Util.cpp index 7657d0cf..79b6c73f 100644 --- a/Utils/Win Util.cpp +++ b/Utils/Win Util.cpp @@ -45,7 +45,8 @@ LPDIRECTSOUNDBUFFER lpSoundEffects[NUM_SOUND_EFFECTS]; -char szSoundEffects[NUM_SOUND_EFFECTS][255] = +//char szSoundEffects[NUM_SOUND_EFFECTS][255] = +char szSoundEffects[MAX_SAMPLES][255] = { "SHOOT1", "MISS1", diff --git a/Utils/XMLAccess.cpp b/Utils/XMLAccess.cpp index 8a0caae5..44d44484 100644 --- a/Utils/XMLAccess.cpp +++ b/Utils/XMLAccess.cpp @@ -1,3 +1,5 @@ +#include "Types.h" + #define WEAPONSFILENAME "TABLEDATA\\Weapons.dat" #define MAX_CHAR_DATA_LENGTH 500 diff --git a/builddefines.h b/builddefines.h index 10d39c4b..8fc4eef4 100644 --- a/builddefines.h +++ b/builddefines.h @@ -11,11 +11,11 @@ //#define JA2EDITOR -// #define DEBUG_ATTACKBUSY +//#define DEBUG_ATTACKBUSY //#define LUACONSOLE -//#define ROBOT_ALWAYS_READY +#define ROBOT_ALWAYS_READY //#ifdef _DEBUG // #ifndef JA2TESTVERSION @@ -33,9 +33,9 @@ #ifdef JA2BETAVERSION #ifndef JA2EDITOR - #define SGP_DEBUG - #define FORCE_ASSERTS_ON - #define SGP_VIDEO_DEBUGGING +// #define SGP_DEBUG +// #define FORCE_ASSERTS_ON +// #define SGP_VIDEO_DEBUGGING #endif #endif diff --git a/ja2_2005Express.sln b/ja2_2005Express.sln new file mode 100644 index 00000000..ff403b34 --- /dev/null +++ b/ja2_2005Express.sln @@ -0,0 +1,85 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ja2_2005Express", "ja2_2005Express.vcproj", "{F44669E7-74AC-444B-B75F-F16F4B9F0265}" + ProjectSection(ProjectDependencies) = postProject + {5234CD2E-97F1-42FF-828D-CE0A1B46805E} = {5234CD2E-97F1-42FF-828D-CE0A1B46805E} + {262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C} = {262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C} + {6283CE93-2960-4596-8E74-7A6FBA8716FF} = {6283CE93-2960-4596-8E74-7A6FBA8716FF} + {D4BDA6AD-9B61-4953-892D-DA3F8CC7E096} = {D4BDA6AD-9B61-4953-892D-DA3F8CC7E096} + {27A49DAF-3F5A-4FF2-B943-9559F0B63032} = {27A49DAF-3F5A-4FF2-B943-9559F0B63032} + {A83DA7DA-2C31-45D8-9A69-B4993A885E76} = {A83DA7DA-2C31-45D8-9A69-B4993A885E76} + {AB8837DB-0435-40C7-916A-0AACF5CFF1C4} = {AB8837DB-0435-40C7-916A-0AACF5CFF1C4} + {FC1938E8-9253-49A8-AA99-4639BBB46C1B} = {FC1938E8-9253-49A8-AA99-4639BBB46C1B} + {60D793F2-90B4-43C9-83B5-221EE11B37E6} = {60D793F2-90B4-43C9-83B5-221EE11B37E6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Editor_2005Express", "Editor\Editor_2005Express.vcproj", "{60D793F2-90B4-43C9-83B5-221EE11B37E6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Laptop_2005Express", "Laptop\Laptop_2005Express.vcproj", "{5234CD2E-97F1-42FF-828D-CE0A1B46805E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua_2005Express", "lua\lua_2005Express.vcproj", "{A83DA7DA-2C31-45D8-9A69-B4993A885E76}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SGP_2005Express", "Standard Gaming Platform\SGP_2005Express.vcproj", "{6283CE93-2960-4596-8E74-7A6FBA8716FF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Strategic_2005Express", "Strategic\Strategic_2005Express.vcproj", "{AB8837DB-0435-40C7-916A-0AACF5CFF1C4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tactical_2005Express", "Tactical\Tactical_2005Express.vcproj", "{D4BDA6AD-9B61-4953-892D-DA3F8CC7E096}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TacticalAI_2005Express", "TacticalAI\TacticalAI_2005Express.vcproj", "{27A49DAF-3F5A-4FF2-B943-9559F0B63032}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TileEngine_2005Express", "TileEngine\TileEngine_2005Express.vcproj", "{FC1938E8-9253-49A8-AA99-4639BBB46C1B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Utils_2005Express", "Utils\Utils_2005Express.vcproj", "{262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F44669E7-74AC-444B-B75F-F16F4B9F0265}.Debug|Win32.ActiveCfg = Debug|Win32 + {F44669E7-74AC-444B-B75F-F16F4B9F0265}.Debug|Win32.Build.0 = Debug|Win32 + {F44669E7-74AC-444B-B75F-F16F4B9F0265}.Release|Win32.ActiveCfg = Release|Win32 + {F44669E7-74AC-444B-B75F-F16F4B9F0265}.Release|Win32.Build.0 = Release|Win32 + {60D793F2-90B4-43C9-83B5-221EE11B37E6}.Debug|Win32.ActiveCfg = Debug|Win32 + {60D793F2-90B4-43C9-83B5-221EE11B37E6}.Debug|Win32.Build.0 = Debug|Win32 + {60D793F2-90B4-43C9-83B5-221EE11B37E6}.Release|Win32.ActiveCfg = Release|Win32 + {60D793F2-90B4-43C9-83B5-221EE11B37E6}.Release|Win32.Build.0 = Release|Win32 + {5234CD2E-97F1-42FF-828D-CE0A1B46805E}.Debug|Win32.ActiveCfg = Debug|Win32 + {5234CD2E-97F1-42FF-828D-CE0A1B46805E}.Debug|Win32.Build.0 = Debug|Win32 + {5234CD2E-97F1-42FF-828D-CE0A1B46805E}.Release|Win32.ActiveCfg = Release|Win32 + {5234CD2E-97F1-42FF-828D-CE0A1B46805E}.Release|Win32.Build.0 = Release|Win32 + {A83DA7DA-2C31-45D8-9A69-B4993A885E76}.Debug|Win32.ActiveCfg = Debug|Win32 + {A83DA7DA-2C31-45D8-9A69-B4993A885E76}.Debug|Win32.Build.0 = Debug|Win32 + {A83DA7DA-2C31-45D8-9A69-B4993A885E76}.Release|Win32.ActiveCfg = Release|Win32 + {A83DA7DA-2C31-45D8-9A69-B4993A885E76}.Release|Win32.Build.0 = Release|Win32 + {6283CE93-2960-4596-8E74-7A6FBA8716FF}.Debug|Win32.ActiveCfg = Debug|Win32 + {6283CE93-2960-4596-8E74-7A6FBA8716FF}.Debug|Win32.Build.0 = Debug|Win32 + {6283CE93-2960-4596-8E74-7A6FBA8716FF}.Release|Win32.ActiveCfg = Release|Win32 + {6283CE93-2960-4596-8E74-7A6FBA8716FF}.Release|Win32.Build.0 = Release|Win32 + {AB8837DB-0435-40C7-916A-0AACF5CFF1C4}.Debug|Win32.ActiveCfg = Debug|Win32 + {AB8837DB-0435-40C7-916A-0AACF5CFF1C4}.Debug|Win32.Build.0 = Debug|Win32 + {AB8837DB-0435-40C7-916A-0AACF5CFF1C4}.Release|Win32.ActiveCfg = Release|Win32 + {AB8837DB-0435-40C7-916A-0AACF5CFF1C4}.Release|Win32.Build.0 = Release|Win32 + {D4BDA6AD-9B61-4953-892D-DA3F8CC7E096}.Debug|Win32.ActiveCfg = Debug|Win32 + {D4BDA6AD-9B61-4953-892D-DA3F8CC7E096}.Debug|Win32.Build.0 = Debug|Win32 + {D4BDA6AD-9B61-4953-892D-DA3F8CC7E096}.Release|Win32.ActiveCfg = Release|Win32 + {D4BDA6AD-9B61-4953-892D-DA3F8CC7E096}.Release|Win32.Build.0 = Release|Win32 + {27A49DAF-3F5A-4FF2-B943-9559F0B63032}.Debug|Win32.ActiveCfg = Debug|Win32 + {27A49DAF-3F5A-4FF2-B943-9559F0B63032}.Debug|Win32.Build.0 = Debug|Win32 + {27A49DAF-3F5A-4FF2-B943-9559F0B63032}.Release|Win32.ActiveCfg = Release|Win32 + {27A49DAF-3F5A-4FF2-B943-9559F0B63032}.Release|Win32.Build.0 = Release|Win32 + {FC1938E8-9253-49A8-AA99-4639BBB46C1B}.Debug|Win32.ActiveCfg = Debug|Win32 + {FC1938E8-9253-49A8-AA99-4639BBB46C1B}.Debug|Win32.Build.0 = Debug|Win32 + {FC1938E8-9253-49A8-AA99-4639BBB46C1B}.Release|Win32.ActiveCfg = Release|Win32 + {FC1938E8-9253-49A8-AA99-4639BBB46C1B}.Release|Win32.Build.0 = Release|Win32 + {262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C}.Debug|Win32.ActiveCfg = Debug|Win32 + {262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C}.Debug|Win32.Build.0 = Debug|Win32 + {262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C}.Release|Win32.ActiveCfg = Release|Win32 + {262A5F80-0B99-4E8E-A6C7-74CB1FD0A67C}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ja2_2005Express.vcproj b/ja2_2005Express.vcproj new file mode 100644 index 00000000..fb4987af --- /dev/null +++ b/ja2_2005Express.vcproj @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ja2_2005Express.vsprops b/ja2_2005Express.vsprops new file mode 100644 index 00000000..ec27ade7 --- /dev/null +++ b/ja2_2005Express.vsprops @@ -0,0 +1,13 @@ + + + + diff --git a/libexpatMT.lib b/libexpatMT.lib index 7d7481c7..d3df5b6e 100644 Binary files a/libexpatMT.lib and b/libexpatMT.lib differ diff --git a/lua/lua_2005Express.vcproj b/lua/lua_2005Express.vcproj new file mode 100644 index 00000000..733002c0 --- /dev/null +++ b/lua/lua_2005Express.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lua51_vs2003.lib b/lua51_vs2003.lib deleted file mode 100644 index 1b0bc75c..00000000 Binary files a/lua51_vs2003.lib and /dev/null differ diff --git a/lua51_vs2005.lib b/lua51_vs2005.lib deleted file mode 100644 index 6fb4f055..00000000 Binary files a/lua51_vs2005.lib and /dev/null differ diff --git a/resource.h b/resource.h deleted file mode 100644 index 04131644..00000000 --- a/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by ja2.rc -// -#define IDI_ICON1 113 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 114 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif