summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-12-29 11:17:30 +0100
committertomsmeding <tom.smeding@gmail.com>2016-12-29 11:17:30 +0100
commit1f00b2bb92cd4bcfcc4c24806df71a453f481f34 (patch)
tree9258452b75c9e3b03ed4030ba4b4707246f10cf6
parent6286f890c132b9cd6a36d585735e5d7310dc0abf (diff)
Formatting
-rw-r--r--global.h6
-rw-r--r--library.cpp1
-rw-r--r--library.h6
-rw-r--r--main.cpp1
-rw-r--r--main.h1
-rw-r--r--object_base.cpp1
-rw-r--r--object_base.h6
7 files changed, 10 insertions, 12 deletions
diff --git a/global.h b/global.h
index 65aaa5e..e980582 100644
--- a/global.h
+++ b/global.h
@@ -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){
diff --git a/library.h b/library.h
index 9722d41..b00acdb 100644
--- a/library.h
+++ b/library.h
@@ -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_
diff --git a/main.cpp b/main.cpp
index 9f62068..0321e7d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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);
diff --git a/main.h b/main.h
index b49d507..218d5d2 100644
--- a/main.h
+++ b/main.h
@@ -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_