Mercurial > hg > Members > koba > t_dandy
diff Dandy.cc @ 46:fce767bb5e25
keep up with scale_matrix(not work)
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Jan 2011 02:20:10 +0900 |
parents | e01948ce859a |
children | b99e4366b913 |
line wrap: on
line diff
--- a/Dandy.cc Sat Jan 15 19:13:03 2011 +0900 +++ b/Dandy.cc Tue Jan 18 02:20:10 2011 +0900 @@ -31,8 +31,7 @@ #include "Character_state.h" static int use_keybord = 0; -static int cdp[20] = { 16, 16, 16, 17, 18, 0 }; -static int d, i; +static int i; static int rswait = 0; static int cf = 0; @@ -51,9 +50,9 @@ static void KeyAssign(int runmode, TraceBuffPtr buff, SDL_Joystick *joy, SGO_PAD *pad); static int runmode = 0; +static char *pad_trace_file; static TraceBuffPtr t_buff; static TraceBuffPtr first; -static char *pad_trace_file; /** * runmode: @@ -152,13 +151,13 @@ printf("game end\n"); } -static int light_sysswitch = 1; +static int light_sysswitch = 0; static int light_num = 4; static void _LightSysSwitch(Viewer *sgroot) { if (light_sysswitch == 1) { - sgroot->OffLightSysSwitch(); + sgroot->OnLightSysSwitch(); for (int i = 0; i < light_num; i++) { SceneGraphPtr light = sgroot->getLight(i); sgroot->OnLightSwitch(i); @@ -309,9 +308,9 @@ root->xyz[2] = 30.0f; /*親の回転、座標から、子の回転、座標を算出*/ - get_matrix(root->matrix, root->angle, root->xyz, root->scale, camera->matrix); + get_matrix(root->matrix, root->angle, root->xyz, camera->matrix); /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ - get_matrix(root->real_matrix, root->angle, root->xyz, root->scale, camera->real_matrix); + get_matrix(root->real_matrix, root->angle, root->xyz, camera->real_matrix); sgroot->setSceneData(root); } @@ -458,7 +457,7 @@ PutSprite(count, 640, 640, 192); //PutSpriteEx(count, 8192, 8192, 0); - if (pad[0].st > 1) { + if ((pad[0].st > 1)||(runmode == 2)) { jiki.bf = TRUE; //CdPlay(1,&cdp[0],0); @@ -616,17 +615,18 @@ } SceneGraphPtr object = sgroot->createSceneGraph(name); - object->xyz[0] = x - object->c_xyz[0]*my_scale; - object->xyz[1] = y - object->c_xyz[1]*my_scale; + object->xyz[0] = x; + object->xyz[1] = y; object->xyz[2] = 0; root->addChild(object); float scale[] = {my_scale,my_scale,1}; /*親の回転、座標から、子の回転、座標を算出*/ - get_matrix(object->matrix, object->angle, object->xyz, scale, root->matrix); + get_matrix(object->matrix, object->angle, object->xyz, root->matrix); + scale_matrix(object->matrix, scale, object->c_xyz); /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ - get_matrix(object->real_matrix, object->angle, object->xyz, scale, root->real_matrix); - + get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix); + scale_matrix(object->real_matrix, scale, object->c_xyz); } void @@ -640,8 +640,8 @@ } SceneGraphPtr object = sgroot->createSceneGraph(name); - object->xyz[0] = x - object->c_xyz[0]*my_scale - m->w*my_scale; - object->xyz[1] = y - object->c_xyz[0]*my_scale - m->w*my_scale; + object->xyz[0] = x - m->w*my_scale; + object->xyz[1] = y - m->h*my_scale; object->xyz[2] = 0; object->c_xyz[0] = m->mx; object->c_xyz[1] = m->my; @@ -650,9 +650,11 @@ float scale[] = {5*scalex,5*scaley,1}; /*親の回転、座標から、子の回転、座標を算出*/ - get_matrix(object->matrix, object->angle, object->xyz, scale, root->matrix); + get_matrix(object->matrix, object->angle, object->xyz, root->matrix); + scale_matrix(object->matrix, scale, object->c_xyz); /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ - get_matrix(object->real_matrix, object->angle, object->xyz, scale, root->real_matrix); + get_matrix(object->real_matrix, object->angle, object->xyz, root->real_matrix); + scale_matrix(object->real_matrix, scale, object->c_xyz); }