diff --git a/CMakeLists.txt b/CMakeLists.txt index a30d266..41a5880 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,11 @@ else() if (MSVC) add_compile_options(/O2 /fp:fast /GA /GL /Gw Qpar /RTCu) else() +<<<<<<< HEAD add_compile_options(-s -03 -ffast-math -fdevirtualize-speculatively -fspeculatively-call-stored-functions -fipa-pta -fdelete-null-pointer-checks -flimit-function-alignment -faggressive-loop-optimizations) +======= + add_compile_options(-O2 -ffast-math -fdevirtualize-speculatively -fspeculatively-call-stored-functions -fipa-pta -fdelete-null-pointer-checks) +>>>>>>> 7760eac (a) endif() endif() ## Setup main source ## diff --git a/scripts/Game_Player.rb b/scripts/Game_Player.rb index 60d50d5..096df72 100644 --- a/scripts/Game_Player.rb +++ b/scripts/Game_Player.rb @@ -12,14 +12,9 @@ class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Invariables #-------------------------------------------------------------------------- - if Graphics.width == 1280 - CENTER_X = 2560 - 16 # Center screen x-coordinate * 2 - CENTER_Y = 2880 - 16 # Center screen y-coordinate * 2 - else - CENTER_X = (320 - 16) * 4 # Center screen x-coordinate * 4 - CENTER_Y = (240 - 16) * 4 # Center screen y-coordinate * 4 - end - #-------------------------------------------------------------------------- + CENTER_X = (Graphics.width / 2) - 16 + CENTER_Y = (Graphics.height / 2) - 16 + #-------------------------------------------------------------------------- # * Passable Determinants # x : x-coordinate # y : y-coordinate diff --git a/scripts/Spriteset_Map.rb b/scripts/Spriteset_Map.rb index 87f54bd..3782410 100644 --- a/scripts/Spriteset_Map.rb +++ b/scripts/Spriteset_Map.rb @@ -308,12 +308,19 @@ class Spriteset_Map # based on its current width and height # no point in updating the sprite if offscreen # this greatly increases performance on larger maps - - ((sprite.character.real_x + (sprite.ox*4) > Graphics.width - 128) && - (sprite.character.real_x - (sprite.ox*4) < Graphics.width + (21 * 128)) && - (sprite.character.real_y + (sprite.oy*4) > (Graphics.height) - 128) && - (sprite.character.real_y - (sprite.oy*4) < (Graphics.height) + (17 * 128))) + if Graphics.width == 1280 + ((sprite.character.real_x + (sprite.ox*4) > Graphics.width - 128) && + (sprite.character.real_x - (sprite.ox*4) < Graphics.width + (21 * 128)) && + (sprite.character.real_y + (sprite.oy*4) > (Graphics.height) - 128) && + (sprite.character.real_y - (sprite.oy*4) < (Graphics.height) + (17 * 128))) sprite.update + else + ((sprite.character.real_x + (sprite.ox*4) > Graphics.width - 128) && + (sprite.character.real_x - (sprite.ox*4) < Graphics.width + (10 * 128)) && + (sprite.character.real_y + (sprite.oy*4) > (Graphics.height) - 128) && + (sprite.character.real_y - (sprite.oy*4) < (Graphics.height) + (6 * 128))) + sprite.update + end else sprite.update_fast end @@ -378,3 +385,4 @@ class Spriteset_Map end end end + diff --git a/src/glstate.cpp b/src/glstate.cpp index 8471aee..9b789ba 100644 --- a/src/glstate.cpp +++ b/src/glstate.cpp @@ -109,7 +109,7 @@ GLState::GLState(const Config &conf){ blendMode.init(BlendNormal); blend.init(true); scissorTest.init(false); - scissorBox.init(IntRect(0, 0, 640, 480)); + scissorBox.init(IntRect(0, 0, conf.defScreenW, conf.defScreenH)); program.init(0); if (conf.maxTextureSize > 0) diff --git a/src/graphics.cpp b/src/graphics.cpp index edd883c..e72d8df 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -50,8 +50,6 @@ #include #include -#define DEF_SCREEN_W (EnableSixteenByNine == 1 ? 640 : 544) -#define DEF_SCREEN_H (EnableSixteenByNine == 1 ? 480 : 416) #define DEF_FRAMERATE (60) #if defined _WIN32 diff --git a/src/oneshot.cpp b/src/oneshot.cpp index 719e0a5..9c95410 100644 --- a/src/oneshot.cpp +++ b/src/oneshot.cpp @@ -43,9 +43,10 @@ #error "Operating system not detected or unsupported." #endif +const Config conf; +#define DEF_SCREEN_W conf.defScreenW +#define DEF_SCREEN_H conf.defScreenH -#define DEF_SCREEN_W 640 -#define DEF_SCREEN_H 480 struct OneshotPrivate{ // Main SDL window @@ -338,8 +339,8 @@ void Oneshot::update(){ screenRect.x = p->winX; screenRect.y = p->winY; SDL_UnlockMutex(p->winMutex); - screenRect.w = 640; - screenRect.h = 480; + screenRect.w = conf.defScreenW; + screenRect.h = conf.defScreenH; //костыль ебучий int num_displays; @@ -359,7 +360,7 @@ void Oneshot::update(){ //If it's entirely within the bounds of the screen, we don't need to check out //any other monitors - if (intersect.x == 0 && intersect.y == 0 && intersect.w == 640 && intersect.h == 480) + if (intersect.x == 0 && intersect.y == 0 && intersect.w == conf.defScreenW && intersect.h == conf.defScreenH) return; for (int y = intersect.y; y < intersect.y + intersect.h; ++y){ diff --git a/src/viewport.h b/src/viewport.h index 121f0cf..bb5c469 100644 --- a/src/viewport.h +++ b/src/viewport.h @@ -29,8 +29,7 @@ struct ViewportPrivate; -class Viewport : public Scene, public SceneElement, public Flashable, public Disposable -{ +class Viewport : public Scene, public SceneElement, public Flashable, public Disposable{ public: Viewport(int x, int y, int width, int height); Viewport(Rect *rect); diff --git a/src/vorbissource.cpp b/src/vorbissource.cpp index d37786a..251a3f5 100644 --- a/src/vorbissource.cpp +++ b/src/vorbissource.cpp @@ -145,8 +145,7 @@ struct VorbisSource : ALDataSource{ } void seekToOffset(float seconds){ - if (seconds <= 0) - { + if (seconds <= 0){ ov_raw_seek(&vf, 0); currentFrame = 0; } @@ -178,29 +177,24 @@ struct VorbisSource : ALDataSource{ canRead = std::min(availBuf, tilLoopEnd); } - while (canRead > 16) - { + while (canRead > 16){ long res = ov_read(&vf, static_cast(bufPtr), canRead, 0, sizeof(int16_t), 1, 0); - if (res < 0) - { + if (res < 0){ /* Read error */ retStatus = ALDataSource::Error; break; } - if (res == 0) - { + if (res == 0){ /* EOF */ - if (loop.requested) - { + if (loop.requested){ retStatus = ALDataSource::WrapAround; seekToOffset(0); } - else - { + else{ retStatus = ALDataSource::EndOfStream; } @@ -211,8 +205,7 @@ struct VorbisSource : ALDataSource{ if (bufUsed > 0) break; - if (readAgain) - { + if (readAgain){ /* We're still not getting data though. * Just error out to prevent an endless loop */ retStatus = ALDataSource::Error; @@ -226,8 +219,7 @@ struct VorbisSource : ALDataSource{ bufPtr = &sampleBuf[bufUsed]; currentFrame += (res / info.frameSize); - if (loop.valid && currentFrame >= loop.end) - { + if (loop.valid && currentFrame >= loop.end){ /* Determine how many frames we're * over the loop end */ int discardFrames = currentFrame - loop.end;