Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <globals.hpp>
- #include <player.hpp>
- #include <tile.hpp>
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- using namespace kit;
- Player player;
- #define SPCENTER_X 254
- #define SPCENTER_Y 177
- #define SPRANGE 250.0f //in pixels
- #define SPMAXVOL 0.125f
- #define SPMAXPAN 1.0f
- f32 distanceToSpeaker(){
- shape::fpoint diff(player.pos.x - SPCENTER_X, player.pos.y - SPCENTER_Y);
- return sqrtf(diff.x*diff.x + diff.y*diff.y);
- }
- f32 volumeFromDistance(f32 distance){
- f32 rangeInverse = SPRANGE - CLAMP(distance, 0, SPRANGE);
- f32 volume = (rangeInverse/SPRANGE) * SPMAXVOL;
- return volume;
- }
- f32 panFromXDifference(shape::fpoint a, shape::fpoint b){
- f32 range = CLAMP(a.x-b.x, -SPRANGE, SPRANGE);
- f32 pan = (range/SPRANGE) * SPMAXPAN;
- return pan;
- }
- #define T(_id_and_tileset) (u8)(_id_and_tileset) //lol
- Tile pattern_mg[] = {
- //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- /* 0*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 1*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 2*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 3*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 4*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),
- /* 5*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),
- /* 6*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),
- /* 7*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),
- /* 8*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),
- /* 9*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x21),T(0x00),T(0x22),T(0x00),T(0x00),T(0x00),T(0x00),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),T(0x02),
- /*10*/ T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x05),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),T(0x01),
- /*11*/ T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),T(0x04),
- /*12*/ T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),
- /*13*/ T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),
- /*14*/ T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),
- /*15*/ T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),
- /*16*/ T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),
- /*17*/ T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),T(0x14),
- };
- Tile pattern_fg[] = {
- //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- /* 0*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 1*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 2*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 3*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 4*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /* 5*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x06),T(0x00),T(0x00),T(0x06),T(0x00),T(0x00),T(0x06),T(0x00),T(0x00),
- /* 6*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),
- /* 7*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),
- /* 8*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),T(0x16),T(0x00),T(0x00),
- /* 9*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x21),T(0x00),T(0x00),T(0x22),T(0x00),T(0x26),T(0x00),T(0x00),T(0x26),T(0x00),T(0x00),T(0x26),T(0x00),T(0x00),
- /*10*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /*11*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /*12*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /*13*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /*14*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /*15*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /*16*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- /*17*/ T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),T(0x00),
- };
- #undef T
- bool fullscreen = false;
- bool handleEvents(){
- bool run = true;
- WindowEvent e;
- while(pollWindowEvent(&e))
- switch(e.type){
- case WINEVENT_WIN_CLOSE: _we_w_close: run = false; break;
- case WINEVENT_KEY_DOWN: {
- if(e.key.repeat) break;
- switch(e.key.vkey){
- case VKEY_ESCAPE : goto _we_w_close;
- case VKEY_F11 : gl_win->setFullscreen(fullscreen^=1); break;
- case VKEY_BSLASH : player.confused^=1; break;
- case VKEY_FSLASH : player.enforceMaxVel^=1; break;
- case VKEY_ENTER : {
- player.pos = shape::fpoint(CANVSIZ_X/2,CANVSIZ_Y/2-80);
- player.vel = shape::fpoint(0,0);
- }break;
- case VKEY_LEFT : player.acc.x += -PLAYER_SPEED; break;
- case VKEY_RIGHT: player.acc.x += PLAYER_SPEED; break;
- case VKEY_UP : {
- if(player.ticksInAir < 2 && !player.jumped){
- player.jumped = true;
- player.vel.y = -PLAYER_JUMP_STRENGTH;
- player.sfx_jumping->play();
- }
- } break;
- }
- } break;
- case WINEVENT_KEY_UP: {
- switch(e.key.vkey){
- case VKEY_LEFT : player.acc.x -= -PLAYER_SPEED; break;
- case VKEY_RIGHT: player.acc.x -= PLAYER_SPEED; break;
- case VKEY_UP : {
- if(player.jumped && player.vel.y<0)
- player.vel.y *= PLAYER_JUMP_CANCEL;
- } break;
- }
- } break;
- }
- return run;
- }
- #define DBG_TXT(_l, _fmt, ...) gl_textf(1,1+(_l)*9, _fmt, __VA_ARGS__)
- int gameMain(int argc, char** argv){
- gl_snd->musicLoadModule("dat/music/sine_half.mod");
- gl_snd->musicSetUseNearest(false);
- gl_snd->musicSetVolumeForced(0.0f, 0.0f);
- gl_snd->musicSetCheckLoop(false); //this forces the module to loop
- gl_snd->musicStart();
- Scene scene;
- scene.bmp_bg = new Bitmap("dat/img/0_bg_gradient_black-cyan.qoi", gl_win);
- scene.pat_mg = pattern_mg;
- scene.pat_fg = pattern_fg;
- scene.stretch_bg = false;
- player.sfx_footstep = new SoundEffect("dat/sfx/player_footstep.qoa", .02f, 0.1);
- player.sfx_landing = new SoundEffect("dat/sfx/player_landing.qoa", .08f, 0.2);
- player.sfx_jumping = new SoundEffect("dat/sfx/player_jumping.qoa", .05f);
- Bitmap siren("dat/img/siren0.qoi", gl_win);
- player.pos.x = CANVSIZ_X/2;
- player.pos.y = CANVSIZ_Y/2 - 80;
- bool run = true;
- f64 timeStart = time::getUptime();
- while(run){
- gl_frameTimer->setTimer(0.25/60);
- if(!handleEvents()) break;
- player.vel.y += GRAVITY;
- player.update();
- if( player.pos.x < -PLAYER_HALF) player.pos.x = CANVSIZ_X+PLAYER_HALF;
- else if(player.pos.x > CANVSIZ_X+PLAYER_HALF) player.pos.x = -PLAYER_HALF;
- if(player.pos.y < -PLAYER_HALF){
- player.pos.y = CANVSIZ_Y/2;
- player.vel.y = fabsf(player.vel.y);
- } else if(player.pos.y > (CANVSIZ_Y/2 + 24 - PLAYER_HALF)){
- if(player.ticksInAir > 3) player.sfx_landing->play();
- player.pos.y = CANVSIZ_Y/2 + 24 - PLAYER_HALF;
- player.vel.y = 0.0f;
- player.ticksInAir = 0;
- player.jumped = false;
- } else if(player.pos.y < CANVSIZ_Y/2){
- ++player.ticksInAir;
- }
- //play footstep sound when feet touch ground
- if(player.queryFootstep()) player.sfx_footstep->play();
- //gl_win->clear(0x7f7f7f); //redundant, since drawBg fills the canvas anyway
- scene.drawBg();
- scene.drawTiles(false);
- gl_text->print(9*0, 9*17, "(supposed to look like a siren)\n v");
- siren.blit(24*9, 24*7, 1.0f, 0xff00ff);
- player.blit(PLAYER_SCALE, PLAYER_SCALE);
- scene.drawTiles(true);
- f32 speakerDistance = distanceToSpeaker(); //relative to player's center
- f32 newVolume = volumeFromDistance(speakerDistance);
- f32 newPan = panFromXDifference(player.pos, {SPCENTER_X, SPCENTER_Y});
- gl_snd->musicSetVolume(newVolume, newVolume);
- gl_snd->musicSetPan(newPan);
- DBG_TXT( 0, "controls: arrow keys, f11, enter, '\\', '/' (esc to quit)");
- DBG_TXT( 2, ".pos = {%6.2f, %6.2f}", player.pos.x, player.pos.y);
- DBG_TXT( 3, ".vel = {%6.2f, %6.2f}", player.vel.x, player.vel.y);
- DBG_TXT( 4, ".acc = {%6.2f, %6.2f}", player.acc.x, player.acc.y);
- DBG_TXT( 5, ".ticksInAir = %u", player.ticksInAir);
- DBG_TXT( 6, ".runningState = %6.4f", player.runningState);
- DBG_TXT( 7, ".facingRight = %s", (player.facingRight)?"true":"false");
- DBG_TXT( 8, ".enforceMaxVel = %s", (player.enforceMaxVel)?"true":"false");
- DBG_TXT( 9, ".confused = %s", (player.confused)?"true":"false");
- DBG_TXT(10, ".jumped = %s", (player.jumped)?"true":"false");
- DBG_TXT(12, "tick latency = %.2fms", (time::getUptime()-timeStart)*1000);
- DBG_TXT(13, "speaker dist. = %.1fpx", speakerDistance);
- DBG_TXT(14, "speaker volume = %.1f%%", newVolume*100);
- DBG_TXT(15, "speaker pan =%4.0f%%", newPan*100);
- gl_win->present();
- timeStart = time::getUptime();
- gl_frameTimer->wait();
- }
- NULLDELETE(player.sfx_footstep);
- NULLDELETE(player.sfx_jumping );
- NULLDELETE(player.sfx_landing );
- delete scene.bmp_bg;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement