Mercurial > hg > Members > kono > tree_dandy2
comparison SgoexCerium.cc @ 35:3b92a4b17049 default tip
fix for macosx Yosemite
author | Nozomi |
---|---|
date | Thu, 19 May 2016 18:18:34 +0900 |
parents | b65f6fc9c84f |
children |
comparison
equal
deleted
inserted
replaced
34:b65f6fc9c84f | 35:3b92a4b17049 |
---|---|
14 flip() | 14 flip() |
15 { | 15 { |
16 CameraPtr camera = droot->sgroot->getCamera(); | 16 CameraPtr camera = droot->sgroot->getCamera(); |
17 | 17 |
18 droot->sgroot->flip(); | 18 droot->sgroot->flip(); |
19 droot->sgroot->lightCalc(); | |
20 | 19 |
21 root = droot->createSceneGraph(); | 20 root = droot->createSceneGraph(); |
22 //root->xyz[0] = screen_w/2; | 21 //root->xyz[0] = screen_w/2; |
23 //root->xyz[1] = screen_h/2;; | 22 //root->xyz[1] = screen_h/2;; |
24 root->xyz[0] = 0; | 23 root->xyz[0] = 0; |
25 root->xyz[1] = 0; | 24 root->xyz[1] = 0; |
26 root->xyz[2] = 30.0f; | 25 root->xyz[2] = 30.0f; |
27 | 26 |
27 droot->sgroot->lightCalc(root); | |
28 /*親の回転、座標から、子の回転、座標を算出*/ | 28 /*親の回転、座標から、子の回転、座標を算出*/ |
29 get_matrix(root->matrix, root->angle, root->xyz, camera->matrix); | 29 get_matrix(root->matrix, root->angle, root->xyz, camera->matrix); |
30 /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ | 30 /*法線用の行列。Cameraの行列を抜いている(Cameraのコンストラクタで、単位行列にしている)*/ |
31 get_matrix(root->real_matrix, root->angle, root->xyz, camera->real_matrix); | 31 // get_matrix(root->real_matrix, root->angle, root->xyz, camera->real_matrix); |
32 | 32 |
33 droot->setSceneData(root); | 33 droot->setSceneData(root); |
34 } | 34 } |
35 | 35 |
36 | 36 |
54 m->color = (color & 32); | 54 m->color = (color & 32); |
55 m->mx = w / 2; | 55 m->mx = w / 2; |
56 m->my = h / 2; | 56 m->my = h / 2; |
57 m->tex_w = power_of_two(m->w); | 57 m->tex_w = power_of_two(m->w); |
58 m->tex_h = power_of_two(m->h); | 58 m->tex_h = power_of_two(m->h); |
59 m->texture = (int *)name; | 59 m->texture_name = name; |
60 | 60 |
61 } | 61 } |
62 | 62 |
63 static float my_scale = 5; | 63 static float my_scale = 5; |
64 | 64 |
65 void | 65 void |
66 PutSprite(int zorder, short x, short y, int number) | 66 PutSprite(int zorder, short x, short y, int number) |
67 { | 67 { |
68 SpriteTable *m = &sptable[number]; | 68 SpriteTable *m = &sptable[number]; |
69 char *name = (char *) m->texture; | 69 const char *name = m->texture_name; |
70 if (!name) { | 70 if (!name) { |
71 printf("PutSprite %d unknown\n",number); | 71 printf("PutSprite %d unknown\n",number); |
72 return; | 72 return; |
73 } | 73 } |
74 SceneGraphPtr object = droot->createSceneGraph(name); | 74 SceneGraphPtr object = droot->createSceneGraph(name); |
102 PutSprite(1, x, y, number); | 102 PutSprite(1, x, y, number); |
103 return; | 103 return; |
104 } | 104 } |
105 | 105 |
106 SpriteTable *m = &sptable[number]; | 106 SpriteTable *m = &sptable[number]; |
107 char *name = (char *) m->texture; | 107 const char *name = m->texture_name; |
108 if (!name) { | 108 if (!name) { |
109 printf("PutSpriteEx %d unknown\n",number); | 109 printf("PutSpriteEx %d unknown\n",number); |
110 return; | 110 return; |
111 } | 111 } |
112 SceneGraphPtr object = droot->createSceneGraph(name); | 112 SceneGraphPtr object = droot->createSceneGraph(name); |