From 6a0d150539897ec65ccc161305db48de10ea35ba Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 16 Sep 2012 10:38:08 +0200 Subject: Interface works - removed mock of CInterface and fixed event passing to CRobotMain - changed texture names from tga and bmp to png - UI now works but interaction is still broken --- src/graphics/engine/engine.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/graphics/engine/engine.cpp') diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index d368aa6..af209bd 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -37,6 +37,7 @@ #include "graphics/engine/water.h" #include "math/geometry.h" #include "sound/sound.h" +#include "ui/interface.h" // Initial size of various vectors @@ -87,15 +88,6 @@ Gfx::EngineObjLevel4::EngineObjLevel4(bool used, Gfx::EngineTriangleType type, c vertices.reserve(LEVEL4_VERTEX_PREALLOCATE_COUNT); } - - -// TODO: temporary stub for CInterface -class CInterface -{ -public: - void Draw() {} -}; - Gfx::CEngine::CEngine(CInstanceManager *iMan, CApplication *app) { m_iMan = iMan; @@ -3124,7 +3116,7 @@ void Gfx::CEngine::DrawInterface() m_device->SetTransform(Gfx::TRANSFORM_WORLD, m_matWorldInterface); // Draw the entire interface - CInterface* interface = static_cast( m_iMan->SearchInstance(CLASS_INTERFACE) ); + Ui::CInterface* interface = static_cast( m_iMan->SearchInstance(CLASS_INTERFACE) ); if (interface != nullptr) interface->Draw(); @@ -3834,6 +3826,8 @@ void Gfx::CEngine::DrawMouseSprite(Math::Point pos, Math::Point size, int icon) Gfx::Vertex(Math::Vector(p2.x, p2.y, 0.0f), normal, Math::Point(u2, v1)) }; + m_device->SetRenderState(Gfx::RENDER_STATE_DEPTH_TEST, false); + m_device->SetRenderState(Gfx::RENDER_STATE_DEPTH_WRITE, false); m_device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4); AddStatisticTriangle(2); } -- cgit v1.2.3-1-g7c22