summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--src/GameDraw.cpp22
-rw-r--r--src/GameInitDispose.cpp20
3 files changed, 35 insertions, 13 deletions
diff --git a/README.md b/README.md
index 881ec55..84ff6d5 100644
--- a/README.md
+++ b/README.md
@@ -44,9 +44,9 @@ which you are now going to try and avoid.
 
 ### Controls
 * wasd = walk
-* shift = run
+* left shift = run
 * mouse = look
-* control = crouch/zoom
+* left control = crouch/zoom
 * click = fire (while aiming) or smash (while running)
   or pick up gun (while crouching over a body and not aiming)
   or disarm (while not aiming)
@@ -55,8 +55,6 @@ which you are now going to try and avoid.
 * e = psychic aim
 * z = toggle soul release
 * space = dive (while running forwards)
-* ctrl+g to grab/ungrab the cursor
-* alt+enter to switch to fullscreen and back again
 
 Keys for debug mode:
 * tab = 3rdperson toggle
diff --git a/src/GameDraw.cpp b/src/GameDraw.cpp
index 9b7c1c5..9848232 100644
--- a/src/GameDraw.cpp
+++ b/src/GameDraw.cpp
@@ -1,3 +1,24 @@
+// Game drawing
+// Copyright (C) 2002  David Rosen
+// Copyright (C) 2003  Ryan C. Gordon
+// Copyright (C) 2003  Steven Fuller
+// Copyright (C) 2021  Nguyễn Gia Phong
+//
+// This file is part of Black Shades.
+//
+// Black Shades is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published
+// by the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Black Shades is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Black Shades.  If not, see <https://www.gnu.org/licenses/>.
+
 #include "Game.h"
 
 extern int thirdperson;
@@ -37,7 +58,6 @@ int Game::DrawGLScene(void)
 		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
 		//"Black Shades"
-		ReSizeGLScene(90.0f, 0.1f);
 		glDisable(GL_TEXTURE_2D);
 		glDisable(GL_DEPTH_TEST);							// Disables Depth Testing
 		glDisable(GL_CULL_FACE);
diff --git a/src/GameInitDispose.cpp b/src/GameInitDispose.cpp
index 1c8cffb..ef5770e 100644
--- a/src/GameInitDispose.cpp
+++ b/src/GameInitDispose.cpp
@@ -62,21 +62,22 @@ void resizeWindow(Game* game, int width, int height)
 {
 	game->screenwidth = width;
 	game->screenheight = height;
+	glViewport(0, 0, width, height);
 }
 
 Game* makeGame(Config config)
 {
 	auto game = new Game();
-	resizeWindow(game, config.width, config.height);
-	game->usermousesensitivity = config.mouse_sensitivity;
-	game->mousesensitivity = game->usermousesensitivity;
-	game->debug = config.debug;
+	game->screenwidth = config.width;
+	game->screenheight = config.height;
 	game->vblsync = config.vsync;
-	blood = config.blood;
 	game->blurness = config.blur;
-	game->mainmenuness = config.menu;
-	game->customlevels = config.custom_levels;
+	blood = config.blood;
+
 	game->musictoggle = config.music;
+
+	game->usermousesensitivity = config.mouse_sensitivity;
+	game->mousesensitivity = game->usermousesensitivity;
 	forwardskey = GLFW_KEY_W;
 	backwardskey = GLFW_KEY_S;
 	leftkey = GLFW_KEY_A;
@@ -85,6 +86,10 @@ Game* makeGame(Config config)
 	psychicaimkey = GLFW_KEY_E;
 	psychickey = GLFW_KEY_Z;
 
+	game->mainmenuness = config.menu;
+	game->customlevels = config.custom_levels;
+	game->debug = config.debug;
+
 	if (!game->initialized) {
 		// TODO: Read high score
 		ifstream ipstream2 {"highscore.txt"};
@@ -1816,7 +1821,6 @@ void initGl(Game* game)
 
 GLvoid Game::ReSizeGLScene(float fov, float near)
 {
-	glViewport(0,0,screenwidth,screenheight);
 	glMatrixMode(GL_PROJECTION);
 	glLoadIdentity();
 	gluPerspective(fov,(GLfloat)screenwidth/(GLfloat)screenheight,near,viewdistance);