aboutsummaryrefslogtreecommitdiff
path: root/src/GameInitDispose.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GameInitDispose.cpp')
-rw-r--r--src/GameInitDispose.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp
index 2d2a5c4..1c8cffb 100644
--- a/src/GameInitDispose.cpp
+++ b/src/GameInitDispose.cpp
@@ -58,11 +58,16 @@ extern int aimkey;
extern int psychicaimkey;
extern int psychickey;
+void resizeWindow(Game* game, int width, int height)
+{
+ game->screenwidth = width;
+ game->screenheight = height;
+}
+
Game* makeGame(Config config)
{
auto game = new Game();
- game->screenwidth = config.width;
- game->screenheight = config.height;
+ resizeWindow(game, config.width, config.height);
game->usermousesensitivity = config.mouse_sensitivity;
game->mousesensitivity = game->usermousesensitivity;
game->debug = config.debug;
@@ -1811,9 +1816,6 @@ void initGl(Game* game)
GLvoid Game::ReSizeGLScene(float fov, float near)
{
- if (screenheight==0)
- screenheight=1;
-
glViewport(0,0,screenwidth,screenheight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();