Mercurial > hg > Members > kono > tree_dandy2
changeset 8:5c405fb3b164
main routine for Cerium
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 23:13:25 +0900 |
parents | 972a7f233b23 |
children | c88a4f98b5ef |
files | Dandy.cc Dandy.h Func.h Makefile Makefile.def |
diffstat | 4 files changed, 29 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/Dandy.cc Tue Dec 07 23:03:45 2010 +0900 +++ b/Dandy.cc Tue Dec 07 23:13:25 2010 +0900 @@ -9,38 +9,35 @@ MainLoopPtr Dandy::init(Viewer *sgroot, int w, int h) { - init_charactor(sgroot, w, h); - init_game(sgroot, w, h); - return sgroot; } -extern Application * +Application * Dandy::application() { return new Dandy(); } -Viewer *sg_root; +Viewer *sgroot; static int dandy_closing(int gamef); -static int dandy_main_lop(int gamef); +static int dandy_main_loop(int gamef); static int dandy_main_init(int gamef); -extern bool +bool Dandy::app_main(Viewer *viewer){ - sg_root = viewer; + sgroot = viewer; // don't use allExecute return 0; }; -exern HTaskPtr +HTaskPtr Dandy::application_task(HTaskPtr next, Viewer* viewer){ int gamef = 0; switch (gamef) { - case 0: gamef= danday_opening(gamef); break; - case 1: gamef= danday_main_loop(gamef); break; - case 2: gamef= danday_closing(gamef); break; + case 0: gamef= dandy_main_init(gamef); break; + case 1: gamef= dandy_main_loop(gamef); break; + case 2: gamef= dandy_closing(gamef); break; } return next; }; @@ -215,7 +212,7 @@ } static int -dandy_main_lop(int gamef) +dandy_main_loop(int gamef) { viewer->sgroot->flip(); viewer->sgroot->lightCalc();
--- a/Dandy.h Tue Dec 07 23:03:45 2010 +0900 +++ b/Dandy.h Tue Dec 07 23:13:25 2010 +0900 @@ -8,8 +8,9 @@ #include "Func.h" class Dandy : public Application { - bool app_main(Viewer *viewer){}; - HTaskPtr application_task(HTaskPtr next, Viewer* viewer){return next;}; + Application* application(); + bool app_main(Viewer *viewer); + HTaskPtr application_task(HTaskPtr next, Viewer* viewer); MainLoopPtr init(Viewer *viewer, int w, int h); };
--- a/Makefile Tue Dec 07 23:03:45 2010 +0900 +++ b/Makefile Tue Dec 07 23:13:25 2010 +0900 @@ -4,7 +4,7 @@ srcdir = . ABI = -m32 -CFLAGS += -g $(ABI) -O2 -Wall `sdl-config --cflags` `xml2-config --cflags` -I../Cerium/include +CFLAGS += -g $(ABI) -O2 -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE) LIBS += `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs` LIBS += -lCerium -lFifoManager
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.def Tue Dec 07 23:13:25 2010 +0900 @@ -0,0 +1,15 @@ +# include/library path +# ex macosx + +# ex linux/ps3 +CERIUM = ../Cerium + +CC = g++ +OPT = -g #-O9 +CFLAGS = -Wall $(OPT) + +ABIBIT = 32 + +INCLUDE = -I. -I.. -I${CERIUM}/include/TaskManager -I$(CERIUM)/Renderer/Engine -I$(CERIUM)/include/Cerium +LIBS = -L${CERIUM}/TaskManager -L$(CERIUM)/Renderer/Engine +TOOL = $(CERIUM)/bin