mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
many changes
* Fixes in WIN32 platform * Remove unused files * Make StaticText work more like tibia * Fix WIN32 compilation * Fix regression in framebuffers that caused battle to disappear * Shader fixes for DX9 * Add two new shaders: noise and heat
This commit is contained in:
@@ -60,6 +60,7 @@ void Painter::refreshState()
|
||||
void Painter::saveState()
|
||||
{
|
||||
assert(m_oldStateIndex<10);
|
||||
m_olderStates[m_oldStateIndex].resolution = m_resolution;
|
||||
m_olderStates[m_oldStateIndex].projectionMatrix = m_projectionMatrix;
|
||||
m_olderStates[m_oldStateIndex].textureMatrix = m_textureMatrix;
|
||||
m_olderStates[m_oldStateIndex].color = m_color;
|
||||
@@ -69,7 +70,6 @@ void Painter::saveState()
|
||||
m_olderStates[m_oldStateIndex].shaderProgram = m_shaderProgram;
|
||||
m_olderStates[m_oldStateIndex].texture = m_texture;
|
||||
m_olderStates[m_oldStateIndex].alphaWriting = m_alphaWriting;
|
||||
m_olderStates[m_oldStateIndex].resolution = m_resolution;
|
||||
m_oldStateIndex++;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ void Painter::saveAndResetState()
|
||||
void Painter::restoreSavedState()
|
||||
{
|
||||
m_oldStateIndex--;
|
||||
setResolution(m_olderStates[m_oldStateIndex].resolution);
|
||||
setProjectionMatrix(m_olderStates[m_oldStateIndex].projectionMatrix);
|
||||
setTextureMatrix(m_olderStates[m_oldStateIndex].textureMatrix);
|
||||
setColor(m_olderStates[m_oldStateIndex].color);
|
||||
@@ -90,7 +91,7 @@ void Painter::restoreSavedState()
|
||||
setClipRect(m_olderStates[m_oldStateIndex].clipRect);
|
||||
setShaderProgram(m_olderStates[m_oldStateIndex].shaderProgram);
|
||||
setTexture(m_olderStates[m_oldStateIndex].texture);
|
||||
setResolution(m_olderStates[m_oldStateIndex].resolution);
|
||||
setAlphaWriting(m_olderStates[m_oldStateIndex].alphaWriting);
|
||||
}
|
||||
|
||||
void Painter::clear(const Color& color)
|
||||
|
@@ -44,6 +44,7 @@ public:
|
||||
};
|
||||
|
||||
struct PainterState {
|
||||
Size resolution;
|
||||
Matrix3 projectionMatrix;
|
||||
Matrix3 textureMatrix;
|
||||
Color color;
|
||||
@@ -53,7 +54,6 @@ public:
|
||||
Texture *texture;
|
||||
PainterShaderProgram *shaderProgram;
|
||||
bool alphaWriting;
|
||||
Size resolution;
|
||||
};
|
||||
|
||||
Painter();
|
||||
|
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010-2012 OTClient <https://github.com/edubart/otclient>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PAINTERSHADERMANAGER_H
|
||||
#define PAINTERSHADERMANAGER_H
|
||||
|
||||
#include "paintershaderprogram.h"
|
||||
|
||||
class PainterShaderManager
|
||||
{
|
||||
public:
|
||||
void init();
|
||||
void terminate();
|
||||
|
||||
PainterShaderProgramPtr createShader();
|
||||
PainterShaderProgramPtr createTexturedFragmentShader(const std::string& shaderFile);
|
||||
|
||||
const PainterShaderProgramPtr& getDrawTexturedProgram() { return m_drawTexturedProgram; }
|
||||
const PainterShaderProgramPtr& getDrawSolidColorProgram() { return m_drawSolidColorProgram; }
|
||||
|
||||
private:
|
||||
PainterShaderProgramPtr m_drawTexturedProgram;
|
||||
PainterShaderProgramPtr m_drawSolidColorProgram;
|
||||
};
|
||||
|
||||
extern PainterShaderManager g_shaders;
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user