# It's usually sufficient to change just the target name and source file list\r
# and be sure that CXX is set to a valid compiler\r
TARGET = test\r
-SOURCE_FILES = mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp\r
+SOURCE_FILES = guiPauseMenu.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp\r
SOURCES = $(addprefix src/, $(SOURCE_FILES))\r
OBJECTS = $(SOURCES:.cpp=.o)\r
FASTTARGET = fasttest\r
#include <fstream>\r
#include <time.h>\r
#include <jmutexautolock.h>\r
+#include <locale.h>\r
#include "common_irrlicht.h"\r
#include "debug.h"\r
#include "map.h"\r
#include "constants.h"\r
#include "strfnd.h"\r
#include "porting.h"\r
-#include <locale.h>\r
+#include "guiPauseMenu.h"\r
\r
IrrlichtDevice *g_device = NULL;\r
\r
\r
if(event.KeyInput.Key == irr::KEY_ESCAPE)\r
{\r
+ //TODO: Not used anymore?\r
if(g_game_focused == true)\r
{\r
dstream<<DTIME<<"ESC pressed"<<std::endl;\r
//driver->setMinHardwareBufferVertexCount(1);\r
\r
scene::ISceneManager* smgr = device->getSceneManager();\r
+ \r
+ // Pause menu\r
+ guiPauseMenu pauseMenu(device, &receiver);\r
\r
gui::IGUIEnvironment* guienv = device->getGUIEnvironment();\r
gui::IGUISkin* skin = guienv->getSkin();\r
\r
while(device->run())\r
{\r
+ /*\r
+ Random calculations\r
+ */\r
+ v2u32 screensize = driver->getScreenSize();\r
+ core::vector2d<s32> displaycenter(screensize.X/2,screensize.Y/2);\r
+\r
// Hilight boxes collected during the loop and displayed\r
core::list< core::aabbox3d<f32> > hilightboxes;\r
\r
/*\r
Special keys\r
*/\r
- if(g_esc_pressed)\r
+ /*if(g_esc_pressed)\r
{\r
break;\r
- }\r
+ }*/\r
\r
/*\r
Player speed control\r
Mouse and camera control\r
*/\r
\r
- if(device->isWindowActive() && g_game_focused)\r
+ if(device->isWindowActive() && g_game_focused && !pauseMenu.isVisible())\r
{\r
device->getCursorControl()->setVisible(false);\r
\r
first_loop_after_window_activation = false;\r
}\r
else{\r
- s32 dx = g_input->getMousePos().X - 320;\r
- s32 dy = g_input->getMousePos().Y - 240;\r
+ s32 dx = g_input->getMousePos().X - displaycenter.X;\r
+ s32 dy = g_input->getMousePos().Y - displaycenter.Y;\r
//std::cout<<"window active, pos difference "<<dx<<","<<dy<<std::endl;\r
camera_yaw -= dx*0.2;\r
camera_pitch += dy*0.2;\r
if(camera_pitch < -89.5) camera_pitch = -89.5;\r
if(camera_pitch > 89.5) camera_pitch = 89.5;\r
}\r
- g_input->setMousePos(320, 240);\r
+ g_input->setMousePos(displaycenter.X, displaycenter.Y);\r
}\r
else{\r
device->getCursorControl()->setVisible(true);\r
Calculate stuff for drawing\r
*/\r
\r
- v2u32 screensize = driver->getScreenSize();\r
- core::vector2d<s32> displaycenter(screensize.X/2,screensize.Y/2);\r
-\r
camera->setAspectRatio((f32)screensize.X / (f32)screensize.Y);\r
\r
/*\r