# HG changeset patch # User Shinji KONO # Date 1292220209 -32400 # Node ID cd5768022d2b863c360e1faa0988c5a0d2785755 # Parent 095e9575cc0ae550ab74f03b1c2e44780326199d 64bit trying.. diff -r 095e9575cc0a -r cd5768022d2b Dandy.cc --- a/Dandy.cc Thu Dec 09 22:33:20 2010 +0900 +++ b/Dandy.cc Mon Dec 13 15:03:29 2010 +0900 @@ -31,13 +31,16 @@ #include "Character.h" #include "Character_state.h" -int use_keybord = 0; -int cdp[20] = { 16, 16, 16, 17, 18, 0 }; -int d, i; +static int use_keybord = 0; +static int cdp[20] = { 16, 16, 16, 17, 18, 0 }; +static int d, i; -int rswait = 0; -int cf = 0; -int cc = 0; +static int rswait = 0; +static int cf = 0; +static int cc = 0; + +static int test_mode = 0; +static char *test_object = "" ; //static SDL_Surface *screen; // static Uint32 background; @@ -116,6 +119,7 @@ case 2: gamef= opening(gamef); break; case 3: gamef= dandy_main_loop(gamef); break; case 4: gamef= dandy_closing(gamef); break; + case 5: gamef= dandy_test(gamef); break; } return next; }; @@ -131,6 +135,16 @@ int TMmain(TaskManager *manager,int argc, char *argv[]) { + for(int i = 1; iset_TMend(TMend); @@ -543,6 +557,8 @@ } +static float my_scale = 1; + void PutSprite(int zorder, short x, short y, int number) { @@ -556,14 +572,27 @@ object->xyz[0] = x; object->xyz[1] = y; object->xyz[2] = 0; + object->c_xyz[0] = m->mx; + object->c_xyz[1] = m->my; root->addChild(object); - float scale[] = {5,5,1}; + float scale[] = {my_scale,my_scale,1}; /*親の回転、座標から、子の回転、座標を算出*/ get_matrix(object->matrix, object->angle, object->xyz, scale, root->matrix); /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ get_matrix(object->real_matrix, object->angle, object->xyz, scale, root->real_matrix); +if (my_scale == 1 && m->w > 32) { +float v0[] = {m->w,0,0,0}; +float v1[] = {1,0,0,0}; +float w; +applyMatrix(v1, object->matrix, v0); +w = sqrtf( v1[0]*v1[0] + v1[1]*v1[1] + v1[2]*v1[2] ); +my_scale = w / ((float) m->w); +printf("scale = %g\n", my_scale); +} + + } void @@ -584,7 +613,7 @@ object->angle[3] = angle; root->addChild(object); - float scale[] = {5*scalex,5*scaley,1}; + float scale[] = {my_scale*scalex,my_scale*scaley,1}; /*親の回転、座標から、子の回転、座標を算出*/ get_matrix(object->matrix, object->angle, object->xyz, scale, root->matrix); /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ diff -r 095e9575cc0a -r cd5768022d2b Makefile --- a/Makefile Thu Dec 09 22:33:20 2010 +0900 +++ b/Makefile Mon Dec 13 15:03:29 2010 +0900 @@ -2,7 +2,7 @@ include ./Makefile.def srcdir = . -ABI = -m32 +ABI = -m$(ABIBIT) 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` diff -r 095e9575cc0a -r cd5768022d2b Makefile.def --- a/Makefile.def Thu Dec 09 22:33:20 2010 +0900 +++ b/Makefile.def Mon Dec 13 15:03:29 2010 +0900 @@ -8,7 +8,7 @@ OPT = -g #-O9 CFLAGS = -Wall $(OPT) -ABIBIT = 32 +ABIBIT = 64 INCLUDE = -I. -I.. -I${CERIUM}/include/TaskManager -I$(CERIUM)/Renderer/Engine -I$(CERIUM)/include/Cerium LIBS = -L${CERIUM}/TaskManager -L$(CERIUM)/Renderer/Engine