Subversion Repositories Kolibri OS

Rev

Rev 5235 | Rev 5239 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5235 Rev 5237
Line 1... Line 1...
1
#include "rsgamedraw.h"
1
#include "rsgamedraw.h"
2
#include "rsgametext.h"
2
#include "rsgametext.h"
3
#include "rsgamemenu.h"
3
#include "rsgamemenu.h"
Line -... Line 4...
-
 
4
 
-
 
5
#include "rsgentex.h"
-
 
6
#include "rs/rsplatform.h"
4
 
7
 
Line 5... Line 8...
5
#include "rskos.h"
8
#include "rskos.h"
Line 6... Line 9...
6
 
9
 
Line 12... Line 15...
12
void game_draw() {
15
void game_draw() {
Line 13... Line 16...
13
 
16
 
14
	int w = GAME_WIDTH;
17
	int w = GAME_WIDTH;
Line -... Line 18...
-
 
18
	int h = GAME_HEIGHT;
Line 15... Line -...
15
	int h = GAME_HEIGHT;
-
 
16
	
-
 
17
 
-
 
18
//	int kk = 20; // (rskos_get_time()/1) % 160;
-
 
19
//	
-
 
20
//	unsigned char *c = game.framebuffer.data;
-
 
21
//	
-
 
22
//	int i;
-
 
23
//	for (i = 0; i < w*h*4; i+=4) {
-
 
24
//	    c[i+0] = 10; //  i/w/3;
-
 
25
//	    c[i+1] = (( (1*i)*(i + kk)/70) & 5) ? 70 : 0;
-
 
26
//	    c[i+2] = 50;
-
 
27
//	    c[i+3] = i % 128;
-
 
28
//	};
-
 
29
 
-
 
30
 
-
 
31
//    texture_clear(&game.framebuffer, COLOR_DARK_RED);
-
 
32
//    texture_clear(&game.tex);
-
 
33
    
-
 
34
//    texture_draw(&game.framebuffer, &game.tex, 40, 40, DRAW_MODE_ADDITIVE);
-
 
35
//    texture_draw(&game.framebuffer, &game.tex, 70, 50, DRAW_MODE_ADDITIVE);
-
 
36
//    texture_draw(&game.framebuffer, &game.tex, 20, 60, DRAW_MODE_ADDITIVE);
-
 
Line 37... Line -...
37
//    texture_draw(&game.framebuffer, &game.tex, 60, 70, DRAW_MODE_ADDITIVE);
-
 
38
//    
-
 
39
//    texture_draw(&game.framebuffer, &game.tex, 111, 150, DRAW_MODE_ADDITIVE);
-
 
40
 
-
 
41
//    int i, c, c2, c3;
-
 
42
//    for (i = 0; i < 100; i++) {
-
 
43
////        DEBUG10f("i = %d, v1 = %.4f, v2 = %.4f \n", i, rs_noise(kk+100, kk+i)*10, rs_noise(kk+200, kk+i+300)*10);
-
 
44
//        c = (0.5+0.45*rs_noise(kk+150, kk+i))*255;
-
 
45
//        c2 = c + 0.05*rs_noise(kk+150, kk+i)*255;
-
 
46
//        c3 = c2; // (0.5+0.49*rs_noise(kk+150, kk+i+2))*255;
-
 
47
//        texture_set_pixel(&game.framebuffer, (0.5+0.49*rs_noise(kk+1100, kk+i))*GAME_WIDTH, (0.5+0.49*rs_noise(kk+1200, kk+i+1300))*GAME_HEIGHT, 
-
 
48
//                          c + (c2<<8) + (c3<<16) + 0xFF000000);
-
 
49
//    };
-
 
50
 
-
 
51
//    texture_clear(&game.tex_ground, COLOR_TRANSPARENT);
-
 
52
//    rs_perlin_configure(47, 4, 0.5, 1000, 256);
-
 
53
//    for (i = 0; i < game.tex_ground.w; i++) {
-
 
54
//        texture_draw_vline(&game.tex_ground, i, 25 + rs_perlin(0,i+game.tz)*25, 2, 0xFF113300);
-
 
55
//        texture_draw_vline(&game.tex_ground, i, 25 + rs_perlin(0,i+game.tz)*25 + 2, 999, 0xFF000000);
-
 
56
//    };
-
 
57
//    
-
 
Line 58... Line 19...
58
////    texture_draw(&game.tex_ground, &game.tex_clouds, game.tz, 0, /* game.tx, game.ty, */ DRAW_MODE_ADDITIVE | DRAW_TILED_FLAG );
19
	
Line 59... Line -...
59
//    texture_draw(&game.framebuffer, &game.tex_ground, 0, GAME_HEIGHT-50, DRAW_MODE_ALPHA);
-
 
60
    
-
 
61
    texture_draw(&game.framebuffer, &game.tex_bg, 0, 0, DRAW_MODE_REPLACE);
20
	if (game.need_redraw) {
62
 
-
 
63
    if ( (game.status == STATUS_MENU) || (game.status == STATUS_LOADING) ){
-
 
64
 
-
 
65
//        char **title = menu_titles[game.menu_index]; 
-
 
66
//        int y = (game.menu_index == MENU_MAIN) ? 280 : 250;
-
 
Line 67... Line 21...
67
//        texture_draw(&game.framebuffer, &game.tex_gui_line, 0, y+15*game.menu_item_index, DRAW_MODE_ALPHA);
21
    
Line 68... Line 22...
68
//        while (*title) {
22
        
69
//            game_textout(20, y, (*(title))[0]==' ' ? 3 : 0 , (*(title))+1 );  // first (zero) char defines action, title starts from second (1st) char
23
 
70
//            title++;
24
        if ( (game.status == STATUS_MENU) || (game.status == STATUS_LOADING) ) {
71
//            y+=15;
25
                
72
//        };
-
 
73
        
-
 
Line 74... Line 26...
74
        if (game.menu_index == MENU_MAIN) {
26
            texture_draw(&game.framebuffer, &game.tex_bg, 0, 0, DRAW_MODE_REPLACE);
Line 75... Line 27...
75
                
27
            
Line 103... Line 55...
103
        };
55
            };
Line 104... Line 56...
104
    
56
        
105
    }
57
        }
Line -... Line 58...
-
 
58
        else {
-
 
59
                
106
    else {
60
            texture_draw(&game.framebuffer, &game.tex_bg_gameplay, 0, 0, DRAW_MODE_REPLACE);
107
            
61
            
108
        int i, j;
62
            int i, j;
109
        for (i = 0; i < FIELD_HEIGHT; i++) {
63
            for (i = 0; i < FIELD_HEIGHT; i++) {
110
            for (j = 0; j < FIELD_WIDTH; j++) {
64
                for (j = 0; j < FIELD_WIDTH; j++) {
Line 131... Line 85...
131
        int time_sec = game.time / 25;
85
            int time_sec = game.time / 25;
132
        str[6] = '0' + ( (time_sec / 100) % 10);
86
            str[6] = '0' + ( (time_sec / 100) % 10);
133
        str[7] = '0' + ( (time_sec / 10) % 10);
87
            str[7] = '0' + ( (time_sec / 10) % 10);
134
        str[8] = '0' + ( (time_sec / 1) % 10);
88
            str[8] = '0' + ( (time_sec / 1) % 10);
Line 135... Line 89...
135
        
89
            
Line 136... Line 90...
136
        game_textout( 32, 32, 3, str );
90
            game_textout( 56, 32, 3, str );
137
        
91
            
138
        char sstr[] = "5C0RE: 000 0F 100   ";
92
            char sstr[] = "5C0RE: 000 0F 100   ";
139
        sstr[7] = '0' + ( (game.score / 100) % 10);
93
            sstr[7] = '0' + ( (game.score / 100) % 10);
Line 140... Line 94...
140
        sstr[8] = '0' + ( (game.score / 10) % 10);
94
            sstr[8] = '0' + ( (game.score / 10) % 10);
-
 
95
            sstr[9] = '0' + ( (game.score / 1) % 10);
-
 
96
            
-
 
97
            game_textout( 56, 64, 3, sstr );
Line 141... Line -...
141
        sstr[9] = '0' + ( (game.score / 1) % 10);
-
 
142
        
-
 
143
        game_textout( 32, GAME_HEIGHT-48, 3, sstr );
-
 
144
                    
-
 
145
//        char s[] = "YOUR TIME: 000";
-
 
146
//        s[11] = '3';
-
 
147
//        s[12] = '9';
-
 
148
//        s[13] = '4';
-
 
149
        //game_textout( GAME_WIDTH/2 - 192, 260, 0, s );
98
   
150
            
-
 
151
        
-
 
152
//        texture_draw(&game.framebuffer, &game.tex_ship[0], game.tx-8, game.ty-4, DRAW_MODE_ALPHA);
99
        };
153
//        texture_draw(&game.framebuffer, &game.tex_ship[1], game.tx-8, game.ty-4, DRAW_MODE_ALPHA);
-
 
154
//        texture_draw(&game.framebuffer, &game.tex_ship[2], game.tx, game.ty-4, DRAW_MODE_ALPHA);
-
 
155
//        texture_draw(&game.framebuffer, &game.tex_ship[3], game.tx, game.ty-4, DRAW_MODE_ALPHA);
-
 
156
        
-
 
157
//        int i;
-
 
158
//        for (i = 0; i < BULLETS_COUNT; i++) {
-
 
159
//            if (game.bullet_y[i]) {
-
 
160
//                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-4, game.bullet_y[i], 0xFF00BB00);
-
 
161
//                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-3, game.bullet_y[i], 0xFF00CC00);
-
 
162
//                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-2, game.bullet_y[i], 0xFF00DD00);
-
 
Line 163... Line 100...
163
//                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-1, game.bullet_y[i], 0xFF00EE00);
100
 
164
//                texture_set_pixel(&game.framebuffer, game.bullet_x[i]-0, game.bullet_y[i], 0xFF00FF00);
-
 
Line 165... Line 101...
165
//            };
101
 
Line 166... Line -...
166
//        };
-
 
Line -... Line 102...
-
 
102
        rskos_draw_area(0, 0, w, h, game.window_scale, game.framebuffer.data, game.scaled_framebuffer);
-
 
103
	};
-
 
104
	
-
 
105
	game.need_redraw = 0;
-
 
106
 
-
 
107
};
-
 
108
 
-
 
109
 
-
 
110
 
-
 
111
void game_textures_init_stage1() {
-
 
112
    
-
 
113
    int i;
-
 
114
    
-
 
115
    texture_init(&game.framebuffer, GAME_WIDTH, GAME_HEIGHT);
-
 
116
    
-
 
117
//    texture_init(&game.tex, 64, 64);
-
 
118
//    rs_gen_init(1, 64);
-
 
119
//    rs_gen_func_set(0, 0.0);
-
 
120
//    rs_gen_func_cell(0, 1200, 10, NULL, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0);
-
 
121
//    rs_gen_func_normalize(0, 0.0, 1.0);
-
 
122
//    rs_gen_func_posterize(0, 5);
-
 
123
//    rs_gen_tex_out_rgba(0, 0, 0, -1, 1.0, 1.0, 1.0, 1.0);
-
 
124
//    memcpy(game.tex.data, rs_gen_reg.tex_out, 64*64*4 );
-
 
125
//    rs_gen_term();
-
 
126
    
-
 
127
    texture_init(&game.tex_clouds, 128, 128);
-
 
128
    rs_gen_init(1, 128);
-
 
129
    rs_gen_func_perlin(0, 8, 5, 0.5, 1100);
-
 
130
    rs_gen_func_normalize(0, 0.0, 1.0);
-
 
131
    rs_gen_func_posterize(0, 6);
-
 
132
    rs_gen_func_mult_add_value(0, 0, 0.6, 0.4);
-
 
133
//    rs_gen_func_set(0, 1.0);
-
 
134
    rs_gen_tex_out_rgba(0, 0, 0, -1, 1.0, 1.0, 1.0, 1.0);
-
 
135
    memcpy(game.tex_clouds.data, rs_gen_reg.tex_out, 128*128*4 );
-
 
136
    rs_gen_term();
-
 
137
 
-
 
138
 
-
 
139
    
-
 
140
 
-
 
141
    texture_init(&game.tex_logo, GAME_WIDTH, 128);
-
 
142
    texture_clear(&game.tex_logo, COLOR_TRANSPARENT);
-
 
143
    
-
 
144
    game_textout_adv( &game.tex_logo, GAME_WIDTH/2 - 192, 3, 1, DRAW_MODE_REPLACE, "MARBLE");
-
 
145
    game_textout_adv( &game.tex_logo, GAME_WIDTH/2 - 192, 63, 1, DRAW_MODE_REPLACE, "MATCH3");
-
 
146
    texture_draw(&game.tex_logo, &game.tex_clouds, 0, 0, DRAW_MODE_MULT | DRAW_TILED_FLAG);
-
 
147
    game_textout_adv( &game.tex_logo, GAME_WIDTH/2 - 192 - 4, 0, 1, DRAW_MODE_MULT, "MARBLE");
-
 
148
    game_textout_adv( &game.tex_logo, GAME_WIDTH/2 - 192 - 4, 60, 1, DRAW_MODE_MULT, "MATCH3");
-
 
149
    
-
 
150
 
-
 
151
    
-
 
152
    texture_init(&game.tex_bg, 512, 512);
-
 
153
    texture_clear(&game.tex_bg, COLOR_SILVER);
-
 
154
 
-
 
155
    texture_init(&game.tex_bg_gameplay, 512, 512);
-
 
156
    texture_clear(&game.tex_bg_gameplay, COLOR_SILVER);
-
 
157
    
-
 
158
    texture_init(&game.tex_cursor, CRYSTAL_SIZE, CRYSTAL_SIZE);
-
 
159
    rs_gen_init(2, CRYSTAL_SIZE);
-
 
160
    
-
 
161
    rs_gen_func_set(0, 0.0); // inner
-
 
162
    rs_gen_func_radial(0, 0.5, 0.5, 0.5, 1.0, 2.0);
-
 
163
    rs_gen_func_clamp(0, 0.1, 0.5);
-
 
164
    rs_gen_func_normalize(0, 0.0, 1.0);
-
 
165
    rs_gen_func_mult_add_value(0, 0, -1.0, 1.0);
-
 
166
 
-
 
167
    rs_gen_func_set(1, 0.0); // outer
-
 
168
    rs_gen_func_radial(1, 0.5, 0.5, 0.5, 1.0, 2.0);
-
 
169
    rs_gen_func_clamp(1, 0.0, 0.2);
-
 
170
    rs_gen_func_normalize(1, 0.0, 1.0);
-
 
171
    
-
 
172
    rs_gen_func_mult(0, 0, 1);
-
 
173
 
-
 
174
    rs_gen_func_set(1, 1.0);
-
 
175
//    rs_gen_tex_out_rgba_set(0.0, 0.0, 0.0, 0.0);
-
 
176
    rs_gen_tex_out_rgba(1, 1, 1, 0, 1.0, 1.0, 1.0, 1.0);
-
 
177
    memcpy(game.tex_cursor.data, rs_gen_reg.tex_out, CRYSTAL_SIZE*CRYSTAL_SIZE*4 );
-
 
178
    rs_gen_term();
-
 
179
 
-
 
180
    texture_init(&game.tex_field, FIELD_WIDTH*CRYSTAL_SIZE + 7, FIELD_HEIGHT*CRYSTAL_SIZE + 7);
-
 
181
    texture_clear(&game.tex_field, 0xAABBBBBB); // 0x66404060 // 0xAACCCCCC
-
 
182
 
-
 
183
    
-
 
184
//    float cr_r[CRYSTALS_COUNT] = { 0.8, 0.2, 0.1, 0.6, 0.7, 0.0, 0.7 };
-
 
185
//    float cr_g[CRYSTALS_COUNT] = { 0.1, 0.6, 0.4, 0.0, 0.6, 0.0, 0.8 };
-
 
186
//    float cr_b[CRYSTALS_COUNT] = { 0.1, 0.1, 0.7, 0.7, 0.0, 0.3, 0.9 };
-
 
187
 
-
 
188
//    float cr_r[CRYSTALS_COUNT] = { 0.9, 0.3, 0.1, 0.7, 0.8, 0.0, 0.8 };
-
 
189
//    float cr_g[CRYSTALS_COUNT] = { 0.1, 0.8, 0.5, 0.0, 0.7, 0.0, 0.8 };
-
 
190
//    float cr_b[CRYSTALS_COUNT] = { 0.0, 0.1, 0.9, 0.8, 0.0, 0.5, 0.9 };
-
 
191
    
-
 
192
    float cr_r[CRYSTALS_COUNT] = { 1.0, 0.4, 0.1, 0.9, 0.9, 0.2, 0.8 };
-
 
193
    float cr_g[CRYSTALS_COUNT] = { 0.1, 1.0, 0.6, 0.1, 0.8, 0.2, 0.8 };
-
 
194
    float cr_b[CRYSTALS_COUNT] = { 0.0, 0.1, 1.0, 1.0, 0.0, 0.9, 0.9 };
-
 
195
    
-
 
196
 
-
 
197
    rs_gen_init(5, CRYSTAL_SIZE);
-
 
198
    for (i = 0; i < CRYSTALS_COUNT; i++) {
-
 
199
    
-
 
200
        texture_init(&(game.tex_crystals[i]), CRYSTAL_SIZE, CRYSTAL_SIZE);
-
 
201
        
-
 
202
        rs_gen_func_set(0, 0.0);
-
 
203
        rs_gen_func_radial(0, 0.5, 0.5, 0.5, 0.75, 10.0);
-
 
204
 
-
 
205
//        rs_gen_func_perlin(2, 33, 4, 0.5, 350+i);
-
 
206
//        rs_gen_func_normalize(2, 0.0, 1.0);
-
 
207
//        rs_gen_func_posterize(2, 4);
-
 
208
//        
-
 
209
//        rs_gen_func_cell(1, 410+i, 50, NULL, -2.0, 1.0, 1.0, 1.0, 0.0, 1.0);
-
 
210
//        rs_gen_func_posterize(1, 2);
-
 
211
//        rs_gen_func_normalize(1, 0.0, 1.0);
-
 
212
//        rs_gen_func_add(1, 1, 2, 1.0, 0.5);
-
 
213
//        rs_gen_func_normalize(1, 0.0, 1.0);
-
 
214
//        rs_gen_func_posterize(1, 4);
-
 
215
//
-
 
216
//        rs_gen_func_add(1, 0, 1, 1.0, 1.0);
-
 
217
//        rs_gen_func_normalize(1, 0.0, 1.0);
-
 
218
//        rs_gen_func_mult(1, 0, 1);
-
 
219
//        rs_gen_func_normalize(1, 0.0, 1.0);
-
 
220
//        rs_gen_func_posterize(1, 4);
-
 
221
        
-
 
222
        rs_gen_func_set(1, 0.0);
-
 
223
        rs_gen_func_cell(1, 110+100*i, 7+i, NULL, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0);
-
 
224
        rs_gen_func_normalize(1, 0.0, 1.0);
-
 
225
//        rs_gen_func_mult_add_value(1, 1, 0.9, 0.1);
-
 
226
        
-
 
227
//        rs_gen_func_normalmap(2, 3, 3, 1, 1.0);
-
 
228
//        rs_gen_func_mult(1, 1, 2);
-
 
229
        
-
 
230
        //rs_gen_tex_out_rgba_set(0.0, 0.0, 0.0, 0.0);
-
 
231
        //rs_gen_tex_out_rgba(1, 1, 1, 1, 0.5+ 0.03*(i%2), 0.7+ 0.03*(i%3) , 0.9, 1.0);
-
 
232
//        rs_gen_tex_out_rgba_set(0.2 + 0.2*(i/3), 0.2 + 0.1*(i%5), 0.2 + 0.1*(i%7), 0.0);
-
 
233
//        rs_gen_tex_out_rgba(1, 1, 1, 1, 0.0, 0.0, 0.0, 1.0);
-
 
234
        
-
 
235
        rs_gen_tex_out_rgba_set(0.0, 0.0, 0.0, 0.0);
-
 
236
//        rs_gen_tex_out_rgba_set( cr_b[i], cr_g[i], cr_r[i], 0.0);
-
 
237
        rs_gen_tex_out_rgba(1, 1, 1, 0, cr_b[i], cr_g[i], cr_r[i], 1.0);
-
 
238
 
-
 
239
        memcpy(game.tex_crystals[i].data, rs_gen_reg.tex_out, CRYSTAL_SIZE*CRYSTAL_SIZE*4 );
-
 
240
    };
-
 
241
    rs_gen_term();
-
 
242
    
-
 
243
    
-
 
244
    
-
 
245
    rs_gen_init(3, EXPLOSION_SIZE);
-
 
246
    for (i = 0; i < EXPLOSION_FRAMES_COUNT; i++) {
-
 
247
            
-
 
248
        texture_init(&(game.tex_explosion[i]), EXPLOSION_SIZE, EXPLOSION_SIZE);
-
 
249
 
-
 
250
        rs_gen_func_set(0, 1.0);
-
 
251
//        rs_gen_func_radial(0, 0.5, 0.5, 0.3 + 0.5*i/EXPLOSION_FRAMES_COUNT, 0.975, 4.0);
-
 
252
//        rs_gen_func_set(0, 1.0);
-
 
253
 
-
 
254
        rs_gen_func_set(1, 0.0);
-
 
255
        rs_gen_func_radial(1, 0.5, 0.5, 0.1 + 0.4*i/EXPLOSION_FRAMES_COUNT, 1.0 - 1.0*i/EXPLOSION_FRAMES_COUNT, 2.5 + i%5);
-
 
256
 
-
 
257
        rs_gen_tex_out_rgba_set( 0.0, 0.0, 0.0, 0.0);
-
 
258
        rs_gen_tex_out_rgba(0, 0, 0, 1, 1.0, 1.0, 1.0, 1.0);
-
 
259
 
-
 
260
        memcpy(game.tex_explosion[i].data, rs_gen_reg.tex_out, EXPLOSION_SIZE*EXPLOSION_SIZE*4 );
-
 
261
    };
-
 
262
    rs_gen_term();
-
 
263
};
-
 
264
 
-
 
265
void game_textures_init_stage2() {
-
 
266
     
-
 
267
//            texture_clear(&game.tex_bg, COLOR_SILVER);
-
 
268
//             /*
-
 
269
        
-
 
270
    rs_gen_init(6, 512);
-
 
271
    rs_gen_func_perlin(0, 8, 5, 0.5, 1100);
-
 
272
    rs_gen_func_normalize(0, 0.0, 1.0);
-
 
273
    rs_gen_func_perlin(1, 8, 5, 0.5, 1700);
-
 
274
    rs_gen_func_normalize(1, 0.0, 1.0);
-
 
275
    rs_gen_func_cell(2, 1118, 50, NULL, 1.0, 0.887, -0.333, 1.0, 0.0, 4.0); // 1360
-
 
276
    rs_gen_func_normalize(2, 0.0, 0.5);
-
 
277
 
-
 
278
    rs_gen_func_adr(3, 2, 0, 1, 1.0, 0.3);
-
 
279
    
-
 
280
    rs_gen_func_inv(3, 3, 7.5);
-
 
281
    rs_gen_func_normalize(3, 0.0, 1.0);
-
 
282
 
-
 
283
//            signed short c[] = { 0, 250, 250, 0, 500, 250, 250, 500};
-
 
284
    signed short c[] = { 0, 0, 0, 512, 512, 0, 512, 512};
-
 
285
//            signed short c[] = { 128, 128, 128, 384, 384, 128, 384, 384};
-
 
286
    //rs_gen_func_cell(4, 0, 4, c, 0.0, 0.3, 1.0, 0.5, 0.0, 0.30);
-
 
287
    rs_gen_func_cell(4, 0, 4, c, 1.0, 0.3, 0.0, 0.95, 0.0, 0.30);
-
 
288
    rs_gen_func_normalize(4, 0.0, 1.0);
-
 
289
 
-
 
290
//            rs_gen_func_radial(5, 0.5, 0.5, 0.60, 1.0, 4.0);
-
 
291
//            rs_gen_func_add(4, 4, 5, 0.5, 0.5);
-
 
292
//
-
 
293
    rs_gen_func_mult(4, 4, 3);
-
 
294
    
-
 
295
    // coloring...
-
 
296
    rs_gen_func_mult_add_value(0, 4, 0.8, 0.0);
-
 
297
    rs_gen_func_add(0, 4, 1, 0.95, 0.05);
-
 
298
    rs_gen_func_add(3, 4, 2, 0.95, 0.05);
-
 
299
 
-
 
300
    
-
 
301
    rs_gen_tex_out_rgba(4, 0, 3, -1, 0.9, 0.9, 0.9, 1.0);
-
 
302
    memcpy(game.tex_bg.data, rs_gen_reg.tex_out, 512*512*4 );
-
 
303
    rs_gen_term();
-
 
304
    
-
 
305
    // */
-
 
306
    
-
 
307
    // Background for gameplay
-
 
308
    
-
 
309
    texture_draw( &game.tex_bg_gameplay, &game.tex_bg, 256, 256, DRAW_MODE_REPLACE | DRAW_TILED_FLAG );
-
 
310
    // Bevel
-
 
311
    texture_draw_vline( &game.tex_bg_gameplay, FIELD_X0 - 5, FIELD_Y0 - 5, FIELD_HEIGHT*CRYSTAL_SIZE + 10, 0xFF404060 );
-
 
312
    texture_draw_hline( &game.tex_bg_gameplay, FIELD_X0 - 5, FIELD_Y0 - 5, FIELD_WIDTH*CRYSTAL_SIZE + 10, 0xFF404060 );
-
 
313
    texture_draw_vline( &game.tex_bg_gameplay, FIELD_X0 - 4, FIELD_Y0 - 4, FIELD_HEIGHT*CRYSTAL_SIZE + 8, 0xFF606080 );
-
 
314
    texture_draw_hline( &game.tex_bg_gameplay, FIELD_X0 - 4, FIELD_Y0 - 4, FIELD_WIDTH*CRYSTAL_SIZE + 8, 0xFF606080 );
-
 
315
    
-
 
316
    texture_draw_vline( &game.tex_bg_gameplay, FIELD_X0 + 4 + FIELD_WIDTH*CRYSTAL_SIZE, FIELD_Y0 - 4, FIELD_HEIGHT*CRYSTAL_SIZE + 8, 0xFFC0C0C0 );
-
 
317
    texture_draw_hline( &game.tex_bg_gameplay, FIELD_X0 - 4, FIELD_Y0 + 4 + FIELD_HEIGHT*CRYSTAL_SIZE, FIELD_WIDTH*CRYSTAL_SIZE + 9, 0xFFC0C0C0 );
-
 
318
    texture_draw_vline( &game.tex_bg_gameplay, FIELD_X0 + 5 + FIELD_WIDTH*CRYSTAL_SIZE, FIELD_Y0 - 5, FIELD_HEIGHT*CRYSTAL_SIZE + 10, 0xFFE0E0E0 );
-
 
319
    texture_draw_hline( &game.tex_bg_gameplay, FIELD_X0 - 5, FIELD_Y0 + 5 + FIELD_HEIGHT*CRYSTAL_SIZE, FIELD_WIDTH*CRYSTAL_SIZE + 11, 0xFFE0E0E0 );
-
 
320
    
-
 
321
    texture_draw( &game.tex_bg_gameplay, &game.tex_field, FIELD_X0 - 3, FIELD_Y0 - 3, DRAW_MODE_ALPHA );
-
 
322
    
-
 
323
    
-
 
324
};
167
        
325
 
Line -... Line 326...
-
 
326
void game_textures_free() {
-
 
327
    free(game.scaled_framebuffer);
-
 
328
    
-
 
329
    //    texture_free(&game.tex_gui_line);
-
 
330
    
-
 
331
    int i;
-
 
332
    for (i = 0; i < CRYSTALS_COUNT; i++) {
-
 
333
        texture_free(&game.tex_crystals[i]);
-
 
334
    };
-
 
335
    
-
 
336
    for (i = 0; i < EXPLOSION_FRAMES_COUNT; i++) {
-
 
337
        texture_free(&game.tex_explosion[i]);