aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index dcfc722..9a71729 100644
--- a/main.cpp
+++ b/main.cpp
@@ -167,6 +167,8 @@ void mainLoop(void);
vec2 offset; /* OFFSET!!!!!!!!!!!!!!!!!!!! */
+std::vector<menuItem>pauseMenu;
+
extern WEATHER weather;
extern bool fadeEnable;
@@ -461,6 +463,8 @@ void mainLoop(void){
prevTime = currentTime;
currentTime = millis();
deltaTime = currentTime - prevTime;
+
+ if(ui::menu)goto MENU;
/*
* Run the logic handler if MSEC_PER_TICK milliseconds have passed.
@@ -484,6 +488,8 @@ void mainLoop(void){
*/
currentWorld->update(player,deltaTime);
+
+ MENU:
/*
* Update debug variables if necessary
@@ -596,9 +602,7 @@ void render(){
player->near=true; // Draw the player's name
- //glUniform2f(glGetUniformLocation(shaderProgram, "lightLocation"), 640,100);
currentWorld->draw(player);
- //glUniform3f(glGetUniformLocation(shaderProgram, "lightColor"), 0,1.0f,0);
/*
@@ -741,6 +745,10 @@ void render(){
}
+ if(ui::menu){
+ if(ui::pMenu)ui::drawMenu(pauseMenu);
+ }
+
/*
* Draw a white triangle as a replacement for the mouse's cursor.
*/
@@ -986,6 +994,10 @@ void logic(){
else fadeIntensity = 0;
}
+ if(ui::pMenu){
+ ui::drawMenu(pauseMenu);
+ }
+
/*
* Increment a loop counter used for animating sprites.
*/