mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 21:39:57 +00:00
meow
This commit is contained in:
parent
caa4755551
commit
a4d86310d8
8 changed files with 36 additions and 39 deletions
|
|
@ -25,7 +25,11 @@ else()
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_compile_options(/O2 /fp:fast /GA /GL /Gw Qpar /RTCu)
|
add_compile_options(/O2 /fp:fast /GA /GL /Gw Qpar /RTCu)
|
||||||
else()
|
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(-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()
|
||||||
endif()
|
endif()
|
||||||
## Setup main source ##
|
## Setup main source ##
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,9 @@ class Game_Player < Game_Character
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Invariables
|
# * Invariables
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
if Graphics.width == 1280
|
CENTER_X = (Graphics.width / 2) - 16
|
||||||
CENTER_X = 2560 - 16 # Center screen x-coordinate * 2
|
CENTER_Y = (Graphics.height / 2) - 16
|
||||||
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
|
|
||||||
#--------------------------------------------------------------------------
|
|
||||||
# * Passable Determinants
|
# * Passable Determinants
|
||||||
# x : x-coordinate
|
# x : x-coordinate
|
||||||
# y : y-coordinate
|
# y : y-coordinate
|
||||||
|
|
|
||||||
|
|
@ -308,12 +308,19 @@ class Spriteset_Map
|
||||||
# based on its current width and height
|
# based on its current width and height
|
||||||
# no point in updating the sprite if offscreen
|
# no point in updating the sprite if offscreen
|
||||||
# this greatly increases performance on larger maps
|
# this greatly increases performance on larger maps
|
||||||
|
if Graphics.width == 1280
|
||||||
((sprite.character.real_x + (sprite.ox*4) > Graphics.width - 128) &&
|
((sprite.character.real_x + (sprite.ox*4) > Graphics.width - 128) &&
|
||||||
(sprite.character.real_x - (sprite.ox*4) < Graphics.width + (21 * 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) - 128) &&
|
||||||
(sprite.character.real_y - (sprite.oy*4) < (Graphics.height) + (17 * 128)))
|
(sprite.character.real_y - (sprite.oy*4) < (Graphics.height) + (17 * 128)))
|
||||||
sprite.update
|
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
|
else
|
||||||
sprite.update_fast
|
sprite.update_fast
|
||||||
end
|
end
|
||||||
|
|
@ -378,3 +385,4 @@ class Spriteset_Map
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ GLState::GLState(const Config &conf){
|
||||||
blendMode.init(BlendNormal);
|
blendMode.init(BlendNormal);
|
||||||
blend.init(true);
|
blend.init(true);
|
||||||
scissorTest.init(false);
|
scissorTest.init(false);
|
||||||
scissorBox.init(IntRect(0, 0, 640, 480));
|
scissorBox.init(IntRect(0, 0, conf.defScreenW, conf.defScreenH));
|
||||||
program.init(0);
|
program.init(0);
|
||||||
|
|
||||||
if (conf.maxTextureSize > 0)
|
if (conf.maxTextureSize > 0)
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,6 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#define DEF_SCREEN_W (EnableSixteenByNine == 1 ? 640 : 544)
|
|
||||||
#define DEF_SCREEN_H (EnableSixteenByNine == 1 ? 480 : 416)
|
|
||||||
#define DEF_FRAMERATE (60)
|
#define DEF_FRAMERATE (60)
|
||||||
|
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,10 @@
|
||||||
#error "Operating system not detected or unsupported."
|
#error "Operating system not detected or unsupported."
|
||||||
#endif
|
#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{
|
struct OneshotPrivate{
|
||||||
// Main SDL window
|
// Main SDL window
|
||||||
|
|
@ -338,8 +339,8 @@ void Oneshot::update(){
|
||||||
screenRect.x = p->winX;
|
screenRect.x = p->winX;
|
||||||
screenRect.y = p->winY;
|
screenRect.y = p->winY;
|
||||||
SDL_UnlockMutex(p->winMutex);
|
SDL_UnlockMutex(p->winMutex);
|
||||||
screenRect.w = 640;
|
screenRect.w = conf.defScreenW;
|
||||||
screenRect.h = 480;
|
screenRect.h = conf.defScreenH;
|
||||||
|
|
||||||
//костыль ебучий
|
//костыль ебучий
|
||||||
int num_displays;
|
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
|
//If it's entirely within the bounds of the screen, we don't need to check out
|
||||||
//any other monitors
|
//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;
|
return;
|
||||||
|
|
||||||
for (int y = intersect.y; y < intersect.y + intersect.h; ++y){
|
for (int y = intersect.y; y < intersect.y + intersect.h; ++y){
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,7 @@
|
||||||
|
|
||||||
struct ViewportPrivate;
|
struct ViewportPrivate;
|
||||||
|
|
||||||
class Viewport : public Scene, public SceneElement, public Flashable, public Disposable
|
class Viewport : public Scene, public SceneElement, public Flashable, public Disposable{
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
Viewport(int x, int y, int width, int height);
|
Viewport(int x, int y, int width, int height);
|
||||||
Viewport(Rect *rect);
|
Viewport(Rect *rect);
|
||||||
|
|
|
||||||
|
|
@ -145,8 +145,7 @@ struct VorbisSource : ALDataSource{
|
||||||
}
|
}
|
||||||
|
|
||||||
void seekToOffset(float seconds){
|
void seekToOffset(float seconds){
|
||||||
if (seconds <= 0)
|
if (seconds <= 0){
|
||||||
{
|
|
||||||
ov_raw_seek(&vf, 0);
|
ov_raw_seek(&vf, 0);
|
||||||
currentFrame = 0;
|
currentFrame = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -178,29 +177,24 @@ struct VorbisSource : ALDataSource{
|
||||||
canRead = std::min(availBuf, tilLoopEnd);
|
canRead = std::min(availBuf, tilLoopEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (canRead > 16)
|
while (canRead > 16){
|
||||||
{
|
|
||||||
long res = ov_read(&vf, static_cast<char*>(bufPtr),
|
long res = ov_read(&vf, static_cast<char*>(bufPtr),
|
||||||
canRead, 0, sizeof(int16_t), 1, 0);
|
canRead, 0, sizeof(int16_t), 1, 0);
|
||||||
|
|
||||||
if (res < 0)
|
if (res < 0){
|
||||||
{
|
|
||||||
/* Read error */
|
/* Read error */
|
||||||
retStatus = ALDataSource::Error;
|
retStatus = ALDataSource::Error;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == 0)
|
if (res == 0){
|
||||||
{
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
if (loop.requested)
|
if (loop.requested){
|
||||||
{
|
|
||||||
retStatus = ALDataSource::WrapAround;
|
retStatus = ALDataSource::WrapAround;
|
||||||
seekToOffset(0);
|
seekToOffset(0);
|
||||||
}
|
}
|
||||||
else
|
else{
|
||||||
{
|
|
||||||
retStatus = ALDataSource::EndOfStream;
|
retStatus = ALDataSource::EndOfStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -211,8 +205,7 @@ struct VorbisSource : ALDataSource{
|
||||||
if (bufUsed > 0)
|
if (bufUsed > 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (readAgain)
|
if (readAgain){
|
||||||
{
|
|
||||||
/* We're still not getting data though.
|
/* We're still not getting data though.
|
||||||
* Just error out to prevent an endless loop */
|
* Just error out to prevent an endless loop */
|
||||||
retStatus = ALDataSource::Error;
|
retStatus = ALDataSource::Error;
|
||||||
|
|
@ -226,8 +219,7 @@ struct VorbisSource : ALDataSource{
|
||||||
bufPtr = &sampleBuf[bufUsed];
|
bufPtr = &sampleBuf[bufUsed];
|
||||||
currentFrame += (res / info.frameSize);
|
currentFrame += (res / info.frameSize);
|
||||||
|
|
||||||
if (loop.valid && currentFrame >= loop.end)
|
if (loop.valid && currentFrame >= loop.end){
|
||||||
{
|
|
||||||
/* Determine how many frames we're
|
/* Determine how many frames we're
|
||||||
* over the loop end */
|
* over the loop end */
|
||||||
int discardFrames = currentFrame - loop.end;
|
int discardFrames = currentFrame - loop.end;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue