diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h index 50bac71d0f..e6c0e0aba2 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h +++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h @@ -406,9 +406,9 @@ class CommandButton : public Overridable enum { MAX_COMMANDS_PER_SET = 32 }; // user interface max is 14 (but internally it's 18 for script only buttons!) enum { MAX_RIGHT_HUD_UPGRADE_CAMEOS = 5}; enum { - MAX_PURCHASE_SCIENCE_RANK_1 = 4, - MAX_PURCHASE_SCIENCE_RANK_3 = 15, - MAX_PURCHASE_SCIENCE_RANK_8 = 4, + MAX_PURCHASE_SCIENCE_RANK_1 = 7, + MAX_PURCHASE_SCIENCE_RANK_3 = 21, + MAX_PURCHASE_SCIENCE_RANK_8 = 7, }; enum { MAX_STRUCTURE_INVENTORY_BUTTONS = 10 }; // there are this many physical buttons in "inventory" windows for structures enum { MAX_BUILD_QUEUE_BUTTONS = 9 };// physical button count for the build queue diff --git a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp index 0a70e79582..9e7ca3c8fb 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp @@ -106,7 +106,7 @@ GlobalData* GlobalData::m_theOriginal = NULL; { "Use3WayTerrainBlends", INI::parseInt, NULL, offsetof( GlobalData, m_use3WayTerrainBlends ) }, { "StretchTerrain", INI::parseBool, NULL, offsetof( GlobalData, m_stretchTerrain ) }, { "UseHalfHeightMap", INI::parseBool, NULL, offsetof( GlobalData, m_useHalfHeightMap ) }, - + { "ViewportHeightScale", INI::parseReal, NULL, offsetof( GlobalData, m_viewportHeightScale ) }, { "DrawEntireTerrain", INI::parseBool, NULL, offsetof( GlobalData, m_drawEntireTerrain ) }, { "TerrainLOD", INI::parseIndexList, TerrainLODNames, offsetof( GlobalData, m_terrainLOD ) }, diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 06b83ec7fb..c867c3f182 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -179,11 +179,14 @@ void ControlBar::populatePurchaseScience( Player* player ) commandSet8 = TheControlBar->findCommandSet(player->getPlayerTemplate()->getPurchaseScienceCommandSetRank8()); // TEMP WILL CHANGE TO PROPER WAY ONCE WORKING for( i = 0; i < MAX_PURCHASE_SCIENCE_RANK_1; i++ ) - m_sciencePurchaseWindowsRank1[i]->winHide(TRUE); + if (m_sciencePurchaseWindowsRank1[i]!=nullptr) + m_sciencePurchaseWindowsRank1[i]->winHide(TRUE); for( i = 0; i < MAX_PURCHASE_SCIENCE_RANK_3; i++ ) - m_sciencePurchaseWindowsRank3[i]->winHide(TRUE); + if (m_sciencePurchaseWindowsRank3[i] != nullptr) + m_sciencePurchaseWindowsRank3[i]->winHide(TRUE); for( i = 0; i < MAX_PURCHASE_SCIENCE_RANK_8; i++ ) - m_sciencePurchaseWindowsRank8[i]->winHide(TRUE); + if (m_sciencePurchaseWindowsRank8[i] != nullptr) + m_sciencePurchaseWindowsRank8[i]->winHide(TRUE); // if no command set match is found hide all the buttons @@ -204,7 +207,8 @@ void ControlBar::populatePurchaseScience( Player* player ) if( commandButton == NULL || BitIsSet( commandButton->getOptions(), SCRIPT_ONLY ) ) { // hide window on interface - m_sciencePurchaseWindowsRank1[ i ]->winHide( TRUE ); + if(m_sciencePurchaseWindowsRank1[ i ] != nullptr) + m_sciencePurchaseWindowsRank1[ i ]->winHide( TRUE ); } // end if else { @@ -264,7 +268,8 @@ void ControlBar::populatePurchaseScience( Player* player ) if( commandButton == NULL || BitIsSet( commandButton->getOptions(), SCRIPT_ONLY ) ) { // hide window on interface - m_sciencePurchaseWindowsRank3[ i ]->winHide( TRUE ); + if (m_sciencePurchaseWindowsRank3[ i ] != nullptr) + m_sciencePurchaseWindowsRank3[ i ]->winHide( TRUE ); } // end if else { @@ -327,7 +332,8 @@ void ControlBar::populatePurchaseScience( Player* player ) if( commandButton == NULL || BitIsSet( commandButton->getOptions(), SCRIPT_ONLY ) ) { // hide window on interface - m_sciencePurchaseWindowsRank8[ i ]->winHide( TRUE ); + if (m_sciencePurchaseWindowsRank8[ i ] != nullptr) + m_sciencePurchaseWindowsRank8[ i ]->winHide( TRUE ); } // end if else { @@ -1157,7 +1163,9 @@ void ControlBar::init( void ) id = TheNameKeyGenerator->nameToKey( windowName.str() ); m_sciencePurchaseWindowsRank1[ i ] = TheWindowManager->winGetWindowFromId( m_contextParent[ CP_PURCHASE_SCIENCE ], id ); - m_sciencePurchaseWindowsRank1[ i ]->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES ); + if (m_sciencePurchaseWindowsRank1[i] != nullptr) { + m_sciencePurchaseWindowsRank1[i]->winSetStatus(WIN_STATUS_USE_OVERLAY_STATES); + } } // end for i for( i = 0; i < MAX_PURCHASE_SCIENCE_RANK_3; i++ ) { @@ -1165,7 +1173,9 @@ void ControlBar::init( void ) id = TheNameKeyGenerator->nameToKey( windowName.str() ); m_sciencePurchaseWindowsRank3[ i ] = TheWindowManager->winGetWindowFromId( m_contextParent[ CP_PURCHASE_SCIENCE ], id ); - m_sciencePurchaseWindowsRank3[ i ]->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES ); + if (m_sciencePurchaseWindowsRank3[i] != nullptr) { + m_sciencePurchaseWindowsRank3[i]->winSetStatus(WIN_STATUS_USE_OVERLAY_STATES); + } } // end for i for( i = 0; i < MAX_PURCHASE_SCIENCE_RANK_8; i++ ) @@ -1174,7 +1184,9 @@ void ControlBar::init( void ) id = TheNameKeyGenerator->nameToKey( windowName.str() ); m_sciencePurchaseWindowsRank8[ i ] = TheWindowManager->winGetWindowFromId( m_contextParent[ CP_PURCHASE_SCIENCE ], id ); - m_sciencePurchaseWindowsRank8[ i ]->winSetStatus( WIN_STATUS_USE_OVERLAY_STATES ); + if (m_sciencePurchaseWindowsRank8[i] != nullptr) { + m_sciencePurchaseWindowsRank8[i]->winSetStatus(WIN_STATUS_USE_OVERLAY_STATES); + } } // end for i // keep a pointer to the window making up the right HUD display diff --git a/GeneralsMD/Code/Main/WinMain.cpp b/GeneralsMD/Code/Main/WinMain.cpp index 13ecdf162e..b4567848a4 100644 --- a/GeneralsMD/Code/Main/WinMain.cpp +++ b/GeneralsMD/Code/Main/WinMain.cpp @@ -804,7 +804,7 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, { Int exitcode = 1; //#ifdef _DEBUG - // WaitForDebugger(); //in debug build, wait for debugger attachment +// WaitForDebugger(); //in debug build, wait for debugger attachment //#endif #ifdef RTS_PROFILE