Provide general purpose Quad in GlobalState
This commit is contained in:
parent
e8a9873125
commit
f89cd2d207
|
@ -254,7 +254,7 @@ void Bitmap::stretchBlt(const IntRect &destRect,
|
||||||
shader.setSubRect(bltSubRect);
|
shader.setSubRect(bltSubRect);
|
||||||
shader.setOpacity(normOpacity);
|
shader.setOpacity(normOpacity);
|
||||||
|
|
||||||
Quad quad;
|
Quad &quad = gState->gpQuad();
|
||||||
quad.setTexPosRect(sourceRect, destRect);
|
quad.setTexPosRect(sourceRect, destRect);
|
||||||
quad.setColor(Vec4(1, 1, 1, normOpacity));
|
quad.setColor(Vec4(1, 1, 1, normOpacity));
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ void Bitmap::gradientFillRect(const IntRect &rect,
|
||||||
|
|
||||||
flush();
|
flush();
|
||||||
|
|
||||||
Quad quad;
|
Quad &quad = gState->gpQuad();
|
||||||
|
|
||||||
if (vertical)
|
if (vertical)
|
||||||
{
|
{
|
||||||
|
@ -405,8 +405,9 @@ void Bitmap::hueChange(int hue)
|
||||||
|
|
||||||
FloatRect texRect(rect());
|
FloatRect texRect(rect());
|
||||||
|
|
||||||
Quad quad;
|
Quad &quad = gState->gpQuad();
|
||||||
quad.setTexPosRect(texRect, texRect);
|
quad.setTexPosRect(texRect, texRect);
|
||||||
|
quad.setColor(Vec4(1, 1, 1, 1));
|
||||||
|
|
||||||
/* Calculate hue parameter */
|
/* Calculate hue parameter */
|
||||||
hue = wrapRange(hue, 0, 359);
|
hue = wrapRange(hue, 0, 359);
|
||||||
|
@ -521,7 +522,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
|
||||||
Tex::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA);
|
Tex::uploadSubImage(0, 0, txtSurf->w, txtSurf->h, txtSurf->pixels, GL_BGRA);
|
||||||
Tex::setSmooth(true);
|
Tex::setSmooth(true);
|
||||||
|
|
||||||
Quad quad;
|
Quad &quad = gState->gpQuad();
|
||||||
quad.setTexRect(FloatRect(0, 0, txtSurf->w, txtSurf->h));
|
quad.setTexRect(FloatRect(0, 0, txtSurf->w, txtSurf->h));
|
||||||
quad.setPosRect(posRect);
|
quad.setPosRect(posRect);
|
||||||
SDL_FreeSurface(txtSurf);
|
SDL_FreeSurface(txtSurf);
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "eventthread.h"
|
#include "eventthread.h"
|
||||||
#include "gl-util.h"
|
#include "gl-util.h"
|
||||||
#include "global-ibo.h"
|
#include "global-ibo.h"
|
||||||
|
#include "quad.h"
|
||||||
#include "binding.h"
|
#include "binding.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
@ -80,6 +81,8 @@ struct GlobalStatePrivate
|
||||||
|
|
||||||
TexFBO gpTexFBO;
|
TexFBO gpTexFBO;
|
||||||
|
|
||||||
|
Quad gpQuad;
|
||||||
|
|
||||||
unsigned int stampCounter;
|
unsigned int stampCounter;
|
||||||
|
|
||||||
GlobalStatePrivate(RGSSThreadData *threadData)
|
GlobalStatePrivate(RGSSThreadData *threadData)
|
||||||
|
@ -180,6 +183,7 @@ GSATT(HueShader&, hueShader)
|
||||||
GSATT(BltShader&, bltShader)
|
GSATT(BltShader&, bltShader)
|
||||||
GSATT(TexPool&, texPool)
|
GSATT(TexPool&, texPool)
|
||||||
GSATT(FontPool&, fontPool)
|
GSATT(FontPool&, fontPool)
|
||||||
|
GSATT(Quad&, gpQuad)
|
||||||
|
|
||||||
void GlobalState::setBindingData(void *data)
|
void GlobalState::setBindingData(void *data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,7 @@ struct GlobalIBO;
|
||||||
struct mrb_state;
|
struct mrb_state;
|
||||||
struct SDL_Window;
|
struct SDL_Window;
|
||||||
struct TexFBO;
|
struct TexFBO;
|
||||||
|
struct Quad;
|
||||||
|
|
||||||
class Scene;
|
class Scene;
|
||||||
class FileSystem;
|
class FileSystem;
|
||||||
|
@ -101,6 +102,8 @@ struct GlobalState
|
||||||
|
|
||||||
TexFBO &gpTexFBO(int minW, int minH);
|
TexFBO &gpTexFBO(int minW, int minH);
|
||||||
|
|
||||||
|
Quad &gpQuad();
|
||||||
|
|
||||||
/* Checks EventThread's shutdown request flag and if set,
|
/* Checks EventThread's shutdown request flag and if set,
|
||||||
* requests the binding to terminate. In this case, this
|
* requests the binding to terminate. In this case, this
|
||||||
* function will most likely not return */
|
* function will most likely not return */
|
||||||
|
|
Loading…
Reference in New Issue