diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-12-29 11:17:30 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-12-29 11:17:30 +0100 |
commit | 1f00b2bb92cd4bcfcc4c24806df71a453f481f34 (patch) | |
tree | 9258452b75c9e3b03ed4030ba4b4707246f10cf6 | |
parent | 6286f890c132b9cd6a36d585735e5d7310dc0abf (diff) |
Formatting
-rw-r--r-- | global.h | 6 | ||||
-rw-r--r-- | library.cpp | 1 | ||||
-rw-r--r-- | library.h | 6 | ||||
-rw-r--r-- | main.cpp | 1 | ||||
-rw-r--r-- | main.h | 1 | ||||
-rw-r--r-- | object_base.cpp | 1 | ||||
-rw-r--r-- | object_base.h | 6 |
7 files changed, 10 insertions, 12 deletions
@@ -1,5 +1,4 @@ -#ifndef _GLOBAL_H_ -#define _GLOBAL_H_ +#pragma once #include <vector> #include <memory> @@ -8,10 +7,9 @@ using namespace std; + class Global{ public: int room_speed=30; vector<shared_ptr<Object>> objects; }; - -#endif //_GLOBAL_H_ diff --git a/library.cpp b/library.cpp index f59d542..687914a 100644 --- a/library.cpp +++ b/library.cpp @@ -4,6 +4,7 @@ using namespace std; + extern Fl_Window_draw *window; void draw_text(int x,int y,const char *s){ @@ -1,7 +1,5 @@ -#ifndef _LIBRARY_H_ -#define _LIBRARY_H_ +#pragma once + void draw_text(int x,int y,const char *s); void log(const char *s); - -#endif //_LIBRARY_H_ @@ -12,6 +12,7 @@ using namespace std; + shared_ptr<Object> makeobjectbyname(int x,int y,const char *name){ #define X(objname) if(strcmp(name,#objname)==0)return make_shared<objname>(x,y); @@ -4,6 +4,7 @@ #include <FL/Fl_Window.H> #include <FL/Fl_draw.H> + class Fl_Window_draw : public Fl_Window{ public: Fl_Window_draw(int w,int h,const char *title); diff --git a/object_base.cpp b/object_base.cpp index 502c2e5..b16acc1 100644 --- a/object_base.cpp +++ b/object_base.cpp @@ -4,6 +4,7 @@ using namespace std; + Object::Object(void){ log("Object constructed"); } diff --git a/object_base.h b/object_base.h index 0b407ab..2651be0 100644 --- a/object_base.h +++ b/object_base.h @@ -1,5 +1,5 @@ -#ifndef _OBJECT_BASE_H_ -#define _OBJECT_BASE_H_ +#pragma once + class Object{ public: @@ -14,5 +14,3 @@ public: virtual void step(void); virtual void draw(void); }; - -#endif //_OBJECT_BASE_H_ |