Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5242 → Rev 5243

/programs/games/marblematch3/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/marblematch3/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/marblematch3/game/rsgame.c
242,7 → 242,7
game.status = STATUS_LOADING;
 
game.window_scale = 1;
// game.window_scale = 1;
// game.window_scale = 2;
// #ifndef RS_KOS
451,8 → 451,7
};
// memset( game.field, 0, FIELD_LENGTH );
game.scaled_framebuffer = malloc(GAME_WIDTH*game.window_scale * GAME_HEIGHT*game.window_scale * 3);
DEBUG10f("scaled framebuffer: %d (window_scale = %d) \n", game.window_scale * GAME_WIDTH * GAME_HEIGHT * 3, game.window_scale);
game.bgr_framebuffer = malloc(GAME_WIDTH * GAME_HEIGHT * 3);
game_font_init();
574,12 → 573,17
if (game.status == STATUS_PLAYING) {
 
#ifndef RS_KOS
if (key == RS_KEY_SPACE) {
game.score = 101;
};
#endif
if (key == RS_KEY_ESCAPE) {
game.time = 0;
game.score = 0;
game.status = STATUS_MENU;
game.need_redraw = 1;
};
};
624,6 → 628,13
game.ty = y;
if (game.status == STATUS_MENU) {
int i;
for (i = 0; i < FIELD_LENGTH; i++) {
game.field[i] = (unsigned char) (0.99 * fabs(rs_noise(i, seed*7 + 10)) * CRYSTALS_COUNT) | CRYSTAL_VISIBLE_BIT;
};
game.selected = 0;
game.time = 0;
game.score = 0;
game.status = STATUS_PLAYING;
/programs/games/marblematch3/game/rsgame.h
139,7 → 139,7
 
typedef struct rs_game_t {
rs_texture_t framebuffer;
unsigned char *scaled_framebuffer; // 24-bit BGRBGRBGR... for direct drawing
unsigned char *bgr_framebuffer; // 24-bit BGRBGRBGR... for direct drawing
int loader_counter;
167,7 → 167,7
int menu_index;
int menu_item_index;
int window_scale;
// int window_scale;
int process_timer;
/programs/games/marblematch3/game/rsgamedraw.c
31,7 → 31,8
if (game.menu_index == MENU_MAIN) {
if (game.status == STATUS_LOADING) {
game_textout_at_center( 0, 240, 0, "L0ADING```" );
game_textout_at_center( 0, 240, 0, L_LOADING );
game_textout_at_center( -3, 240-2, 3, L_LOADING );
}
else {
 
39,25 → 40,26
 
if (game.time) {
game_textout_at_center( 0, 230, 0, "LEVEL PA55ED" );
game_textout_at_center( -3, 230-2, 3, "LEVEL PA55ED" );
game_textout_at_center( 0, 230, 0, L_LEVEL_PASSED );
game_textout_at_center( -3, 230-2, 3, L_LEVEL_PASSED );
char s[] = "TIME: 000";
char s[] = L_TIME;
int time_sec = game.time / 25;
s[6] = '0' + (( time_sec / 100 ) % 10);
s[7] = '0' + (( time_sec / 10 ) % 10);
s[8] = '0' + (( time_sec / 1 ) % 10);
char *str_num = strchr(s, 'x');
str_num[0] = '0' + (( time_sec / 100 ) % 10);
str_num[1] = '0' + (( time_sec / 10 ) % 10);
str_num[2] = '0' + (( time_sec / 1 ) % 10);
game_textout_at_center( 0, 260, 0, s );
game_textout_at_center( -3, 260-2, 3, s );
};
 
game_textout_at_center( 0, 300, 0, "CLICK T0 5TART" );
game_textout_at_center( -3, 300-2, 3, "CLICK T0 5TART" );
game_textout_at_center( 0, 300, 0, L_START );
game_textout_at_center( -3, 300-2, 3, L_START );
};
game_textout( 2, GAME_HEIGHT-10, 2, "DEVEL0PED BY R0MAN 5HUVAL0V");
game_textout( 2, GAME_HEIGHT-10, 2, L_BOTTOM_LINE_DEVELOPER_INFO);
};
}
92,11 → 94,12
};
 
 
char str[] = "TIME: 999 ";
char str[] = L_TIME;
int time_sec = game.time / 25;
str[6] = '0' + ( (time_sec / 100) % 10);
str[7] = '0' + ( (time_sec / 10) % 10);
str[8] = '0' + ( (time_sec / 1) % 10);
char *str_num = strchr(str, 'x');
str_num[0] = '0' + ( (time_sec / 100) % 10);
str_num[1] = '0' + ( (time_sec / 10) % 10);
str_num[2] = '0' + ( (time_sec / 1) % 10);
game_textout( 56+3, 32+2, 0, str );
// game_textout( 56-1, 32-1, 0, str );
103,10 → 106,11
game_textout( 56, 32, 3, str );
char sstr[] = "5C0RE: 000 0F 100 ";
sstr[7] = '0' + ( (game.score / 100) % 10);
sstr[8] = '0' + ( (game.score / 10) % 10);
sstr[9] = '0' + ( (game.score / 1) % 10);
char sstr[] = L_SCORE;
str_num = strchr(sstr, 'x');
str_num[0] = '0' + ( (game.score / 100) % 10);
str_num[1] = '0' + ( (game.score / 10) % 10);
str_num[2] = '0' + ( (game.score / 1) % 10);
game_textout( 56+3, 64+2, 0, sstr );
game_textout( 56, 64, 3, sstr );
115,7 → 119,7
 
 
// rskos_draw_area(0, 0, w, h, game.window_scale, game.framebuffer.data, NULL, RSKOS_BGRA);
rskos_draw_area(0, 0, w, h, game.window_scale, game.framebuffer.data, game.scaled_framebuffer, 0);
rskos_draw_area(0, 0, w, h, 1, game.framebuffer.data, game.bgr_framebuffer, 0);
};
if (!continue_need_redraw) {
218,9 → 222,9
// float cr_g[CRYSTALS_COUNT] = { 0.1, 0.8, 0.5, 0.0, 0.7, 0.0, 0.8 };
// float cr_b[CRYSTALS_COUNT] = { 0.0, 0.1, 0.9, 0.8, 0.0, 0.5, 0.9 };
float cr_r[CRYSTALS_COUNT] = { 1.0, 0.4, 0.1, 0.9, 0.9, 0.2, 0.8 };
float cr_g[CRYSTALS_COUNT] = { 0.1, 1.0, 0.6, 0.1, 0.8, 0.2, 0.8 };
float cr_b[CRYSTALS_COUNT] = { 0.0, 0.1, 1.0, 1.0, 0.0, 0.9, 0.9 };
float cr_r[CRYSTALS_COUNT] = { 1.0, 0.4, 0.10, 0.9, 1.0, 0.2, 0.8 };
float cr_g[CRYSTALS_COUNT] = { 0.1, 1.0, 0.75, 0.1, 0.9, 0.2, 0.8 };
float cr_b[CRYSTALS_COUNT] = { 0.0, 0.1, 1.00, 1.0, 0.1, 0.9, 0.9 };
 
// rs_gen_init(5, CRYSTAL_SIZE);
357,7 → 361,7
};
 
void game_textures_free() {
free(game.scaled_framebuffer);
free(game.bgr_framebuffer);
// texture_free(&game.tex_gui_line);
/programs/games/marblematch3/game/rsgamemenu.c
27,25 → 27,25
 
char* menu_main_titles[] = {
"a"L_START,
"1"L_SETTINGS,
"2"L_ABOUT,
"b"L_QUIT,
// "1"L_SETTINGS,
// "2"L_ABOUT,
// "b"L_QUIT,
0
};
 
char* menu_settings_titles[] = {
" "L_WINDOW_SCALE,
window_scale_str,
" ",
"0"L_DONE,
// " "L_WINDOW_SCALE,
// window_scale_str,
// " ",
// "0"L_DONE,
0
};
 
char* menu_about_titles[] = {
" "L_DEVELOPED_BY,
" "L_ROMAN_SHUVALOV,
" ",
"0"L_DONE,
// " "L_DEVELOPED_BY,
// " "L_ROMAN_SHUVALOV,
// " ",
// "0"L_DONE,
0
};
 
/programs/games/marblematch3/game/strings.h
2,11 → 2,9
#define RS_STRINGS_H
 
#ifndef RS_KOS
#include "strings_ru.h"
#include "strings_en.h"
#else
 
//#include "../lang.h"
#ifdef LANG_RU
// Russian
#include "strings_ru.h"
/programs/games/marblematch3/game/strings_en.h
6,25 → 6,17
// Be careful, only specific chars are available to use
// See readme for details
 
// Main Menu
#define L_START "5TART"
#define L_SETTINGS "5ETTING5"
#define L_ABOUT "CREDITS"
#define L_QUIT "QUIT"
// Lower 'xxx' is used to detect number position, it will be replaced by numbers
 
// Settings menu
#define L_WINDOW_SCALE "WINDOW SCALE:"
#define L_DONE "DONE"
#define L_LOADING "L0ADING```"
 
// About menu
#define L_DEVELOPED_BY "DEVELOPED BY"
#define L_ROMAN_SHUVALOV "ROMAN SHUVALOV"
#define L_START "CLICK T0 5TART"
 
// Main screen
#define L_TIME "TIME: xxx"
#define L_SCORE "5C0RE: xxx 0F 100"
 
#define L_LEVEL_PASSED "LEVEL PA55ED"
 
#define L_BOTTOM_LINE_DEVELOPER_INFO "DEVELOPER: ROMAN SHUVALOV` TOGLIATTI_ 2014"
 
// Gameplay
#define L_TECHDEMO_LINE1 "THIS IS TECHDEMO` "
#define L_TECHDEMO_LINE2 "USE ARROWS TO MOVE_ <A> TO SHOOT_ <E5C> TO EXIT` "
 
#endif
/programs/games/marblematch3/game/strings_ru.h
6,26 → 6,17
// Be careful, only specific chars are available to use
// See readme for details
 
// Main Menu
#define L_START "CTAPT"
#define L_SETTINGS "HACTP0^Ki"
#define L_ABOUT "0b igPE"
#define L_QUIT "B\\X0d"
// Lower 'xxx' is used to detect number position, it will be replaced by numbers
 
// Settings menu
#define L_WINDOW_SCALE "MAChTAb 0KHA:"
#define L_DONE "g0T0B0"
#define L_LOADING "3AgPY3KA```"
 
// About menu
#define L_DEVELOPED_BY "PA3PAb0T4iK:"
#define L_ROMAN_SHUVALOV "P0MAH hYBAl0B"
#define L_START "HA4AT] igPY"
 
// Main screen
#define L_BOTTOM_LINE_DEVELOPER_INFO "PA3PAb0T4iK: P0MAH hYBAl0B` T0l]aTTi_ 2014"
#define L_TIME "BPEMa: xxx"
#define L_SCORE "04Ki: xxx i3 100"
 
// Gameplay
#define L_TECHDEMO_LINE1 "eT0 TEXH0dEMKA` "
#define L_TECHDEMO_LINE2 "CTPElKi = dBijEHiE_ <A> = B\\CTPEl_ <E5C> = B\\X0d` "
#define L_LEVEL_PASSED "YP0BEH] nP0^dEH"
 
#define L_BOTTOM_LINE_DEVELOPER_INFO "PA3PAb0T4iK: P0MAH hYBAl0B` T0l]aTTi_ 2014"
 
#endif
/programs/games/marblematch3/readme.utf8.txt
8,3 → 8,6
Marble Match 3 -- game that is developed for contest.
Developer: Roman Shuvalov (http://board.kolibrios.org/memberlist.php?mode=viewprofile&u=6469)
 
If you want to translate this game, please use localization tool,
it is same as in my other game, Heliothryx, so please check out
localization readme for Heliothryx and use Heliothryx localization tool.