aboutsummaryrefslogtreecommitdiff
path: root/src/master/master.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-02 23:48:34 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-02 23:48:34 +0800
commitb9d4b60486e224261990c0732852513e86dd94ff (patch)
tree9f9dd20a888875833af11dc7a67b849a74825b5b /src/master/master.hpp
parentabffe5f72dfb39da8d480ce3c4b546404684a060 (diff)
downloadbullet-lab-remix-b9d4b60486e224261990c0732852513e86dd94ff.tar.xz
Add BLR3 files. Modify Readme.
Currently BLR3 is VERY primitive!!
Diffstat (limited to 'src/master/master.hpp')
-rw-r--r--src/master/master.hpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/master/master.hpp b/src/master/master.hpp
new file mode 100644
index 0000000..8ccb740
--- /dev/null
+++ b/src/master/master.hpp
@@ -0,0 +1,64 @@
+#ifndef MASTER_H
+#define MASTER_H
+#include "smelt.hpp"
+#include "smdatapack.hpp"
+#include "smmath.hpp"
+#include "smentity.hpp"
+#include "smanim.hpp"
+#include <thread>
+#include <chrono>
+struct pn{int p,n;};
+class scenePrototype
+{
+public:
+ virtual bool sceneUpdate(){return false;}
+ virtual bool sceneRender(){return false;}
+ virtual bool threadUpdate(){return false;}
+ virtual ~scenePrototype(){}
+};
+class sceneManager
+{
+private:
+ scenePrototype *sps[256];
+ static SMELT* sm;
+ static std::thread* uth;
+ char names[256][16];
+ bool active[256],thactive;
+ int scnt,dlps,lp,utime;
+ float lps,lpsud;
+ pn pq[256];
+public:
+ sceneManager();
+ ~sceneManager();
+ int registerScene(scenePrototype *sp,const char* scenename,int priority);
+ void activateScene(const char* scene);
+ void deactivateScene(const char* scene);
+ void startUpdate();
+ void stopUpdate();
+ bool isThreadActive();
+ int getSceneID(const char* scene);
+ bool isSceneActive(int sceneid);
+ void setLPS(int lps);
+ float getLPS();
+ int getTHUpdateTime();
+ bool update();
+ void threadUpdate();
+};
+
+class introScene:public scenePrototype
+{
+private:
+ char* ssptr;DWORD sssez;
+ smvec2d *pos,*vel,*acc;
+ float *scale,delay;
+ smEntity2D *blt;
+ int bcnt,step,ch;
+ static SMELT *sm;
+public:
+ introScene();
+ ~introScene();
+ void introInit();
+ bool sceneUpdate()override;
+ bool sceneRender()override;
+};
+#endif