mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 07:43:01 +01:00
Add Shader Palette Lookup
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform sampler2D uTexture;
|
uniform sampler2D uTexture;
|
||||||
|
|
||||||
in vec2 fPosition;
|
in vec2 fPosition;
|
||||||
in vec2 fTextureCoordinate;
|
in vec2 fTextureCoordinate;
|
||||||
|
|
||||||
layout (location = 0) out vec4 oColour;
|
out vec4 oColour;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec2 uScreenSize;
|
uniform ivec2 uScreenSize;
|
||||||
uniform ivec4 uBounds;
|
uniform ivec4 uBounds;
|
||||||
uniform ivec4 uTextureCoordinates;
|
uniform ivec4 uTextureCoordinates;
|
||||||
|
|
||||||
in int vIndex;
|
in uint vIndex;
|
||||||
|
|
||||||
out vec2 fPosition;
|
out vec2 fPosition;
|
||||||
out vec2 fTextureCoordinate;
|
out vec2 fTextureCoordinate;
|
||||||
@@ -13,22 +13,22 @@ void main()
|
|||||||
{
|
{
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
switch (vIndex) {
|
switch (vIndex) {
|
||||||
case 0:
|
case 0u:
|
||||||
pos = uBounds.xy;
|
pos = uBounds.xy;
|
||||||
fTextureCoordinate = uTextureCoordinates.xy;
|
fTextureCoordinate = uTextureCoordinates.xy;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1u:
|
||||||
pos = uBounds.zy;
|
pos = uBounds.zy;
|
||||||
fTextureCoordinate = uTextureCoordinates.zy;
|
fTextureCoordinate = uTextureCoordinates.zy;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2u:
|
||||||
pos = uBounds.zw;
|
|
||||||
fTextureCoordinate = uTextureCoordinates.zw;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
pos = uBounds.xw;
|
pos = uBounds.xw;
|
||||||
fTextureCoordinate = uTextureCoordinates.xw;
|
fTextureCoordinate = uTextureCoordinates.xw;
|
||||||
break;
|
break;
|
||||||
|
case 3u:
|
||||||
|
pos = uBounds.zw;
|
||||||
|
fTextureCoordinate = uTextureCoordinates.zw;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fPosition = pos;
|
fPosition = pos;
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec4 uClip;
|
uniform ivec4 uClip;
|
||||||
uniform int uFlags;
|
uniform int uFlags;
|
||||||
uniform vec4 uColour;
|
uniform vec4 uColour;
|
||||||
uniform sampler2D uTexture;
|
uniform usampler2D uTexture;
|
||||||
|
uniform vec4 uPalette[256];
|
||||||
|
|
||||||
in vec2 fPosition;
|
in vec2 fPosition;
|
||||||
in vec2 fTextureCoordinate;
|
in vec2 fTextureCoordinate;
|
||||||
|
|
||||||
layout (location = 0) out vec4 oColour;
|
out vec4 oColour;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
@@ -18,7 +19,7 @@ void main()
|
|||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 texel = texture(uTexture, fTextureCoordinate);
|
vec4 texel = uPalette[texture(uTexture, fTextureCoordinate).r];
|
||||||
if ((uFlags & 1) != 0)
|
if ((uFlags & 1) != 0)
|
||||||
{
|
{
|
||||||
oColour = vec4(uColour.rgb, uColour.a * texel.a);
|
oColour = vec4(uColour.rgb, uColour.a * texel.a);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec2 uScreenSize;
|
uniform ivec2 uScreenSize;
|
||||||
uniform ivec4 uBounds;
|
uniform ivec4 uBounds;
|
||||||
uniform ivec4 uTextureCoordinates;
|
uniform ivec4 uTextureCoordinates;
|
||||||
|
|
||||||
in int vIndex;
|
in uint vIndex;
|
||||||
|
|
||||||
out vec2 fPosition;
|
out vec2 fPosition;
|
||||||
out vec2 fTextureCoordinate;
|
out vec2 fTextureCoordinate;
|
||||||
@@ -13,22 +13,22 @@ void main()
|
|||||||
{
|
{
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
switch (vIndex) {
|
switch (vIndex) {
|
||||||
case 0:
|
case 0u:
|
||||||
pos = uBounds.xy;
|
pos = uBounds.xy;
|
||||||
fTextureCoordinate = uTextureCoordinates.xy;
|
fTextureCoordinate = uTextureCoordinates.xy;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1u:
|
||||||
pos = uBounds.zy;
|
pos = uBounds.zy;
|
||||||
fTextureCoordinate = uTextureCoordinates.zy;
|
fTextureCoordinate = uTextureCoordinates.zy;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2u:
|
||||||
pos = uBounds.zw;
|
|
||||||
fTextureCoordinate = uTextureCoordinates.zw;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
pos = uBounds.xw;
|
pos = uBounds.xw;
|
||||||
fTextureCoordinate = uTextureCoordinates.xw;
|
fTextureCoordinate = uTextureCoordinates.xw;
|
||||||
break;
|
break;
|
||||||
|
case 3u:
|
||||||
|
pos = uBounds.zw;
|
||||||
|
fTextureCoordinate = uTextureCoordinates.zw;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fPosition = pos;
|
fPosition = pos;
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec4 uClip;
|
uniform ivec4 uClip;
|
||||||
uniform sampler2D uTextureMask;
|
uniform usampler2D uTextureMask;
|
||||||
uniform sampler2D uTextureColour;
|
uniform usampler2D uTextureColour;
|
||||||
|
uniform vec4 uPalette[256];
|
||||||
|
|
||||||
in vec2 fPosition;
|
in vec2 fPosition;
|
||||||
in vec2 fTextureCoordinate;
|
in vec2 fTextureCoordinate;
|
||||||
|
|
||||||
layout (location = 0) out vec4 oColour;
|
out vec4 oColour;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
@@ -17,7 +18,7 @@ void main()
|
|||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 mask = texture(uTextureMask, fTextureCoordinate);
|
vec4 mask = uPalette[texture(uTextureMask, fTextureCoordinate).r];
|
||||||
vec4 colour = texture(uTextureColour, fTextureCoordinate);
|
vec4 colour = uPalette[texture(uTextureColour, fTextureCoordinate).r];
|
||||||
oColour = colour * mask;
|
oColour = colour * mask;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec2 uScreenSize;
|
uniform ivec2 uScreenSize;
|
||||||
uniform ivec4 uBounds;
|
uniform ivec4 uBounds;
|
||||||
|
|
||||||
in int vIndex;
|
in uint vIndex;
|
||||||
|
|
||||||
out vec2 fPosition;
|
out vec2 fPosition;
|
||||||
out vec2 fTextureCoordinate;
|
out vec2 fTextureCoordinate;
|
||||||
@@ -12,22 +12,22 @@ void main()
|
|||||||
{
|
{
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
switch (vIndex) {
|
switch (vIndex) {
|
||||||
case 0:
|
case 0u:
|
||||||
pos = uBounds.xy;
|
pos = uBounds.xy;
|
||||||
fTextureCoordinate = vec2(0, 0);
|
fTextureCoordinate = vec2(0, 0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1u:
|
||||||
pos = uBounds.zy;
|
pos = uBounds.zy;
|
||||||
fTextureCoordinate = vec2(1, 0);
|
fTextureCoordinate = vec2(1, 0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2u:
|
||||||
pos = uBounds.zw;
|
|
||||||
fTextureCoordinate = vec2(1, 1);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
pos = uBounds.xw;
|
pos = uBounds.xw;
|
||||||
fTextureCoordinate = vec2(0, 1);
|
fTextureCoordinate = vec2(0, 1);
|
||||||
break;
|
break;
|
||||||
|
case 3u:
|
||||||
|
pos = uBounds.zw;
|
||||||
|
fTextureCoordinate = vec2(1, 1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fPosition = pos;
|
fPosition = pos;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec2 uScreenSize;
|
uniform ivec2 uScreenSize;
|
||||||
uniform ivec4 uClip;
|
uniform ivec4 uClip;
|
||||||
@@ -6,7 +6,7 @@ uniform vec4 uColour;
|
|||||||
|
|
||||||
in vec2 fPosition;
|
in vec2 fPosition;
|
||||||
|
|
||||||
layout (location = 0) out vec4 oColour;
|
out vec4 oColour;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec2 uScreenSize;
|
uniform ivec2 uScreenSize;
|
||||||
uniform ivec4 uBounds;
|
uniform ivec4 uBounds;
|
||||||
|
|
||||||
in int vIndex;
|
in uint vIndex;
|
||||||
|
|
||||||
out vec2 fPosition;
|
out vec2 fPosition;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
if (vIndex == 0)
|
if (vIndex == 0u)
|
||||||
{
|
{
|
||||||
pos = uBounds.xy;
|
pos = uBounds.xy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec2 uScreenSize;
|
uniform ivec2 uScreenSize;
|
||||||
uniform ivec4 uClip;
|
uniform ivec4 uClip;
|
||||||
@@ -9,7 +9,7 @@ uniform ivec4 uBounds;
|
|||||||
|
|
||||||
in vec2 fPosition;
|
in vec2 fPosition;
|
||||||
|
|
||||||
layout (location = 0) out vec4 oColour;
|
out vec4 oColour;
|
||||||
|
|
||||||
float getluma(vec3 colour)
|
float getluma(vec3 colour)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#version 330
|
#version 150
|
||||||
|
|
||||||
uniform ivec2 uScreenSize;
|
uniform ivec2 uScreenSize;
|
||||||
uniform ivec4 uBounds;
|
uniform ivec4 uBounds;
|
||||||
|
|
||||||
in int vIndex;
|
in uint vIndex;
|
||||||
|
|
||||||
out vec2 fPosition;
|
out vec2 fPosition;
|
||||||
|
|
||||||
@@ -11,18 +11,18 @@ void main()
|
|||||||
{
|
{
|
||||||
vec2 pos;
|
vec2 pos;
|
||||||
switch (vIndex) {
|
switch (vIndex) {
|
||||||
case 0:
|
case 0u:
|
||||||
pos = uBounds.xy;
|
pos = uBounds.xy;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1u:
|
||||||
pos = uBounds.zy;
|
pos = uBounds.zy;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2u:
|
||||||
pos = uBounds.zw;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
pos = uBounds.xw;
|
pos = uBounds.xw;
|
||||||
break;
|
break;
|
||||||
|
case 3u:
|
||||||
|
pos = uBounds.zw;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fPosition = pos;
|
fPosition = pos;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ CopyFramebufferShader::CopyFramebufferShader() : OpenGLShaderProgram("copyframeb
|
|||||||
glGenBuffers(1, &_vbo);
|
glGenBuffers(1, &_vbo);
|
||||||
glGenVertexArrays(1, &_vao);
|
glGenVertexArrays(1, &_vao);
|
||||||
|
|
||||||
vec2i vertices[] = { 0, 1, 2, 3 };
|
GLuint vertices[] = { 0, 1, 2, 2, 1, 3 };
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ void CopyFramebufferShader::SetTexture(GLuint texture)
|
|||||||
void CopyFramebufferShader::Draw()
|
void CopyFramebufferShader::Draw()
|
||||||
{
|
{
|
||||||
glBindVertexArray(_vao);
|
glBindVertexArray(_vao);
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* DISABLE_OPENGL */
|
#endif /* DISABLE_OPENGL */
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ DrawImageMaskedShader::DrawImageMaskedShader() : OpenGLShaderProgram("drawimagem
|
|||||||
glGenBuffers(1, &_vbo);
|
glGenBuffers(1, &_vbo);
|
||||||
glGenVertexArrays(1, &_vao);
|
glGenVertexArrays(1, &_vao);
|
||||||
|
|
||||||
vec2i vertices[] = { 0, 1, 2, 3 };
|
GLuint vertices[] = { 0, 1, 2, 2, 1, 3 };
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||||
|
|
||||||
@@ -53,6 +53,7 @@ void DrawImageMaskedShader::GetLocations()
|
|||||||
uBounds = GetUniformLocation("uBounds");
|
uBounds = GetUniformLocation("uBounds");
|
||||||
uTextureMask = GetUniformLocation("uTextureMask");
|
uTextureMask = GetUniformLocation("uTextureMask");
|
||||||
uTextureColour = GetUniformLocation("uTextureColour");
|
uTextureColour = GetUniformLocation("uTextureColour");
|
||||||
|
uPalette = GetUniformLocation("uPalette");
|
||||||
|
|
||||||
vIndex = GetAttributeLocation("vIndex");
|
vIndex = GetAttributeLocation("vIndex");
|
||||||
}
|
}
|
||||||
@@ -82,12 +83,17 @@ void DrawImageMaskedShader::SetTextureColour(GLuint texture)
|
|||||||
OpenGLAPI::SetTexture2D(1, texture);
|
OpenGLAPI::SetTexture2D(1, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawImageMaskedShader::SetPalette(const vec4f *glPalette)
|
||||||
|
{
|
||||||
|
glUniform4fv(uPalette, 256, (const GLfloat *) glPalette);
|
||||||
|
}
|
||||||
|
|
||||||
void DrawImageMaskedShader::Draw(sint32 left, sint32 top, sint32 right, sint32 bottom)
|
void DrawImageMaskedShader::Draw(sint32 left, sint32 top, sint32 right, sint32 bottom)
|
||||||
{
|
{
|
||||||
SetBounds(left, top, right, bottom);
|
SetBounds(left, top, right, bottom);
|
||||||
|
|
||||||
glBindVertexArray(_vao);
|
glBindVertexArray(_vao);
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* DISABLE_OPENGL */
|
#endif /* DISABLE_OPENGL */
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "GLSLTypes.h"
|
#include "GLSLTypes.h"
|
||||||
#include "OpenGLShaderProgram.h"
|
#include "OpenGLShaderProgram.h"
|
||||||
|
#include <SDL_pixels.h>
|
||||||
|
|
||||||
class DrawImageMaskedShader : public OpenGLShaderProgram
|
class DrawImageMaskedShader : public OpenGLShaderProgram
|
||||||
{
|
{
|
||||||
@@ -27,6 +28,7 @@ private:
|
|||||||
GLuint uBounds;
|
GLuint uBounds;
|
||||||
GLuint uTextureMask;
|
GLuint uTextureMask;
|
||||||
GLuint uTextureColour;
|
GLuint uTextureColour;
|
||||||
|
GLuint uPalette;
|
||||||
|
|
||||||
GLuint vIndex;
|
GLuint vIndex;
|
||||||
|
|
||||||
@@ -42,6 +44,7 @@ public:
|
|||||||
void SetBounds(sint32 left, sint32 top, sint32 right, sint32 bottom);
|
void SetBounds(sint32 left, sint32 top, sint32 right, sint32 bottom);
|
||||||
void SetTextureMask(GLuint texture);
|
void SetTextureMask(GLuint texture);
|
||||||
void SetTextureColour(GLuint texture);
|
void SetTextureColour(GLuint texture);
|
||||||
|
void SetPalette(const vec4f *glPalette);
|
||||||
void Draw(sint32 left, sint32 top, sint32 right, sint32 bottom);
|
void Draw(sint32 left, sint32 top, sint32 right, sint32 bottom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ DrawImageShader::DrawImageShader() : OpenGLShaderProgram("drawimage")
|
|||||||
glGenBuffers(1, &_vbo);
|
glGenBuffers(1, &_vbo);
|
||||||
glGenVertexArrays(1, &_vao);
|
glGenVertexArrays(1, &_vao);
|
||||||
|
|
||||||
vec2i vertices[] = { 0, 1, 2, 3 };
|
GLuint vertices[] = { 0, 1, 2, 2, 1, 3 };
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||||
|
|
||||||
@@ -56,6 +56,7 @@ void DrawImageShader::GetLocations()
|
|||||||
uTexture = GetUniformLocation("uTexture");
|
uTexture = GetUniformLocation("uTexture");
|
||||||
uColour = GetUniformLocation("uColour");
|
uColour = GetUniformLocation("uColour");
|
||||||
uFlags = GetUniformLocation("uFlags");
|
uFlags = GetUniformLocation("uFlags");
|
||||||
|
uPalette = GetUniformLocation("uPalette");
|
||||||
|
|
||||||
vIndex = GetAttributeLocation("vIndex");
|
vIndex = GetAttributeLocation("vIndex");
|
||||||
}
|
}
|
||||||
@@ -95,12 +96,17 @@ void DrawImageShader::SetFlags(uint32 flags)
|
|||||||
glUniform1i(uFlags, flags);
|
glUniform1i(uFlags, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawImageShader::SetPalette(const vec4f *glPalette)
|
||||||
|
{
|
||||||
|
glUniform4fv(uPalette, 256, (const GLfloat *) glPalette);
|
||||||
|
}
|
||||||
|
|
||||||
void DrawImageShader::Draw(sint32 left, sint32 top, sint32 right, sint32 bottom)
|
void DrawImageShader::Draw(sint32 left, sint32 top, sint32 right, sint32 bottom)
|
||||||
{
|
{
|
||||||
SetBounds(left, top, right, bottom);
|
SetBounds(left, top, right, bottom);
|
||||||
|
|
||||||
glBindVertexArray(_vao);
|
glBindVertexArray(_vao);
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* DISABLE_OPENGL */
|
#endif /* DISABLE_OPENGL */
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "GLSLTypes.h"
|
#include "GLSLTypes.h"
|
||||||
#include "OpenGLShaderProgram.h"
|
#include "OpenGLShaderProgram.h"
|
||||||
|
#include <SDL_pixels.h>
|
||||||
|
|
||||||
class DrawImageShader : public OpenGLShaderProgram
|
class DrawImageShader : public OpenGLShaderProgram
|
||||||
{
|
{
|
||||||
@@ -29,11 +30,14 @@ private:
|
|||||||
GLuint uTexture;
|
GLuint uTexture;
|
||||||
GLuint uColour;
|
GLuint uColour;
|
||||||
GLuint uFlags;
|
GLuint uFlags;
|
||||||
|
GLuint uPalette;
|
||||||
|
|
||||||
GLuint vIndex;
|
GLuint vIndex;
|
||||||
|
|
||||||
GLuint _vbo;
|
GLuint _vbo;
|
||||||
GLuint _vao;
|
GLuint _vao;
|
||||||
|
|
||||||
|
SDL_Color _palette[256];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DrawImageShader();
|
DrawImageShader();
|
||||||
@@ -46,7 +50,7 @@ public:
|
|||||||
void SetTexture(GLuint texture);
|
void SetTexture(GLuint texture);
|
||||||
void SetColour(vec4f colour);
|
void SetColour(vec4f colour);
|
||||||
void SetFlags(uint32 flags);
|
void SetFlags(uint32 flags);
|
||||||
|
void SetPalette(const vec4f *glPalette);
|
||||||
void Draw(sint32 left, sint32 top, sint32 right, sint32 bottom);
|
void Draw(sint32 left, sint32 top, sint32 right, sint32 bottom);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ DrawLineShader::DrawLineShader() : OpenGLShaderProgram("drawline")
|
|||||||
glGenBuffers(1, &_vbo);
|
glGenBuffers(1, &_vbo);
|
||||||
glGenVertexArrays(1, &_vao);
|
glGenVertexArrays(1, &_vao);
|
||||||
|
|
||||||
vec2i vertices[] = { 0, 1 };
|
GLuint vertices[] = { 0, 1 };
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ FillRectShader::FillRectShader() : OpenGLShaderProgram("fillrect")
|
|||||||
glGenBuffers(1, &_vbo);
|
glGenBuffers(1, &_vbo);
|
||||||
glGenVertexArrays(1, &_vao);
|
glGenVertexArrays(1, &_vao);
|
||||||
|
|
||||||
vec2i vertices[] = { 0, 1, 2, 3 };
|
GLuint vertices[] = { 0, 1, 2, 2, 1, 3 };
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ void FillRectShader::Draw(sint32 left, sint32 top, sint32 right, sint32 bottom)
|
|||||||
SetBounds(left, top, right, bottom);
|
SetBounds(left, top, right, bottom);
|
||||||
|
|
||||||
glBindVertexArray(_vao);
|
glBindVertexArray(_vao);
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
glDrawArrays(GL_TRIANGLES, 0, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* DISABLE_OPENGL */
|
#endif /* DISABLE_OPENGL */
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ static const char * TryLoadAllProcAddresses()
|
|||||||
SetupOpenGLFunction(glEnd);
|
SetupOpenGLFunction(glEnd);
|
||||||
SetupOpenGLFunction(glGenTextures);
|
SetupOpenGLFunction(glGenTextures);
|
||||||
SetupOpenGLFunction(glGetError);
|
SetupOpenGLFunction(glGetError);
|
||||||
|
SetupOpenGLFunction(glPixelStorei);
|
||||||
SetupOpenGLFunction(glReadPixels);
|
SetupOpenGLFunction(glReadPixels);
|
||||||
SetupOpenGLFunction(glTexImage2D);
|
SetupOpenGLFunction(glTexImage2D);
|
||||||
SetupOpenGLFunction(glTexParameteri);
|
SetupOpenGLFunction(glTexParameteri);
|
||||||
@@ -101,6 +102,7 @@ static const char * TryLoadAllProcAddresses()
|
|||||||
SetupOpenGLFunction(glUniform2i);
|
SetupOpenGLFunction(glUniform2i);
|
||||||
SetupOpenGLFunction(glUniform4f);
|
SetupOpenGLFunction(glUniform4f);
|
||||||
SetupOpenGLFunction(glUniform4i);
|
SetupOpenGLFunction(glUniform4i);
|
||||||
|
SetupOpenGLFunction(glUniform4fv);
|
||||||
SetupOpenGLFunction(glUseProgram);
|
SetupOpenGLFunction(glUseProgram);
|
||||||
SetupOpenGLFunction(glVertexAttribIPointer);
|
SetupOpenGLFunction(glVertexAttribIPointer);
|
||||||
SetupOpenGLFunction(glVertexAttribPointer);
|
SetupOpenGLFunction(glVertexAttribPointer);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#define glEnd __static__glEnd
|
#define glEnd __static__glEnd
|
||||||
#define glGenTextures __static__glGenTextures
|
#define glGenTextures __static__glGenTextures
|
||||||
#define glGetError __static__glGetError
|
#define glGetError __static__glGetError
|
||||||
|
#define glPixelStorei __static__glPixelStorei
|
||||||
#define glReadPixels __static__glReadPixels
|
#define glReadPixels __static__glReadPixels
|
||||||
#define glTexImage2D __static__glTexImage2D
|
#define glTexImage2D __static__glTexImage2D
|
||||||
#define glTexParameteri __static__glTexParameteri
|
#define glTexParameteri __static__glTexParameteri
|
||||||
@@ -61,6 +62,7 @@
|
|||||||
#undef glEnd
|
#undef glEnd
|
||||||
#undef glGenTextures
|
#undef glGenTextures
|
||||||
#undef glGetError
|
#undef glGetError
|
||||||
|
#undef glPixelStorei
|
||||||
#undef glReadPixels
|
#undef glReadPixels
|
||||||
#undef glTexImage2D
|
#undef glTexImage2D
|
||||||
#undef glTexParameteri
|
#undef glTexParameteri
|
||||||
@@ -80,6 +82,7 @@ typedef void (APIENTRYP PFNGLENABLEPROC )(GLenum cap);
|
|||||||
typedef void (APIENTRYP PFNGLENDPROC )(void);
|
typedef void (APIENTRYP PFNGLENDPROC )(void);
|
||||||
typedef GLenum (APIENTRYP PFNGLGETERRORPROC )(void);
|
typedef GLenum (APIENTRYP PFNGLGETERRORPROC )(void);
|
||||||
typedef void (APIENTRYP PFNGLGENTEXTURESPROC )(GLsizei n, GLuint *textures);
|
typedef void (APIENTRYP PFNGLGENTEXTURESPROC )(GLsizei n, GLuint *textures);
|
||||||
|
typedef void (APIENTRYP PFNGLPIXELSTOREIPROC )(GLenum pname, GLint param);
|
||||||
typedef void (APIENTRYP PFNGLREADPIXELSPROC )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels);
|
typedef void (APIENTRYP PFNGLREADPIXELSPROC )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels);
|
||||||
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC )(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC )(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||||
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC )(GLenum target, GLenum pname, GLint param);
|
typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC )(GLenum target, GLenum pname, GLint param);
|
||||||
@@ -110,6 +113,7 @@ GLAPI_DECL PFNGLENABLEPROC glEnable GLAP
|
|||||||
GLAPI_DECL PFNGLENDPROC glEnd GLAPI_SET;
|
GLAPI_DECL PFNGLENDPROC glEnd GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLGENTEXTURESPROC glGenTextures GLAPI_SET;
|
GLAPI_DECL PFNGLGENTEXTURESPROC glGenTextures GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLGETERRORPROC glGetError GLAPI_SET;
|
GLAPI_DECL PFNGLGETERRORPROC glGetError GLAPI_SET;
|
||||||
|
GLAPI_DECL PFNGLPIXELSTOREIPROC glPixelStorei GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLREADPIXELSPROC glReadPixels GLAPI_SET;
|
GLAPI_DECL PFNGLREADPIXELSPROC glReadPixels GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLTEXIMAGE2DPROC glTexImage2D GLAPI_SET;
|
GLAPI_DECL PFNGLTEXIMAGE2DPROC glTexImage2D GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLTEXPARAMETERIPROC glTexParameteri GLAPI_SET;
|
GLAPI_DECL PFNGLTEXPARAMETERIPROC glTexParameteri GLAPI_SET;
|
||||||
@@ -148,6 +152,7 @@ GLAPI_DECL PFNGLUNIFORM1IPROC glUniform1i GLAP
|
|||||||
GLAPI_DECL PFNGLUNIFORM2IPROC glUniform2i GLAPI_SET;
|
GLAPI_DECL PFNGLUNIFORM2IPROC glUniform2i GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLUNIFORM4FPROC glUniform4f GLAPI_SET;
|
GLAPI_DECL PFNGLUNIFORM4FPROC glUniform4f GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLUNIFORM4IPROC glUniform4i GLAPI_SET;
|
GLAPI_DECL PFNGLUNIFORM4IPROC glUniform4i GLAPI_SET;
|
||||||
|
GLAPI_DECL PFNGLUNIFORM4FVPROC glUniform4fv GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLUSEPROGRAMPROC glUseProgram GLAPI_SET;
|
GLAPI_DECL PFNGLUSEPROGRAMPROC glUseProgram GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer GLAPI_SET;
|
GLAPI_DECL PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer GLAPI_SET;
|
||||||
GLAPI_DECL PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer GLAPI_SET;
|
GLAPI_DECL PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer GLAPI_SET;
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ public:
|
|||||||
|
|
||||||
void Initialise();
|
void Initialise();
|
||||||
void Resize(sint32 width, sint32 height);
|
void Resize(sint32 width, sint32 height);
|
||||||
|
void ResetPalette();
|
||||||
|
|
||||||
void Clear(uint32 colour) override;
|
void Clear(uint32 colour) override;
|
||||||
void FillRect(uint32 colour, sint32 x, sint32 y, sint32 w, sint32 h) override;
|
void FillRect(uint32 colour, sint32 x, sint32 y, sint32 w, sint32 h) override;
|
||||||
@@ -250,8 +251,9 @@ public:
|
|||||||
|
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
||||||
_context = SDL_GL_CreateContext(_window);
|
_context = SDL_GL_CreateContext(_window);
|
||||||
|
if(_context == nullptr) throw Exception("OpenGL 3.2 Not Available");
|
||||||
SDL_GL_MakeCurrent(_window, _context);
|
SDL_GL_MakeCurrent(_window, _context);
|
||||||
|
|
||||||
if (!OpenGLAPI::Initialise())
|
if (!OpenGLAPI::Initialise())
|
||||||
@@ -264,10 +266,6 @@ public:
|
|||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
// Do not draw the unseen side of the primitives
|
|
||||||
glEnable(GL_CULL_FACE);
|
|
||||||
glCullFace(GL_FRONT);
|
|
||||||
|
|
||||||
_copyFramebufferShader = new CopyFramebufferShader();
|
_copyFramebufferShader = new CopyFramebufferShader();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,8 +289,7 @@ public:
|
|||||||
colour.b / 255.0f,
|
colour.b / 255.0f,
|
||||||
colour.a / 255.0f };
|
colour.a / 255.0f };
|
||||||
}
|
}
|
||||||
_drawingContext->GetTextureCache()
|
_drawingContext->ResetPalette();
|
||||||
->SetPalette(Palette);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Invalidate(sint32 left, sint32 top, sint32 right, sint32 bottom) override
|
void Invalidate(sint32 left, sint32 top, sint32 right, sint32 bottom) override
|
||||||
@@ -502,6 +499,15 @@ void OpenGLDrawingContext::Resize(sint32 width, sint32 height)
|
|||||||
_fillRectShader->SetScreenSize(width, height);
|
_fillRectShader->SetScreenSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OpenGLDrawingContext::ResetPalette()
|
||||||
|
{
|
||||||
|
_textureCache->SetPalette(_engine->Palette);
|
||||||
|
_drawImageShader->Use();
|
||||||
|
_drawImageShader->SetPalette(_engine->GLPalette);
|
||||||
|
_drawImageMaskedShader->Use();
|
||||||
|
_drawImageMaskedShader->SetPalette(_engine->GLPalette);
|
||||||
|
}
|
||||||
|
|
||||||
void OpenGLDrawingContext::Clear(uint32 colour)
|
void OpenGLDrawingContext::Clear(uint32 colour)
|
||||||
{
|
{
|
||||||
FillRect(colour, _clipLeft - _offsetX, _clipTop - _offsetY, _clipRight, _clipBottom);
|
FillRect(colour, _clipLeft - _offsetX, _clipTop - _offsetY, _clipRight, _clipBottom);
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ OpenGLShaderProgram::OpenGLShaderProgram(const char * name)
|
|||||||
_id = glCreateProgram();
|
_id = glCreateProgram();
|
||||||
glAttachShader(_id, _vertexShader->GetShaderId());
|
glAttachShader(_id, _vertexShader->GetShaderId());
|
||||||
glAttachShader(_id, _fragmentShader->GetShaderId());
|
glAttachShader(_id, _fragmentShader->GetShaderId());
|
||||||
|
glBindFragDataLocation(_id, 0, "oColour");
|
||||||
|
|
||||||
if (!Link())
|
if (!Link())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||||
*
|
*
|
||||||
@@ -53,14 +53,14 @@ void TextureCache::InvalidateImage(uint32 image)
|
|||||||
|
|
||||||
GLuint TextureCache::GetOrLoadImageTexture(uint32 image)
|
GLuint TextureCache::GetOrLoadImageTexture(uint32 image)
|
||||||
{
|
{
|
||||||
auto kvp = _imageTextureMap.find(image);
|
auto kvp = _imageTextureMap.find(image & 0x7FFFF);
|
||||||
if (kvp != _imageTextureMap.end())
|
if (kvp != _imageTextureMap.end())
|
||||||
{
|
{
|
||||||
return kvp->second;
|
return kvp->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint texture = LoadImageTexture(image);
|
GLuint texture = LoadImageTexture(image);
|
||||||
_imageTextureMap[image] = texture;
|
_imageTextureMap[image & 0x7FFFF] = texture;
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
@@ -88,15 +88,15 @@ GLuint TextureCache::LoadImageTexture(uint32 image)
|
|||||||
GLuint texture;
|
GLuint texture;
|
||||||
glGenTextures(1, &texture);
|
glGenTextures(1, &texture);
|
||||||
|
|
||||||
uint32 width, height;
|
rct_drawpixelinfo * dpi = GetImageAsDPI(image, 0);
|
||||||
void * pixels32 = GetImageAsARGB(image, 0, &width, &height);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels32);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, dpi->width, dpi->height, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, dpi->bits);
|
||||||
Memory::Free(pixels32);
|
|
||||||
|
DeleteDPI(dpi);
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
@@ -106,15 +106,15 @@ GLuint TextureCache::LoadGlyphTexture(uint32 image, uint8 * palette)
|
|||||||
GLuint texture;
|
GLuint texture;
|
||||||
glGenTextures(1, &texture);
|
glGenTextures(1, &texture);
|
||||||
|
|
||||||
uint32 width, height;
|
rct_drawpixelinfo * dpi = GetGlyphAsDPI(image, palette);
|
||||||
void * pixels32 = GetGlyphAsARGB(image, palette, &width, &height);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels32);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, dpi->width, dpi->height, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, dpi->bits);
|
||||||
|
|
||||||
Memory::Free(pixels32);
|
DeleteDPI(dpi);
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
@@ -135,6 +135,17 @@ void * TextureCache::GetImageAsARGB(uint32 image, uint32 tertiaryColour, uint32
|
|||||||
return pixels32;
|
return pixels32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rct_drawpixelinfo * TextureCache::GetImageAsDPI(uint32 image, uint32 tertiaryColour)
|
||||||
|
{
|
||||||
|
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||||
|
sint32 width = g1Element->width;
|
||||||
|
sint32 height = g1Element->height;
|
||||||
|
|
||||||
|
rct_drawpixelinfo * dpi = CreateDPI(width, height);
|
||||||
|
gfx_draw_sprite_software(dpi, image, -g1Element->x_offset, -g1Element->y_offset, tertiaryColour);
|
||||||
|
return dpi;
|
||||||
|
}
|
||||||
|
|
||||||
void * TextureCache::GetGlyphAsARGB(uint32 image, uint8 * palette, uint32 * outWidth, uint32 * outHeight)
|
void * TextureCache::GetGlyphAsARGB(uint32 image, uint8 * palette, uint32 * outWidth, uint32 * outHeight)
|
||||||
{
|
{
|
||||||
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||||
@@ -151,6 +162,17 @@ void * TextureCache::GetGlyphAsARGB(uint32 image, uint8 * palette, uint32 * outW
|
|||||||
return pixels32;
|
return pixels32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rct_drawpixelinfo * TextureCache::GetGlyphAsDPI(uint32 image, uint8 * palette)
|
||||||
|
{
|
||||||
|
rct_g1_element * g1Element = gfx_get_g1_element(image & 0x7FFFF);
|
||||||
|
sint32 width = g1Element->width;
|
||||||
|
sint32 height = g1Element->height;
|
||||||
|
|
||||||
|
rct_drawpixelinfo * dpi = CreateDPI(width, height);
|
||||||
|
gfx_draw_sprite_palette_set_software(dpi, image, -g1Element->x_offset, -g1Element->y_offset, palette, nullptr);
|
||||||
|
return dpi;
|
||||||
|
}
|
||||||
|
|
||||||
void * TextureCache::ConvertDPIto32bpp(const rct_drawpixelinfo * dpi)
|
void * TextureCache::ConvertDPIto32bpp(const rct_drawpixelinfo * dpi)
|
||||||
{
|
{
|
||||||
size_t numPixels = dpi->width * dpi->height;
|
size_t numPixels = dpi->width * dpi->height;
|
||||||
|
|||||||
@@ -69,7 +69,9 @@ private:
|
|||||||
GLuint LoadImageTexture(uint32 image);
|
GLuint LoadImageTexture(uint32 image);
|
||||||
GLuint LoadGlyphTexture(uint32 image, uint8 * palette);
|
GLuint LoadGlyphTexture(uint32 image, uint8 * palette);
|
||||||
void * GetImageAsARGB(uint32 image, uint32 tertiaryColour, uint32 * outWidth, uint32 * outHeight);
|
void * GetImageAsARGB(uint32 image, uint32 tertiaryColour, uint32 * outWidth, uint32 * outHeight);
|
||||||
|
rct_drawpixelinfo * GetImageAsDPI(uint32 image, uint32 tertiaryColour);
|
||||||
void * GetGlyphAsARGB(uint32 image, uint8 * palette, uint32 * outWidth, uint32 * outHeight);
|
void * GetGlyphAsARGB(uint32 image, uint8 * palette, uint32 * outWidth, uint32 * outHeight);
|
||||||
|
rct_drawpixelinfo * GetGlyphAsDPI(uint32 image, uint8 * palette);
|
||||||
void * ConvertDPIto32bpp(const rct_drawpixelinfo * dpi);
|
void * ConvertDPIto32bpp(const rct_drawpixelinfo * dpi);
|
||||||
void FreeTextures();
|
void FreeTextures();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user