Merge branch 'master' of github-softcoder-megaglest:MegaGlest/megaglest-source

This commit is contained in:
SoftCoder 2014-01-03 15:10:59 -08:00
commit 2badd13fd3
4 changed files with 21 additions and 3 deletions

View File

@ -72,6 +72,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
updateDataSynchDetailText = false; updateDataSynchDetailText = false;
launchingNewGame = false; launchingNewGame = false;
this->zoomedMap = false;
this->render_mapPreviewTexture_X = mapPreviewTexture_X; this->render_mapPreviewTexture_X = mapPreviewTexture_X;
this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_Y = mapPreviewTexture_Y;
this->render_mapPreviewTexture_W = mapPreviewTexture_W; 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_Y = 0;
this->render_mapPreviewTexture_W = metrics.getVirtualW(); this->render_mapPreviewTexture_W = metrics.getVirtualW();
this->render_mapPreviewTexture_H = metrics.getVirtualH(); this->render_mapPreviewTexture_H = metrics.getVirtualH();
this->zoomedMap = true;
cleanupMapPreviewTexture(); cleanupMapPreviewTexture();
} }
@ -1169,10 +1171,14 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_Y = mapPreviewTexture_Y;
this->render_mapPreviewTexture_W = mapPreviewTexture_W; this->render_mapPreviewTexture_W = mapPreviewTexture_W;
this->render_mapPreviewTexture_H = mapPreviewTexture_H; this->render_mapPreviewTexture_H = mapPreviewTexture_H;
this->zoomedMap = false;
cleanupMapPreviewTexture(); cleanupMapPreviewTexture();
} }
} }
if(this->zoomedMap==true){
return;
}
} }
if(mainMessageBox.getEnabled()) { if(mainMessageBox.getEnabled()) {
@ -2436,7 +2442,9 @@ void MenuStateConnectedGame::render() {
this->render_mapPreviewTexture_W, this->render_mapPreviewTexture_W,
this->render_mapPreviewTexture_H, this->render_mapPreviewTexture_H,
mapPreviewTexture,1.0f); mapPreviewTexture,1.0f);
if(this->zoomedMap==true) {
return;
}
//printf("=================> Rendering map preview texture\n"); //printf("=================> Rendering map preview texture\n");
} }

View File

@ -104,6 +104,7 @@ private:
MapInfo mapInfo; MapInfo mapInfo;
Texture2D *mapPreviewTexture; Texture2D *mapPreviewTexture;
bool zoomedMap;
int render_mapPreviewTexture_X; int render_mapPreviewTexture_X;
int render_mapPreviewTexture_Y; int render_mapPreviewTexture_Y;
int render_mapPreviewTexture_W; int render_mapPreviewTexture_W;

View File

@ -80,6 +80,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
this->gameUUID = getUUIDAsString(); this->gameUUID = getUUIDAsString();
this->zoomedMap=false;
this->render_mapPreviewTexture_X = mapPreviewTexture_X; this->render_mapPreviewTexture_X = mapPreviewTexture_X;
this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_Y = mapPreviewTexture_Y;
this->render_mapPreviewTexture_W = mapPreviewTexture_W; 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_Y = 0;
this->render_mapPreviewTexture_W = metrics.getVirtualW(); this->render_mapPreviewTexture_W = metrics.getVirtualW();
this->render_mapPreviewTexture_H = metrics.getVirtualH(); this->render_mapPreviewTexture_H = metrics.getVirtualH();
this->zoomedMap = true;
cleanupMapPreviewTexture(); cleanupMapPreviewTexture();
} }
@ -1081,10 +1083,15 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) {
this->render_mapPreviewTexture_Y = mapPreviewTexture_Y; this->render_mapPreviewTexture_Y = mapPreviewTexture_Y;
this->render_mapPreviewTexture_W = mapPreviewTexture_W; this->render_mapPreviewTexture_W = mapPreviewTexture_W;
this->render_mapPreviewTexture_H = mapPreviewTexture_H; this->render_mapPreviewTexture_H = mapPreviewTexture_H;
this->zoomedMap = false;
cleanupMapPreviewTexture(); cleanupMapPreviewTexture();
} }
return;
} }
if(this->zoomedMap == true){
return;
}
} }
if(activeInputLabel!=NULL && !(activeInputLabel->mouseClick(x,y))){ if(activeInputLabel!=NULL && !(activeInputLabel->mouseClick(x,y))){
@ -2031,10 +2038,11 @@ void MenuStateCustomGame::render() {
this->render_mapPreviewTexture_W, this->render_mapPreviewTexture_W,
this->render_mapPreviewTexture_H, this->render_mapPreviewTexture_H,
mapPreviewTexture,1.0f); mapPreviewTexture,1.0f);
if(this->zoomedMap==true) {
return;
}
//printf("=================> Rendering map preview texture\n"); //printf("=================> Rendering map preview texture\n");
} }
if(scenarioLogoTexture != NULL) { if(scenarioLogoTexture != NULL) {
renderer.renderTextureQuad(300,350,400,300,scenarioLogoTexture,1.0f); renderer.renderTextureQuad(300,350,400,300,scenarioLogoTexture,1.0f);
//renderer.renderBackground(scenarioLogoTexture); //renderer.renderBackground(scenarioLogoTexture);

View File

@ -192,6 +192,7 @@ private:
MapPreview mapPreview; MapPreview mapPreview;
Texture2D *mapPreviewTexture; Texture2D *mapPreviewTexture;
bool zoomedMap;
int render_mapPreviewTexture_X; int render_mapPreviewTexture_X;
int render_mapPreviewTexture_Y; int render_mapPreviewTexture_Y;
int render_mapPreviewTexture_W; int render_mapPreviewTexture_W;