mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
outfit colors
This commit is contained in:
@@ -19,7 +19,6 @@ void Graphics::init()
|
||||
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
logInfo("GPU ", glGetString(GL_RENDERER));
|
||||
@@ -30,6 +29,7 @@ void Graphics::init()
|
||||
m_emptyTexture = TexturePtr(new Texture);
|
||||
|
||||
bindColor(Color::white);
|
||||
bindBlendFunc(BLEND_NORMAL);
|
||||
}
|
||||
|
||||
void Graphics::terminate()
|
||||
@@ -285,6 +285,18 @@ void Graphics::bindTexture(const TexturePtr& texture)
|
||||
glBindTexture(GL_TEXTURE_2D, texture->getId());
|
||||
}
|
||||
|
||||
void Graphics::bindBlendFunc(BlendFuncType blendType)
|
||||
{
|
||||
switch(blendType) {
|
||||
case BLEND_NORMAL:
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
case BLEND_COLORIZING:
|
||||
glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::startDrawing()
|
||||
{
|
||||
assert(!m_drawing);
|
||||
|
@@ -3,6 +3,11 @@
|
||||
|
||||
#include "declarations.h"
|
||||
|
||||
enum BlendFuncType {
|
||||
BLEND_NORMAL,
|
||||
BLEND_COLORIZING
|
||||
};
|
||||
|
||||
class Graphics
|
||||
{
|
||||
public:
|
||||
@@ -29,6 +34,7 @@ public:
|
||||
|
||||
void bindColor(const Color& color);
|
||||
void bindTexture(const TexturePtr& texture);
|
||||
void bindBlendFunc(BlendFuncType blendType);
|
||||
|
||||
// drawing API
|
||||
void drawTexturedRect(const Rect& screenCoords,
|
||||
|
Reference in New Issue
Block a user