aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-04-27 08:50:07 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-04-27 08:50:07 -0400
commit174bcd3a415c21fc2c59a3af1b6333faa78b37d0 (patch)
treed2f9c9fe8a79628fb95557acb2a0bc03aedb07e3 /include
parent88c21e763178856aef0155595d49085919205951 (diff)
ui fixes, other stuff
Diffstat (limited to 'include')
-rw-r--r--include/common.hpp23
-rw-r--r--include/config.hpp25
-rw-r--r--include/gametime.hpp18
-rw-r--r--include/mob.hpp1
-rw-r--r--include/threadpool.hpp53
5 files changed, 29 insertions, 91 deletions
diff --git a/include/common.hpp b/include/common.hpp
index 5a0fcb2..1f7b9fc 100644
--- a/include/common.hpp
+++ b/include/common.hpp
@@ -18,8 +18,7 @@
#include <thread>
#include <mutex>
#include <future>
-#include <math.h>
-#include <threadpool.hpp>
+#include <cmath>
#include <algorithm>
#define GLEW_STATIC
@@ -153,19 +152,6 @@ typedef col Color;
#define GAME_NAME "Independent Study v0.7 alpha - NOW WITH lights and snow and stuff"
-/**
- * The desired width of the game window.
- */
-
-extern unsigned int SCREEN_WIDTH;
-
-/**
- * The desired height of the game window.
- */
-
-extern unsigned int SCREEN_HEIGHT;
-
-extern bool FULLSCREEN;
extern bool uiLoop;
extern std::mutex mtx;
@@ -179,13 +165,8 @@ extern std::mutex mtx;
*
*/
-#define HLINES(n) (HLINE * n)
-
-extern unsigned int HLINE;
+#define HLINES(n) (game::HLINE * n)
-extern float VOLUME_MASTER;
-extern float VOLUME_MUSIC;
-extern float VOLUME_SFX;
/**
* A 'wrapper' for libc's srand(), as we hope to eventually have our own random number
* generator.
diff --git a/include/config.hpp b/include/config.hpp
index 8bd0bc9..bc9d052 100644
--- a/include/config.hpp
+++ b/include/config.hpp
@@ -1,18 +1,25 @@
#ifndef CONFIG_H
#define CONFIG_H
-#include <iostream>
+#include <string>
-#include <SDL2/SDL_mixer.h>
+namespace game {
+ extern unsigned int HLINE;
+ extern unsigned int SCREEN_WIDTH;
+ extern unsigned int SCREEN_HEIGHT;
+ extern bool FULLSCREEN;
-#include <tinyxml2.h>
-#include <ui.hpp>
+ namespace config {
+ extern float VOLUME_MASTER;
+ extern float VOLUME_MUSIC;
+ extern float VOLUME_SFX;
-
-namespace config {
- void read(void);
- void update(void);
- void save(void);
+ extern std::string xmlFolder;
+
+ void read(void);
+ void update(void);
+ void save(void);
+ }
}
#endif //CONFIG_H
diff --git a/include/gametime.hpp b/include/gametime.hpp
index c2991d2..a809ef9 100644
--- a/include/gametime.hpp
+++ b/include/gametime.hpp
@@ -1,16 +1,18 @@
#ifndef GAMETIME_H_
#define GAMETIME_H_
-namespace gtime {
- void setTickCount(unsigned int t);
- unsigned int getTickCount(void);
- unsigned int getDeltaTime(void);
+namespace game {
+ namespace time {
+ void setTickCount(unsigned int t);
+ unsigned int getTickCount(void);
+ unsigned int getDeltaTime(void);
- void tick(void);
- void tick(unsigned int ticks);
- bool tickHasPassed(void);
+ void tick(void);
+ void tick(unsigned int ticks);
+ bool tickHasPassed(void);
- void mainLoopHandler(void);
+ void mainLoopHandler(void);
+ }
}
#endif // GAMETIME_H_
diff --git a/include/mob.hpp b/include/mob.hpp
index 0ed6bc1..9f006b9 100644
--- a/include/mob.hpp
+++ b/include/mob.hpp
@@ -76,6 +76,7 @@ public:
class Trigger : public Mob {
private:
std::string id;
+ bool triggered;
public:
Trigger(void);
diff --git a/include/threadpool.hpp b/include/threadpool.hpp
deleted file mode 100644
index c341673..0000000
--- a/include/threadpool.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef THREADPOOL_H
-#define THREADPOOL_H
-
-#include <vector>
-#include <queue>
-#include <thread>
-#include <mutex>
-#include <condition_variable>
-#include <iostream>
-#include <unistd.h>
-
-using namespace std;
-
-class ThreadPool
-{
-public:
-
- // Constructor.
- ThreadPool(int threads);
-
- // Destructor.
- ~ThreadPool();
-
- // Adds task to a task queue.
- void Enqueue(function<void()> f);
-
- // Shut down the pool.
- void ShutDown();
-
-private:
- // Thread pool storage.
- vector<thread> threadPool;
-
- // Queue to keep track of incoming tasks.
- queue<function<void()>> tasks;
-
- // Task queue mutex.
- mutex tasksMutex;
-
- // Condition variable.
- condition_variable condition;
-
- // Indicates that pool needs to be shut down.
- bool terminate;
-
- // Indicates that pool has been terminated.
- bool stopped;
-
- // Function that will be invoked by our threads.
- void Invoke();
-};
-
-#endif //THRE \ No newline at end of file