Skip to content

Commit d5b08a6

Browse files
Revert "Allow window resizing"
This reverts commit e441969.
1 parent 4432358 commit d5b08a6

5 files changed

Lines changed: 3 additions & 37 deletions

File tree

CGame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ class CGame
7474

7575
bool Init();
7676
bool ReCreateWindow();
77-
void UpdateDisplaySize(const Extent& newSize);
7877

7978
void EventHandling(SDL_Event* Event);
8079

CGame_Event.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ void CGame::EventHandling(SDL_Event* Event)
9898

9999
switch(Event->key.keysym.sym)
100100
{
101-
case SDLK_RETURN:
102-
case SDLK_KP_ENTER:
103-
if(Event->key.keysym.mod & KMOD_ALT)
104-
fullscreen = !fullscreen;
105-
break;
101+
case SDLK_F2: fullscreen = !fullscreen; break;
106102

107103
#ifdef _ADMINMODE
108104
case SDLK_F3: // if CTRL and ALT are pressed
@@ -412,15 +408,6 @@ void CGame::EventHandling(SDL_Event* Event)
412408
break;
413409
}
414410

415-
case SDL_WINDOWEVENT:
416-
{
417-
if(Event->window.event == SDL_WINDOWEVENT_RESIZED)
418-
{
419-
UpdateDisplaySize(Extent(Event->window.data1, Event->window.data2));
420-
}
421-
break;
422-
}
423-
424411
case SDL_QUIT: Running = false; break;
425412

426413
default: break;

CGame_Init.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
#include "CGame.h"
77
#include "CIO/CFile.h"
8-
#include "CIO/CMenu.h"
9-
#include "CIO/CWindow.h"
108
#include "CMap.h"
119
#include "CSurface.h"
1210
#include "SGE/sge_blib.h"
@@ -24,7 +22,7 @@ bool CGame::ReCreateWindow()
2422
window_.reset();
2523
window_.reset(SDL_CreateWindow("Return to the Roots Map editor [BETA]", SDL_WINDOWPOS_CENTERED,
2624
SDL_WINDOWPOS_CENTERED, GameResolution.x, GameResolution.y,
27-
fullscreen ? SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE));
25+
fullscreen ? SDL_WINDOW_FULLSCREEN : 0));
2826
if(!window_)
2927
return false;
3028
renderer_.reset(SDL_CreateRenderer(window_.get(), -1, 0));
@@ -40,19 +38,6 @@ bool CGame::ReCreateWindow()
4038
return true;
4139
}
4240

43-
void CGame::UpdateDisplaySize(const Extent& newSize)
44-
{
45-
GameResolution = newSize;
46-
displayTexture_.reset();
47-
displayTexture_ =
48-
makeSdlTexture(renderer_, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, newSize.x, newSize.y);
49-
Surf_Display = makeRGBSurface(newSize.x, newSize.y, true);
50-
for(auto& menu : Menus)
51-
menu->resetSurface();
52-
for(auto& wnd : Windows)
53-
wnd->resetSurface();
54-
}
55-
5641
bool CGame::Init()
5742
{
5843
std::cout << "Return to the Roots Map editor\n";

CIO/CControlContainer.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ class CControlContainer
6868
}
6969
void setWaste() { waste = true; }
7070
bool isWaste() const { return waste; }
71-
void resetSurface()
72-
{
73-
surface.reset();
74-
needRender = true;
75-
}
7671
// Methods
7772
CButton* addButton(void callback(int), int clickedParam, Uint16 x = 0, Uint16 y = 0, Uint16 w = 20, Uint16 h = 20,
7873
int color = BUTTON_GREY, const char* text = nullptr, int picture = -1);

callbacks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ void callback::EditorHelpMenu(int Param)
611611
"..............................F1");
612612
SelectBoxHelp->addOption(
613613
"Window/"
614-
"Fullscreen...................................................................................Alt+Enter");
614+
"Fullscreen........................................................................................F2");
615615
SelectBoxHelp->addOption(
616616
"Zoom in/normal/out......................................................................F5/F6/"
617617
"F7");

0 commit comments

Comments
 (0)