Fix compile error for OpenGL ES

This commit is contained in:
Eduardo Bart 2013-02-07 03:56:02 -02:00
parent 4f3be92208
commit ea0d5f3d81
4 changed files with 17 additions and 15 deletions

View File

@ -2,6 +2,7 @@ minimapWidget = nil
minimapButton = nil minimapButton = nil
minimapWindow = nil minimapWindow = nil
otmm = true otmm = true
preloaded = false
function init() function init()
minimapButton = modules.client_topmenu.addRightGameToggleButton('minimapButton', tr('Minimap') .. ' (Ctrl+M)', '/images/topbuttons/minimap', toggle) minimapButton = modules.client_topmenu.addRightGameToggleButton('minimapButton', tr('Minimap') .. ' (Ctrl+M)', '/images/topbuttons/minimap', toggle)
@ -66,8 +67,13 @@ function onMiniWindowClose()
minimapButton:setOn(false) minimapButton:setOn(false)
end end
function preload()
loadMap(false)
preloaded = true
end
function online() function online()
loadMap() loadMap(not preloaded)
minimapWidget:followLocalPlayer() minimapWidget:followLocalPlayer()
end end
@ -75,9 +81,12 @@ function offline()
saveMap() saveMap()
end end
function loadMap() function loadMap(clean)
local protocolVersion = g_game.getProtocolVersion() local protocolVersion = g_game.getProtocolVersion()
if clean then
g_minimap.clean() g_minimap.clean()
end
if otmm then if otmm then
local minimapFile = '/minimap.otmm' local minimapFile = '/minimap.otmm'

View File

@ -360,9 +360,9 @@ bool Graphics::canUseBlendFuncSeparate()
bool Graphics::canUseBlendEquation() bool Graphics::canUseBlendEquation()
{ {
#if OPENGL_ES==2 #if OPENGL_ES==2
return true; return false;
#elif OPENGL_ES==1 #elif OPENGL_ES==1
return true; return false;
#else #else
if(!GLEW_VERSION_1_4) if(!GLEW_VERSION_1_4)
return false; return false;

View File

@ -289,14 +289,7 @@ void Painter::updateGlBlendEquation()
{ {
if(!g_graphics.canUseBlendEquation()) if(!g_graphics.canUseBlendEquation())
return; return;
switch(m_blendEquation) { glBlendEquation(m_blendEquation);
case BlendEquation_Max:
glBlendEquation(GL_MAX);
break;
case BlendEquation_Add:
glBlendEquation(GL_FUNC_ADD);
break;
}
} }
void Painter::updateGlClipRect() void Painter::updateGlClipRect()

View File

@ -44,8 +44,8 @@ public:
TriangleStrip = GL_TRIANGLE_STRIP TriangleStrip = GL_TRIANGLE_STRIP
}; };
enum BlendEquation { enum BlendEquation {
BlendEquation_Add, BlendEquation_Add = 0x8006, // GL_FUNC_ADD
BlendEquation_Max, BlendEquation_Max = 0x8008, // GL_MAX
}; };
struct PainterState { struct PainterState {