From d491a54f52ea397adb63e89bc927135c1a0f39b9 Mon Sep 17 00:00:00 2001 From: alpine Date: Wed, 31 Dec 2014 12:20:35 +0000 Subject: [PATCH] Heliothryx game: Release Candidate git-svn-id: svn://kolibrios.org@5322 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/games/heliothryx/game/rsgame.c | 27 --------------------- programs/games/heliothryx/game/rsgame.h | 15 ++---------- programs/games/heliothryx/game/rsgamedraw.c | 22 ----------------- programs/games/heliothryx/game/rsgamemenu.c | 9 +------ programs/games/heliothryx/game/rsgamemenu.h | 1 - 5 files changed, 3 insertions(+), 71 deletions(-) diff --git a/programs/games/heliothryx/game/rsgame.c b/programs/games/heliothryx/game/rsgame.c index af79d551a1..e6b2f3684a 100755 --- a/programs/games/heliothryx/game/rsgame.c +++ b/programs/games/heliothryx/game/rsgame.c @@ -218,23 +218,6 @@ void soundbuf_sin_fade(rs_soundbuf_t *snd, float freq) { snd->data[i] = ( 1.0 - 1.0*i/snd->length_samples ) * sin( ( (1.0 - 0.48*i/snd->length_samples) * freq ) *i) * amp; }; - - /* - - // ok - - rs_sgen_init(2, snd->length_samples); - rs_sgen_func_pm(1, 880.0, 21.0, 0.3, 110.0, 0.3); - rs_sgen_func_normalize(1, 1.0); - rs_sgen_func_lowpass(0, 1, 1.0, 0.0, 1.0); - rs_sgen_wave_out(0); - - memcpy(snd->data, rs_sgen_reg.wave_out, snd->length_samples*2 ); - - rs_sgen_term(); - - */ - rskos_snd_update_buffer(&snd->hbuf, snd->data, snd->length_samples); }; @@ -259,9 +242,6 @@ unsigned char clamp_byte(int value) { void game_reg_init() { -// game.tx = 0; -// game.ty = 0; -// game.tz = 0; game.player_x = 0; game.player_y = 0; @@ -269,13 +249,6 @@ void game_reg_init() { game.bg_color = COLOR_BLACK; -// int i; -// for (i = 0; i < BULLETS_COUNT; i++) { -// game.bullet_x[i] = 0; -// game.bullet_y[i] = 0; -// }; -// game.bullet_index = 0; - game.objs = malloc( sizeof(game_obj_t) * GAME_OBJS_MAX_COUNT ); game.status = STATUS_MENU; diff --git a/programs/games/heliothryx/game/rsgame.h b/programs/games/heliothryx/game/rsgame.h index 959a6b0c50..852b2c4da2 100755 --- a/programs/games/heliothryx/game/rsgame.h +++ b/programs/games/heliothryx/game/rsgame.h @@ -122,11 +122,7 @@ typedef struct game_obj_t { float y; int t; float f; - -// int health; -// int reserved0; -// int reserved1; -// int reserved2; + } game_obj_t; #define OBJ_FLAG_DESTROYED 0x01 @@ -164,7 +160,6 @@ void game_obj_remove(int index); #define RS_ARROW_RIGHT_MASK 0x08 #define RS_ATTACK_KEY_MASK 0x10 -//#define BULLETS_COUNT 8 #define GAME_SHOOT_PERIOD 3 @@ -218,17 +213,11 @@ typedef struct rs_game_t { int window_scale; -// int tx1; -// int ty1; int tz; int player_x; int player_y; -// int player_z; - -// int bullet_x[BULLETS_COUNT]; -// int bullet_y[BULLETS_COUNT]; -// int bullet_index; + int shoot_delay; int shoot_keypressed; int shoot_restore_delay; diff --git a/programs/games/heliothryx/game/rsgamedraw.c b/programs/games/heliothryx/game/rsgamedraw.c index 54fc6fc838..f4658de400 100755 --- a/programs/games/heliothryx/game/rsgamedraw.c +++ b/programs/games/heliothryx/game/rsgamedraw.c @@ -16,34 +16,15 @@ void game_draw() { int kk = 20; // (rskos_get_time()/1) % 160; -// -// unsigned char *c = game.framebuffer.data; -// -// int i; -// for (i = 0; i < w*h*4; i+=4) { -// c[i+0] = 10; // i/w/3; -// c[i+1] = (( (1*i)*(i + kk)/70) & 5) ? 70 : 0; -// c[i+2] = 50; -// c[i+3] = i % 128; -// }; texture_clear(&game.framebuffer, game.bg_color ); game.bg_color = COLOR_BLACK; -// texture_clear(&game.tex); - -// texture_draw(&game.framebuffer, &game.tex, 40, 40, DRAW_MODE_ADDITIVE); -// texture_draw(&game.framebuffer, &game.tex, 70, 50, DRAW_MODE_ADDITIVE); -// texture_draw(&game.framebuffer, &game.tex, 20, 60, DRAW_MODE_ADDITIVE); -// texture_draw(&game.framebuffer, &game.tex, 60, 70, DRAW_MODE_ADDITIVE); -// -// texture_draw(&game.framebuffer, &game.tex, 111, 150, DRAW_MODE_ADDITIVE); int i, c, c2, c3; for (i = 0; i < 100; i++) { -// DEBUG10f("i = %d, v1 = %.4f, v2 = %.4f \n", i, rs_noise(kk+100, kk+i)*10, rs_noise(kk+200, kk+i+300)*10); c = (0.5+0.45*rs_noise(kk+150, kk+i))*255; c2 = c + 0.05*rs_noise(kk+150, kk+i)*255; c3 = c2; // (0.5+0.49*rs_noise(kk+150, kk+i+2))*255; @@ -209,9 +190,6 @@ void game_draw() { - -// game_textout( 2, 12, 2, L_TECHDEMO_LINE2 ); - }; texture_draw(&game.tex_ground, &game.tex_clouds, game.tz, 0, /* game.tx, game.ty, */ DRAW_MODE_ADDITIVE | DRAW_TILED_FLAG ); diff --git a/programs/games/heliothryx/game/rsgamemenu.c b/programs/games/heliothryx/game/rsgamemenu.c index 7628bd2610..1a04e8be5e 100644 --- a/programs/games/heliothryx/game/rsgamemenu.c +++ b/programs/games/heliothryx/game/rsgamemenu.c @@ -21,7 +21,7 @@ char level_passed_score_str[] = " 0000 "; - letter a...z means action (a = 0th, b = 1st, c = 2nd, see menu_actions[] above) - number 0...9 means goto menu #0, #1, #2... see menu_titles[] below - space ' ' means no action, menu item is unselectable - - empty string "" is now allowed and can cause segfault + - empty string "" is not allowed and can cause segfault String from second char is label of menu item */ @@ -60,12 +60,6 @@ char* menu_game_over_titles[] = { 0 }; -//char* menu_game_over_titles[] = { -// " "L_GAME_OVER, -// " ", -// "0"L_BACK, -// 0 -//}; char* menu_pause_titles[] = { " "L_PAUSE, @@ -80,7 +74,6 @@ char **menu_titles[] = { /* 0 */ menu_main_titles, /* 1 */ menu_settings_titles, /* 2 */ menu_about_titles, -// /* 3 */ menu_level_passed_titles, /* 3 */ menu_game_over_titles, /* 4 */ menu_pause_titles, 0 diff --git a/programs/games/heliothryx/game/rsgamemenu.h b/programs/games/heliothryx/game/rsgamemenu.h index 14efac5fb5..0b08484a09 100644 --- a/programs/games/heliothryx/game/rsgamemenu.h +++ b/programs/games/heliothryx/game/rsgamemenu.h @@ -10,7 +10,6 @@ #define MENU_MAIN 0 #define MENU_SETTINGS 1 #define MENU_ABOUT 2 -//#define MENU_LEVEL_PASSED 3 #define MENU_GAME_OVER 3 #define MENU_PAUSE 4