# HG changeset patch # User koba # Date 1293520942 -32400 # Node ID d2e627af7f61623ef87c96ed7c39dfd89ee61ad0 # Parent 813f5461daabb58976f35e906922843212c7c557 fix. diff -r 813f5461daab -r d2e627af7f61 TaskDandy.cc --- a/TaskDandy.cc Tue Dec 28 15:50:04 2010 +0900 +++ b/TaskDandy.cc Tue Dec 28 16:22:22 2010 +0900 @@ -531,16 +531,13 @@ m->color = (color & 32); m->mx = w / 2; m->my = h / 2; - m->tex_w = power_of_two(sptable[number].w); - m->tex_h = power_of_two(sptable[number].h); - //texMinX[number] = 0.0f; - //texMinY[number] = 0.0f; - //texMaxX[number] = (GLfloat)sptable[number].w / sptable[number].tex_w; - //texMaxY[number] = (GLfloat)sptable[number].h / sptable[number].tex_h; - // printf("texMaxX = %f, w = %d, tex_w = %d\n", texMaxX[number], sptable[number].w, sptable[number].tex_w); + m->tex_w = power_of_two(m->w); + m->tex_h = power_of_two(m->h); + m->texture = (int *)name; +} -} +static float my_scale = 5; void PutSprite(int zorder, short x, short y, int number) @@ -552,12 +549,12 @@ return; } SceneGraphPtr object = sgroot->createSceneGraph(name); - object->xyz[0] = x; - object->xyz[1] = y; + object->xyz[0] = x - object->c_xyz[0]*my_scale; + object->xyz[1] = y - object->c_xyz[1]*my_scale; object->xyz[2] = 0; 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のコンストラクタで、単位行列にしている)*/ @@ -575,8 +572,8 @@ return; } SceneGraphPtr object = sgroot->createSceneGraph(name); - object->xyz[0] = x; - object->xyz[1] = y; + 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[2] = 0; object->c_xyz[0] = m->mx; object->c_xyz[1] = m->my;