Lines 6-19
Link Here
|
6 |
2004/03/31 jumpei isshiki |
6 |
2004/03/31 jumpei isshiki |
7 |
*/ |
7 |
*/ |
8 |
|
8 |
|
9 |
private import std.math; |
9 |
private import std.c.math; |
10 |
private import std.random; |
10 |
private import std.random; |
11 |
private import std.string; |
11 |
private import std.string; |
12 |
private import SDL; |
12 |
private import SDL; |
13 |
private import opengl; |
13 |
private import opengl; |
14 |
private import util_sdl; |
14 |
private import util_sdl; |
15 |
private import task; |
15 |
private import task; |
16 |
private import bg; |
16 |
private import bg; |
|
|
17 |
private import system; |
17 |
|
18 |
|
18 |
float fade_r = 0.0f; |
19 |
float fade_r = 0.0f; |
19 |
float fade_g = 0.0f; |
20 |
float fade_g = 0.0f; |
Lines 53-68
Link Here
|
53 |
for(int i = 0; i < 3; i++){ |
54 |
for(int i = 0; i < 3; i++){ |
54 |
switch(i){ |
55 |
switch(i){ |
55 |
case 0: |
56 |
case 0: |
56 |
tpos[X] = -((rand() % 4096) / 1024.0f + 1.0f); |
57 |
tpos[X] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f); |
57 |
tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f); |
58 |
tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f); |
58 |
break; |
59 |
break; |
59 |
case 1: |
60 |
case 1: |
60 |
tpos[X] = ((rand() % 2048) / 1024.0f - 1.0f); |
61 |
tpos[X] = cast(float)((rand() % 2048) / 1024.0f - 1.0f); |
61 |
tpos[Y] = -((rand() % 4096) / 1024.0f + 1.0f); |
62 |
tpos[Y] = -cast(float)((rand() % 4096) / 1024.0f + 1.0f); |
62 |
break; |
63 |
break; |
63 |
case 2: |
64 |
case 2: |
64 |
tpos[X] = +((rand() % 4096) / 1024.0f + 1.0f); |
65 |
tpos[X] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f); |
65 |
tpos[Y] = +((rand() % 4096) / 1024.0f + 1.0f); |
66 |
tpos[Y] = +cast(float)((rand() % 4096) / 1024.0f + 1.0f); |
66 |
break; |
67 |
break; |
67 |
default: |
68 |
default: |
68 |
break; |
69 |
break; |
Lines 74-81
Link Here
|
74 |
tpos[Y] = fabs(tpos[Y]); |
75 |
tpos[Y] = fabs(tpos[Y]); |
75 |
TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0)); |
76 |
TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0)); |
76 |
} |
77 |
} |
77 |
TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f; |
78 |
TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f; |
78 |
TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f; |
79 |
TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f; |
79 |
TskBuf[id].tx += TskBuf[id].px; |
80 |
TskBuf[id].tx += TskBuf[id].px; |
80 |
TskBuf[id].ty += TskBuf[id].py; |
81 |
TskBuf[id].ty += TskBuf[id].py; |
81 |
TskBuf[id].wait = 60; |
82 |
TskBuf[id].wait = 60; |
Lines 165-180
Link Here
|
165 |
for(int i = 0; i < 3; i++){ |
166 |
for(int i = 0; i < 3; i++){ |
166 |
switch(i){ |
167 |
switch(i){ |
167 |
case 0: |
168 |
case 0: |
168 |
tpos[X] = -((rand() % 12288) / 1024.0f + 3.0f); |
169 |
tpos[X] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f); |
169 |
tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f); |
170 |
tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f); |
170 |
break; |
171 |
break; |
171 |
case 1: |
172 |
case 1: |
172 |
tpos[X] = ((rand() % 6144) / 1024.0f - 3.0f); |
173 |
tpos[X] = (cast(float)(rand() % 6144) / 1024.0f - 3.0f); |
173 |
tpos[Y] = -((rand() % 12288) / 1024.0f + 3.0f); |
174 |
tpos[Y] = -(cast(float)(rand() % 12288) / 1024.0f + 3.0f); |
174 |
break; |
175 |
break; |
175 |
case 2: |
176 |
case 2: |
176 |
tpos[X] = +((rand() % 12288) / 1024.0f + 3.0f); |
177 |
tpos[X] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f); |
177 |
tpos[Y] = +((rand() % 12288) / 1024.0f + 3.0f); |
178 |
tpos[Y] = +(cast(float)(rand() % 12288) / 1024.0f + 3.0f); |
178 |
break; |
179 |
break; |
179 |
default: |
180 |
default: |
180 |
break; |
181 |
break; |
Lines 186-193
Link Here
|
186 |
tpos[Y] = fabs(tpos[Y]); |
187 |
tpos[Y] = fabs(tpos[Y]); |
187 |
TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0)); |
188 |
TskBuf[id].body_ang[i][W] = sqrt(pow(tpos[X],2.0) + pow(tpos[Y],2.0)); |
188 |
} |
189 |
} |
189 |
TskBuf[id].tx = (rand() % 512000) / 1000.0f - 256.0f; |
190 |
TskBuf[id].tx = cast(float)(rand() % 512000) / 1000.0f - 256.0f; |
190 |
TskBuf[id].ty = (rand() % 512000) / 1000.0f - 256.0f; |
191 |
TskBuf[id].ty = cast(float)(rand() % 512000) / 1000.0f - 256.0f; |
191 |
TskBuf[id].tx += TskBuf[id].px; |
192 |
TskBuf[id].tx += TskBuf[id].px; |
192 |
TskBuf[id].ty += TskBuf[id].py; |
193 |
TskBuf[id].ty += TskBuf[id].py; |
193 |
TskBuf[id].wait = 60; |
194 |
TskBuf[id].wait = 60; |
Lines 279-291
Link Here
|
279 |
TskBuf[id].fp_draw = &TSKBrokenBodyDraw; |
280 |
TskBuf[id].fp_draw = &TSKBrokenBodyDraw; |
280 |
TskBuf[id].fp_exit = &TSKBrokenBodyExit; |
281 |
TskBuf[id].fp_exit = &TSKBrokenBodyExit; |
281 |
TskBuf[id].alpha = 1.0f; |
282 |
TskBuf[id].alpha = 1.0f; |
282 |
TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f; |
283 |
TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f; |
283 |
TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f; |
284 |
TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f; |
284 |
TskBuf[id].tx *= 2.0f; |
285 |
TskBuf[id].tx *= 2.0f; |
285 |
TskBuf[id].ty *= 2.0f; |
286 |
TskBuf[id].ty *= 2.0f; |
286 |
TskBuf[id].tx += TskBuf[id].px; |
287 |
TskBuf[id].tx += TskBuf[id].px; |
287 |
TskBuf[id].ty += TskBuf[id].py; |
288 |
TskBuf[id].ty += TskBuf[id].py; |
288 |
TskBuf[id].rot_add = (rand % 30) - 15; |
289 |
TskBuf[id].rot_add = cast(float)(rand % 30) - 15; |
289 |
if(!(TskBuf[id].rot_add - 15)) TskBuf[id].rot_add = -1; |
290 |
if(!(TskBuf[id].rot_add - 15)) TskBuf[id].rot_add = -1; |
290 |
else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1; |
291 |
else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1; |
291 |
if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15); |
292 |
if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15); |
Lines 410-422
Link Here
|
410 |
TskBuf[id].fp_draw = &TSKBrokenLineDraw; |
411 |
TskBuf[id].fp_draw = &TSKBrokenLineDraw; |
411 |
TskBuf[id].fp_exit = &TSKBrokenLineExit; |
412 |
TskBuf[id].fp_exit = &TSKBrokenLineExit; |
412 |
TskBuf[id].alpha = 1.0f; |
413 |
TskBuf[id].alpha = 1.0f; |
413 |
TskBuf[id].tx = (rand() % 256000) / 1000.0f - 128.0f; |
414 |
TskBuf[id].tx = cast(float)(rand() % 256000) / 1000.0f - 128.0f; |
414 |
TskBuf[id].ty = (rand() % 256000) / 1000.0f - 128.0f; |
415 |
TskBuf[id].ty = cast(float)(rand() % 256000) / 1000.0f - 128.0f; |
415 |
TskBuf[id].tx *= 2.0f; |
416 |
TskBuf[id].tx *= 2.0f; |
416 |
TskBuf[id].ty *= 2.0f; |
417 |
TskBuf[id].ty *= 2.0f; |
417 |
TskBuf[id].tx += TskBuf[id].px; |
418 |
TskBuf[id].tx += TskBuf[id].px; |
418 |
TskBuf[id].ty += TskBuf[id].py; |
419 |
TskBuf[id].ty += TskBuf[id].py; |
419 |
TskBuf[id].rot_add = (rand % 30) - 15; |
420 |
TskBuf[id].rot_add = cast(float)(rand % 30) - 15; |
420 |
if(!(TskBuf[id].rot_add - 15)) TskBuf[id].rot_add = -1; |
421 |
if(!(TskBuf[id].rot_add - 15)) TskBuf[id].rot_add = -1; |
421 |
else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1; |
422 |
else if(!(TskBuf[id].rot_add + 15)) TskBuf[id].rot_add = +1; |
422 |
if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15); |
423 |
if(TskBuf[id].rot_add < 0) TskBuf[id].rot_add = PI / (TskBuf[id].rot_add - 15); |