From 29f5881ded48c5627f2fdf771d8ef9e4e3889dbb Mon Sep 17 00:00:00 2001 From: titiger Date: Fri, 3 Jan 2014 19:19:10 +0100 Subject: [PATCH] Just render zoomed map preview and nothing else. --- source/glest_game/menu/menu_state_connected_game.cpp | 10 +++++++++- source/glest_game/menu/menu_state_connected_game.h | 1 + source/glest_game/menu/menu_state_custom_game.cpp | 12 ++++++++++-- source/glest_game/menu/menu_state_custom_game.h | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 1e7a43f0..b27d7095 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -72,6 +72,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM updateDataSynchDetailText = false; launchingNewGame = false; + this->zoomedMap = false; this->render_mapPreviewTexture_X = mapPreviewTexture_X; this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_W = mapPreviewTexture_W; @@ -1161,6 +1162,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){ this->render_mapPreviewTexture_Y = 0; this->render_mapPreviewTexture_W = metrics.getVirtualW(); this->render_mapPreviewTexture_H = metrics.getVirtualH(); + this->zoomedMap = true; cleanupMapPreviewTexture(); } @@ -1169,10 +1171,14 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){ this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_W = mapPreviewTexture_W; this->render_mapPreviewTexture_H = mapPreviewTexture_H; + this->zoomedMap = false; cleanupMapPreviewTexture(); } } + if(this->zoomedMap==true){ + return; + } } if(mainMessageBox.getEnabled()) { @@ -2436,7 +2442,9 @@ void MenuStateConnectedGame::render() { this->render_mapPreviewTexture_W, this->render_mapPreviewTexture_H, mapPreviewTexture,1.0f); - + if(this->zoomedMap==true) { + return; + } //printf("=================> Rendering map preview texture\n"); } diff --git a/source/glest_game/menu/menu_state_connected_game.h b/source/glest_game/menu/menu_state_connected_game.h index 00a3fa06..0d94fc47 100644 --- a/source/glest_game/menu/menu_state_connected_game.h +++ b/source/glest_game/menu/menu_state_connected_game.h @@ -104,6 +104,7 @@ private: MapInfo mapInfo; Texture2D *mapPreviewTexture; + bool zoomedMap; int render_mapPreviewTexture_X; int render_mapPreviewTexture_Y; int render_mapPreviewTexture_W; diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 84d243b0..393db382 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -80,6 +80,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu, this->gameUUID = getUUIDAsString(); + this->zoomedMap=false; this->render_mapPreviewTexture_X = mapPreviewTexture_X; this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_W = mapPreviewTexture_W; @@ -1073,6 +1074,7 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) { this->render_mapPreviewTexture_Y = 0; this->render_mapPreviewTexture_W = metrics.getVirtualW(); this->render_mapPreviewTexture_H = metrics.getVirtualH(); + this->zoomedMap = true; cleanupMapPreviewTexture(); } @@ -1081,10 +1083,15 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) { this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_W = mapPreviewTexture_W; this->render_mapPreviewTexture_H = mapPreviewTexture_H; + this->zoomedMap = false; cleanupMapPreviewTexture(); } + return; } + if(this->zoomedMap == true){ + return; + } } if(activeInputLabel!=NULL && !(activeInputLabel->mouseClick(x,y))){ @@ -2031,10 +2038,11 @@ void MenuStateCustomGame::render() { this->render_mapPreviewTexture_W, this->render_mapPreviewTexture_H, mapPreviewTexture,1.0f); - + if(this->zoomedMap==true) { + return; + } //printf("=================> Rendering map preview texture\n"); } - if(scenarioLogoTexture != NULL) { renderer.renderTextureQuad(300,350,400,300,scenarioLogoTexture,1.0f); //renderer.renderBackground(scenarioLogoTexture); diff --git a/source/glest_game/menu/menu_state_custom_game.h b/source/glest_game/menu/menu_state_custom_game.h index fa8a68ab..51af9800 100644 --- a/source/glest_game/menu/menu_state_custom_game.h +++ b/source/glest_game/menu/menu_state_custom_game.h @@ -192,6 +192,7 @@ private: MapPreview mapPreview; Texture2D *mapPreviewTexture; + bool zoomedMap; int render_mapPreviewTexture_X; int render_mapPreviewTexture_Y; int render_mapPreviewTexture_W;