Mercurial > hg > Game > S_Dandy
changeset 6:446447936e9f default tip
remove disused file.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 22:55:02 +0900 |
parents | 93bdb789e60d |
children | |
files | src/collision.c src/count2.cc src/count2.h src/main.cc src/move.cc src/move.h src/schedule3.cc src/scheduletest.cc src/tama2.cc src/testgl.cc |
diffstat | 10 files changed, 0 insertions(+), 3803 deletions(-) [+] |
line wrap: on
line diff
--- a/src/collision.c Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,270 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <SDL.h> -#include "SDL_opengl.h" -#include "object.h" -#include "Character.h" -#include "Character_state.h" -#include "tokuten.h" -#include "collision.h" -//#include "atari.h" -#include "bom.h" -#include "count2.h" -#include "sound.h" -//#include "Enemy.h" -//#include "libps.h" -#include "sgoex.h" - -extern SpriteTable sptable[DEFOBJ]; - -void -nocollision(SceneGraphPtr node, int screen_w, int screen_h, - SceneGraphPtr tree){} - -CHARACTER * atari(CHARACTER *p) -{ - int i1, h, w, ex, ey, charno; - int n; - ex = p->x; - ey = p->y; - charno = p->charano; - w = sptable[charno].w; - h = sptable[charno].h; - //i2 = playerno; - - - //自機やられ -#ifndef INVISIBLE_MODE - if ((ex < jiki.x + 128 / 2) && (ex + w > jiki.x + 128 / 2) - && (ey < jiki.y + 128 / 2) && (ey + h > jiki.y + 128 / 2) - && jiki.muteki == 0) { - //se_voice[0] = SsUtKeyOn(vab[JIKIOUT], 0, 0, 65, 0, 60, 60); - Bom(jiki.x + 16, jiki.y + 16); - jiki.bf = FALSE; - jiki.zanki--; - jiki.muteki = 120; - - infg.stg = 0; - infg_level--; - if (infg_level < 0) - infg_level = 0; - - return p; - } -#endif - - if (p->tama == TRUE) - goto jumping; - for (i1 = 0; i1 < tama_lv1_end + 1; i1++) { - - if ((tama_lv1[i1].x + 64 + 64 > ex) - && (ex + w > tama_lv1[i1].x + 16) - && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) - && (tama_lv1[i1].r != -1)) { - tama_lv1[i1].r = -1; - p->vit -= TAMALV1P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - if ((tama_lv1[i1].x + 64 > ex) && (ex + w > tama_lv1[i1].x) - && (tama_lv1[i1].y + 128 > ey) && (tama_lv1[i1].y < ey + h) - && (tama_lv1[i1].l != -1)) { - tama_lv1[i1].l = -1; - p->vit -= TAMALV1P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - } - - for (i1 = 0; i1 < tama_lv2_end + 1; i1++) { - if ((tama_lv2[i1].x + 128 + 64 > ex) - && (ex + w > tama_lv2[i1].x + 128) - && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) - && (tama_lv2[i1].rr != -1)) { - tama_lv2[i1].rr = -1; - p->vit -= TAMALV2P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - - if ((tama_lv2[i1].x + 64 + 64 > ex) - && (ex + w > tama_lv2[i1].x + 16) - && (tama_lv2[i1].y - 32 + 192 > ey) - && (tama_lv2[i1].y - 32 < ey + h) - && (tama_lv2[i1].sr != -1)) { - tama_lv2[i1].sr = -1; - p->vit -= TAMALV2P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - if ((tama_lv2[i1].x + 64 > ex) && (ex + w > tama_lv2[i1].x) - && (tama_lv2[i1].y - 32 + 192 > ey) - && (tama_lv2[i1].y - 32 < ey + h) - && (tama_lv2[i1].sl != -1)) { - tama_lv2[i1].sl = -1; - p->vit -= TAMALV2P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - if ((tama_lv2[i1].x - 64 + 64 > ex) - && (ex + w > tama_lv2[i1].x - 64) - && (tama_lv2[i1].y + 192 > ey) && (tama_lv2[i1].y < ey + h) - && (tama_lv2[i1].ll != -1)) { - tama_lv2[i1].ll = -1; - p->vit -= TAMALV2P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - } - if ((tlv3[0].r > 0) && (jiki.x < ex + w) && (jiki.x + 128 > ex) - && (jiki.y > ey + h)) { - p->vit -= TAMALV3P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - jumping: - if ((tlv3[0].r > 0) && (jiki.x < ex + w) && (jiki.x + 128 > ex) - && (jiki.y + 128 > ey) && (jiki.y < ey + h)) { - p->vit -= TAMALV3P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - /*laser lv1 */ - for (i1 = 0; i1 < laser_lv1_end + 1; i1++) { - n = laser_lv1[i1].r * 128 / 4096; - - if ((laser_lv1[i1].x + n > ex) && (ex + w > laser_lv1[i1].x) - && (laser_lv1[i1].y + n > ey) && (laser_lv1[i1].y < ey + h) - && (laser_lv1[i1].r != -1)) { - laser_lv1[i1].r = -1; - laser_lv1[i1].y = -1; - p->vit -= LASERLV1P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - } - /*shield(laser lv2) */ - if ((p->tama == TRUE) && (lg.stg > 0) && - (laser_lv2[0].x + 128 > ex) && (ex + w > laser_lv2[0].x - 128) - && (laser_lv2[0].y + 128 > ey) && (laser_lv2[0].y - 128 < ey + h) - && (laser_lv2[0].r != 0)) { - p->vit -= LASERLV2P; - lg.stg -= 26; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - /*bomber(laser lv3) */ - if (laser_lv3[0].r < 62) { - for (i1 = 1; i1 < 128; i1++) { - if ((laser_lv3[i1].x + 128 > ex) && (ex + w > laser_lv3[i1].x) - && (laser_lv3[i1].y + 128 > ey) - && (laser_lv3[i1].y < ey + h) - && (laser_lv3[i1].r > 0)) { - tama_lv2[i1].rr = -1; - p->vit -= LASERLV3P; - infg.stg++; - if (p->vit <= 0) { - infg.stg += 4; - Bom(p->x, p->y); - enemycount += (p->score * - ((infg.stg / 128) + infg_level + 1)); - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - return p; - } - } - } - } - return p; -}
--- a/src/count2.cc Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,413 +0,0 @@ -#include <stdlib.h> -#include "object.h" -#include "count2.h" -#include "sound.h" -#include "bom.h" -#include "sankaku.h" -//#include "libps.h" -#include "sgoex.h" -#include "debug.h" - -/* - * debugging - */ -extern SGO_PAD pad[2]; - -player jiki = { 60, 200, 3, 0, FALSE, 120, 3, 3 }; - -laser laser_lv1[20]; -laser laser_lv2[20]; -stge lg = { 4096 }; -stge pg = { 4096 }; - -int infg_level = { 0 }; - -stge infg = { 1 }; - -tama1 tama_lv1[20]; -tama2 tama_lv2[20]; -tama1 tlv3[3]; - -int py; -int bomcount = { 0 }; -int charcount = { 0 }; -int bania; - -int pointkakudo(int playerno); - -int bf = { 0 }; - -int tama_lv1_end = { -1 }; -int tama_lv2_end = { -1 }; -int laser_lv1_end = { -1 }; -int laser_lv2_end = { -1 }; - -laser laser_lv3[64] = { {0, 0, 0, 0, 64, 0} }; - -int se_key[6] = { -1, -1, -1, -1, -1, -1 }; - -void Player(int playerno) -{ - int i; - float wariai1, wariai2; - /* - if (jiki.zanki > 0) { - DefSprite(194, "remainder.bmp", 8 * (jiki.zanki - 1), 8, 480, effect); - count++; - PutSprite(count, 128, 224, 194); - } - */ - if (jiki.bf == FALSE) { - Bom(jiki.x, jiki.y); - return; - } - /*時機無敵時間計算 */ - if (jiki.muteki > 0 && jiki.bf == TRUE) { - count++; - // PutSprite(count, jiki.x + 16, jiki.y + 16, 193); - PutSpriteEx(193, jiki.x + 16, jiki.y + 16, 2, 2, 1); - count++; - // PutSprite(count, jiki.x + 16, jiki.y + 16, 193); - PutSpriteEx(193, jiki.x + 16, jiki.y + 16, 2, 2, 1); - - jiki.muteki--; - } - /*コントローラ上限値-------------------------------- */ - maxf(pad[0].right, 3); - maxf(pad[0].left, 3); - maxf(pad[0].up, 3); - maxf(pad[0].down, 3); - - - /*自機の動き---------------------------------------- */ - jiki.x += pad[0].right - pad[0].left; - jiki.y += pad[0].down - pad[0].up; - - - /*自機の動き---------------------------------------- */ - mini(jiki.x, 0); - maxf(jiki.x, 1688 - 128); - mini(jiki.y, 0); - maxf(jiki.y, 964 - 128); - - if (pad[0].right > 0) { - if (charcount < 0) - charcount = 0; - else - charcount++; - } - if (pad[0].left > 0) { - if (charcount > 0) - charcount = 0; - else - charcount--; - } - if ((pad[0].left == 0) && (pad[0].right == 0)) - charcount = 0; - jiki.ch = - 3 * (charcount < 3) * (charcount > -3) + 2 * (charcount < - -3) * (charcount >= - -15) + - 1 * (charcount < -15) - + 4 * (charcount > 3) * (charcount <= 15) + 5 * (charcount > 15); - - - /*玉レベル1登録------------------------------------ */ - if ((pad[0].k4 % 3 == 1) && (pad[0].k3 % 3 == 0)) { - - PlaySdlMixer(0, SHOT_A);// output sound - //se_voice[0] = SsUtKeyOn(vab[SHOT_A], 0, 0, 65, 0, 60, 60); - pad[0].k4 = 1; - tama_lv1_end++; - i = tama_lv1_end; - - tama_lv1[i].x = jiki.x; - tama_lv1[i].y = jiki.y; - tama_lv1[i].r = 1; - tama_lv1[i].l = 1; - - if (pg.stg <= MAXP) - pg.stg += 1; - } - /*玉レベル2登録------------------------------------ */ - if ((pad[0].k3 % 3 == 1) && (pad[0].k4 == 0) && (pg.stg > 64)) { - - PlaySdlMixer(0, SHOT_B);// output sound - //se_key[1] = SsUtKeyOn(vab[SHOT_B], 0, 0, 65, 0, 80, 80); - se_key[1] = SsUtKeyOn(vab[SHOT_B], 0, 0, 65, 0, 80, 80); - pad[0].k3 = 1; - tama_lv2_end++; - i = tama_lv2_end; - - tama_lv2[i].x = jiki.x; - tama_lv2[i].y = jiki.y; - tama_lv2[i].rr = 1; - tama_lv2[i].sr = 1; - tama_lv2[i].sl = 1; - tama_lv2[i].ll = 1; - - pg.stg -= 64; - } - /*玉レベル3登録------------------------------------- */ - if ((pad[0].k3 % 5 > 0) && (pad[0].k4 % 5 > 0)) { - pad[0].k3 = 1; - pad[0].k4 = 1; - i = 0; - while (tlv3[i].y != -1) { - i++; - } - if ((i < 1) && (pg.stg > 2000)) { - PlaySdlMixer(0,SHOT_C); // re-za- - //se_voice[0] = SsUtKeyOn(vab[SHOT_C], 0, 0, 65, 0, 75, 75); - se_voice[0] = SsUtKeyOn(vab[SHOT_C], 0, 0, 65, 0, 75, 75); - tlv3[i].x = jiki.x; - tlv3[i].y = jiki.y; - pg.stg -= 2000; - tlv3[i].r = 90; - jiki.muteki = 4; - } - } - /*押してないときの玉ゲージ回復---------------------- */ - if ((pad[0].k3 == 0) && (pad[0].k4 == 0)) - if (pg.stg <= MAXP) - pg.stg += 4; - /*玉レベル1表示------------------------------ */ - for (i = 0; i < tama_lv1_end + 1; i++) { - tama_lv1[i].y -= 64; - if (tama_lv1[i].r == 1) { - count++; - PutSprite(count, tama_lv1[i].x + 64, tama_lv1[i].y, 6); - } - if (tama_lv1[i].l == 1) { - count++; - PutSprite(count, tama_lv1[i].x, tama_lv1[i].y, 7); - } - if (tama_lv1[i].y < 0) { - if (tama_lv1_end == i) { - tama_lv1_end--; - break; - } - if (tama_lv1_end > i) { - tama_lv1[i] = tama_lv1[tama_lv1_end]; - tama_lv1_end--; - i--; - } - } - } - /*玉レベル2表示------------------------------ */ - for (i = 0; i < tama_lv2_end + 1; i++) { - tama_lv2[i].y -= 64; - if (tama_lv2[i].rr == 1) { - count++; - PutSprite(count, tama_lv2[i].x + 128, tama_lv2[i].y-96, 8); - } - if (tama_lv2[i].sr == 1) { - count++; - PutSprite(count, tama_lv2[i].x + 64, tama_lv2[i].y - 192, 8); - } - if (tama_lv2[i].sl == 1) { - count++; - PutSprite(count, tama_lv2[i].x, tama_lv2[i].y - 192, 8); - } - if (tama_lv2[i].ll == 1) { - count++; - PutSprite(count, tama_lv2[i].x - 64, tama_lv2[i].y-92, 8); - } - if (tama_lv2[i].y < 0) { - if (tama_lv2_end == i) { - tama_lv2_end--; - break; - } - if (tama_lv2_end > i) { - tama_lv2[i] = tama_lv2[tama_lv2_end]; - tama_lv2_end--; - i--; - } - } - } - /*玉レベル3表示----------------------------------- */ - if (tlv3[0].r > 0) { - /*波動砲本体 */ - tlv3[0].x = jiki.x + 96; - tlv3[0].y = jiki.y; - count++; - // PutSprite(count, tlv3[0].x, tlv3[0].y - 128, 9); - PutSpriteEx(9, tlv3[0].x, tlv3[0].y - 128, tlv3[0].r *2 /45, 3, 1); - - - /*干渉部分 */ - //DefSprite(39, 0, 16, 112 - ((tlv3[0].r % 8) / 2) * 16, 16, 16, - // 480); - - /*波動砲干渉部分 */ - count++; - // PutSprite(count, jiki.x + 16, jiki.y + 32, 39); - PutSpriteEx(39, jiki.x + 16, jiki.y + 32, 2, 2, 1); - - /*終了フラグ */ - tlv3[0].r--; - if (tlv3[0].r == 0) - tlv3[0].y = -1; - } - /* } */ - /*玉ゲージの中身表示------------------------- */ - wariai2 = pg.stg; - wariai1 = wariai2 / 4096.0; - py = 64.0 * wariai1; - - //DefSprite(11, "offensivepower_gauge.bmp", 8, py, 480, effect); - count++; - //PutSprite(count, 0, 240 - 96 + 64 - py, 11); - /*レーザーゲージの中身表示------------------------ */ - wariai2 = lg.stg; - wariai1 = wariai2 / 4096.0; - py = 64.0 * wariai1; - //DefSprite(15, "diffensivepower_gauge.bmp", 9, py, 480, effect); - - count++; - //PutSprite(count, 18, 240 - 105, 15); - /*インフレゲージ------------------------------------- */ - if (infg.stg > 640) { - infg.stg = 0; - infg_level++; - if (infg_level > 11) { - infg_level = 11; - infg.stg = 640; - } - } - py = infg.stg / 8; - //DefSprite(49, "inflation_meter.bmp", 16, py, 320, effect); - -#define REGULATION_PUTSIZE_X 5 - count++; - //PutSprite(count, REGULATION_PUTSIZE_X + 4 - 7, 24 + 83 - py, 49); - count++; - //PutSprite(count, REGULATION_PUTSIZE_X + 0, 40 + 80, 200 + infg_level); - - /*バーニアアニメーション----------------------------- */ - bania++; - bania %= 3; - //DefSprite(12, "burner.bmp", 16, 16, 480, effect); - count++; - //PutSprite(count, jiki.x + 8, jiki.y + 32, 12); - - /*照準コントロール----------------------------------- */ - if (pad[0].r1 % 2 == 1) { - pad[0].r1 = 1; - jiki.point += 10; - } - if (pad[0].l1 % 2 == 1) { - pad[0].l1 = 1; - jiki.point -= 10; - } - jiki.point %= 360; - int siny = 50 * Mysin(jiki.point - 90) / SANKAKU; - int cosx = 30 + 50 * Mycos(jiki.point - 90) / SANKAKU; - count++; - DefSpriteEx(13, 4, 64); - // PutSprite(count, jiki.x + 16, jiki.y, 13); - PutSpriteEx(13, jiki.x + cosx, jiki.y + siny, 2, 2, jiki.point); - /*押してないときレーザーゲージ回復------------------- */ - - if ((pad[0].k1 == 0) && (pad[0].k0 == 0)) - if (lg.stg <= MAXP) - lg.stg += 4; - /*レーザーレベル1登録------------------------------- */ - if ((pad[0].k1 % 3 == 1) && (pad[0].k0 == 0) && (lg.stg > 16)) { - PlaySdlMixer(0, RING) ; // RING - - //se_key[3] = SsUtKeyOn(vab[LASER_A], 0, 0, 65, 0, 50, 50); - pad[0].k1 = 1; - laser_lv1_end++; - i = laser_lv1_end; - - laser_lv1[i].sx = 32 * Mysin(jiki.point) / SANKAKU; - laser_lv1[i].sy = 32 * Mycos(jiki.point) / SANKAKU; - laser_lv1[i].x = jiki.x + 128; - laser_lv1[i].y = jiki.y + 128; - laser_lv1[i].r = 1000; - laser_lv1[i].s = 0.08; - lg.stg -= 16; - } - /*--------------------------------------------------*/ - for (i = 0; i < laser_lv1_end + 1; i++) { - if (laser_lv1[i].r != -1) { - laser_lv1[i].y -= laser_lv1[i].sy; - laser_lv1[i].x += laser_lv1[i].sx; - laser_lv1[i].r += 100; - laser_lv1[i].s += 0.05; - count++; - DefSpriteEx(16, 16, 16); - // PutSprite(count, laser_lv1[i].x, laser_lv1[i].y, 16); - PutSpriteEx(16, laser_lv1[i].x, laser_lv1[i].y, laser_lv1[i].s, laser_lv1[i].s, 1); - } - if (waku(laser_lv1[i].x, laser_lv1[i].y)) { - if (laser_lv1_end == i) { - laser_lv1_end--; - break; - } - if (laser_lv1_end > i) { - laser_lv1[i] = laser_lv1[laser_lv1_end]; - laser_lv1_end--; - i--; - } - } - } - /*レーザーレベル2登録------------------------------- */ - if ((pad[0].k1 == 0) && (pad[0].k0 != 0) && (lg.stg > 200)) { - PlaySdlMixer(0, NEW) ;// SHIELD - - if (laser_lv2[0].r == 0) { - laser_lv2[0].r = 1; - lg.stg -= 100; - } else { - laser_lv2[0].r %= 45; - laser_lv2[0].r++; - lg.stg -= 10; - } - } else { - laser_lv2[0].r = 0; - } - /*------------------------------------*/ - if (laser_lv2[0].r != 0) { - laser_lv2[0].x = jiki.x + 128 + 256 * Mysin(jiki.point) / SANKAKU; - laser_lv2[0].y = jiki.y + 128 - 256 * Mycos(jiki.point) / SANKAKU; - count++; - // PutSprite(count, laser_lv2[0].x, laser_lv2[0].y, 17); - PutSpriteEx(17, laser_lv2[0].x, laser_lv2[0].y, 2, 2, laser_lv2[0].r * 8); - } - -/*ここに特殊兵器ボムの関数をよろしく*/ -/*発射準備 (laser_lv3[playerno][0] は、爆発発生の種。)*/ - if ((pad[0].k1 > 0) && (pad[0].k0 > 0) - && (lg.stg > 2400) && (laser_lv3[0].r > 61)) { - PlaySdlMixer(0, BOM) ;// BOM - //se_voice[0] = SsUtKeyOn(vab[LASER_C], 0, 0, 65, 0, 70, 70); - - laser_lv3[0].x = jiki.x + 256 * Mysin(jiki.point) / SANKAKU; - laser_lv3[0].y = jiki.y - 256 * Mycos(jiki.point) / SANKAKU; - laser_lv3[0].r = 0; - lg.stg -= 2400; - jiki.muteki = 60; - } - if (laser_lv3[0].r < 62) { /*ボムフラグ継続か */ - laser_lv3[0].r++; - if (laser_lv3[0].r % 2 == 0) { /*爆風発生 */ - laser_lv3[1 + laser_lv3[0].r / 2].r = 8; - laser_lv3[1 + laser_lv3[0].r / 2].x = - laser_lv3[0].x + rand() % 640 - 320; - laser_lv3[1 + laser_lv3[0].r / 2].y = - laser_lv3[0].y + rand() % 640 - 320; - } - } - /*ボムノアニメーション */ - for (i = 1; i < 32; i++) { - if (laser_lv3[i].r > 0) { - laser_lv3[i].r--; - count++; - // PutSprite(count, laser_lv3[i].x, laser_lv3[i].y, - // 47 - (laser_lv3[i].r)); - PutSpriteEx(47 - (laser_lv3[i].r), laser_lv3[i].x, laser_lv3[i].y, 4, 4, 1); - } - } -}
--- a/src/count2.h Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -#include "bool.h" -#ifndef _COUNT2_H_ -#define _COUNT2_H_ - - -#define MAXP 4096 -#define waku(x,y) ( ((y<0)||(y>964)||(x<0)||(x>1688)) ? 1 : 0) -#define maxf(x,y) x=( (x<y) ? x : y) -#define mini(x,y) x=( (x<y) ? y : x) -#define TAMALV1P 14 -#define TAMALV2P 50 -#define TAMALV3P 24 - -#define LASERLV1P 17 -#define LASERLV2P 154 -#define LASERLV3P 51 - -typedef struct player { - int x; - int y; - int ch; - int point; - BOOL bf; - int muteki; - int zanki; - int ccount; -} player; - -typedef struct tama { - int x; - int y; -} tama; - -typedef struct tama1 { - int x; - int y; - int r; - int l; -} tama1; - -typedef struct tama2 { - int x; - int y; - int rr; - int sr; - int sl; - int ll; -} tama2; - -typedef struct stge { - int stg; -} stge; - -typedef struct laser { - float x; - float y; - float sx; - float sy; - int r; - int enemyno; - float s; -} laser; - -extern int pointkakudo(int playerno); -extern void Player(int playerno); -extern laser laser_lv3[64]; -extern tama1 tlv3[3]; - -extern player jiki; - -extern stge lg; -extern stge pg; -extern stge infg; -extern int infg_level; - -extern tama1 tama_lv1[20]; -extern tama2 tama_lv2[20]; - -extern laser laser_lv1[20]; -extern laser laser_lv2[20]; - -extern int laser_lv1_end; - -extern int tama_lv1_end; -extern int tama_lv2_end; - -#endif // _COUNT2_H
--- a/src/main.cc Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,470 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <math.h> -#include <time.h> -#include <SDL.h> -#include "SDL_opengl.h" -#include "object.h" -#include "tree_controll.h" -#include "xml.h" -#include "profile.h" -#include "syokika.h" -//#include "libps.h" -#include "sankaku.h" -#include "sgoex.h" -#include "sound.h" -#include "bool.h" -//#include "move.h" -#include "Character.h" -#include "Character_state.h" -#include "bom.h" -#include "count2.h" -//#include "Enemy.h" -#include "tokuten.h" -#include "schedule.h" -#include "tama.h" -//#include"profile.h" -#include "debug.h" -#include "trace.h" -#include "LoadSprite.h" -#include <SDL_mixer.h> - -#include "error.h" - -int gamef = 0; -int use_keybord = 0; -int cdp[20] = { 16, 16, 16, 17, 18, 0 }; -int d, i; - -int rswait = 0; -int cf = 0; -int cc = 0; - -//static SDL_Surface *screen; -static Uint32 background; -static char *pad_trace_file; - -extern void schedule(); -extern void tokuten(); -extern void Pad(); -extern void keybord(); -//extern void PutSpriteEx(int number, int x, int y, GLfloat scalex, GLfloat scaley, GLfloat angle); -//GLuint texture[250] = {0}; -static void gamesyokika(); -static void opening(); -static void pause(); -//static char *pad_trace_file; -extern void SDL_GL_Enter2DMode(); -extern void SDL_GL_Leave2DMode(); - -/** - * runmode: - * 0 - normal game - * 1 - capture mode - * program will capture all pad traces on a play and - * dump it into a file - * 2 - trace mode - * program will run with a trace file which is generated - * by capture-mode - */ -int runmode; - -#ifdef ENABLE_TRACEMODE -#define SCMP_SIZ 8 - - -void print_usage() -{ - dbg_printf("usage: %s [-h|-help|--help][--capture filename][--trace filename]\n",PROGRAM_NAME); -} - - - -int get_option(int argc, char *argv[]) -{ - int i; - if (argc < 2) { - return 0; - } - for (i = 0; i < argc; i++) { - if (!strncmp(argv[i], "--capture", SCMP_SIZ)) { - if (++i >= argc) { - return 1; - } - pad_trace_file = argv[i]; - runmode = 1; - return 0; - } else if (!strncmp(argv[i], "--trace", SCMP_SIZ)) { - if (++i >= argc) { - return 1; - } - pad_trace_file = argv[i]; - runmode = 2; - return 0; - } else if (!strncmp(argv[i], "--help", SCMP_SIZ) || - !strncmp(argv[i], "-help", SCMP_SIZ) || - !strncmp(argv[i], "-h", SCMP_SIZ)) { - return 1; - } - } - return 1; -} -#endif //ENABLE_TRACEMODE - - -int main(int argc, char *argv[]) -{ - Timeprof timeprof_move; - timeprof_move = timeprof_new(); - dbg_init("/dev/stdout"); - - /** - * timeprof $B$,$"$k$s$@$1$I$M(B - */ - int frames = 0; - int start_time = 0, stop_time = 0; - -#ifdef ENABLE_TRACEMODE - if (get_option(argc, argv)) { - print_usage(); - return (1); - } - if (pad_trace_file) { - pad_file_open(pad_trace_file); - } - if(myrand_open_file("rand_trace")) { - perror("main"); - retun 1; - } -#endif //ENABLE_TRACEMODE - - //SDL_Joystick *joy=SDL_JoystickOpen(0); - - syokika(argc, argv); - __debug("syokika$B$,8F$S$@$5$l$^$7$?(B\n"); - SDL_Joystick *joy=SDL_JoystickOpen(0); - if(!joy) { - fprintf(stderr,"failed to open joystick 0\n"); - use_keybord = 1; - } - background = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00); - SDL_FillRect(screen, NULL, background); - SDL_GL_Enter2DMode(); - - opening(joy); - - __debug("opening$B$,$h$S$@$5$l$^$7$?(B\n"); - - /** - * sound.c $B$K0\$7$^$7$?(B - * $BBe$o$j$K(B InitSdlMixer(void); $B$r;H$$$^$9!#(B - * $B$^$"Cf?H0l=o$J$s$@$1$I$M(B - */ - /** - if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY,MIX_DEFAULT_FORMAT,2,1024) < 0) { - fprintf(stderr,"failed to initialize SDL_mixer.\n"); - SDL_Quit(); - exit(-1); - } - */ - - // SDL_mixer $B$H$+$$$m$$$m=i4|2=(B - // $B$b$7(B Init $B$K<:GT$7$?$i(B - // $B0J8e$N(B Mixer $B4XO"$N4X?t$r8F$S=P$7$F$b(B - // $BCf$G$O2?$b9T$o$l$J$$$H$+$$$&>.:Y9)$rF~$l$^$7$?!#(B - InitSdlMixer(); - - // $B2;3Z%U%!%$%k$NFI$_9~$_(B - LoadSdlMixer(); - - // $B%\%j%e!<%`D4@0(B - InitVolume(); - - // $B2;=P$7%F%9%H(B - PlaySdlMixer(-1, BGM); - - if(!(init_chara_list(1024))){ - __debug("failed to init_chara_list\n"); - } - - __debug("finished init_chara_list\n"); - - start_time = SDL_GetTicks(); - - while (gamef) { - if ((pad[0].l1 != 0) && (pad[0].r1 != 0) && - (pad[0].l2 != 0) && (pad[0].r2 != 0)) { - glFlush(); - SDL_GL_SwapBuffers( ); - gamesyokika(joy); - } - - if (pad[0].quit != 0) { - gamef = 0; - } - - //SDL_FillRect(screen, NULL, background); - glClear( GL_COLOR_BUFFER_BIT); - - schedule(); - enemyfaste = count; - - timeprof_begin(timeprof_move); - //Move(); //enemy move - collision_detect(); - outofwindow(); - timeprof_end(timeprof_move); - state_update(); - asteroidi = 0; - //charpatern(); - //bosguage(); - - if (jiki.bf == TRUE) { - Player(0); - count++; - PutSprite(count, jiki.x, jiki.y, jiki.ch); - } - - Putbom(); - tokuten(); - - count++; - //PutSprite(count, 0, 960 - 96, 10); - /*$B%$%s%U%l%2!<%8(B */ - count++; - //PutSprite(count, 0, 0, 48); - obj_draw(); - pause(joy); - - if (use_keybord) { - keybord(); - } else { - Pad(joy); - } - - glFlush(); - SDL_GL_SwapBuffers( ); - filpcount++; - SDL_Delay(10); - count = 0; - - - frames++; - } - - stop_time = SDL_GetTicks(); - - { - char buf[128]; - timeprof_sprint(buf, "move", timeprof_move); - dbg_printf("%s\n", buf); - } - - printf("%f FPS\n", ((float)frames)/(stop_time-start_time)*1000.0); - - SDL_GL_Leave2DMode(); - SDL_FreeSurface(sprite); - - SDL_JoystickClose(joy); - - //_______________________________________________ - // SDL_mixer$B$N8e;OKv(B - Mix_CloseAudio(); - Mix_HaltMusic(); - FreeSdlMixer() ; - //_______________________________________________ - - - SDL_Quit(); - return(0); -} - - -void gamesyokika(SDL_Joystick *joy) -{ - laser_lv3[0].r = 62; - laser_lv3[0].r = 62; - for (i = 0; i < 3; i++) { - tlv3[i].y = -1; - } - filpcount = 0; - stage = 0; - //for (i = 0; i < 300; i++) - //enemy[i].f = FALSE; - jiki.zanki = 3; - jiki.x = 60; - jiki.y = 200; - jiki.ch = 3; - jiki.point = 0; - jiki.bf = FALSE; - jiki.muteki = 120; - enemycount = 0; - lg.stg = 4096; - pg.stg = 4096; - infg.stg = 0; - infg_level = 0; - //kyeenemyno = -1; - fastebos = 0; - jiki.ccount = 99; - p_extend = 200000; - pad[0].up=0; - pad[0].down=0; - pad[0].right=0; - pad[0].left=0; - pad[0].st=0; - pad[0].se=0; - opening(joy); -} - - -void opening(SDL_Joystick *joy) -{ - //for (i = 0; i < 300; i++) { - //}; - - SoundStop(); - SoundPlay(7); - - while (1) { - if(use_keybord == 1) { - keybord(); - } else { - Pad(joy); - } - - count = 1; - - PutSprite(count, 700, 480, 53); // put `push start' string on screen. - count++; - PutSprite(count, 224, 776, 119); // put `super dandy' - count++; - // PutSprite(count, 200, 64, 190); - // PutSpriteEx(count, 8192, 8192, 0); - PutSpriteEx(190, 800, 264, 2, 2, 5); - count++; - PutSprite(count, 396, 432, 191); - //PutSpriteEx(count, 8192, 8192, 0); - count++; - PutSprite(count, 640, 640, 192); - //PutSpriteEx(count, 8192, 8192, 0); - - if (pad[0].st > 1) { - jiki.bf = TRUE; - - //CdPlay(1,&cdp[0],0); - SoundStop(); - SoundPlay(0); - - gamef = 1; - pad[0].st = 1; - return; - } - if ((pad[0].se > 0) && (pad[0].st > 0)) { - gamef = 0; - break; - } - - - SDL_GL_SwapBuffers( ); - } -} - -void -pause(SDL_Joystick *joy) -{ - if (jiki.zanki != 0 && jiki.bf != FALSE) { - if (pad[0].se == 1) { - //Mix_Pause(BGM); - PauseSdlMixer(BGM); - while(1){ - if(use_keybord == 1) { - keybord(); - } else { - Pad(joy); - } - if(pad[0].st == 0) - continue; - pad[0].up=0; - pad[0].down=0; - pad[0].right=0; - pad[0].left=0; - pad[0].se=0; - pad[0].st=0; - //Mix_Resume(BGM); - ResumeSdlMixer(BGM); - break; - } - } - } - if (jiki.zanki == 0) { - // RECT *recp; - if ((jiki.ccount > 0) && (cf == 0)) { - cf = 1; - count++; - //cgcg(2); - PutSprite(2, 480, 480, 110); - count++; - //cgcg(1); - } - if ((jiki.ccount > 0) && (cf == 1)) { - while (1) { - if (pad[0].st > 0) { - cf = 0; - jiki.ccount--; - jiki.zanki = 3; - enemycount++; - cc = 0; - for (i = 0; i < 4; i++) { - clear_result[i] = 0; - } - goto f; - } - cc++; - if (29 - cc / 60 < 20) { - cc = 0; - cf = 3; - break; - } - SDL_Delay(100); - PutSprite(1, 640, 640, 29 - cc / 60); - // PutSpriteEx(1, 409 * ((cc % 60) + 1), 409 * ((cc % 60) + 1), 0); - - Pad(joy); - SDL_GL_SwapBuffers( ); - } - } - if (rswait > 60 * 6) { - cf = 0; - rswait = 0; - gamesyokika(joy); - } - rswait++; - count++; - //cgcg(1); - PutSprite(1, 480, 480, 19); - return; - } - if (jiki.bf == FALSE) { - f: - if (rswait < 80) { - rswait++; - return; - } else { - rswait = 0; - jiki.x = 60; - jiki.y = 200; - jiki.bf = TRUE; - - pad[0].st = 0; - lg.stg = 4096; - pg.stg = 4096; - laser_lv3[0].r = 62; - tlv3[0].r = 0; - tlv3[0].y = -1; - return; - // sb_size = -1; - } - } -}
--- a/src/move.cc Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,963 +0,0 @@ -#include <stdlib.h> -#include <SDL.h> -//#include "libps2.h" -#include "move.h" -#include "Enemy.h" -#include "count2.h" -#include "tokuten.h" -#include "schedule.h" -#include "bom.h" -#include "sankaku.h" -//#include "libps.h" -#include "sgoex.h" -#include "atari.h" -#include"debug.h" -#include "SDL_opengl.h" -extern SpriteView spview[MAXOBJ]; - - -int tekino0; -int rinkx; -int rinky; -int rinkf1 = 0, rinkf2 = 0; -int asteroiddt[200]; -int asteroidi = 0; -int enemyfaste = 0; -int sf; -int amari; -int fastebos = 0; - -void asteroid(int tekino); - -void Move() -{ - int tekino; - - for (tekino = 0; tekino < 100; tekino++) { - if (enemy[tekino].f == TRUE) { - if ((enemy[tekino].move != 8) && - (enemy[tekino].move != 9)) - if (jiki.bf == TRUE) - if (atari(0, tekino)) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - enemycount += (enemy[tekino].sc * - ((infg.stg / 128) + infg_level + 1)); - } - if (enemy[tekino].f == TRUE); - switch (enemy[tekino].move) { - case 0: - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - break; - case 1: - enemy[tekino].x -= enemy[tekino].sx; - enemy[tekino].y -= enemy[tekino].sy; - break; - case 2: - enemy[tekino].sy -= 0.25; - enemy[tekino].y += enemy[tekino].sy; - break; - case 3: - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - if ((enemy[tekino].dt1 == 60) || - (enemy[tekino].dt1 == 90) || - (enemy[tekino].dt1 == 30)) - Puttama(0, enemy[tekino].x, enemy[tekino].y); - enemy[tekino].dt1++; - break; - case 4: - enemy[tekino].y += enemy[tekino].sy; - enemy[tekino].x += enemy[tekino].sx; - if (enemy[tekino].y < jiki.y - && enemy[tekino].y + 16 > jiki.y) { - enemy[tekino].sy = -2; - enemy[tekino].sx = - ((jiki.x > enemy[tekino].x) ? 4 : -4); - enemy[tekino].move = 7; - } - break; - case 5: - enemy[tekino].y += enemy[tekino].sy; - enemy[tekino].x += enemy[tekino].sx; - if (enemy[tekino].y + 96 < jiki.y - && enemy[tekino].y + 128 > jiki.y) { - enemy[tekino].sy = -2; - enemy[tekino].sx = - ((jiki.x > enemy[tekino].x) ? 4 : -4); - enemy[tekino].move = 0; - } - break; - case 6: - enemy[tekino].y += enemy[tekino].sy; - enemy[tekino].x += enemy[tekino].sx; - if (enemy[tekino].y + 96 < jiki.y - && enemy[tekino].y + 128 > jiki.y) { - enemy[tekino].sy = 2; - enemy[tekino].sx = - ((jiki.x > enemy[tekino].x) ? 4 : -4); - enemy[tekino].move = 0; - } - break; - - case 7: - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - if ((enemy[tekino].dt1 == 60) || (enemy[tekino].dt1 == 90) - || (enemy[tekino].dt1 == 30)) - Puttama(1, enemy[tekino].x, enemy[tekino].y); - enemy[tekino].dt1++; - break; -////////1面中ボスパターン///////////////////////////////// - case 8: /*8から11まで登場パターン */ - if (enemy[tekino].y < 520) { - tekino0 = tekino; - kyeenemyno = tekino; - enemy[tekino].y += enemy[tekino].sy; - count++; - DefSpriteEx(enemy[tekino].charno, 16*4, 32*4); - // PutSprite(count, enemy[tekino].x, enemy[tekino].y, - // enemy[tekino].charno); - PutSpriteEx(enemy[tekino].charno, enemy[tekino].x*4, enemy[tekino].y*4, 0.2, 0.2, 1); - enemy[tekino].dt1 = 512; - enemy[tekino].s = 0.125; - goto putout; - } - enemy[tekino].move = 9; - case 9: - if (enemy[tekino].s <= 2) { - enemy[tekino].s += 0.05; - enemy[tekino].y -= 12; - count++; - DefSpriteEx(54, 16*4, 32*4); - // PutSprite(count, enemy[tekino].x, enemy[tekino].y, 54); - PutSpriteEx(54, enemy[tekino].x*4, enemy[tekino].y*4, enemy[tekino].s, enemy[tekino].s, 1); - goto putout; - } - count++; - DefSpriteEx(54, 16, 32); - // PutSprite(count, enemy[tekino].x, enemy[tekino].y, 54); - PutSpriteEx(54, enemy[tekino].x, enemy[tekino].y, enemy[tekino].s, enemy[tekino].s, 1); - - rinkx = enemy[tekino].x; - rinky = enemy[tekino].y; - Putenemy(5, rinkx - 16, rinky - 16, 1, 0, 10); - Putenemy(5, rinkx - 16, rinky - 16, -1, 0, 10); - enemy[tekino].move = 11; - enemy[tekino].dt1 = 8192; - goto putout; - case 10: - if (enemy[tekino].dt1 < 48) { - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - enemy[tekino].dt1++; - break; - } - rinkf1 = 1; - enemy[tekino].dt1 = rinkx; - enemy[tekino].dt2 = rinky; - enemy[tekino].move = 13; - break; - case 11: - if (rinkf1 == 0) { - count++; - DefSpriteEx(54, 16, 32); - // PutSprite(count, enemy[tekino].x, enemy[tekino].y, 54); - PutSpriteEx(54, enemy[tekino].x, enemy[tekino].y, enemy[tekino].s, enemy[tekino].s, 1); - goto putout; - } - enemy[tekino].dt1 = 0; - enemy[tekino].dt2 = 0; - enemy[tekino].move = 12; - break; - case 12: - if (fastebos > 60 * 60) { - if (enemy[tekino].y > 240 + 32) - enemy[tekino].f = FALSE; - enemy[tekino].y += 3; - rinky += 3; - count++; - DefSpriteEx(54, 16, 32); - // PutSprite(count, enemy[tekino].x, enemy[tekino].y, 54); - PutSpriteEx(54, enemy[tekino].x, enemy[tekino].y, 2, 2, 1); - goto putout; - } - if (enemy[tekino].dt1 <= 60) { - if (jiki.x + 15 - rinkx < -5) - enemy[tekino].sx = -0.8; - else if (jiki.x + 15 - rinkx > 5) - enemy[tekino].sx = +0.8; - else - enemy[tekino].sx = 0; - enemy[tekino].x += enemy[tekino].sx; - rinkx = enemy[tekino].x; - rinky = enemy[tekino].y; - } - if ((enemy[tekino].dt1 > 60) && (enemy[tekino].dt1 <= 70)) { - if (enemy[tekino].dt1 % 2 == 1) { - Puttama(0, rinkx - 16, rinky); - Puttama(0, rinkx, rinky); - Puttama(0, rinkx + 16, rinky); - } - } - if ((enemy[tekino].dt1 > 180) - && (enemy[tekino].dt1 <= 240)) { - if (enemy[tekino].dt1 % 2 == 1) { - rinkf2 = 1; - Puttama(2, rinkx - 16, enemy[tekino].y - 32); - Puttama(3, rinkx + 32 - 16, enemy[tekino].y - 32); - } else - rinkf2 = 0; - } - if (enemy[tekino].dt1 > 240) { - rinkf2 = 2; - } - if ((enemy[tekino].dt1 > 240) - && (enemy[tekino].dt1 <= 400)) { - count++; - PutSprite(count, rinkx - 16, rinky + 32, - 58 + enemy[tekino].dt1 % 4); - } - if ((enemy[tekino].dt1 > 300) - && (enemy[tekino].dt1 <= 400)) { - rinkf2 = 3; - if (jiki.x + 15 - rinkx < -5) - enemy[tekino].sx = -1; - else if (jiki.x + 15 - rinkx > 5) - enemy[tekino].sx = +1; - else - enemy[tekino].sx = 0; - enemy[tekino].x += enemy[tekino].sx; - rinkx = enemy[tekino].x; - rinky = enemy[tekino].y; - Puttama(4, rinkx - 8, rinky + 16); - } - if ((enemy[tekino].dt1 > 400) - && (enemy[tekino].dt1 <= 500)) { - rinkf2 = 4; - if (jiki.x + 15 - rinkx < -5) - enemy[tekino].sx = -1; - else if (jiki.x + 15 - rinkx > 5) - enemy[tekino].sx = +1; - else - enemy[tekino].sx = 0; - enemy[tekino].x += enemy[tekino].sx; - rinkx = enemy[tekino].x; - rinky = enemy[tekino].y; - } - if (enemy[tekino].dt1 > 500) { - rinkf2 = 5; - if (jiki.x + 15 - rinkx < -5) - enemy[tekino].sx = -1; - else if (jiki.x + 15 - rinkx > 5) - enemy[tekino].sx = +1; - else - enemy[tekino].sx = 0; - enemy[tekino].x += enemy[tekino].sx; - rinkx = enemy[tekino].x; - rinky = enemy[tekino].y; - } - if (enemy[tekino].dt1 > 600) { - rinkf2 = 0; - enemy[tekino].dt1 = 0; - } - fastebos++; - enemy[tekino].dt1++; - count++; - DefSpriteEx(54, 16, 32); - // PutSprite(count, enemy[tekino].x, enemy[tekino].y, 54); - PutSpriteEx(54, enemy[tekino].x, enemy[tekino].y, 2, 2, 1); - goto putout; - case 13: - if (enemy[tekino0].f == FALSE) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - } - enemy[tekino].x += rinkx - enemy[tekino].dt1; - enemy[tekino].y += rinky - enemy[tekino].dt2; - enemy[tekino].dt1 = rinkx; - enemy[tekino].dt2 = rinky; - if (rinkf2 == 1) { - if (enemy[tekino].x > rinkx) { - Puttama(2, enemy[tekino].x + 32, enemy[tekino].y); - } - if (enemy[tekino].x < rinkx) { - Puttama(3, enemy[tekino].x, enemy[tekino].y); - } - } - if (rinkf2 == 4) { - count++; - PutSprite(count, enemy[tekino].x, enemy[tekino].y + 56, - 58 + filpcount % 4); - } - if (rinkf2 == 5) { - if (enemy[tekino].x > rinkx) { - Puttama(5, enemy[tekino].x + 8, - enemy[tekino].y + 24); - } - if (enemy[tekino].x < rinkx) { - Puttama(5, enemy[tekino].x + 8, - enemy[tekino].y + 24); - } - } - break; - case 20: - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - enemy[tekino].sx -= 0.5; //-=1; - enemy[tekino].sy += 0.4; //+=0.8; - break; - case 21: - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - enemy[tekino].sx += 0.5; //+=1; - enemy[tekino].sy += 0.4; //+=0.8; - break; -///////////ここまで/////////////////////// - case 22: - sf = rand() % 4; - if ((sf == 0) || (sf == 1)) { - enemy[tekino].x = -35; - enemy[tekino].y = rand() % (120 - 35); - enemy[tekino].sx = (rand() % 4 + 1); - enemy[tekino].sy = rand() % 3 - 1; - enemy[tekino].move = 23; - } - if ((sf == 2)) { - enemy[tekino].x = rand() % 290; - enemy[tekino].y = -30; - enemy[tekino].sx = rand() % 3 - 1; - enemy[tekino].sy = (rand() % 4 + 1); - enemy[tekino].move = 23; - } - if (sf == 3) { - enemy[tekino].x = 320; - enemy[tekino].y = rand() % (120 - 35); - enemy[tekino].sx = (rand() % 4 + 1) * -1; - enemy[tekino].sy = rand() % 3 - 1; - enemy[tekino].move = 23; - } - break; - case 23: - asteroid(tekino); - break; - //////////////////////////////////////// - case 24: - kyeenemyno = tekino; - tekino0 = 0; - rinkx = 0; - rinky = 0; - rinkf1 = 0; - rinkf2 = 0; - enemy[tekino].move = 25; - break; - case 25: - if (enemy[tekino].dt1 <= 360) { - enemy[tekino].x = - Mycos(enemy[tekino].dt1) * 30 / SANKAKU + 82 + 32; - enemy[tekino].y = - Mysin(enemy[tekino].dt1) * 30 / SANKAKU + 30; - } - if (enemy[tekino].dt1 > 360) { - enemy[tekino].x = - Mycos(enemy[tekino].dt1) * 30 * -1 / SANKAKU + - 142 + 32; - enemy[tekino].y = - Mysin(enemy[tekino].dt1) * 30 / SANKAKU + 30; - } - count++; - PutSprite(count, enemy[tekino].x - 42, enemy[tekino].y, - 64); - amari = rand() % 160; - if ((amari == 1) && (enemy[kyeenemyno + 5].f == TRUE)) { - enemy[tekino].move = 26; //バルカンパターン - rinkf1 = 1; - } - if ((amari == 2) && (enemy[kyeenemyno + 1].f == TRUE)) { - enemy[tekino].move = 27; //ロケットパンチパターン - rinkf1 = 5; - rinkx = 0; - break; - } - if ((enemy[kyeenemyno + 5].f != TRUE) - && (enemy[kyeenemyno + 1].f != TRUE)) - enemy[tekino].move = 28; - enemy[tekino].dt1 += 3; - if (enemy[tekino].dt1 == 720) - enemy[tekino].dt1 = 0; - break; - case 26: //バルカンパターン - if ((enemy[tekino].dt2 > 50) && (enemy[tekino].dt2 < 100)) { - rinkf1 = 2; - } - if (enemy[tekino].dt2 > 100) - rinkf1 = 3; - if (enemy[tekino].dt2 == 400) - rinkf1 = 4; - count++; - PutSprite(count, enemy[tekino].x - 42, enemy[tekino].y, - 64); - if (enemy[tekino].dt2 == 401) { - enemy[tekino].dt2 = 0; - rinkf1 = 0; - enemy[tekino].move = 25; - break; - } - enemy[tekino].dt2++; - break; - case 27: //ロケットパンチパターン - if ((enemy[tekino].dt2 > 50) && (enemy[tekino].dt2 < 60) - && (enemy[tekino].x > -24) - && (enemy[tekino].y > -24)) { - rinkf1 = 6; - rinkx -= 4; - enemy[tekino].x -= 4; - enemy[tekino].y -= 4; - } - if (enemy[tekino].dt2 == 80) { - rinkf1 = 7; - } - if (enemy[tekino].dt2 == 81) { - rinkf1 = 8; - } - if (enemy[tekino].dt2 == 124) { - rinkf1 = 9; - } - - if (enemy[tekino].dt2 == 400) { - rinkf1 = 10; - } - if (enemy[tekino].dt2 == 444) { - rinkf1 = 11; - } - if (enemy[tekino].dt2 == 500) { - rinkf1 = 12; - } - if ((enemy[tekino].dt2 > 80) && (enemy[tekino].dt2 < 200)) - if ((rinkx != 0) && (enemy[tekino].dt2 % 2 == 1)) { - rinkx++; - enemy[tekino].x++; - enemy[tekino].y++; - } - count++; - PutSprite(count, enemy[tekino].x - 32, enemy[tekino].y, 6); - if (rinkf1 == 12) { - enemy[tekino].dt2 = 0; - rinkf1 = 0; - rinkx = 0; - enemy[tekino].move = 25; - break; - } - enemy[tekino].dt2++; - break; - case 28: - if (enemy[tekino].dt1 <= 360) { - enemy[tekino].x = - Mycos(enemy[tekino].dt1) * 30 / SANKAKU + 82 + 32; - enemy[tekino].y = - Mysin(enemy[tekino].dt1) * 30 / SANKAKU + 30; - } - if (enemy[tekino].dt1 > 360) { - enemy[tekino].x = - Mycos(enemy[tekino].dt1) * 30 * -1 / SANKAKU + - 142 + 32; - enemy[tekino].y = - Mysin(enemy[tekino].dt1) * 30 / SANKAKU + 30; - } - count++; - PutSprite(count, enemy[tekino].x - 42, enemy[tekino].y, - 64); - if (enemy[tekino].dt1 % 30 == 3) - Putenemy(24, enemy[tekino].x + 14, - enemy[tekino].y + 14, - (rand() % 5 + 0.5) * (rand() % 2 == - 1 ? -1 : 1), - (rand() % 5 + 0.5) * (rand() % 2 == - 1 ? -1 : 1), 29); - enemy[tekino].dt1 += 3; - break; - case 29: - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - if (enemy[tekino].dt1 % 18 == 1) - Puttama(0, enemy[tekino].x, enemy[tekino].y); - enemy[tekino].dt1++; - break; - case 30: //本体 - enemy[tekino].x = enemy[kyeenemyno].x - 32; - enemy[tekino].y = enemy[kyeenemyno].y; - break; - case 31: //右腕 - if ((enemy[kyeenemyno + 3].f == FALSE) - || (kyeenemyno == -1)) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - break; - } - - if (rinkf1 == 0) { - enemy[tekino].x = enemy[kyeenemyno].x + 40; - enemy[tekino].y = enemy[kyeenemyno].y + 28; - enemy[tekino].dt2 = 0; - } - if (rinkf1 == 5) { - enemy[tekino].x = enemy[kyeenemyno].x + 52; - enemy[tekino].y = enemy[kyeenemyno].y; - count++; - PutSprite(count, enemy[tekino].x - 4, - enemy[tekino].y - 20, - 80 + enemy[tekino].dt2 % 4); - enemy[tekino].dt2++; - } - if (rinkf1 == 6) { - if (enemy[tekino].y < 240 - 48) { - enemy[tekino].y += 6; - } else { - // rinkf1=7; - break; - } - count++; - PutSprite(count, enemy[tekino].x - 4, - enemy[tekino].y - 20, - 90 + enemy[tekino].dt2 % 4); - enemy[tekino].dt2++; - } - if (rinkf1 == 7) { - Putenemy(22, enemy[tekino].x + 14, - enemy[tekino].y + 14, 0, 0, 40); - // rinkf1=8; - break; - } - if (rinkf1 == 11) { - if (enemy[kyeenemyno].y + 20 != enemy[tekino].y) { - enemy[tekino].y--; - } else { - // rinkf1=12; - break; - } - count++; - PutSprite(count, enemy[tekino].x + 8, - enemy[tekino].y + 44, - 58 + enemy[tekino].dt2 % 4); - enemy[tekino].dt2++; - } - break; - case 32: //左腕 - if ((enemy[kyeenemyno + 4].f == FALSE) - || (kyeenemyno == -1)) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - break; - } - enemy[tekino].x = enemy[kyeenemyno].x - 40; - enemy[tekino].y = enemy[kyeenemyno].y + 28; - if (rinkf1 == 5) { - enemy[tekino].x = enemy[kyeenemyno].x - 24 + 4; - enemy[tekino].y = enemy[kyeenemyno].y + 28; - enemy[tekino].charno = enemystate[20].charno; - } - if (rinkf1 == 11) { - enemy[tekino].charno = enemystate[14].charno; - } - if (rinkf1 == 7) { - Putenemy(23, enemy[tekino].x + 14, - enemy[tekino].y + 14, 0, 0, 41); - // rinkf1=8; - break; - } - break; - case 33: //右肩 - if ((enemy[kyeenemyno].f == FALSE) || (kyeenemyno == -1)) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - } - enemy[tekino].x = enemy[kyeenemyno].x + 32; - enemy[tekino].y = enemy[kyeenemyno].y; - if (rinkf1 == 5) { - enemy[tekino].x = enemy[kyeenemyno].x + 32 - 4; - enemy[tekino].y = enemy[kyeenemyno].y; - enemy[tekino].charno = enemystate[19].charno; - } - if (rinkf1 == 6) { - enemy[tekino].charno = enemystate[11].charno; - } - break; - case 34: //左肩 - if ((enemy[kyeenemyno].f == FALSE) || (kyeenemyno == -1)) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - } - enemy[tekino].x = enemy[kyeenemyno].x - 32; - enemy[tekino].y = enemy[kyeenemyno].y; - if (rinkf1 == 5) { - enemy[tekino].charno = enemystate[21].charno; - } - if (rinkf1 == 6) { - enemy[tekino].charno = enemystate[12].charno; - } - break; - case 35: //胸 - if (kyeenemyno == -1) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - } - enemy[tekino].x = enemy[kyeenemyno].x; - enemy[tekino].y = enemy[kyeenemyno].y + 32; - if (rinkf1 == 1) { - enemy[tekino].charno = enemystate[16].charno; - } - if (rinkf1 == 2) { - count++; - PutSprite(count, enemy[tekino].x - 10, - enemy[tekino].y + 16, - 58 + enemy[tekino].dt2 % 4); - count++; - PutSprite(count, enemy[tekino].x + 10, - enemy[tekino].y + 16, - 58 + enemy[tekino].dt2 % 4); - enemy[tekino].dt2++; - } - if (rinkf1 == 3) { - count++; - PutSprite(count, enemy[tekino].x - 10, - enemy[tekino].y + 16, - 58 + enemy[tekino].dt2 % 4); - count++; - PutSprite(count, enemy[tekino].x + 10, - enemy[tekino].y + 16, - 58 + enemy[tekino].dt2 % 4); - if (enemy[tekino].dt2 % 20 == 1) { - Puttama(7, enemy[tekino].x, enemy[tekino].y + 16); - Puttama(7, enemy[tekino].x + 20, - enemy[tekino].y + 16); - } - enemy[tekino].dt2++; - } - if (rinkf1 == 4) { - enemy[tekino].charno = enemystate[15].charno; - enemy[tekino].dt2 = 0; - } - break; - case 40: //アームバルカン - if (enemy[kyeenemyno + 1].f == FALSE) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - } - if ((rinkf1 == 8) && (enemy[tekino].dt1 % 3 == 1)) { - if ((enemy[tekino].dt2 < 16)) { - enemy[tekino].dt2++; - DefSprite(76, 1, 112, 0, 16, enemy[tekino].dt2, - 480); - } else { - // rinkf1=9; - break; - } - } - if (rinkf1 == 9) { - if (enemy[tekino].dt1 % 15 == 1) { - Puttama(8, enemy[tekino].x, enemy[tekino].y); - } - } - if (rinkf1 == 10) { - if (enemy[tekino].dt2 != 0) { - enemy[tekino].dt2--; - DefSprite(76, 1, 112, 0, 16, enemy[tekino].dt2, - 480); - } else { - enemy[tekino].f = FALSE; - // rinkf1=11; - } - } - enemy[tekino].dt1++; - break; - case 41: //左腕アップアームバルカン - if (enemy[kyeenemyno + 2].f == FALSE) { - Bom(enemy[tekino].x, enemy[tekino].y); - enemy[tekino].f = FALSE; - } - enemy[tekino].x = enemy[kyeenemyno].x - 20 - 7; - enemy[tekino].y = enemy[kyeenemyno].y + 28 + 15; - if ((rinkf1 == 8) && (enemy[tekino].dt1 % 3 == 1)) { - if ((enemy[tekino].dt2 < 16)) { - enemy[tekino].dt2++; - DefSprite(77, 1, 112, 16, enemy[tekino].dt2, 16, 480); /*左腕アップアーム砲 */ - } else { - rinkf1 = 9; - break; - } - } - if (rinkf1 == 9) { - if (enemy[tekino].dt1 % 15 == 1) { - Puttama(9 + rand() % 2, enemy[tekino].x, - enemy[tekino].y); - } - } - if (rinkf1 == 10) { - if (enemy[tekino].dt2 != 0) { - enemy[tekino].dt2--; - DefSprite(77, 1, 112, 16, enemy[tekino].dt2, 16, - 480); - } else { - enemy[tekino].f = FALSE; - // rinkf1=11; - } - } - enemy[tekino].dt1++; - break; - case 400: - enemy[tekino].sy++; - enemy[tekino].y += enemy[tekino].sy / 4; - break; - case 401: - enemy[tekino].sx++; - enemy[tekino].x += enemy[tekino].sx / 8; - if (enemy[tekino].x > (jiki.x - 32)) { - enemy[tekino].sy--; - } - enemy[tekino].y += enemy[tekino].sy / 8; - if (enemy[tekino].dt1 % 50 == 37) { - Puttama(1, enemy[tekino].x + 8, enemy[tekino].y + 24); - } - enemy[tekino].dt1++; - break; - case 402: - enemy[tekino].sx--; - enemy[tekino].x += enemy[tekino].sx / 8; - if (enemy[tekino].x < (jiki.x + 32)) { - enemy[tekino].sy--; - } - enemy[tekino].y += enemy[tekino].sy / 8; - if (enemy[tekino].dt1 % 50 == 37) { - Puttama(1, enemy[tekino].x + 8, enemy[tekino].y + 24); - } - enemy[tekino].dt1++; - break; - case 410: - kyeenemyno = tekino; - case 411: - if (enemy[tekino].dt2 > 356) - enemy[tekino].sx = -1; - if (enemy[tekino].dt2 < -398) - enemy[tekino].sx = 1; - if ((enemy[tekino].dt1) % 62 == 0) - Putenemy(41, - enemy[tekino].x, - enemy[tekino].y, - (int) -Mycos(enemy[tekino].dt1 / 16) * 4 / - SANKAKU, - (int) -Mysin(enemy[tekino].dt1 / 16) * 4 / - SANKAKU, 7); - if ((enemy[tekino].dt1) % 13 == 0) - Puttama(11, enemy[tekino].x + 32, - enemy[tekino].y + 32); - - enemy[tekino].dt2 += enemy[tekino].sx; - enemy[tekino].dt1 += enemy[tekino].dt2 / 4; - - enemy[tekino].x = jiki.x - 16 + - Mycos(enemy[tekino].dt1 / 16) * 128 / SANKAKU; - enemy[tekino].y = jiki.y - 16 + - Mysin(enemy[tekino].dt1 / 16) * 128 / SANKAKU; - if (enemy[tekino].x < 0) - enemy[tekino].x = 0; - if (enemy[tekino].x > 260) - enemy[tekino].x = 260; - if (enemy[tekino].y < 0) - enemy[tekino].y = 0; - if (enemy[tekino].y > 232) - enemy[tekino].y = 232; - break; - case 500: - enemy[tekino].s = 0; - - kyeenemyno = tekino; - enemy[tekino].dt2++; - enemy[tekino].dt2 %= 512; - enemy[tekino].dt1++; - count++; - DefSpriteEx(100, 16, 16); - // PutSprite(count, enemy[tekino].x + 16, - // enemy[tekino].y + 16, 100); - PutSpriteEx(100, enemy[tekino].x + 16, enemy[tekino].y + 16, 2, 2, enemy[tekino].dt1); - - if (enemy[tekino].dt1 % (5 + enemy[tekino].dt2 / 8) == 1) { - if (rand() % 2 == 1) - Putenemy(24, enemy[tekino].x, enemy[tekino].y, - (rand() % 5 + 0.5) * (rand() % 2 == - 1 ? -1 : 1), - (rand() % 5 + 0.5) * (rand() % 2 == - 1 ? -1 : 1), 501); - else - Putenemy(rand() % 2 + 1, enemy[tekino].x, - enemy[tekino].y, - (int) Mycos(enemy[tekino].dt1 / 4) * 4 / - SANKAKU, - (int) -Mysin(enemy[tekino].dt1 / 4) * 4 / - SANKAKU, 501); - } - if (enemy[tekino].dt1 == 50) { - /*Putenemy(44,0,0,1,1,411); */ - } - goto putout; - case 501: - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - if (enemy[tekino].dt1 % 32 == 1) - Puttama(11, enemy[tekino].x, enemy[tekino].y); - enemy[tekino].dt1++; - break; - case 600: - kyeenemyno = tekino; - enemy[tekino].dt1 += 30; - enemy[tekino].dt2++; - enemy[tekino].dt1 %= 360; - enemy[tekino].x += Mycos(enemy[tekino].dt1) * 4 / SANKAKU; - enemy[tekino].y += Mysin(enemy[tekino].dt1) * 4 / SANKAKU; - Puttama(11, enemy[tekino].x + 16, enemy[tekino].y + 16); - Puttama(11, enemy[tekino].x + 32, enemy[tekino].y + 48); - Puttama(11, enemy[tekino].x + 48, enemy[tekino].y + 16); - if (enemy[tekino].dt2 > 240) - enemy[tekino].move = 601; - if (enemy[tekino].x < 0) - enemy[tekino].x = 0; - if (enemy[tekino].x > 260) - enemy[tekino].x = 260; - if (enemy[tekino].y < 0) - enemy[tekino].y = 0; - if (enemy[tekino].y > 232) - enemy[tekino].y = 232; - break; - case 601: - enemy[tekino].dt2++; - if (enemy[tekino].x < jiki.x) - enemy[tekino].sx++; - if (enemy[tekino].x > jiki.x) - enemy[tekino].sx--; - enemy[tekino].x += enemy[tekino].sx; - Putenemy(6, enemy[tekino].x + 16 + rand() % 32, - enemy[tekino].y, 0, rand() % 4, 400); - if (enemy[tekino].x < 0) - enemy[tekino].x = 0; - if (enemy[tekino].x > 260) - enemy[tekino].x = 260; - if (enemy[tekino].y < 0) - enemy[tekino].y = 0; - if (enemy[tekino].y > 232) - enemy[tekino].y = 232; - if (enemy[tekino].dt2 > 800) { - enemy[tekino].move = 602; - } - break; - case 602: - enemy[tekino].dt2++; - Putenemy(24, enemy[tekino].x + 14, enemy[tekino].y + 14, - (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), - (rand() % 5 + 0.5) * (rand() % 2 == 1 ? -1 : 1), - 29); - if (enemy[tekino].dt2 > 1024) { - enemy[tekino].move = 600; - enemy[tekino].dt2 = 0; - } - break; - } - if ((enemy[tekino].y > 964 + 32) - || (enemy[tekino].x > 1688 + 50) - || (enemy[tekino].y < 0 - 128) - || (enemy[tekino].x < 0 - 200)) { - enemy[tekino].f = FALSE; - } - count++; - PutSprite(count, enemy[tekino].x, enemy[tekino].y, - enemy[tekino].charno); - } - putout:; - } - asteroidi = 0; -} -void asteroid(int tekino) -{ - int i; - - asteroiddt[asteroidi] = tekino; - // if(asteroidi==0) - // { - enemy[tekino].x += enemy[tekino].sx; - enemy[tekino].y += enemy[tekino].sy; - // } - if (asteroidi > 0) { - for (i = 0; i < asteroidi; i++) { - if ((enemy[asteroiddt[i]].x + 32 > enemy[tekino].x) - && (enemy[tekino].x + 32 > enemy[asteroiddt[i]].x) - && (enemy[asteroiddt[i]].y + 32 > enemy[tekino].y) - && (enemy[asteroiddt[i]].y < enemy[tekino].y + 32)) { - enemy[tekino].sx *= -1; - enemy[tekino].sy *= -1; - } - } - } - asteroidi++; -} - -void charpatern() -{ - /* - GsSPRITE gt; - SpriteView st; - int counttag; - counttag = count; - enemyfaste++; - while (counttag > enemyfaste) { - st = spview[counttag]; - gt = sprite[counttag]; - sprite[counttag] = sprite[enemyfaste]; - spview[counttag] = spview[enemyfaste]; - sprite[enemyfaste] = gt; - spview[enemyfaste] = st; - counttag--; - enemyfaste++; - } - */ -} -void cgcg(int p) -{ - /* - GsSPRITE gt; - SpriteView st; - int counttag; - counttag = count; - - st = spview[counttag]; - gt = sprite[counttag]; - sprite[counttag] = sprite[p]; - spview[counttag] = spview[p]; - sprite[p] = gt; - spview[p] = st; -*/ -} - -void bosguage() -{ - int h; - float py; - float wariai1, wariai2; - if (kyeenemyno != -1) { - if (stage == 0) - h = 4; - if (stage == 1) - h = 18; - if (stage == 2) - h = 44; - if (stage == 3) - h = 30; - if (stage == 4) - h = 49; - wariai2 = enemy[kyeenemyno].p; - wariai1 = wariai2 / enemystate[h].p; - py = 186.0 * wariai1; - DefSprite(94, 3, 48, 64 + (186 - py), 16, py, 480); - count++; - // PutSprite(count, 320 - 16, 220 - py, 94); - PutSpriteEx(94, 1500, 1100 - py, 4, 4, 0); - } -}
--- a/src/move.h Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -#ifndef _MOVE_H_ -#define _MOVE_H_ - -extern void asteroid(int tekino); -extern void charpatern(); -extern void bosguage(); -extern void Move(); - -extern int fastebos; -extern void cgcg(int p); -extern void charpatern(); - -extern int enemyfaste; -#endif //_MOVE_H_
--- a/src/schedule3.cc Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,728 +0,0 @@ -#include <stdlib.h> -#include <SDL.h> -//#include "bool.h" -#include "schedule.h" -#include "Character.h" -#include "Character_state.h" -//#include "sound.h" -//#include "bom.h" -//#include "tokuten.h" -//#include "count2.h" -//#include "libps.h" -//#include"debug.h" -//#include "SDL_opengl.h" -enum { - FRAME_RATE = 32, -}; - -/*enemy schedule*/ -//int kyeenemyno = -1; -void schedule(sgroot->flame) -{ - CHARACTER *p; - int i; - if (stage == 0) - { - switch (filpcount) { - case 1: - // SoundStop(); - // SoundPlay(0); - break; - - case FRAME_RATE * 2: - Putenemy(1, 120, -128, 0, 4, chara_state0); - break; - case FRAME_RATE * 3: - Putenemy(1, 56, -128, 0, 8, chara_state0); - Putenemy(1, 184, -128, 0, 8, chara_state0); - break; - case FRAME_RATE * 4: - Putenemy(1, 120, -128, 0, 4, chara_state0); - break; - case FRAME_RATE * 5: - Putenemy(1, 224, -128, 1, 1, chara_state0); - Putenemy(1, 184, -128, 1, 1, chara_state0); - break; - case FRAME_RATE * 6: - Putenemy(1, 120, -128, 1, 2, chara_state0); - break; - case FRAME_RATE * 7: - Putenemy(1, 56, -128, 0, 1, chara_state0); - Putenemy(1, 184, -128, 0, 1, chara_state0); - break; - case FRAME_RATE * 8: - Putenemy(2, 120, -128, 0, 1, chara_state0); - break; - - case FRAME_RATE * 12: - Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 13: - Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 14: - Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 15: - Putenemy(2, 1280 - 128 - 120, -128, -1, 1, chara_state4); - break; - case FRAME_RATE * 16: - Putenemy(2, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 17: - Putenemy(2, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 18: - Putenemy(1, 1280 - 128 - 120, -32, 0, 1, chara_state4); - Putenemy(1, 1280 - 128, -128, -2, 1, chara_state4); - Putenemy(1, 800, -88, -1, 1, chara_state4); - break; - - case FRAME_RATE * 24: - Putenemy(1, 256, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 25: - Putenemy(2, 512, -128, 0, 1, chara_state4); - Putenemy(2, 1280 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 26: - Putenemy(1, 384, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256, -128, 0, 2, chara_state4); - Putenemy(1, 512, -128, 0, 3, chara_state4); - Putenemy(1, 1280 - 256, -128, 0, 2, chara_state4); - break; - case FRAME_RATE * 27: - Putenemy(2, 512, -128, 0, 3, chara_state2); - Putenemy(2, 256 - 128, -128, 0, 2, chara_state2); - Putenemy(2, 768, -128, 0, 4, chara_state2); - Putenemy(2, 128, -128, 0, 3, chara_state2); - break; - case FRAME_RATE * 28: - Putenemy(1, 256, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 29: - Putenemy(2, 256, -128, 0, 1, chara_state4); - Putenemy(2, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 30: - Putenemy(1, 256, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - - case FRAME_RATE * 33: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5);//5/22/pm5:300 - break; - case FRAME_RATE * 34: - Putenemy(2, 256, 1088, 0, -1, chara_state5); - Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 35: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 36: - Putenemy(2, 256, 1088, 0, -1, chara_state5); - Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 37: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 38: - Putenemy(2, 256, 1088, 0, -1, chara_state5); - Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 39: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - - case FRAME_RATE * 50: - Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 46: - Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 54: - Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3); - break; - - case FRAME_RATE * 60: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 61: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 62: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 63: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 64: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 65: - Putenemy(40, 256, 1088, 0, -1, chara_state6); - Putenemy(40, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - - case FRAME_RATE * 80: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 66: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 84: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 70: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 88: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 74: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 92: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 78: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - - case FRAME_RATE * 100: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 81: - Putenemy(42, 256, -128, 0, 1, chara_state7); - Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 104: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 83: - Putenemy(42, 256, -128, 0, 1, chara_state7); - Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 108: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 85: - Putenemy(42, 256, -128, 0, 1, chara_state7); - Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 112: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - - case FRAME_RATE * 130: - SoundStop(); - SoundPlay(4); - for(p = active_chara_list;p!=NULL;p=p->next) - { - p->f = FALSE; - p->state = delete_chara; - p->collision = noaction; - } - Putenemy(4, 520, -128, 0, 1, chara_state8); // 1面ボスをPutenemy - } //case文 - - //kyeenemynoはenemyオブジェクトのID。 - //ボスが登場していないときはkyeenemynoに-1がセットされる。 - //move.cではenemyオブジェクトのIDはtekinoで扱うが、 - //ボスのenemyオブジェクトだけ特別にkyeenemynoにもIDがセットされる。 - //kyeenemynoはボスの初期化時にセットされる。 - if (filpcount > FRAME_RATE * 130) { - if (kyeenemyno->f == FALSE) { - // ボスが死ぬと実行される - //if (enemy[kyeenemyno].y < 240 + 32) { - // 条件を満たすとSuperbomが呼ばれるが何の条件かは - // 分からない。Superbomはoriginalのゲーム中では一回も - // 呼ばれない。if文をはずすと一瞬だけ大きな爆発が - // 起こるがショボイ。 - // Superbom(enemy[kyeenemyno].x, enemy[kyeenemyno].y); - //} - stage = 1; - filpcount = 0; - //kyeenemyno = -1; - clear_result[0] = infg_level; - } - } - } //stage0.end - -#if 0 - if (stage == 1) { - switch (filpcount) { - case 1: - SoundStop(); - SoundPlay(1); - //SsSetTempo(seq[1], 0, 140); - break; - - case FRAME_RATE * 3: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 4: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 5: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 6: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 7: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 8: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 9: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 10: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 11: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 12: - Putenemy(2, 256, -128, -1, 2, chara_state7); - break; - case FRAME_RATE * 13: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 14: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 15: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 16: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 20: - Putenemy(2, 512, -128, 0, 2, chara_state4); - Putenemy(2, 1024, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 21: - Putenemy(42, 0, 384, 0, 0, chara_state401); - break; - case FRAME_RATE * 23: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 24: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 25: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 26: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 27: - Putenemy(2, 800, 0, 1, 3, chara_state5); - break; - case FRAME_RATE * 28: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 29: - Putenemy(41, 256, 0, 0, 1, chara_state5); - Putenemy(41, 1280 - 256 - 128, 0, 0, 1, chara_state5); - Putenemy(9, 0, 0, 0, 3, chara_state22); - break; - case FRAME_RATE * 30: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 31: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 32: - Putenemy(42, 1280, 256, 0, -1, chara_state402); - Putenemy(42, 1280, 384, 0, 0, chara_state402); - Putenemy(42, 1280, 512, 0, -1, chara_state402); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 33: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 34: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 35: - Putenemy(2, 640, 0, 0, 3, chara_state5); - break; - case FRAME_RATE * 36: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 43: - for (i = 0; i < 7; i++) { - Putenemy(43, rand() % 2560, -i * 16, 0, rand() % 4, chara_state400); - } - break; - case FRAME_RATE * 44: - for (i = 0; i < 9; i++) { - Putenemy(43, rand() % 2560, -i * 12, 0, rand() % 4, chara_state400); - } - break; - case FRAME_RATE * 45: - for (i = 0; i < 5; i++) { - Putenemy(43, rand() % 640, 0, 0, rand() % 4, chara_state400); - } - break; - case FRAME_RATE * 48: - Putenemy(41, 88, 0, 0, 2, chara_state3); - Putenemy(41, 176, 0, 0, 3, chara_state3); - break; - case FRAME_RATE * 50: - Putenemy(41, 266, 0, 0, 3, chara_state4); - break; - case FRAME_RATE * 51: - Putenemy(41, 352, 0, 0, 3, chara_state5); - break; - case FRAME_RATE * 52: - Putenemy(40, 840, 0, 4, 0, chara_state6); - Putenemy(40, 928, 0, 4, 0, chara_state7); - Putenemy(9, 976, 0, 4, 0, chara_state22); - break; - case FRAME_RATE * 61: - /* - for (i = 0; i < 300; i++) { - enemy[i].f = FALSE; - } - */ - for(p = active_chara_list->next;p!=NULL;p=p->next) - { - p->state = delete_chara; - p->collision = noaction; - p->f = FALSE; - } - break; - - case FRAME_RATE * 64: - SoundStop(); - SoundPlay(5); - Putenemy(18, 528, 0, 0, 0, chara_state24); - /* Puttama(6,100,0); */ - - Putenemy(13, 688, 28, 0, 0, chara_state31); - Putenemy(14, 368, 28, 0, 0, chara_state32); - - Putenemy(11, 656, 0, 0, 0, chara_state33); - Putenemy(12, 400, 0, 0, 0, chara_state34); - - Putenemy(15, 528, 32, 0, 0, chara_state35); - break; - } - ////////////////////// - - if (filpcount > FRAME_RATE * 64) { - if (kyeenemyno->f == FALSE) { - Superbom(kyeenemyno->x, kyeenemyno->y); - stage = 2; - filpcount = 0; - //kyeenemyno = -1; - clear_result[1] = infg_level; - } - } - } - if (stage == 2) { - switch (filpcount) { - case 1: - SoundStop(); - SoundPlay(2); - break; - - case FRAME_RATE * 2: - for (i = 0; i < 5; i++) { - Putenemy(43, rand() % 2560, -i * 16, 0, rand() % 4, chara_state400); - } - break; - - case FRAME_RATE * 3: - for (i = 0; i < 7; i++) { - Putenemy(43, rand() % 2560, -i * 16, 0, rand() % 4, chara_state400); - } - break; - case FRAME_RATE * 4: - for (i = 0; i < 9; i++) { - Putenemy(43, rand() % 2560, -i * 12, 0, rand() % 4, chara_state400); - } - break; - case FRAME_RATE * 5: - for (i = 0; i < 5; i++) { - Putenemy(43, rand() % 2560, 0, 0, rand() % 4, chara_state400); - } - break; - case FRAME_RATE * 9: - for (i = 0; i < 4; i++) { - Putenemy(1, i * 128 + 128, 0, i, rand() % 4 + 1, chara_state7); - } - break; - case FRAME_RATE * 10: - for (i = 0; i < 4; i++) { - Putenemy(1, 1120 - i * 128, 0, 4 - i, rand() % 4 + 1, chara_state7); - } - break; - case FRAME_RATE * 11: - for (i = 0; i < 4; i++) { - Putenemy(41, 4*i * 64*4 + 32*4, 0, 2, rand() % 2 + 1, chara_state6); - } - break; - case FRAME_RATE * 12: - for (i = 0; i < 4; i++) { - Putenemy(41, 280*4 - i * 64*4, 0, -2, rand() % 2 + 1, chara_state6); - } - break; - case FRAME_RATE * 15: - Putenemy(42, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - Putenemy(42, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 16: - Putenemy(41, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - Putenemy(41, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 18: - Putenemy(42, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - Putenemy(42, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 19: - Putenemy(41, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 20: - Putenemy(42, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 24: - Putenemy(41, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 25: - Putenemy(42, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 26: - Putenemy(41, rand() % (320*4 - 64*4) + 32*4, -32*4, 0, 1, chara_state7); - break; - case FRAME_RATE * 30: - Putenemy(1, 400, -128, 0, 3, chara_state3); - Putenemy(1, 560, -128, 0, 2, chara_state3); - Putenemy(1, 400, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 31: - Putenemy(1, 400, -128, 0, 3, chara_state3); - Putenemy(1, 400, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 32: - Putenemy(1, 400, -128, 0, 3, chara_state3); - Putenemy(1, 560, -128, 0, 2, chara_state3); - Putenemy(1, 400, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 36: - Putenemy(1, 400, -128, 0, 3, chara_state3); - Putenemy(1, 560, -128, 0, 2, chara_state3); - Putenemy(1, 400, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 37: - Putenemy(1, 440, -128, 0, 3, chara_state3); - break; - case FRAME_RATE * 38: - Putenemy(1, 600, -128, 0, 2, chara_state3); - Putenemy(1, 760, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 39: - Putenemy(1, 480, -128, 0, 3, chara_state3); - Putenemy(1, 640, -128, 0, 2, chara_state3); - Putenemy(1, 800, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 40: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 41: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 42: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 43: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 44: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 45: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 46: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 47: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 48: - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 49: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 52: - Putenemy(42, 0, 128, 0, 0, chara_state401); - Putenemy(42, 0, 256, 0, 1, chara_state401); - Putenemy(42, 0, 384, 0, 0, chara_state401); - Putenemy(42, 0, 512, 0, -1, chara_state401); - break; - case FRAME_RATE * 54: - Putenemy(42, 1280, 128, 0, 0, chara_state402); - Putenemy(42, 1280, 256, 0, 1, chara_state402); - Putenemy(42, 1280, 384, 0, 0, chara_state402); - Putenemy(42, 1280, 512, 0, -1, chara_state402); - break; - case FRAME_RATE * 56: - Putenemy(42, 0, 128, 0, 0, chara_state401); - Putenemy(42, 0, 256, 0, 1, chara_state401); - Putenemy(42, 0, 384, 0, 0, chara_state401); - - Putenemy(42, 1280, 256, 0, 1, chara_state402); - Putenemy(42, 1280, 384, 0, 0, chara_state402); - Putenemy(42, 1280, 512, 0, -1, chara_state402); - break; - case FRAME_RATE * 59: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 61: - Putenemy(1, 400, -128, 0, 1, chara_state3); - Putenemy(1, 560, 1008, 0, 1, chara_state3); - Putenemy(1, 720, 1040, 0, 1, chara_state3); - break; - case FRAME_RATE * 62: - for (i = 0; i < 9; i++) { - Putenemy(43, rand() % 2560, -i * 12, 0, rand() % 4, chara_state400); - } - break; - case FRAME_RATE * 63: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 65: - Putenemy(2, 440, -128, 0, -2, chara_state3); - break; - case FRAME_RATE * 66: - Putenemy(2, 600, -128, 0, -2, chara_state3); - Putenemy(1, 760, 1040, 0, -1, chara_state3); - break; - case FRAME_RATE * 67: - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - Putenemy(9, 0, 0, 0, 0, chara_state22); - break; - case FRAME_RATE * 69: - Putenemy(2, 480, 1040, 0, -3, chara_state3); - Putenemy(1, 640, 1040, 0, -2, chara_state3); - Putenemy(2, 800, 1040, 0, -1, chara_state3); - break; - case FRAME_RATE * 85: - SoundStop(); - SoundPlay(4); - Putenemy(44, 0, 0, 1, 1, chara_state410); - break; - } - if (filpcount > FRAME_RATE * 85) { - if (kyeenemyno->f == FALSE) { - Superbom(kyeenemyno->x, kyeenemyno->y); - stage = 3; - filpcount = 0; - //kyeenemyno = -1; - clear_result[2] = infg_level; - } - } - } - - if (stage == 3) { - switch (filpcount) { - case 1: - SoundStop(); - SoundPlay(3); - break; - //now - case FRAME_RATE * 10: - Putenemy(30, 640, 200 - 64, 0, 0, chara_state500); - break; - } - if (filpcount > FRAME_RATE * 10) { - if (kyeenemyno->f == FALSE) { - Superbom(kyeenemyno->x, kyeenemyno->y); - - stage = 4; - filpcount = 0; - //kyeenemyno = -1; - } - } - } - - if (stage == 4) { - switch (filpcount) { - case 4: - Putenemy(49, 640, 200-64, 0, 0, chara_state600); - } - if (filpcount > 4) { - if (kyeenemyno->f == FALSE) { - Superbom(kyeenemyno->x, kyeenemyno->y); - - stage = 5; - filpcount = 0; - //kyeenemyno = -1; - clear_result[3] = infg_level; - SoundStop(); - SoundPlay(6); - } - } - } - if (stage == 5) { - /* - for (i = 0; i < 300; i++) { - if (enemy[i].f == TRUE) { - // goto noend; - filpcount = 0; - } - } - */ - - - Endingscore(filpcount); - if (filpcount > 4000) - filpcount = 4000; - noend: - ; - } -#endif -} -
--- a/src/scheduletest.cc Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,233 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <SDL.h> -#include "schedule.h" -#include "Character.h" -#include "Character_state.h" -#include "sound.h" -#include "bom.h" -#include "tokuten.h" -#include "count2.h" -//#include "libps.h" -#include"debug.h" -#include "SDL_opengl.h" -enum { - FRAME_RATE = 32, -}; - -/*enemy schedule*/ -int kyeenemyno = -1; -void schedule() -{ - int i; - if (stage == 0) - { - switch (filpcount) { - case 1: - SoundStop(); - SoundPlay(0); - break; - - case FRAME_RATE * 2: - Putenemy(1, 120, -128, 0, 4, chara_state0); - break; - case FRAME_RATE * 3: - Putenemy(1, 56, -128, 0, 8, chara_state0); - Putenemy(1, 184, -128, 0, 8, chara_state0); - break; - case FRAME_RATE * 4: - Putenemy(1, 120, -128, 0, 4, chara_state0); - break; - case FRAME_RATE * 5: - Putenemy(1, 224, -128, 1, 1, chara_state0); - Putenemy(1, 184, -128, 1, 1, chara_state0); - break; - case FRAME_RATE * 6: - Putenemy(1, 120, -128, 1, 2, chara_state0); - break; - case FRAME_RATE * 7: - Putenemy(1, 56, -128, 0, 1, chara_state0); - Putenemy(1, 184, -128, 0, 1, chara_state0); - break; - case FRAME_RATE * 8: - Putenemy(2, 120, -128, 0, 1, chara_state0); - break; - - case FRAME_RATE * 12: - Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 13: - Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 14: - Putenemy(1, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 15: - Putenemy(2, 1280 - 128 - 120, -128, -1, 1, chara_state4); - break; - case FRAME_RATE * 16: - Putenemy(2, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 17: - Putenemy(2, 1280 - 128 - 120, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 18: - Putenemy(1, 1280 - 128 - 120, -32, 0, 1, chara_state4); - Putenemy(1, 1280 - 128, -128, -2, 1, chara_state4); - Putenemy(1, 800, -88, -1, 1, chara_state4); - break; - - case FRAME_RATE * 24: - Putenemy(1, 256, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 25: - Putenemy(2, 512, -128, 0, 1, chara_state4); - Putenemy(2, 1280 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 26: - Putenemy(1, 384, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256, -128, 0, 2, chara_state4); - Putenemy(1, 512, -128, 0, 3, chara_state4); - Putenemy(1, 1280 - 256, -128, 0, 2, chara_state4); - break; - case FRAME_RATE * 27: - Putenemy(2, 512, -128, 0, 3, chara_state2); - Putenemy(2, 256 - 128, -128, 0, 2, chara_state2); - Putenemy(2, 768, -128, 0, 4, chara_state2); - Putenemy(2, 128, -128, 0, 3, chara_state2); - break; - case FRAME_RATE * 28: - Putenemy(1, 256, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 29: - Putenemy(2, 256, -128, 0, 1, chara_state4); - Putenemy(2, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - case FRAME_RATE * 30: - Putenemy(1, 256, -128, 0, 1, chara_state4); - Putenemy(1, 1280 - 256 - 128, -128, 0, 1, chara_state4); - break; - - case FRAME_RATE * 33: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5);//5/22/pm5:300 - break; - case FRAME_RATE * 34: - Putenemy(2, 256, 1088, 0, -1, chara_state5); - Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 35: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 36: - Putenemy(2, 256, 1088, 0, -1, chara_state5); - Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 37: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 38: - Putenemy(2, 256, 1088, 0, -1, chara_state5); - Putenemy(2, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - case FRAME_RATE * 39: - Putenemy(1, 256, 1088, 0, -1, chara_state5); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state5); - break; - - case FRAME_RATE * 50: - Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 46: - Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3); - break; - case FRAME_RATE * 54: - Putenemy(40, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state3); - break; - - case FRAME_RATE * 60: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 61: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 62: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 63: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 64: - Putenemy(1, 256, 1088, 0, -1, chara_state6); - Putenemy(1, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - case FRAME_RATE * 65: - Putenemy(40, 256, 1088, 0, -1, chara_state6); - Putenemy(40, 1280 - 256 - 128, 1088, 0, -1, chara_state6); - break; - - case FRAME_RATE * 80: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 66: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 84: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 70: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 88: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 74: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 92: - Putenemy(42, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 78: - Putenemy(41, rand() % (1280 - 256) + 128, -128, 0, 1, chara_state7); - break; - - case FRAME_RATE * 100: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 81: - Putenemy(42, 256, -128, 0, 1, chara_state7); - Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 104: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 83: - Putenemy(42, 256, -128, 0, 1, chara_state7); - Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 108: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 85: - Putenemy(42, 256, -128, 0, 1, chara_state7); - Putenemy(42, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - case FRAME_RATE * 112: - Putenemy(41, 256, -128, 0, 1, chara_state7); - Putenemy(41, 1280 - 256 - 128, -128, 0, 1, chara_state7); - break; - - } //case文 - } -}
--- a/src/tama2.cc Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -#include <stdlib.h> -#include "Character.h" -#include "Character_state.h" -#include "sankaku.h" -#include"debug.h" -#include <SDL_mixer.h> -#include "sound.h" - -/*たまたまたま*/ -/*tama.h*/ -void -Puttama(int type, float x, float y) -{ - PlaySdlMixer(0, SHOT_B) ;// Enemys atack !! - TFon(); - switch (type) { - case 0: - Putenemy(3, x, y, 0, 2, chara_state0); - Putenemy(3, x, y, (float) Mysin(15) * 2 / SANKAKU, - (float) Mycos(15) * 2 / SANKAKU, chara_state0); - Putenemy(3, x, y, (float) Mysin(30) * 2 / SANKAKU, - (float) Mycos(30) * 2 / SANKAKU, chara_state0); - Putenemy(3, x, y, (float) Mysin(-15) * 2 / SANKAKU, - (float) Mycos(-15) * 2 / SANKAKU, chara_state0); - Putenemy(3, x, y, (float) Mysin(-30) * 2 / SANKAKU, - (float) Mycos(-30) * 2 / SANKAKU, chara_state0); - break; - case 1: - Putenemy(3, x, y, (float) Mysin(rand() % 15) * 2 / SANKAKU, - (float) Mycos(rand() % 15) * 2 / SANKAKU, chara_state0); - Putenemy(3, x, y, (float) Mysin(rand() % 15) * 2 / SANKAKU, - (float) Mycos(rand() % 15) * 2 / SANKAKU, chara_state0); -// Putenemy(3,x,y,(float) Mysin(rand()%15)*2/SANKAKU,(float)Mycos(rand()%15)*2/SANKAKU,chara_state0); -// Putenemy(3,x,y,(float) Mysin(rand()%15)*2/SANKAKU,(float)Mycos(rand()%15)*2/SANKAKU,chara_state0); -// Putenemy(3,x,y,(float) Mysin(rand()%15)*2/SANKAKU,(float)Mycos(rand()%15)*2/SANKAKU,chara_state0); - - Putenemy(3, x, y, (float) Mysin(rand() % 15 * -1) * 2 / SANKAKU, - (float) Mycos(rand() % 15 * -1) * 2 / SANKAKU, chara_state0); - Putenemy(3, x, y, (float) Mysin(rand() % 15 * -1) * 2 / SANKAKU, - (float) Mycos(rand() % 15 * -1) * 2 / SANKAKU, chara_state0); -// Putenemy(3,x,y,(float) Mysin(rand()%15*-1)*2/SANKAKU,(float)Mycos(rand()%15*-1)*2/SANKAKU,chara_state0); -// Putenemy(3,x,y,(float) Mysin(rand()%15*-1)*2/SANKAKU,(float)Mycos(rand()%15*-1)*2/SANKAKU,chara_state0); -// Putenemy(3,x,y,(float) Mysin(rand()%15*-1)*2/SANKAKU,(float)Mycos(rand()%15*-1)*2/SANKAKU,chara_state0); - break; - - case 2: - Putenemy(6, x, y, 10, -3, chara_state20); - break; - case 3: - Putenemy(6, x, y, -10, -3, chara_state21); - break; - case 4: - Putenemy(7, x, y, 0, 15, chara_state0); - break; - case 5: - Putenemy(8, x, y, 0, 30, chara_state0); - break; - case 6: //本体 - Putenemy(10, x, y, 0, 0, chara_state30); - break; - case 7: - Putenemy(6, x, y, 0, 4, chara_state0); - Putenemy(6, x, y, (float) Mysin(15) * 4 / SANKAKU, - (float) Mycos(15) * 4 / SANKAKU, chara_state0); - Putenemy(6, x, y, (float) Mysin(30) * 4 / SANKAKU, - (float) Mycos(30) * 4 / SANKAKU, chara_state0); - Putenemy(6, x, y, (float) Mysin(-15) * 4 / SANKAKU, - (float) Mycos(-15) * 4 / SANKAKU, chara_state0); - Putenemy(6, x, y, (float) Mysin(-30) * 4 / SANKAKU, - (float) Mycos(-30) * 4 / SANKAKU, chara_state0); - break; - case 8: - Putenemy(3, x + 8, y + 8, -4, 0, chara_state0); - Putenemy(3, x + 8, y + 8, 4, 0, chara_state0); - Putenemy(3, x + 8, y, -4, Mysin(30) * -8 / SANKAKU, chara_state0); - Putenemy(3, x + 8, y, 4, Mysin(30) * -8 / SANKAKU, chara_state0); - break; - case 9: - Putenemy(3, x + 8, y, -4, Mysin(30) * -8 / SANKAKU, chara_state0); - Putenemy(3, x + 8, y, 4, Mysin(30) * -8 / SANKAKU, chara_state0); - Putenemy(3, x + 8, y, -4, Mysin(30) * 8 / SANKAKU, chara_state0); - Putenemy(3, x + 8, y, 4, Mysin(30) * 8 / SANKAKU, chara_state0); - break; - case 10: - Putenemy(3, x + 8, y, -4, 0, chara_state0); - Putenemy(3, x + 8, y, 4, 0, chara_state0); - Putenemy(3, x + 8, y, 0, 4, chara_state0); - Putenemy(3, x + 8, y, 0, -4, chara_state0); - break; - case 11: - { - int a; - a = rand() % 360; - - Putenemy(3, x + 8, y, (float) Mycos(a) / SANKAKU, - (float) Mysin(a) / SANKAKU, chara_state0); - } - } - TFoff(); -}
--- a/src/testgl.cc Tue Dec 07 18:48:25 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,525 +0,0 @@ -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <math.h> -#include <SDL.h> -#include <SDL_opengl.h> -#include <SDL_image.h> -#include "object.h" -#include "xml.h" -#include "Pad.h" - - -static int power_of_two(int input) -{ - int value = 1; - - while ( value < input ) - { - value <<= 1; - } - return value; -} - - -GLuint SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord) -{ - GLuint texture; - int w, h; - SDL_Surface *image; - SDL_Rect area; - Uint32 saved_flags; - Uint8 saved_alpha; - - /* Use the surface width and height expanded to powers of 2 */ - w = power_of_two(surface->w); - h = power_of_two(surface->h); - texcoord[0] = 0.0f; /* Min X */ - texcoord[1] = 0.0f; /* Min Y */ - texcoord[2] = (GLfloat)surface->w / w; /* Max X */ - texcoord[3] = (GLfloat)surface->h / h; /* Max Y */ - - image = SDL_CreateRGBSurface( - SDL_SWSURFACE, - w, h, - 32, -#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */ - 0x000000FF, - 0x0000FF00, - 0x00FF0000, - 0xFF000000 -#else - 0xFF000000, - 0x00FF0000, - 0x0000FF00, - 0x000000FF -#endif - ); - if ( image == NULL ) - { - return 0; - } - - /* Save the alpha blending attributes */ - saved_flags = surface->flags&(SDL_SRCALPHA|SDL_RLEACCELOK); - saved_alpha = surface->format->alpha; - if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) - { - SDL_SetAlpha(surface, 0, 0); - } - - /* Copy the surface into the GL texture image */ - area.x = 0; - area.y = 0; - area.w = surface->w; - area.h = surface->h; - SDL_BlitSurface(surface, &area, image, &area); - - /* Restore the alpha blending attributes */ - if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) - { - SDL_SetAlpha(surface, saved_flags, saved_alpha); - } - - /* Create an OpenGL texture for the image */ - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexImage2D(GL_TEXTURE_2D, - 0, - GL_RGBA, - w, h, - 0, - GL_RGBA, - GL_UNSIGNED_BYTE, - image->pixels); - SDL_FreeSurface(image); /* No longer needed */ - - return texture; -} - -/* -float tes_angle[3] = {0,0,0}; -void obj_draw(SURFACE *surfaces) -{ - int n; - - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, (GLuint)surfaces->texture); - - glTranslatef(surfaces->xyz[0],surfaces->xyz[1],surfaces->xyz[2]); - - glTranslatef(*(surfaces->data[2][0]), *(surfaces->data[2][0]+1), *(surfaces->data[2][0]+2)); - - glRotatef(surfaces->angle[0], 1, 0, 0); - glRotatef(surfaces->angle[1], 0, 1, 0); - glRotatef(surfaces->angle[2], 0, 0, 1); - - glTranslatef(-*(surfaces->data[2][0]), -*(surfaces->data[2][0]+1), -*(surfaces->data[2][0]+2)); - - glBegin( GL_TRIANGLES); - for(n=0; n<surfaces->size; n++) - { - glTexCoord2f(*(surfaces->data[3][n]),*(surfaces->data[3][n]+1)); - glVertex3f(*(surfaces->data[0][n]),*(surfaces->data[0][n]+1),*(surfaces->data[0][n]+2)); - glNormal3f(*(surfaces->data[1][n]),*(surfaces->data[1][n]+1),*(surfaces->data[1][n]+2)); - } - glEnd( ); - glDisable(GL_TEXTURE_2D); -} -*/ - - -static SURFACE *next_draw_node(SURFACE *surfaces) -{ - SURFACE *node = surfaces; - if(node->child != NULL) - { - glPushMatrix(); - return node->child; - } - else if(node->brother != NULL) - { - glPopMatrix(); - glPushMatrix(); - return node->brother; - } - else - { - node = node->parent; - if(node != NULL) - { - glPopMatrix(); - } - while(node != NULL) - { - if(node->brother != NULL) - { - glPopMatrix(); - glPushMatrix(); - return node->brother; - } - else - { - node = node->parent; - if(node != NULL) - { - glPopMatrix(); - } - } - } - return NULL; - } -} - -SURFACE *search_node(OBJECT *top, char *name) -{ - SURFACE *node; - node = top->surfaces; - while(node != NULL) - { - node = next_draw_node(node); - if(!strcmp(node->image_name, name) - { - return node; - } - } -} - -void all_obj_draw(OBJECT *top) -{ - SURFACE *node; - node = top->surfaces; - glPushMatrix(); - while(node != NULL) - { - obj_draw(node); - //if(node->child != NULL) - { - node = next_draw_node(node); - } - /* - else - { - //node = node->next; - } - */ - } - glPopMatrix(); -} - - -static SURFACE *next_node(SURFACE *surfaces) -{ - SURFACE *node = surfaces; - if(node->child != NULL) - { - return node->child; - } - else if(node->brother != NULL) - { - return node->brother; - } - else - { - node = node->parent; - while(node != NULL) - { - if(node->brother != NULL) - { - return node->brother; - } - else - { - node = node->parent; - } - } - return NULL; - } -} - - - - - -void node_draw(OBJECT *top, char *name) -{ - SURFACE *node; - for(node=top->surfaces; node!=NULL; node=next_node(node)) - { - if(!strcmp(node->name, name)) - { - glPushMatrix(); - obj_draw(node); - glPopMatrix(); - } - } -} - - - -void node_prameter_change(OBJECT *top, char *name, float x, float y, float z, float ax, float ay, float az) -{ - SURFACE *node; - for(node=top->surfaces; node!=NULL; node=next_node(node)) - { - if(!strcmp(node->name, name)) - { - node->xyz[0] = x; - node->xyz[1] = y; - node->xyz[2] = z; - node->angle[0] = ax; - node->angle[1] = ay; - node->angle[2] = az; - } - } -} - -void all_object_load_texture(OBJECT *top) -{ - SURFACE *node; - SDL_Surface *image; - GLfloat texcoord[4]; - for(node=top->surfaces; node!=NULL; node=next_node(node)) - { - //image = SDL_LoadBMP(node->image_name); - //image = IMG_Load(node->image_name); - image = LoadSprite(node, image); - node->texture = (int *)SDL_GL_LoadTexture(image, texcoord); - SDL_FreeSurface(image); - } -} - - -int RunGLTest( int argc, char* argv[], int bpp, int width, int height) -{ - int i; - int rgb_size[3]; - int w = width; - int h = height; - int done = 0; - int frames; - Uint32 start_time, this_time; - - Uint32 video_flags; - int value; - - OBJECT *obj; - obj = read_xml_3d_file(argv[1]); - - - if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) - { - fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError()); - exit( 1 ); - } - - /* See if we should detect the display depth */ - if ( bpp == 0 ) - { - if ( SDL_GetVideoInfo()->vfmt->BitsPerPixel <= 8 ) - { - bpp = 8; - } - else - { - bpp = 16; /* More doesn't seem to work */ - } - } - - //video_flags = SDL_OPENGLBLIT; - video_flags = SDL_OPENGL; - - for ( i=1; argv[i]; ++i ) - { - if ( strcmp(argv[i], "-fullscreen") == 0 ) - { - video_flags |= SDL_FULLSCREEN; - } - } - - /* Initialize the display */ - switch (bpp) - { - case 8: - rgb_size[0] = 3; - rgb_size[1] = 3; - rgb_size[2] = 2; - break; - case 15: - case 16: - rgb_size[0] = 5; - rgb_size[1] = 5; - rgb_size[2] = 5; - break; - default: - rgb_size[0] = 8; - rgb_size[1] = 8; - rgb_size[2] = 8; - break; - } - SDL_GL_SetAttribute( SDL_GL_RED_SIZE, rgb_size[0] ); - SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, rgb_size[1] ); - SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, rgb_size[2] ); - SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); - SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); - - SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 0 ); - - if ( SDL_SetVideoMode( w, h, bpp, video_flags ) == NULL ) - { - fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError()); - SDL_Quit(); - exit(1); - } - - printf("Screen BPP: %d\n", SDL_GetVideoSurface()->format->BitsPerPixel); - printf("\n"); - printf( "Vendor : %s\n", glGetString( GL_VENDOR ) ); - printf( "Renderer : %s\n", glGetString( GL_RENDERER ) ); - printf( "Version : %s\n", glGetString( GL_VERSION ) ); - printf( "Extensions : %s\n", glGetString( GL_EXTENSIONS ) ); - printf("\n"); - - SDL_GL_GetAttribute( SDL_GL_RED_SIZE, &value ); - printf( "SDL_GL_RED_SIZE: requested %d, got %d\n", rgb_size[0],value); - SDL_GL_GetAttribute( SDL_GL_GREEN_SIZE, &value ); - printf( "SDL_GL_GREEN_SIZE: requested %d, got %d\n", rgb_size[1],value); - SDL_GL_GetAttribute( SDL_GL_BLUE_SIZE, &value ); - printf( "SDL_GL_BLUE_SIZE: requested %d, got %d\n", rgb_size[2],value); - SDL_GL_GetAttribute( SDL_GL_DEPTH_SIZE, &value ); - printf( "SDL_GL_DEPTH_SIZE: requested %d, got %d\n", bpp, value ); - SDL_GL_GetAttribute( SDL_GL_DOUBLEBUFFER, &value ); - printf( "SDL_GL_DOUBLEBUFFER: requested 1, got %d\n", value ); - - - /* Set the window manager title bar */ - SDL_WM_SetCaption( "SDL GL test", "testgl" ); - - glViewport( 0, 0, w, h ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity( ); - - glOrtho( -40.0, 40.0, -40.0, 40.0, -400.0, 400.0 ); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity( ); - - glEnable(GL_DEPTH_TEST); - - glDepthFunc(GL_LESS); - - glShadeModel(GL_SMOOTH); - - - //load texture image - all_object_load_texture(obj); - - - /* Loop until done. */ - start_time = SDL_GetTicks(); - frames = 0; - while( !done ) - { - GLenum gl_error; - char* sdl_error; - SDL_Event event; - while(SDL_PollEvent(&event)) - { - if(event.type==SDL_QUIT) goto QUIT; - } - - /* Do our drawing, too. */ - glClearColor( 0.0, 0.0, 0.0, 1.0 ); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - Pad(); - - //node_prameter_change(obj, "Cube", 0, 0, 0, 0, 1, 0); - //node_prameter_change(obj, "Sphere.001", 0, 0, 0, 0, 1, 0); - //node_prameter_change(obj, "Plane", 0, 0, 0, 0, 1, 0); - //node_prameter_change(obj, "Plane.001", 0, 0, 0, 0, 1, 0); - //node_prameter_change(obj, "Sphere", 0, 0, 0, 0, 1, 0); - - all_obj_draw(obj); - //node_draw(obj, "Cube"); - - glMatrixMode(GL_MODELVIEW); - //glRotatef(1.0, 1.0, 1.0, 1.0); - /* - if(pad[0].up > 0) - { - node_prameter_change(obj, "Plane", 0, 1, 0, 0, 0, 0); - } - else if(pad[0].down > 0) - { - node_prameter_change(obj, "Plane", 0, -1, 0, 0, 0, 0); - } - - if(pad[0].right > 0) - { - node_prameter_change(obj, "Plane", 1, 0, 0, 0, 0, 0); - } - else if(pad[0].left > 0) - { - node_prameter_change(obj, "Plane", -1, 0, 0, 0, 0, 0); - } - */ - SDL_GL_SwapBuffers( ); - - /* Check for error conditions. */ - gl_error = glGetError( ); - - if( gl_error != GL_NO_ERROR ) - { - fprintf( stderr, "testgl: OpenGL error: %s\n", (char *)gl_error ); - } - - sdl_error = SDL_GetError( ); - - if( sdl_error[0] != '\0' ) - { - fprintf(stderr, "testgl: SDL error '%s'\n", sdl_error); - SDL_ClearError(); - } - - ++frames; - } - - /* Destroy our GL context, etc. */ - QUIT: - /* Print out the frames per second */ - this_time = SDL_GetTicks(); - if ( this_time != start_time ) - { - printf("%2.2f FPS\n",((float)frames/(this_time-start_time))*1000.0); - } - SDL_Quit( ); - return(0); -} - -int main(int argc, char *argv[]) -{ - int i; - int bpp = 0; - int width = 640; - int height = 480; - for ( i=1; argv[i]; ++i ) - { - if ( strcmp(argv[i], "-bpp") == 0 ) - { - bpp = atoi(argv[++i]); - } - if ( strcmp(argv[i], "-width") == 0 ) - { - width = atoi(argv[++i]); - } - if ( strcmp(argv[i], "-height") == 0 ) - { - height = atoi(argv[++i]); - } - } - RunGLTest(argc, argv, bpp, width, height); - return 0; -}