Merge separate RGSS version build configs into one
Setup active RGSS version at runtime. Desired version can be specified via config, or as default, auto detected from the game files. This removes the need to build specifically for each version, which should help packaging a lot. This also greatly reduces the danger of introducing code that wouldn't compile on all RGSS version paths (as certain code paths were completely ifdef'd out). This can be optimized more, eg. not compiling shaders that aren't needed in the active version.
This commit is contained in:
parent
b1981055e1
commit
55f1542c76
41 changed files with 460 additions and 465 deletions
|
@ -58,10 +58,8 @@ ALDataSource *createSDLSource(SDL_RWops &ops,
|
|||
uint32_t maxBufSize,
|
||||
bool looped);
|
||||
|
||||
#ifdef RGSS2
|
||||
ALDataSource *createVorbisSource(SDL_RWops &ops,
|
||||
bool looped);
|
||||
#endif
|
||||
|
||||
#ifdef MIDI
|
||||
ALDataSource *createMidiSource(SDL_RWops &ops,
|
||||
|
|
|
@ -198,27 +198,33 @@ void ALStream::openSource(const std::string &filename)
|
|||
shState->fileSystem().openRead(srcOps, filename.c_str(), FileSystem::Audio, false, &ext);
|
||||
needsRewind = false;
|
||||
|
||||
#if RGSS2 || MIDI
|
||||
/* Try to read ogg file signature */
|
||||
char sig[5] = { 0 };
|
||||
SDL_RWread(&srcOps, sig, 1, 4);
|
||||
SDL_RWseek(&srcOps, 0, RW_SEEK_SET);
|
||||
bool readSig = rgssVer >= 2;
|
||||
|
||||
#ifdef RGSS2
|
||||
if (!strcmp(sig, "OggS"))
|
||||
{
|
||||
source = createVorbisSource(srcOps, looped);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef MIDI
|
||||
if (!strcmp(sig, "MThd"))
|
||||
readSig = true;
|
||||
#endif
|
||||
|
||||
if (readSig)
|
||||
{
|
||||
source = createMidiSource(srcOps, looped);
|
||||
return;
|
||||
/* Try to read ogg file signature */
|
||||
char sig[5] = { 0 };
|
||||
SDL_RWread(&srcOps, sig, 1, 4);
|
||||
SDL_RWseek(&srcOps, 0, RW_SEEK_SET);
|
||||
|
||||
if (!strcmp(sig, "OggS"))
|
||||
{
|
||||
source = createVorbisSource(srcOps, looped);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef MIDI
|
||||
if (!strcmp(sig, "MThd"))
|
||||
{
|
||||
source = createMidiSource(srcOps, looped);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
source = createSDLSource(srcOps, ext, STREAM_BUF_SIZE, looped);
|
||||
}
|
||||
|
|
|
@ -551,8 +551,6 @@ void Bitmap::clearRect(const IntRect &rect)
|
|||
p->onModified();
|
||||
}
|
||||
|
||||
#ifdef RGSS2
|
||||
|
||||
void Bitmap::blur()
|
||||
{
|
||||
GUARD_MEGA;
|
||||
|
@ -689,8 +687,6 @@ void Bitmap::radialBlur(int angle, int divisions)
|
|||
p->onModified();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void Bitmap::clear()
|
||||
{
|
||||
GUARD_MEGA;
|
||||
|
|
|
@ -73,10 +73,8 @@ public:
|
|||
int width, int height);
|
||||
void clearRect(const IntRect &rect);
|
||||
|
||||
#ifdef RGSS2
|
||||
void blur();
|
||||
void radialBlur(int angle, int divisions);
|
||||
#endif
|
||||
|
||||
void clear();
|
||||
|
||||
|
|
|
@ -122,14 +122,15 @@ typedef std::vector<std::string> StringVec;
|
|||
namespace po = boost::program_options;
|
||||
|
||||
Config::Config()
|
||||
: debugMode(false),
|
||||
: rgssVersion(0),
|
||||
debugMode(false),
|
||||
winResizable(false),
|
||||
fullscreen(false),
|
||||
fixedAspectRatio(true),
|
||||
smoothScaling(false),
|
||||
vsync(false),
|
||||
defScreenW(DEF_SCREEN_W),
|
||||
defScreenH(DEF_SCREEN_H),
|
||||
defScreenW(0),
|
||||
defScreenH(0),
|
||||
fixedFramerate(0),
|
||||
frameSkip(true),
|
||||
solidFonts(false),
|
||||
|
@ -147,6 +148,7 @@ Config::Config()
|
|||
void Config::read(int argc, char *argv[])
|
||||
{
|
||||
#define PO_DESC_ALL \
|
||||
PO_DESC(rgssVersion, int) \
|
||||
PO_DESC(debugMode, bool) \
|
||||
PO_DESC(winResizable, bool) \
|
||||
PO_DESC(fullscreen, bool) \
|
||||
|
@ -219,7 +221,7 @@ void Config::read(int argc, char *argv[])
|
|||
|
||||
GUARD_ALL( fontSubs = vm["fontSub"].as<StringVec>(); );
|
||||
|
||||
GUARD_ALL( rubyLoadpaths = vm["rubyLoadpath"].as<StringVec>(); )
|
||||
GUARD_ALL( rubyLoadpaths = vm["rubyLoadpath"].as<StringVec>(); );
|
||||
|
||||
#undef PO_DESC
|
||||
#undef PO_DESC_ALL
|
||||
|
@ -329,4 +331,31 @@ void Config::readGameINI()
|
|||
|
||||
if (game.title.empty())
|
||||
game.title = baseName(gameFolder);
|
||||
|
||||
if (rgssVersion == 0)
|
||||
{
|
||||
/* Try to guess RGSS version based on Data/Scripts extension */
|
||||
rgssVersion = 1;
|
||||
|
||||
if (!game.scripts.empty())
|
||||
{
|
||||
const char *p = &game.scripts[game.scripts.size()];
|
||||
const char *head = &game.scripts[0];
|
||||
|
||||
while (--p != head)
|
||||
if (*p == '.')
|
||||
break;
|
||||
|
||||
if (!strcmp(p, ".rvdata"))
|
||||
rgssVersion = 2;
|
||||
else if (!strcmp(p, ".rvdata2"))
|
||||
rgssVersion = 3;
|
||||
}
|
||||
}
|
||||
|
||||
if (defScreenW <= 0)
|
||||
defScreenW = (rgssVersion == 1 ? 640 : 544);
|
||||
|
||||
if (defScreenH <= 0)
|
||||
defScreenH = (rgssVersion == 1 ? 480 : 416);
|
||||
}
|
||||
|
|
10
src/config.h
10
src/config.h
|
@ -25,16 +25,10 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifndef RGSS2
|
||||
# define DEF_SCREEN_W 640
|
||||
# define DEF_SCREEN_H 480
|
||||
#else
|
||||
# define DEF_SCREEN_W 544
|
||||
# define DEF_SCREEN_H 416
|
||||
#endif
|
||||
|
||||
struct Config
|
||||
{
|
||||
int rgssVersion;
|
||||
|
||||
bool debugMode;
|
||||
|
||||
bool winResizable;
|
||||
|
|
18
src/font.cpp
18
src/font.cpp
|
@ -48,14 +48,6 @@ BUNDLED_FONT_DECL(liberation)
|
|||
#define BNDL_F_D(f) BUNDLED_FONT_D(f)
|
||||
#define BNDL_F_L(f) BUNDLED_FONT_L(f)
|
||||
|
||||
#ifdef RGSS3
|
||||
# define DEF_SHADOW false
|
||||
# define DEF_OUTLINE true
|
||||
#else
|
||||
# define DEF_SHADOW true
|
||||
# define DEF_OUTLINE false
|
||||
#endif
|
||||
|
||||
typedef std::pair<std::string, int> FontKey;
|
||||
|
||||
static SDL_RWops *openBundledFont()
|
||||
|
@ -269,14 +261,20 @@ std::string FontPrivate::defaultName = "Arial";
|
|||
int FontPrivate::defaultSize = 22;
|
||||
bool FontPrivate::defaultBold = false;
|
||||
bool FontPrivate::defaultItalic = false;
|
||||
bool FontPrivate::defaultOutline = DEF_OUTLINE;
|
||||
bool FontPrivate::defaultShadow = DEF_SHADOW;
|
||||
bool FontPrivate::defaultOutline = false; /* Inited at runtime */
|
||||
bool FontPrivate::defaultShadow = false; /* Inited at runtime */
|
||||
Color *FontPrivate::defaultColor = &FontPrivate::defaultColorTmp;
|
||||
Color *FontPrivate::defaultOutColor = &FontPrivate::defaultOutColorTmp;
|
||||
|
||||
Color FontPrivate::defaultColorTmp(255, 255, 255, 255);
|
||||
Color FontPrivate::defaultOutColorTmp(0, 0, 0, 128);
|
||||
|
||||
void Font::initDefaults()
|
||||
{
|
||||
FontPrivate::defaultOutline = (rgssVer >= 3 ? true : false);
|
||||
FontPrivate::defaultShadow = (rgssVer >= 3 ? false : true );
|
||||
}
|
||||
|
||||
bool Font::doesExist(const char *name)
|
||||
{
|
||||
if (!name)
|
||||
|
|
|
@ -102,6 +102,8 @@ public:
|
|||
DECL_ATTR_STATIC( DefaultOutline, bool )
|
||||
DECL_ATTR_STATIC( DefaultOutColor, Color* )
|
||||
|
||||
static void initDefaults();
|
||||
|
||||
/* internal */
|
||||
_TTF_Font *getSdlFont();
|
||||
|
||||
|
|
|
@ -45,11 +45,9 @@
|
|||
#include <errno.h>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef RGSS2
|
||||
# define DEF_FRAMERATE 60
|
||||
#else
|
||||
# define DEF_FRAMERATE 40
|
||||
#endif
|
||||
#define DEF_SCREEN_W (rgssVer == 1 ? 640 : 544)
|
||||
#define DEF_SCREEN_H (rgssVer == 1 ? 480 : 416)
|
||||
#define DEF_FRAMERATE (rgssVer == 1 ? 40 : 60)
|
||||
|
||||
struct PingPong
|
||||
{
|
||||
|
|
|
@ -205,23 +205,32 @@ static const KbBindingData defaultKbBindings[] =
|
|||
{ SDL_SCANCODE_B, Input::None },
|
||||
{ SDL_SCANCODE_D, Input::Z },
|
||||
{ SDL_SCANCODE_Q, Input::L },
|
||||
{ SDL_SCANCODE_W, Input::R },
|
||||
#if RGSS_VER == 1
|
||||
{ SDL_SCANCODE_W, Input::R }
|
||||
};
|
||||
|
||||
/* RGSS1 */
|
||||
static const KbBindingData defaultKbBindings1[] =
|
||||
{
|
||||
{ SDL_SCANCODE_Z, Input::A },
|
||||
{ SDL_SCANCODE_C, Input::C },
|
||||
{ SDL_SCANCODE_V, Input::Z },
|
||||
{ SDL_SCANCODE_A, Input::Y },
|
||||
{ SDL_SCANCODE_S, Input::X }
|
||||
#else
|
||||
};
|
||||
|
||||
/* RGSS2 and higher */
|
||||
static const KbBindingData defaultKbBindings2[] =
|
||||
{
|
||||
{ SDL_SCANCODE_Z, Input::C },
|
||||
{ SDL_SCANCODE_C, Input::None },
|
||||
{ SDL_SCANCODE_V, Input::None },
|
||||
{ SDL_SCANCODE_A, Input::X },
|
||||
{ SDL_SCANCODE_S, Input::Y }
|
||||
#endif
|
||||
};
|
||||
|
||||
static elementsN(defaultKbBindings);
|
||||
static elementsN(defaultKbBindings1);
|
||||
static elementsN(defaultKbBindings2);
|
||||
|
||||
/* Rebindable */
|
||||
static const JsBindingData defaultJsBindings[] =
|
||||
|
@ -374,15 +383,20 @@ struct InputPrivate
|
|||
|
||||
void initKbBindings()
|
||||
{
|
||||
kbBindings.resize(staticKbBindingsN+defaultKbBindingsN);
|
||||
|
||||
size_t n = 0;
|
||||
kbBindings.clear();
|
||||
|
||||
for (size_t i = 0; i < staticKbBindingsN; ++i)
|
||||
kbBindings[n++] = KbBinding(staticKbBindings[i]);
|
||||
kbBindings.push_back(KbBinding(staticKbBindings[i]));
|
||||
|
||||
for (size_t i = 0; i < defaultKbBindingsN; ++i)
|
||||
kbBindings[n++] = KbBinding(defaultKbBindings[i]);
|
||||
kbBindings.push_back(KbBinding(defaultKbBindings[i]));
|
||||
|
||||
if (rgssVer == 1)
|
||||
for (size_t i = 0; i < defaultKbBindings1N; ++i)
|
||||
kbBindings.push_back(KbBinding(defaultKbBindings1[i]));
|
||||
else
|
||||
for (size_t i = 0; i < defaultKbBindings2N; ++i)
|
||||
kbBindings.push_back(KbBinding(defaultKbBindings2[i]));
|
||||
|
||||
/* Add to binging array */
|
||||
for (size_t i = 0; i < kbBindings.size(); ++i)
|
||||
|
|
|
@ -179,13 +179,15 @@ bool SceneElement::operator<(const SceneElement &o) const
|
|||
{
|
||||
if (z == o.z)
|
||||
{
|
||||
#ifdef RGSS2
|
||||
/* RGSS2: If two sprites' Z values collide,
|
||||
* their Y coordinates decide draw order. Only
|
||||
* on equal Y does the creation time take effect */
|
||||
if (isSprite && o.isSprite && spriteY != o.spriteY)
|
||||
return (spriteY < o.spriteY);
|
||||
#endif
|
||||
if (rgssVer >= 2)
|
||||
{
|
||||
/* RGSS2: If two sprites' Z values collide,
|
||||
* their Y coordinates decide draw order. Only
|
||||
* on equal Y does the creation time take effect */
|
||||
if (isSprite && o.isSprite && spriteY != o.spriteY)
|
||||
return (spriteY < o.spriteY);
|
||||
}
|
||||
|
||||
return (creationStamp <= o.creationStamp);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,14 +42,11 @@
|
|||
#include "../simpleColor.vert.xxd"
|
||||
#include "../sprite.vert.xxd"
|
||||
#include "../tilemap.vert.xxd"
|
||||
|
||||
#ifdef RGSS2
|
||||
#include "../blur.frag.xxd"
|
||||
#include "../simpleMatrix.vert.xxd"
|
||||
#include "../blurH.vert.xxd"
|
||||
#include "../blurV.vert.xxd"
|
||||
#include "../tilemapvx.vert.xxd"
|
||||
#endif
|
||||
|
||||
|
||||
#define INIT_SHADER(vert, frag, name) \
|
||||
|
@ -505,8 +502,6 @@ void HueShader::setInputTexture(TEX::ID tex)
|
|||
}
|
||||
|
||||
|
||||
#ifdef RGSS2
|
||||
|
||||
SimpleMatrixShader::SimpleMatrixShader()
|
||||
{
|
||||
INIT_SHADER(simpleMatrix, simpleAlpha, SimpleMatrixShader);
|
||||
|
@ -551,8 +546,6 @@ void TilemapVXShader::setAniOffset(const Vec2 &value)
|
|||
gl.Uniform2f(u_aniOffset, value.x, value.y);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
BltShader::BltShader()
|
||||
{
|
||||
|
|
|
@ -213,7 +213,6 @@ private:
|
|||
GLint u_hueAdjust, u_inputTexture;
|
||||
};
|
||||
|
||||
#ifdef RGSS2
|
||||
class SimpleMatrixShader : public ShaderBase
|
||||
{
|
||||
public:
|
||||
|
@ -255,8 +254,6 @@ private:
|
|||
GLint u_aniOffset;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/* Bitmap blit */
|
||||
class BltShader : public ShaderBase
|
||||
{
|
||||
|
@ -288,12 +285,9 @@ struct ShaderSet
|
|||
SimpleTransShader simpleTrans;
|
||||
HueShader hue;
|
||||
BltShader blt;
|
||||
|
||||
#ifdef RGSS2
|
||||
SimpleMatrixShader simpleMatrix;
|
||||
BlurShader blur;
|
||||
TilemapVXShader tilemapVX;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // SHADER_H
|
||||
|
|
|
@ -46,15 +46,21 @@
|
|||
#include <string>
|
||||
|
||||
SharedState *SharedState::instance = 0;
|
||||
int SharedState::rgssVersion = 0;
|
||||
static GlobalIBO *_globalIBO = 0;
|
||||
|
||||
#ifdef RGSS3
|
||||
#define GAME_ARCHIVE "Game.rgss3a"
|
||||
#elif RGSS2
|
||||
#define GAME_ARCHIVE "Game.rgss2a"
|
||||
#else
|
||||
#define GAME_ARCHIVE "Game.rgssad"
|
||||
#endif
|
||||
static const char *defGameArchive()
|
||||
{
|
||||
if (rgssVer == 1)
|
||||
return "Game.rgssad";
|
||||
else if (rgssVer == 2)
|
||||
return "Game.rgss2a";
|
||||
else if (rgssVer == 3)
|
||||
return "Game.rgss3a";
|
||||
|
||||
assert(!"unreachable");
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct SharedStatePrivate
|
||||
{
|
||||
|
@ -122,7 +128,7 @@ struct SharedStatePrivate
|
|||
}
|
||||
|
||||
// FIXME find out correct archive filename
|
||||
std::string archPath = GAME_ARCHIVE;
|
||||
std::string archPath = defGameArchive();
|
||||
|
||||
/* Check if a game archive exists */
|
||||
FILE *tmp = fopen(archPath.c_str(), "r");
|
||||
|
@ -158,8 +164,9 @@ struct SharedStatePrivate
|
|||
|
||||
/* RGSS3 games will call setup_midi, so there's
|
||||
* no need to do it on startup */
|
||||
#if MIDI && !RGSS3
|
||||
midiState.initDefaultSynths();
|
||||
#if MIDI
|
||||
if (rgssVer <= 2)
|
||||
midiState.initDefaultSynths();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -177,6 +184,9 @@ void SharedState::initInstance(RGSSThreadData *threadData)
|
|||
* SharedState depends on GlobalIBO existing,
|
||||
* Font depends on SharedState existing */
|
||||
|
||||
rgssVersion = threadData->config.rgssVersion;
|
||||
Font::initDefaults();
|
||||
|
||||
_globalIBO = new GlobalIBO();
|
||||
_globalIBO->ensureSize(1);
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#define shState SharedState::instance
|
||||
#define glState shState->_glState()
|
||||
#define rgssVer SharedState::rgssVersion
|
||||
|
||||
struct SharedStatePrivate;
|
||||
struct RGSSThreadData;
|
||||
|
@ -114,6 +115,7 @@ struct SharedState
|
|||
void checkShutdown();
|
||||
|
||||
static SharedState *instance;
|
||||
static int rgssVersion;
|
||||
|
||||
/* This function will throw an Exception instance
|
||||
* on initialization error */
|
||||
|
|
|
@ -374,11 +374,11 @@ void Sprite::setY(int value)
|
|||
|
||||
p->trans.setPosition(Vec2(getX(), value));
|
||||
|
||||
#ifdef RGSS2
|
||||
p->wave.dirty = true;
|
||||
|
||||
setSpriteY(value);
|
||||
#endif
|
||||
if (rgssVer >= 2)
|
||||
{
|
||||
p->wave.dirty = true;
|
||||
setSpriteY(value);
|
||||
}
|
||||
}
|
||||
|
||||
void Sprite::setOX(int value)
|
||||
|
@ -413,9 +413,8 @@ void Sprite::setZoomY(float value)
|
|||
p->trans.setScale(Vec2(getZoomX(), value));
|
||||
p->recomputeBushDepth();
|
||||
|
||||
#ifdef RGSS2
|
||||
p->wave.dirty = true;
|
||||
#endif
|
||||
if (rgssVer >= 2)
|
||||
p->wave.dirty = true;
|
||||
}
|
||||
|
||||
void Sprite::setAngle(float value)
|
||||
|
|
|
@ -280,13 +280,14 @@ void build(TEXFBO &tf, Bitmap *bitmaps[BM_COUNT])
|
|||
FBO::clear();
|
||||
glState.clearColor.pop();
|
||||
|
||||
#ifdef RGSS3
|
||||
SDL_Surface *shadow = createShadowSet();
|
||||
TEX::bind(tf.tex);
|
||||
TEX::uploadSubImage(shadowArea.x*32, shadowArea.y*32,
|
||||
shadow->w, shadow->h, shadow->pixels, GL_RGBA);
|
||||
SDL_FreeSurface(shadow);
|
||||
#endif
|
||||
if (rgssVer >= 3)
|
||||
{
|
||||
SDL_Surface *shadow = createShadowSet();
|
||||
TEX::bind(tf.tex);
|
||||
TEX::uploadSubImage(shadowArea.x*32, shadowArea.y*32,
|
||||
shadow->w, shadow->h, shadow->pixels, GL_RGBA);
|
||||
SDL_FreeSurface(shadow);
|
||||
}
|
||||
|
||||
Bitmap *bm;
|
||||
#define EXEC_BLITS(part) \
|
||||
|
@ -585,12 +586,12 @@ onTile(Reader &reader, int16_t tileID,
|
|||
{
|
||||
int16_t flag = tableGetSafe(flags, tileID);
|
||||
bool overPlayer = flag & OVER_PLAYER_FLAG;
|
||||
bool isTable;
|
||||
|
||||
#if RGSS_VER == 3
|
||||
bool isTable = flag & TABLE_FLAG;
|
||||
#elif RGSS_VER == 2
|
||||
bool isTable = (tileID - 0x0B00) % (8 * 0x30) >= (7 * 0x30);
|
||||
#endif
|
||||
if (rgssVer >= 3)
|
||||
isTable = flag & TABLE_FLAG;
|
||||
else
|
||||
isTable = (tileID - 0x0B00) % (8 * 0x30) >= (7 * 0x30);
|
||||
|
||||
/* B ~ E */
|
||||
if (tileID < 0x0400)
|
||||
|
@ -683,11 +684,8 @@ void readTiles(Reader &reader, const Table &data,
|
|||
for (int i = 0; i < 2; ++i)
|
||||
readLayer(reader, data, flags, ox, oy, w, h, i);
|
||||
|
||||
#ifdef RGSS3
|
||||
readShadowLayer(reader, data, ox, oy, w, h);
|
||||
#else
|
||||
(void) createShadowSet; (void) readShadowLayer;
|
||||
#endif
|
||||
if (rgssVer >= 3)
|
||||
readShadowLayer(reader, data, ox, oy, w, h);
|
||||
|
||||
readLayer(reader, data, flags, ox, oy, w, h, 2);
|
||||
}
|
||||
|
|
|
@ -35,15 +35,9 @@
|
|||
#include <algorithm>
|
||||
#include <sigc++/connection.h>
|
||||
|
||||
#ifdef RGSS3
|
||||
# define DEF_Z 100
|
||||
# define DEF_PADDING 12
|
||||
# define DEF_BACK_OPAC 192
|
||||
#else
|
||||
# define DEF_Z 0
|
||||
# define DEF_PADDING 16
|
||||
# define DEF_BACK_OPAC 255
|
||||
#endif
|
||||
#define DEF_Z (rgssVer >= 3 ? 100 : 0)
|
||||
#define DEF_PADDING (rgssVer >= 3 ? 12 : 16)
|
||||
#define DEF_BACK_OPAC (rgssVer >= 3 ? 192 : 255)
|
||||
|
||||
template<typename T>
|
||||
struct Sides
|
||||
|
@ -765,11 +759,11 @@ struct WindowVXPrivate
|
|||
glState.scissorBox.push();
|
||||
glState.scissorTest.pushSet(true);
|
||||
|
||||
#ifdef RGSS3
|
||||
glState.scissorBox.setIntersect(clip);
|
||||
#else
|
||||
glState.scissorBox.setIntersect(IntRect(trans.x, trans.y, geo.w, geo.h));
|
||||
#endif
|
||||
if (rgssVer >= 3)
|
||||
glState.scissorBox.setIntersect(clip);
|
||||
else
|
||||
glState.scissorBox.setIntersect(IntRect(trans.x, trans.y, geo.w, geo.h));
|
||||
|
||||
IntRect pad = padRect;
|
||||
pad.x += trans.x;
|
||||
pad.y += trans.y;
|
||||
|
@ -779,10 +773,13 @@ struct WindowVXPrivate
|
|||
Vec2i contTrans = pad.pos();
|
||||
contTrans.x += cursorRect->x;
|
||||
contTrans.y += cursorRect->y;
|
||||
#ifdef RGSS3
|
||||
contTrans.x -= contentsOff.x;
|
||||
contTrans.y -= contentsOff.y;
|
||||
#endif
|
||||
|
||||
if (rgssVer >= 3)
|
||||
{
|
||||
contTrans.x -= contentsOff.x;
|
||||
contTrans.y -= contentsOff.y;
|
||||
}
|
||||
|
||||
shader.setTranslation(contTrans);
|
||||
|
||||
TEX::setSmooth(true);
|
||||
|
@ -792,9 +789,9 @@ struct WindowVXPrivate
|
|||
|
||||
if (contents)
|
||||
{
|
||||
#ifndef RGSS3
|
||||
glState.scissorBox.setIntersect(clip);
|
||||
#endif
|
||||
if (rgssVer <= 2)
|
||||
glState.scissorBox.setIntersect(clip);
|
||||
|
||||
Vec2i contTrans = pad.pos();
|
||||
contTrans.x -= contentsOff.x;
|
||||
contTrans.y -= contentsOff.y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue