mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-25 16:23:46 +02:00
Remove most of the #ifndef MKXPZ_RETRO
macros in graphics-related code
This commit is contained in:
parent
efde7d527d
commit
01fce50d97
4 changed files with 8 additions and 130 deletions
|
@ -545,6 +545,7 @@ if is_libretro
|
||||||
'src/audio/soundemitter.cpp',
|
'src/audio/soundemitter.cpp',
|
||||||
'src/audio/vorbissource.cpp',
|
'src/audio/vorbissource.cpp',
|
||||||
'src/crypto/rgssad.cpp',
|
'src/crypto/rgssad.cpp',
|
||||||
|
'src/display/autotiles.cpp',
|
||||||
'src/display/bitmap.cpp',
|
'src/display/bitmap.cpp',
|
||||||
'src/display/plane.cpp',
|
'src/display/plane.cpp',
|
||||||
'src/display/sprite.cpp',
|
'src/display/sprite.cpp',
|
||||||
|
@ -559,6 +560,7 @@ if is_libretro
|
||||||
'src/display/gl/shader.cpp',
|
'src/display/gl/shader.cpp',
|
||||||
'src/display/gl/texpool.cpp',
|
'src/display/gl/texpool.cpp',
|
||||||
'src/display/gl/tileatlas.cpp',
|
'src/display/gl/tileatlas.cpp',
|
||||||
|
'src/display/gl/tilequad.cpp',
|
||||||
'src/display/gl/vertex.cpp',
|
'src/display/gl/vertex.cpp',
|
||||||
'src/display/graphics.cpp',
|
'src/display/graphics.cpp',
|
||||||
'src/etc/etc.cpp',
|
'src/etc/etc.cpp',
|
||||||
|
|
|
@ -28,17 +28,13 @@
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
#include "gl-util.h"
|
#include "gl-util.h"
|
||||||
#include "quad.h"
|
#include "quad.h"
|
||||||
#include "quadarray.h"
|
#include "quadarray.h"
|
||||||
#include "transform.h"
|
#include "transform.h"
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
#include "etc-internal.h"
|
#include "etc-internal.h"
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
#include "shader.h"
|
#include "shader.h"
|
||||||
#include "glstate.h"
|
#include "glstate.h"
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
#include "sigslot/signal.hpp"
|
#include "sigslot/signal.hpp"
|
||||||
|
|
||||||
|
@ -66,9 +62,7 @@ struct PlanePrivate
|
||||||
|
|
||||||
bool quadSourceDirty;
|
bool quadSourceDirty;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
SimpleQuadArray qArray;
|
SimpleQuadArray qArray;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
EtcTemps tmp;
|
EtcTemps tmp;
|
||||||
|
|
||||||
|
@ -87,9 +81,7 @@ struct PlanePrivate
|
||||||
prepareCon = shState->prepareDraw.connect
|
prepareCon = shState->prepareDraw.connect
|
||||||
(&PlanePrivate::prepare, this);
|
(&PlanePrivate::prepare, this);
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
qArray.resize(1);
|
qArray.resize(1);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~PlanePrivate()
|
~PlanePrivate()
|
||||||
|
@ -107,7 +99,6 @@ struct PlanePrivate
|
||||||
|
|
||||||
void updateQuadSource()
|
void updateQuadSource()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
if (gl.npot_repeat)
|
if (gl.npot_repeat)
|
||||||
{
|
{
|
||||||
FloatRect srcRect;
|
FloatRect srcRect;
|
||||||
|
@ -121,7 +112,6 @@ struct PlanePrivate
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
if (nullOrDisposed(bitmap))
|
if (nullOrDisposed(bitmap))
|
||||||
return;
|
return;
|
||||||
|
@ -144,7 +134,6 @@ struct PlanePrivate
|
||||||
|
|
||||||
FloatRect tex = bitmap->rect();
|
FloatRect tex = bitmap->rect();
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
qArray.resize(tilesX * tilesY);
|
qArray.resize(tilesX * tilesY);
|
||||||
|
|
||||||
for (size_t y = 0; y < tilesY; ++y)
|
for (size_t y = 0; y < tilesY; ++y)
|
||||||
|
@ -157,7 +146,6 @@ struct PlanePrivate
|
||||||
}
|
}
|
||||||
|
|
||||||
qArray.commit();
|
qArray.commit();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepare()
|
void prepare()
|
||||||
|
@ -293,7 +281,6 @@ void Plane::draw()
|
||||||
if (!p->opacity)
|
if (!p->opacity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
ShaderBase *base;
|
ShaderBase *base;
|
||||||
|
|
||||||
if (p->color->hasEffect() || p->tone->hasEffect() || p->opacity != 255)
|
if (p->color->hasEffect() || p->tone->hasEffect() || p->opacity != 255)
|
||||||
|
@ -333,15 +320,12 @@ void Plane::draw()
|
||||||
TEX::setRepeat(false);
|
TEX::setRepeat(false);
|
||||||
|
|
||||||
glState.blendMode.pop();
|
glState.blendMode.pop();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plane::onGeometryChange(const Scene::Geometry &geo)
|
void Plane::onGeometryChange(const Scene::Geometry &geo)
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
if (gl.npot_repeat)
|
if (gl.npot_repeat)
|
||||||
Quad::setPosRect(&p->qArray.vertices[0], FloatRect(geo.rect));
|
Quad::setPosRect(&p->qArray.vertices[0], FloatRect(geo.rect));
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
p->sceneGeo = geo;
|
p->sceneGeo = geo;
|
||||||
p->quadSourceDirty = true;
|
p->quadSourceDirty = true;
|
||||||
|
|
|
@ -28,19 +28,15 @@
|
||||||
#include "sharedstate.h"
|
#include "sharedstate.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "debugwriter.h"
|
#include "debugwriter.h"
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
#include "glstate.h"
|
#include "glstate.h"
|
||||||
#include "gl-util.h"
|
#include "gl-util.h"
|
||||||
#include "gl-meta.h"
|
#include "gl-meta.h"
|
||||||
#include "global-ibo.h"
|
#include "global-ibo.h"
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
#include "etc-internal.h"
|
#include "etc-internal.h"
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
#include "quadarray.h"
|
#include "quadarray.h"
|
||||||
#include "texpool.h"
|
#include "texpool.h"
|
||||||
#include "quad.h"
|
#include "quad.h"
|
||||||
#include "vertex.h"
|
#include "vertex.h"
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
#include "tileatlas.h"
|
#include "tileatlas.h"
|
||||||
#include "tilemap-common.h"
|
#include "tilemap-common.h"
|
||||||
|
|
||||||
|
@ -51,15 +47,11 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
#include <SDL_surface.h>
|
#include <SDL_surface.h>
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
extern const StaticRect autotileRects[];
|
extern const StaticRect autotileRects[];
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
typedef std::vector<SVertex> SVVector;
|
typedef std::vector<SVertex> SVVector;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
static const int tilesetW = 8 * 32;
|
static const int tilesetW = 8 * 32;
|
||||||
static const int autotileW = 3 * 32;
|
static const int autotileW = 3 * 32;
|
||||||
|
@ -195,9 +187,7 @@ static elementsN(flashAlpha);
|
||||||
|
|
||||||
struct GroundLayer : public ViewportElement
|
struct GroundLayer : public ViewportElement
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
GLsizei vboCount;
|
GLsizei vboCount;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
TilemapPrivate *p;
|
TilemapPrivate *p;
|
||||||
|
|
||||||
GroundLayer(TilemapPrivate *p, Viewport *viewport);
|
GroundLayer(TilemapPrivate *p, Viewport *viewport);
|
||||||
|
@ -215,21 +205,17 @@ struct GroundLayer : public ViewportElement
|
||||||
struct ZLayer : public ViewportElement
|
struct ZLayer : public ViewportElement
|
||||||
{
|
{
|
||||||
size_t index;
|
size_t index;
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
GLintptr vboOffset;
|
GLintptr vboOffset;
|
||||||
GLsizei vboCount;
|
GLsizei vboCount;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
TilemapPrivate *p;
|
TilemapPrivate *p;
|
||||||
|
|
||||||
/* If this layer is part of a batch and not
|
/* If this layer is part of a batch and not
|
||||||
* the head, it is 'muted' via this flag */
|
* the head, it is 'muted' via this flag */
|
||||||
bool batchedFlag;
|
bool batchedFlag;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* If this layer is a batch head, this variable
|
/* If this layer is a batch head, this variable
|
||||||
* holds the element count of the entire batch */
|
* holds the element count of the entire batch */
|
||||||
GLsizei vboBatchCount;
|
GLsizei vboBatchCount;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
ZLayer(TilemapPrivate *p, Viewport *viewport);
|
ZLayer(TilemapPrivate *p, Viewport *viewport);
|
||||||
|
|
||||||
|
@ -263,9 +249,7 @@ struct TilemapPrivate
|
||||||
|
|
||||||
/* Tile atlas */
|
/* Tile atlas */
|
||||||
struct {
|
struct {
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
TEXFBO gl;
|
TEXFBO gl;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
Vec2i size;
|
Vec2i size;
|
||||||
|
|
||||||
|
@ -290,13 +274,11 @@ struct TilemapPrivate
|
||||||
/* Map viewport position */
|
/* Map viewport position */
|
||||||
Vec2i viewpPos;
|
Vec2i viewpPos;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Ground layer vertices */
|
/* Ground layer vertices */
|
||||||
SVVector groundVert;
|
SVVector groundVert;
|
||||||
|
|
||||||
/* ZLayer vertices */
|
/* ZLayer vertices */
|
||||||
SVVector zlayerVert[zlayersMax];
|
SVVector zlayerVert[zlayersMax];
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
/* Base quad indices of each zlayer
|
/* Base quad indices of each zlayer
|
||||||
* in the shared buffer */
|
* in the shared buffer */
|
||||||
|
@ -305,10 +287,8 @@ struct TilemapPrivate
|
||||||
/* Shared buffers for all tiles */
|
/* Shared buffers for all tiles */
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
GLMeta::VAO vao;
|
GLMeta::VAO vao;
|
||||||
VBO::ID vbo;
|
VBO::ID vbo;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
bool animated;
|
bool animated;
|
||||||
|
|
||||||
/* Animation state */
|
/* Animation state */
|
||||||
|
@ -390,7 +370,6 @@ struct TilemapPrivate
|
||||||
tiles.animated = false;
|
tiles.animated = false;
|
||||||
tiles.aniIdx = 0;
|
tiles.aniIdx = 0;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Init tile buffers */
|
/* Init tile buffers */
|
||||||
tiles.vbo = VBO::gen();
|
tiles.vbo = VBO::gen();
|
||||||
|
|
||||||
|
@ -399,7 +378,6 @@ struct TilemapPrivate
|
||||||
tiles.vao.ibo = shState->globalIBO().ibo;
|
tiles.vao.ibo = shState->globalIBO().ibo;
|
||||||
|
|
||||||
GLMeta::vaoInit(tiles.vao);
|
GLMeta::vaoInit(tiles.vao);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
elem.ground = new GroundLayer(this, viewport);
|
elem.ground = new GroundLayer(this, viewport);
|
||||||
|
|
||||||
|
@ -419,13 +397,11 @@ struct TilemapPrivate
|
||||||
for (size_t i = 0; i < zlayersMax; ++i)
|
for (size_t i = 0; i < zlayersMax; ++i)
|
||||||
delete elem.zlayers[i];
|
delete elem.zlayers[i];
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
shState->releaseAtlasTex(atlas.gl);
|
shState->releaseAtlasTex(atlas.gl);
|
||||||
|
|
||||||
/* Destroy tile buffers */
|
/* Destroy tile buffers */
|
||||||
GLMeta::vaoFini(tiles.vao);
|
GLMeta::vaoFini(tiles.vao);
|
||||||
VBO::del(tiles.vbo);
|
VBO::del(tiles.vbo);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
/* Disconnect signal handlers */
|
/* Disconnect signal handlers */
|
||||||
tilesetCon.disconnect();
|
tilesetCon.disconnect();
|
||||||
|
@ -457,11 +433,7 @@ struct TilemapPrivate
|
||||||
int tsH = tileset->height();
|
int tsH = tileset->height();
|
||||||
atlas.efTilesetH = tsH - (tsH % 32);
|
atlas.efTilesetH = tsH - (tsH % 32);
|
||||||
|
|
||||||
#ifdef MKXPZ_RETRO
|
|
||||||
atlas.size = TileAtlas::minSize(atlas.efTilesetH, 2048); // TODO
|
|
||||||
#else
|
|
||||||
atlas.size = TileAtlas::minSize(atlas.efTilesetH, glState.caps.maxTexSize);
|
atlas.size = TileAtlas::minSize(atlas.efTilesetH, glState.caps.maxTexSize);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
if (atlas.size.x < 0)
|
if (atlas.size.x < 0)
|
||||||
throw Exception(Exception::MKXPError,
|
throw Exception(Exception::MKXPError,
|
||||||
|
@ -557,11 +529,9 @@ struct TilemapPrivate
|
||||||
{
|
{
|
||||||
updateAtlasInfo();
|
updateAtlasInfo();
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Aquire atlas tex */
|
/* Aquire atlas tex */
|
||||||
shState->releaseAtlasTex(atlas.gl);
|
shState->releaseAtlasTex(atlas.gl);
|
||||||
shState->requestAtlasTex(atlas.size.x, atlas.size.y, atlas.gl);
|
shState->requestAtlasTex(atlas.size.x, atlas.size.y, atlas.gl);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
atlasDirty = true;
|
atlasDirty = true;
|
||||||
}
|
}
|
||||||
|
@ -574,7 +544,6 @@ struct TilemapPrivate
|
||||||
|
|
||||||
TileAtlas::BlitVec blits = TileAtlas::calcBlits(atlas.efTilesetH, atlas.size);
|
TileAtlas::BlitVec blits = TileAtlas::calcBlits(atlas.efTilesetH, atlas.size);
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Clear atlas */
|
/* Clear atlas */
|
||||||
FBO::bind(atlas.gl.fbo);
|
FBO::bind(atlas.gl.fbo);
|
||||||
glState.clearColor.pushSet(Vec4());
|
glState.clearColor.pushSet(Vec4());
|
||||||
|
@ -586,7 +555,6 @@ struct TilemapPrivate
|
||||||
glState.clearColor.pop();
|
glState.clearColor.pop();
|
||||||
|
|
||||||
GLMeta::blitBegin(atlas.gl);
|
GLMeta::blitBegin(atlas.gl);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
/* Blit autotiles */
|
/* Blit autotiles */
|
||||||
for (size_t i = 0; i < atlas.usableATs.size(); ++i)
|
for (size_t i = 0; i < atlas.usableATs.size(); ++i)
|
||||||
|
@ -604,7 +572,6 @@ struct TilemapPrivate
|
||||||
Debug() << "BUG: High-res Tilemap blit autotiles not implemented";
|
Debug() << "BUG: High-res Tilemap blit autotiles not implemented";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
GLMeta::blitSource(autotile->getGLTypes());
|
GLMeta::blitSource(autotile->getGLTypes());
|
||||||
|
|
||||||
if (atW <= autotileW && tiles.animated && !atlas.smallATs[atInd])
|
if (atW <= autotileW && tiles.animated && !atlas.smallATs[atInd])
|
||||||
|
@ -630,21 +597,21 @@ struct TilemapPrivate
|
||||||
GLMeta::blitRectangle(IntRect(0, 0, blitW, blitH),
|
GLMeta::blitRectangle(IntRect(0, 0, blitW, blitH),
|
||||||
Vec2i(0, atInd*autotileH));
|
Vec2i(0, atInd*autotileH));
|
||||||
}
|
}
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
GLMeta::blitEnd();
|
GLMeta::blitEnd();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
/* Blit tileset */
|
/* Blit tileset */
|
||||||
if (tileset->megaSurface())
|
if (tileset->megaSurface())
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Mega surface tileset */
|
/* Mega surface tileset */
|
||||||
SDL_Surface *tsSurf = tileset->megaSurface();
|
SDL_Surface *tsSurf = tileset->megaSurface();
|
||||||
|
|
||||||
|
#ifdef MKXPZ_RETRO
|
||||||
|
if (false) // TODO: get from config
|
||||||
|
#else
|
||||||
if (shState->config().subImageFix)
|
if (shState->config().subImageFix)
|
||||||
|
#endif // MKXPZ_RETRO
|
||||||
{
|
{
|
||||||
/* Implementation for broken GL drivers */
|
/* Implementation for broken GL drivers */
|
||||||
FBO::bind(atlas.gl.fbo);
|
FBO::bind(atlas.gl.fbo);
|
||||||
|
@ -694,7 +661,6 @@ struct TilemapPrivate
|
||||||
|
|
||||||
GLMeta::subRectImageEnd();
|
GLMeta::subRectImageEnd();
|
||||||
}
|
}
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -703,7 +669,6 @@ struct TilemapPrivate
|
||||||
Debug() << "BUG: High-res Tilemap regular tileset not implemented";
|
Debug() << "BUG: High-res Tilemap regular tileset not implemented";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Regular tileset */
|
/* Regular tileset */
|
||||||
GLMeta::blitBegin(atlas.gl);
|
GLMeta::blitBegin(atlas.gl);
|
||||||
GLMeta::blitSource(tileset->getGLTypes());
|
GLMeta::blitSource(tileset->getGLTypes());
|
||||||
|
@ -717,7 +682,6 @@ struct TilemapPrivate
|
||||||
}
|
}
|
||||||
|
|
||||||
GLMeta::blitEnd();
|
GLMeta::blitEnd();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,7 +701,6 @@ struct TilemapPrivate
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
void handleAutotile(int x, int y, int tileInd, SVVector *array)
|
void handleAutotile(int x, int y, int tileInd, SVVector *array)
|
||||||
{
|
{
|
||||||
/* Which autotile [0-7] */
|
/* Which autotile [0-7] */
|
||||||
|
@ -780,7 +743,6 @@ struct TilemapPrivate
|
||||||
array->push_back(v[j]);
|
array->push_back(v[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
void handleTile(int x, int y, int z)
|
void handleTile(int x, int y, int z)
|
||||||
{
|
{
|
||||||
|
@ -797,7 +759,6 @@ struct TilemapPrivate
|
||||||
if (prio == -1)
|
if (prio == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
SVVector *targetArray;
|
SVVector *targetArray;
|
||||||
|
|
||||||
/* Prio 0 tiles are all part of the same ground layer */
|
/* Prio 0 tiles are all part of the same ground layer */
|
||||||
|
@ -833,17 +794,14 @@ struct TilemapPrivate
|
||||||
|
|
||||||
for (size_t i = 0; i < 4; ++i)
|
for (size_t i = 0; i < 4; ++i)
|
||||||
targetArray->push_back(v[i]);
|
targetArray->push_back(v[i]);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearQuadArrays()
|
void clearQuadArrays()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
groundVert.clear();
|
groundVert.clear();
|
||||||
|
|
||||||
for (size_t i = 0; i < zlayersMax; ++i)
|
for (size_t i = 0; i < zlayersMax; ++i)
|
||||||
zlayerVert[i].clear();
|
zlayerVert[i].clear();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildQuadArray()
|
void buildQuadArray()
|
||||||
|
@ -880,11 +838,7 @@ struct TilemapPrivate
|
||||||
|
|
||||||
static size_t quadDataSize(size_t quadCount)
|
static size_t quadDataSize(size_t quadCount)
|
||||||
{
|
{
|
||||||
#ifdef MKXPZ_RETRO
|
|
||||||
return 0; // TODO
|
|
||||||
#else
|
|
||||||
return quadCount * sizeof(SVertex) * 4;
|
return quadCount * sizeof(SVertex) * 4;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t zlayerSize(size_t index)
|
size_t zlayerSize(size_t index)
|
||||||
|
@ -894,7 +848,6 @@ struct TilemapPrivate
|
||||||
|
|
||||||
void uploadBuffers()
|
void uploadBuffers()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Calculate total quad count */
|
/* Calculate total quad count */
|
||||||
size_t groundQuadCount = groundVert.size() / 4;
|
size_t groundQuadCount = groundVert.size() / 4;
|
||||||
size_t quadCount = groundQuadCount;
|
size_t quadCount = groundQuadCount;
|
||||||
|
@ -925,12 +878,10 @@ struct TilemapPrivate
|
||||||
|
|
||||||
/* Ensure global IBO size */
|
/* Ensure global IBO size */
|
||||||
shState->ensureQuadIBO(quadCount);
|
shState->ensureQuadIBO(quadCount);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bindShader(ShaderBase *&shaderVar)
|
void bindShader(ShaderBase *&shaderVar)
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
if (tiles.animated || color->hasEffect() || tone->hasEffect() || opacity != 255)
|
if (tiles.animated || color->hasEffect() || tone->hasEffect() || opacity != 255)
|
||||||
{
|
{
|
||||||
TilemapShader &tilemapShader = shState->shaders().tilemap;
|
TilemapShader &tilemapShader = shState->shaders().tilemap;
|
||||||
|
@ -950,15 +901,12 @@ struct TilemapPrivate
|
||||||
}
|
}
|
||||||
|
|
||||||
shaderVar->applyViewportProj();
|
shaderVar->applyViewportProj();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void bindAtlas(ShaderBase &shader)
|
void bindAtlas(ShaderBase &shader)
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
TEX::bind(atlas.gl.tex);
|
TEX::bind(atlas.gl.tex);
|
||||||
shader.setTexSize(atlas.size);
|
shader.setTexSize(atlas.size);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateActiveElements(std::vector<int> &zlayerInd)
|
void updateActiveElements(std::vector<int> &zlayerInd)
|
||||||
|
@ -986,11 +934,9 @@ struct TilemapPrivate
|
||||||
/* Only allocate elements for non-emtpy zlayers */
|
/* Only allocate elements for non-emtpy zlayers */
|
||||||
std::vector<int> zlayerInd;
|
std::vector<int> zlayerInd;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
for (size_t i = 0; i < zlayersMax; ++i)
|
for (size_t i = 0; i < zlayersMax; ++i)
|
||||||
if (zlayerVert[i].size() > 0)
|
if (zlayerVert[i].size() > 0)
|
||||||
zlayerInd.push_back(i);
|
zlayerInd.push_back(i);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
updateActiveElements(zlayerInd);
|
updateActiveElements(zlayerInd);
|
||||||
elem.activeLayers = zlayerInd.size();
|
elem.activeLayers = zlayerInd.size();
|
||||||
|
@ -1042,7 +988,6 @@ struct TilemapPrivate
|
||||||
ZLayer *batchHead = zlayers[i];
|
ZLayer *batchHead = zlayers[i];
|
||||||
batchHead->batchedFlag = false;
|
batchHead->batchedFlag = false;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
GLsizei vboBatchCount = batchHead->vboCount;
|
GLsizei vboBatchCount = batchHead->vboCount;
|
||||||
IntruListLink<SceneElement> *iter = &batchHead->link;
|
IntruListLink<SceneElement> *iter = &batchHead->link;
|
||||||
|
|
||||||
|
@ -1062,7 +1007,6 @@ struct TilemapPrivate
|
||||||
}
|
}
|
||||||
|
|
||||||
batchHead->vboBatchCount = vboBatchCount;
|
batchHead->vboBatchCount = vboBatchCount;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
--i;
|
--i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1135,9 +1079,7 @@ struct TilemapPrivate
|
||||||
|
|
||||||
GroundLayer::GroundLayer(TilemapPrivate *p, Viewport *viewport)
|
GroundLayer::GroundLayer(TilemapPrivate *p, Viewport *viewport)
|
||||||
: ViewportElement(viewport, 0),
|
: ViewportElement(viewport, 0),
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
vboCount(0),
|
vboCount(0),
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
p(p)
|
p(p)
|
||||||
{
|
{
|
||||||
onGeometryChange(scene->getGeometry());
|
onGeometryChange(scene->getGeometry());
|
||||||
|
@ -1145,14 +1087,11 @@ GroundLayer::GroundLayer(TilemapPrivate *p, Viewport *viewport)
|
||||||
|
|
||||||
void GroundLayer::updateVboCount()
|
void GroundLayer::updateVboCount()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
vboCount = p->zlayerBases[0] * 6;
|
vboCount = p->zlayerBases[0] * 6;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroundLayer::draw()
|
void GroundLayer::draw()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
if (p->groundVert.size() == 0)
|
if (p->groundVert.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1176,14 +1115,11 @@ void GroundLayer::draw()
|
||||||
p->flashMap.draw(flashAlpha[p->flashAlphaIdx] / 255.f, p->dispPos);
|
p->flashMap.draw(flashAlpha[p->flashAlphaIdx] / 255.f, p->dispPos);
|
||||||
|
|
||||||
glState.blendMode.pop();
|
glState.blendMode.pop();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroundLayer::drawInt()
|
void GroundLayer::drawInt()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
gl.DrawElements(GL_TRIANGLES, vboCount, _GL_INDEX_TYPE, (GLvoid*) 0);
|
gl.DrawElements(GL_TRIANGLES, vboCount, _GL_INDEX_TYPE, (GLvoid*) 0);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroundLayer::onGeometryChange(const Scene::Geometry &geo)
|
void GroundLayer::onGeometryChange(const Scene::Geometry &geo)
|
||||||
|
@ -1193,15 +1129,11 @@ void GroundLayer::onGeometryChange(const Scene::Geometry &geo)
|
||||||
|
|
||||||
ZLayer::ZLayer(TilemapPrivate *p, Viewport *viewport)
|
ZLayer::ZLayer(TilemapPrivate *p, Viewport *viewport)
|
||||||
: ViewportElement(viewport, 0),
|
: ViewportElement(viewport, 0),
|
||||||
#ifdef MKXPZ_RETRO
|
|
||||||
index(0)
|
|
||||||
#else
|
|
||||||
index(0),
|
index(0),
|
||||||
vboOffset(0),
|
vboOffset(0),
|
||||||
vboCount(0),
|
vboCount(0),
|
||||||
p(p),
|
p(p),
|
||||||
vboBatchCount(0)
|
vboBatchCount(0)
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void ZLayer::setIndex(int value)
|
void ZLayer::setIndex(int value)
|
||||||
|
@ -1211,10 +1143,8 @@ void ZLayer::setIndex(int value)
|
||||||
z = calculateZ(p, index);
|
z = calculateZ(p, index);
|
||||||
scene->reinsert(*this);
|
scene->reinsert(*this);
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
vboOffset = p->zlayerBases[index] * sizeof(index_t) * 6;
|
vboOffset = p->zlayerBases[index] * sizeof(index_t) * 6;
|
||||||
vboCount = p->zlayerSize(index) * 6;
|
vboCount = p->zlayerSize(index) * 6;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZLayer::draw()
|
void ZLayer::draw()
|
||||||
|
@ -1227,7 +1157,6 @@ void ZLayer::draw()
|
||||||
p->bindShader(shader);
|
p->bindShader(shader);
|
||||||
p->bindAtlas(*shader);
|
p->bindAtlas(*shader);
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
glState.blendMode.pushSet(p->blendType);
|
glState.blendMode.pushSet(p->blendType);
|
||||||
|
|
||||||
GLMeta::vaoBind(p->tiles.vao);
|
GLMeta::vaoBind(p->tiles.vao);
|
||||||
|
@ -1238,14 +1167,11 @@ void ZLayer::draw()
|
||||||
GLMeta::vaoUnbind(p->tiles.vao);
|
GLMeta::vaoUnbind(p->tiles.vao);
|
||||||
|
|
||||||
glState.blendMode.pop();
|
glState.blendMode.pop();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZLayer::drawInt()
|
void ZLayer::drawInt()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
gl.DrawElements(GL_TRIANGLES, vboBatchCount, _GL_INDEX_TYPE, (GLvoid*) vboOffset);
|
gl.DrawElements(GL_TRIANGLES, vboBatchCount, _GL_INDEX_TYPE, (GLvoid*) vboOffset);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ZLayer::calculateZ(TilemapPrivate *p, int index)
|
int ZLayer::calculateZ(TilemapPrivate *p, int index)
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
#include "etc-internal.h"
|
#include "etc-internal.h"
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
#include "tilequad.h"
|
#include "tilequad.h"
|
||||||
|
|
||||||
#include "gl-util.h"
|
#include "gl-util.h"
|
||||||
|
@ -34,7 +33,6 @@
|
||||||
#include "quadarray.h"
|
#include "quadarray.h"
|
||||||
#include "texpool.h"
|
#include "texpool.h"
|
||||||
#include "glstate.h"
|
#include "glstate.h"
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
#include "sigslot/signal.hpp"
|
#include "sigslot/signal.hpp"
|
||||||
|
|
||||||
|
@ -120,7 +118,6 @@ static const uint8_t pauseAniAlpha[] =
|
||||||
|
|
||||||
static elementsN(pauseAniAlpha);
|
static elementsN(pauseAniAlpha);
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Points to an array of quads which it doesn't own.
|
/* Points to an array of quads which it doesn't own.
|
||||||
* Useful for setting alpha of quads stored inside
|
* Useful for setting alpha of quads stored inside
|
||||||
* bigger arrays */
|
* bigger arrays */
|
||||||
|
@ -139,7 +136,6 @@ struct QuadChunk
|
||||||
vert[i].color.w = value;
|
vert[i].color.w = value;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
/* Vocabulary:
|
/* Vocabulary:
|
||||||
*
|
*
|
||||||
|
@ -200,7 +196,6 @@ struct WindowPrivate
|
||||||
bool opacityDirty;
|
bool opacityDirty;
|
||||||
bool baseTexDirty;
|
bool baseTexDirty;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
ColorQuadArray baseQuadArray;
|
ColorQuadArray baseQuadArray;
|
||||||
|
|
||||||
/* Used when opacity < 255 */
|
/* Used when opacity < 255 */
|
||||||
|
@ -210,7 +205,6 @@ struct WindowPrivate
|
||||||
QuadChunk backgroundVert;
|
QuadChunk backgroundVert;
|
||||||
|
|
||||||
Quad baseTexQuad;
|
Quad baseTexQuad;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
struct WindowControls : public ViewportElement
|
struct WindowControls : public ViewportElement
|
||||||
{
|
{
|
||||||
|
@ -239,7 +233,6 @@ struct WindowPrivate
|
||||||
|
|
||||||
WindowControls controlsElement;
|
WindowControls controlsElement;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
ColorQuadArray controlsQuadArray;
|
ColorQuadArray controlsQuadArray;
|
||||||
int controlsQuadCount;
|
int controlsQuadCount;
|
||||||
|
|
||||||
|
@ -247,7 +240,6 @@ struct WindowPrivate
|
||||||
|
|
||||||
QuadChunk pauseAniVert;
|
QuadChunk pauseAniVert;
|
||||||
QuadChunk cursorVert;
|
QuadChunk cursorVert;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
uint8_t cursorAniAlphaIdx;
|
uint8_t cursorAniAlphaIdx;
|
||||||
uint8_t pauseAniAlphaIdx;
|
uint8_t pauseAniAlphaIdx;
|
||||||
|
@ -280,11 +272,9 @@ struct WindowPrivate
|
||||||
{
|
{
|
||||||
refreshCursorRectCon();
|
refreshCursorRectCon();
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
controlsQuadArray.resize(14);
|
controlsQuadArray.resize(14);
|
||||||
cursorVert.count = 9;
|
cursorVert.count = 9;
|
||||||
pauseAniVert.count = 1;
|
pauseAniVert.count = 1;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
prepareCon = shState->prepareDraw.connect
|
prepareCon = shState->prepareDraw.connect
|
||||||
(&WindowPrivate::prepare, this);
|
(&WindowPrivate::prepare, this);
|
||||||
|
@ -292,9 +282,7 @@ struct WindowPrivate
|
||||||
|
|
||||||
~WindowPrivate()
|
~WindowPrivate()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
shState->texPool().release(baseTex);
|
shState->texPool().release(baseTex);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
cursorRectCon.disconnect();
|
cursorRectCon.disconnect();
|
||||||
prepareCon.disconnect();
|
prepareCon.disconnect();
|
||||||
|
|
||||||
|
@ -345,7 +333,6 @@ struct WindowPrivate
|
||||||
cornerRects.bl = IntRect(0, h-16, 16, 16);
|
cornerRects.bl = IntRect(0, h-16, 16, 16);
|
||||||
cornerRects.br = IntRect(w-16, h-16, 16, 16);
|
cornerRects.br = IntRect(w-16, h-16, 16, 16);
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Required quad count */
|
/* Required quad count */
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
@ -402,7 +389,6 @@ struct WindowPrivate
|
||||||
|
|
||||||
FloatRect texRect = FloatRect(0, 0, size.x, size.y);
|
FloatRect texRect = FloatRect(0, 0, size.x, size.y);
|
||||||
baseTexQuad.setTexPosRect(texRect, texRect);
|
baseTexQuad.setTexPosRect(texRect, texRect);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
opacityDirty = true;
|
opacityDirty = true;
|
||||||
baseTexDirty = true;
|
baseTexDirty = true;
|
||||||
|
@ -410,12 +396,10 @@ struct WindowPrivate
|
||||||
|
|
||||||
void updateBaseAlpha()
|
void updateBaseAlpha()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* This is always applied unconditionally */
|
/* This is always applied unconditionally */
|
||||||
backgroundVert.setAlpha(backOpacity.norm);
|
backgroundVert.setAlpha(backOpacity.norm);
|
||||||
|
|
||||||
baseTexQuad.setColor(Vec4(1, 1, 1, opacity.norm));
|
baseTexQuad.setColor(Vec4(1, 1, 1, opacity.norm));
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
baseTexDirty = true;
|
baseTexDirty = true;
|
||||||
}
|
}
|
||||||
|
@ -423,7 +407,6 @@ struct WindowPrivate
|
||||||
void ensureBaseTexReady()
|
void ensureBaseTexReady()
|
||||||
{
|
{
|
||||||
/* Make sure texture is big enough */
|
/* Make sure texture is big enough */
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
int newW = baseTex.width;
|
int newW = baseTex.width;
|
||||||
int newH = baseTex.height;
|
int newH = baseTex.height;
|
||||||
bool resizeNeeded = false;
|
bool resizeNeeded = false;
|
||||||
|
@ -444,14 +427,12 @@ struct WindowPrivate
|
||||||
|
|
||||||
shState->texPool().release(baseTex);
|
shState->texPool().release(baseTex);
|
||||||
baseTex = shState->texPool().request(newW, newH);
|
baseTex = shState->texPool().request(newW, newH);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
baseTexDirty = true;
|
baseTexDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void redrawBaseTex()
|
void redrawBaseTex()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
/* Discard old buffer */
|
/* Discard old buffer */
|
||||||
TEX::bind(baseTex.tex);
|
TEX::bind(baseTex.tex);
|
||||||
TEX::allocEmpty(baseTex.width, baseTex.height);
|
TEX::allocEmpty(baseTex.width, baseTex.height);
|
||||||
|
@ -470,7 +451,9 @@ struct WindowPrivate
|
||||||
FBO::clear();
|
FBO::clear();
|
||||||
|
|
||||||
/* Repaint base */
|
/* Repaint base */
|
||||||
|
#ifndef MKXPZ_RETRO // TODO
|
||||||
windowskin->bindTex(shader);
|
windowskin->bindTex(shader);
|
||||||
|
#endif // MKXPZ_RETRO
|
||||||
TEX::setSmooth(true);
|
TEX::setSmooth(true);
|
||||||
|
|
||||||
/* We need to blit the background without blending,
|
/* We need to blit the background without blending,
|
||||||
|
@ -490,12 +473,10 @@ struct WindowPrivate
|
||||||
glState.blendMode.pop();
|
glState.blendMode.pop();
|
||||||
glState.viewport.pop();
|
glState.viewport.pop();
|
||||||
TEX::setSmooth(false);
|
TEX::setSmooth(false);
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildControlsVert()
|
void buildControlsVert()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
Vertex *vert = controlsQuadArray.vertices.data();
|
Vertex *vert = controlsQuadArray.vertices.data();
|
||||||
|
|
||||||
|
@ -545,7 +526,6 @@ struct WindowPrivate
|
||||||
|
|
||||||
controlsQuadArray.commit();
|
controlsQuadArray.commit();
|
||||||
controlsQuadCount = i;
|
controlsQuadCount = i;
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepare()
|
void prepare()
|
||||||
|
@ -569,7 +549,6 @@ struct WindowPrivate
|
||||||
updateBaseQuadArray = true;
|
updateBaseQuadArray = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
if (updateBaseQuadArray)
|
if (updateBaseQuadArray)
|
||||||
baseQuadArray.commit();
|
baseQuadArray.commit();
|
||||||
|
|
||||||
|
@ -587,7 +566,6 @@ struct WindowPrivate
|
||||||
baseTexDirty = false;
|
baseTexDirty = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawBase()
|
void drawBase()
|
||||||
|
@ -598,7 +576,6 @@ struct WindowPrivate
|
||||||
if (size == Vec2i(0, 0))
|
if (size == Vec2i(0, 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
SimpleAlphaShader &shader = shState->shaders().simpleAlpha;
|
SimpleAlphaShader &shader = shState->shaders().simpleAlpha;
|
||||||
shader.bind();
|
shader.bind();
|
||||||
shader.applyViewportProj();
|
shader.applyViewportProj();
|
||||||
|
@ -620,7 +597,6 @@ struct WindowPrivate
|
||||||
|
|
||||||
TEX::setSmooth(false);
|
TEX::setSmooth(false);
|
||||||
}
|
}
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawControls()
|
void drawControls()
|
||||||
|
@ -644,7 +620,6 @@ struct WindowPrivate
|
||||||
const IntRect windowRect(efPos, size);
|
const IntRect windowRect(efPos, size);
|
||||||
const IntRect contentsRect(efPos + Vec2i(16), size - Vec2i(32));
|
const IntRect contentsRect(efPos + Vec2i(16), size - Vec2i(32));
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
glState.scissorTest.pushSet(true);
|
glState.scissorTest.pushSet(true);
|
||||||
glState.scissorBox.push();
|
glState.scissorBox.push();
|
||||||
glState.scissorBox.setIntersect(windowRect);
|
glState.scissorBox.setIntersect(windowRect);
|
||||||
|
@ -679,12 +654,10 @@ struct WindowPrivate
|
||||||
|
|
||||||
glState.scissorBox.pop();
|
glState.scissorBox.pop();
|
||||||
glState.scissorTest.pop();
|
glState.scissorTest.pop();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateControls()
|
void updateControls()
|
||||||
{
|
{
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
bool updateArray = false;
|
bool updateArray = false;
|
||||||
|
|
||||||
if (active && cursorVert.vert)
|
if (active && cursorVert.vert)
|
||||||
|
@ -709,7 +682,6 @@ struct WindowPrivate
|
||||||
|
|
||||||
if (updateArray)
|
if (updateArray)
|
||||||
controlsQuadArray.commit();
|
controlsQuadArray.commit();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void stepAnimations()
|
void stepAnimations()
|
||||||
|
@ -776,9 +748,7 @@ void Window::setWindowskin(Bitmap *value)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
value->ensureNonMega();
|
value->ensureNonMega();
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
|
|
||||||
p->windowskinDispCon = value->wasDisposed.connect(&WindowPrivate::windowskinDisposal, p);
|
p->windowskinDispCon = value->wasDisposed.connect(&WindowPrivate::windowskinDisposal, p);
|
||||||
}
|
}
|
||||||
|
@ -803,11 +773,9 @@ void Window::setContents(Bitmap *value)
|
||||||
|
|
||||||
p->contentsDispCon = value->wasDisposed.connect(&WindowPrivate::contentsDisposal, p);
|
p->contentsDispCon = value->wasDisposed.connect(&WindowPrivate::contentsDisposal, p);
|
||||||
|
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
value->ensureNonMega();
|
value->ensureNonMega();
|
||||||
|
|
||||||
p->contentsQuad.setTexPosRect(value->rect(), value->rect());
|
p->contentsQuad.setTexPosRect(value->rect(), value->rect());
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::setStretch(bool value)
|
void Window::setStretch(bool value)
|
||||||
|
@ -919,9 +887,7 @@ void Window::setContentsOpacity(int value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p->contentsOpacity = value;
|
p->contentsOpacity = value;
|
||||||
#ifndef MKXPZ_RETRO
|
|
||||||
p->contentsQuad.setColor(Vec4(1, 1, 1, p->contentsOpacity.norm));
|
p->contentsQuad.setColor(Vec4(1, 1, 1, p->contentsOpacity.norm));
|
||||||
#endif // MKXPZ_RETRO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::initDynAttribs()
|
void Window::initDynAttribs()
|
||||||
|
|
Loading…
Add table
Reference in a new issue