Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5225 → Rev 5243

/programs/games/heliothryx/game/rsmain.h
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/programs/games/heliothryx/game/rsmain.c
File deleted
Property changes:
Deleted: svn:executable
-*
\ No newline at end of property
/programs/games/heliothryx/game/rs/rsmicrolibc.c
170,5 → 170,24
}
 
 
char* strchr(char* s, int c) {
 
while (*s) {
if (*s == (char) c) {
return s;
};
s++;
};
return NULL;
 
};
 
unsigned int strlen ( char * str ) {
unsigned int len = 0;
while ( *str ) {
len++;
str++;
};
return len;
};
 
/programs/games/heliothryx/game/rs/rsmicrolibc.h
50,4 → 50,7
void* memset(void *mem, int c, unsigned size);
void* memcpy(void *dst, const void *src, unsigned size);
 
char* strchr(char* s, int c);
unsigned int strlen ( char * str );
 
#endif
/programs/games/heliothryx/game/rs/rsplatform.h
40,22 → 40,26
#define RS_KEY_X 45
 
 
unsigned int get_time();
 
 
typedef void RSFUNC0();
typedef void RSFUNC1i(int);
/*typedef void RSFUNC1i(int);
typedef void RSFUNC2i(int,int);
typedef void RSFUNC1i1f(int,float);
typedef void RSFUNC1i1f(int,float); */
 
typedef RSFUNC0 *PRSFUNC0;
typedef RSFUNC1i *PRSFUNC1i;
/*typedef RSFUNC1i *PRSFUNC1i;
typedef RSFUNC2i *PRSFUNC2i;
typedef RSFUNC1i1f *PRSFUNC1i1f;
typedef RSFUNC1i1f *PRSFUNC1i1f;*/
 
 
/*
void NullFunc0();
void NullFunc1i(int i);
void NullFunc2i(int i, int j);
void NullFunc1i1f(int i, float f);
 
*/
 
typedef struct rs_app_t {
 
62,21 → 66,26
unsigned short app_time;
unsigned short delta_time;
 
PRSFUNC2i OnSize;
/*
 
PRSFUNC2i OnKeyDown;
PRSFUNC1i OnKeyUp;
 
PRSFUNC2i OnMouseDown;
PRSFUNC2i OnMouseUp;
 
PRSFUNC0 OnAppProcess;
PRSFUNC0 rsAppOnInitDisplay;
PRSFUNC0 rsAppOnTermDisplay;
 
*/
 
} rs_app_t;
 
extern rs_app_t rs_app;
 
void rsAppZero();
//void rsAppZero();
 
 
 
/programs/games/heliothryx/game/rs/rsplatform_kos.c
240,5 → 240,3
 
kol_exit();
}
 
 
/programs/games/heliothryx/game/rsgame.c
24,6 → 24,7
#endif
 
 
 
rs_game_t game;
 
 
162,6 → 163,24
for (i = 0; i < snd->length_samples; i++) {
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);
};
 
196,7 → 215,7
game.status = STATUS_MENU;
game.window_scale = 2;
#ifdef RS_LINUX
#ifndef RS_KOS
game.window_scale = 3;
window_scale_str[3] = '3';
#endif
421,7 → 440,7
rs_gen_term();
 
#ifdef RS_LINUX
#ifndef RS_KOS
rs_audio_init(RS_AUDIO_FMT_MONO16, RS_AUDIO_FREQ_16000, 0);
#endif
 
446,7 → 465,7
 
DEBUG10("--- Game Term ---");
 
#ifdef RS_LINUX
#ifndef RS_KOS
rs_audio_term();
#endif
 
511,6 → 530,7
 
if ( (game.menu_index == MENU_SETTINGS) && (game.menu_item_index == MENU_ITEM_WINDOW_SCALE) ) {
game_change_window_scale(-1);
game_ding(1);
};
 
//PlayBuffer(hBuff, 0);
520,6 → 540,7
if ( (game.menu_index == MENU_SETTINGS) && (game.menu_item_index == MENU_ITEM_WINDOW_SCALE) ) {
game_change_window_scale(1);
game_ding(1);
};
 
//StopBuffer(hBuff);
591,7 → 612,17
 
};
 
void GameMouseDown(int x, int y) {
game.tx = x;
game.ty = y;
DEBUG10f("Mouse Down %d, %d \n", x, y);
};
 
void GameMouseUp(int x, int y) {
//
};
 
 
void game_change_window_scale(int d) {
int scale = window_scale_str[3] - '0';
621,6 → 652,9
rskos_resize_window( GAME_WIDTH * scale, GAME_HEIGHT * scale );
 
window_scale_str[3] = scale + '0';
};
 
void game_ding(int i) {
/programs/games/heliothryx/game/rsgame.h
8,7 → 8,15
 
*/
 
#ifndef RS_LINUX
#ifndef RS_WIN32
#ifndef RS_KOS
#error Please specify platform
#endif
#endif
#endif
 
 
#include "rskos.h"
#include "rs/rsplatform.h"
//#include "rs/rstexture.h"
182,6 → 190,9
void GameKeyDown(int key, int first);
void GameKeyUp(int key);
 
void GameMouseDown(int x, int y);
void GameMouseUp(int x, int y);
 
void game_change_window_scale(int d);
 
#endif // RSGAME_H_INCLUDED
/programs/games/heliothryx/game/rsgamedraw.c
6,9 → 6,9
 
#include "rsnoise.h"
 
#include "strings.h"
 
 
 
void game_draw() {
 
int w = 320;
76,9 → 76,9
texture_draw(&game.framebuffer, &game.tex_rocks[i], 250+80*rs_noise(i,150), 60+60*rs_noise(i,1110), DRAW_MODE_ADDITIVE );
};
game_textout( GAME_WIDTH/2 - 100, 40, 1, "HELIOTHRYX");
game_textout( GAME_WIDTH/2 - 8, 58, 3, "TECHDEMO");
game_textout( 2, GAME_HEIGHT-10, 2, "DEVELOPER: ROMAN SHUVALOV` TOGLIATTI_ 2014");
game_textout( GAME_WIDTH/2 - 100, 40, 1, "HELI0THRYX");
game_textout( GAME_WIDTH/2 - 8, 58, 3, "TECHDEM0");
game_textout( 2, GAME_HEIGHT-10, 2, L_BOTTOM_LINE_DEVELOPER_INFO);
};
}
100,8 → 100,8
};
};
game_textout( 2, 2, 2, "THIS IS TECHDEMO` ");
game_textout( 2, 12, 2, "USE ARROWS TO MOVE_ <A> TO SHOOT_ <ESC> TO EXIT` ");
game_textout( 2, 2, 2, L_TECHDEMO_LINE1 );
game_textout( 2, 12, 2, L_TECHDEMO_LINE2 );
};
 
/programs/games/heliothryx/game/rsgamemenu.c
4,6 → 4,8
 
#include "rskos.h"
 
#include "strings.h"
 
PRSFUNC0 menu_actions[] = {
/* a */ &menu_action_start,
/* b */ &menu_action_exit,
12,27 → 14,38
 
char window_scale_str[] = "c< 2X >";
 
/*
First char:
- 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
String from second char is label of menu item
 
*/
 
 
char* menu_main_titles[] = {
"a5TART",
"15ETTING5",
"2ABOUT",
"bQUIT",
"a"L_START,
"1"L_SETTINGS,
"2"L_ABOUT,
"b"L_QUIT,
0
};
 
char* menu_settings_titles[] = {
" WINDOW SCALE:",
" "L_WINDOW_SCALE,
window_scale_str,
" ",
"0DONE",
"0"L_DONE,
0
};
 
char* menu_about_titles[] = {
" DEVELOPED BY",
" ROMAN SHUVALOV",
" "L_DEVELOPED_BY,
" "L_ROMAN_SHUVALOV,
" ",
"0DONE",
"0"L_DONE,
0
};
 
113,7 → 126,7
};
 
void menu_action_exit() {
#ifndef RS_LINUX
#ifdef RS_KOS
GameTerm();
#endif
rskos_exit();
/programs/games/heliothryx/game/rsgametext.c
217,7 → 217,7
11, 25,
6, 0,
 
// 31 not implemented
// 31 not implemented - need to create up-left DOT for percent(%) sign
16, 26-16,
16, 26+16,
16, 26,
226,8 → 226,8
 
};
 
uint32_t ch_seg[64] = {
0b00111111, // // for cross-line in O | 1<<12 | 1<<19, // 0
unsigned int ch_seg[64] = {
0b00111111 /* | 1<<12 | 1<<19 */, // 0 or O
1<<26 | 1<<8 | 1<<9 | 1<<3, // 1
0b01011011, // 2
1<<0 | 1<<12 | 1<<15 | 1<<2 | 1<<3, // 3
261,12 → 261,12
1<<5 | 1<<4 | 1<<3, // L
1<<5 | 1<<4 | 1<<1 | 1<<2 | 1<<16 | 1<<12, // M
1<<5 | 1<<4 | 1<<16 | 1<<11 | 1<<1 | 1<<2, // N
0b00111111, // O
1<<16 | 1<<11 | 1<<19 | 1<<12 | 1<<6 | 1<<8 | 1<<9, // O - FREE SYMBOL
 
1<<4 | 1<<5 | 1<<0 | 1<<1 | 1<<6, // P
1<<0 | 1<<1 | 1<<13 | 1<<27 | 1<<4 | 1<<5 | 1<<11, // Q // old: 0b00111111 | 1<<11, // Q
1<<0 | 1<<1 | 1<<6 | 1<<5 | 1<<4 | 1<<11, // R
0b01101101, // S
(1 << 18 | 1 << 13) | (1 << 29 | 1 << 26) | (1 << 5 | 1 << 2) | (1 << 19 | 1 << 12), // percent(%) sign, s == 5 -> // 0b01101101, // S
1<<0 | 1<<8 | 1<<9, // T
1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5, // U
1<<1 | 1<<13 | 1<<17 | 1<<5, // V
296,7 → 296,7
1<<4 | 1<<18 | 1<<28 | 1<<1 | 1<<2, // l // old symmetric: 1<<4 | 1<<18 | 1<<10 | 1<<2, // l // old: 1<<19 | 1<<12 | 1<<1 | 1<<2, // lЛ
1<<5 | 1<<4 | 1<<3 | 1<<1 | 1<<2 | 1<<9 | 1<<21, // mЩ,
1<<4 | 1<<5 | 1<<0 | 1<<1 | 1<<2, // n
1<<0 | 1<<12 | 1<<15 | 1<<2 | 1<<3, // oЗ
(1<<8 | 1<<9) | 1<<10 | 1<<18, // 'o' for arrow up ^
 
};
 
/programs/games/heliothryx/game/rskos.c
1,6 → 1,6
#include "rskos.h"
 
#ifdef RS_LINUX
#ifndef RS_KOS
 
#include "rs/rstexture.h"
#include "rs/rsgl.h"
/programs/games/heliothryx/game/rskos.h
16,7 → 16,7
// sound
 
#ifndef SNDBUF
#ifdef RS_LINUX
#ifndef RS_KOS
#include "rs/rsaudio.h"
typedef rs_sound_t* SNDBUF;
#else
/programs/games/heliothryx/game/rssoundgen.c
1,13 → 1,17
#include "rssoundgen.h"
 
/*
 
#include "rsnoise.h"
 
#include "rs/rsmx.h"
 
 
#ifdef RS_KOS
#include "rs/rsplatform.h"
#else
#include <stdlib.h>
#include <math.h>
#include <string.h>
#endif
 
rs_sgen_reg_t rs_sgen_reg;
 
454,4 → 458,4
};
};
 
*/
 
/programs/games/heliothryx/game/rssoundgen.h
3,10 → 3,8
 
#include "rsgame.h"
 
/*
//#include "rs/rsaudio.h"
 
#include "rs/rsaudio.h"
 
typedef struct rs_sgen_reg_t {
int wave_length;
int waves_count;
40,6 → 38,6
 
//void rs_gen_func_mult_add_value(int dest, int src, float val_mult, float val_add);
 
*/
 
 
#endif