summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index 0321e7d..b1e394e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -13,23 +13,26 @@
using namespace std;
-shared_ptr<Object> makeobjectbyname(int x,int y,const char *name){
+static 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);
OBJECT_CLASSES_XLIST
#undef X
- return NULL; //no object with that name
+ return nullptr; //no object with that name
}
Global global;
-Fl_Window_draw *window;
+static Fl_Window_draw *window;
-Fl_Window_draw::Fl_Window_draw(int w,int h,const char *title=0):Fl_Window(w,h,title){}
-Fl_Window_draw::Fl_Window_draw(int x,int y,int w,int h,const char *label=0L):Fl_Window(x,y,w,h,label){}
+Fl_Window_draw::Fl_Window_draw(int w,int h,const char *title=0)
+ :Fl_Window(w,h,title){}
+Fl_Window_draw::Fl_Window_draw(int x,int y,int w,int h,const char *label=nullptr)
+ :Fl_Window(x,y,w,h,label){}
+
void Fl_Window_draw::draw(void){
fl_rectf(0,0,w(),h(),FL_WHITE);
fl_color(FL_BLACK);
@@ -51,7 +54,7 @@ void stepcallback(void*){
int main(int argc,char **argv){
struct timeval tv;
- gettimeofday(&tv,NULL);
+ gettimeofday(&tv,nullptr);
srand(tv.tv_sec*1000000+tv.tv_usec);
window=new Fl_Window_draw(640,480,GAME_NAME);