Subversion Repositories Kolibri OS

Rev

Rev 5316 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5316 Rev 5322
Line 216... Line 216...
216
    int amp = 19000;
216
    int amp = 19000;
217
    for (i = 0; i < snd->length_samples; i++) {
217
    for (i = 0; i < snd->length_samples; i++) {
218
		snd->data[i] = ( 1.0 - 1.0*i/snd->length_samples ) * sin( ( (1.0 - 0.48*i/snd->length_samples) * freq ) *i) * amp;
218
		snd->data[i] = ( 1.0 - 1.0*i/snd->length_samples ) * sin( ( (1.0 - 0.48*i/snd->length_samples) * freq ) *i) * amp;
219
	};
219
	};
Line 220... Line -...
220
	
-
 
221
	
-
 
222
	/*
-
 
223
	
-
 
224
	// ok
-
 
225
	
-
 
226
	rs_sgen_init(2, snd->length_samples);
-
 
227
	rs_sgen_func_pm(1, 880.0, 21.0, 0.3, 110.0, 0.3);
-
 
228
	rs_sgen_func_normalize(1, 1.0);
-
 
229
	rs_sgen_func_lowpass(0, 1, 1.0, 0.0, 1.0);
-
 
230
	rs_sgen_wave_out(0);
-
 
231
	
-
 
232
	memcpy(snd->data, rs_sgen_reg.wave_out, snd->length_samples*2 );
-
 
233
	
-
 
234
	rs_sgen_term();
-
 
235
	
-
 
236
	*/
-
 
237
	
220
	
238
	rskos_snd_update_buffer(&snd->hbuf, snd->data, snd->length_samples);
221
	rskos_snd_update_buffer(&snd->hbuf, snd->data, snd->length_samples);
Line 239... Line 222...
239
};
222
};
240
 
223
 
Line 257... Line 240...
257
    return (value > 255) ? 255 : value;
240
    return (value > 255) ? 255 : value;
258
};
241
};
Line 259... Line 242...
259
 
242
 
260
 
-
 
261
void game_reg_init() {
-
 
262
//    game.tx = 0;
-
 
Line 263... Line 243...
263
//    game.ty = 0;
243
 
264
//    game.tz = 0;
244
void game_reg_init() {
265
    
245
    
Line 266... Line 246...
266
    game.player_x = 0;
246
    game.player_x = 0;
Line 267... Line -...
267
    game.player_y = 0;
-
 
268
    game.tz = 0;
-
 
269
    
-
 
270
    game.bg_color = COLOR_BLACK;
-
 
271
 
-
 
272
//    int i;
-
 
273
//    for (i = 0; i < BULLETS_COUNT; i++) {
-
 
274
//        game.bullet_x[i] = 0;
247
    game.player_y = 0;
Line 275... Line 248...
275
//        game.bullet_y[i] = 0;
248
    game.tz = 0;
Line 276... Line 249...
276
//    };
249