This commit is contained in:
ZakatTeamI2P 2026-05-18 16:39:35 +04:00
parent caa4755551
commit a4d86310d8
8 changed files with 36 additions and 39 deletions

View file

@ -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 ##

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -50,8 +50,6 @@
#include <errno.h>
#include <algorithm>
#define DEF_SCREEN_W (EnableSixteenByNine == 1 ? 640 : 544)
#define DEF_SCREEN_H (EnableSixteenByNine == 1 ? 480 : 416)
#define DEF_FRAMERATE (60)
#if defined _WIN32

View file

@ -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){

View file

@ -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);

View file

@ -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<char*>(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;