diff options
author | Michał Konopacki <konopacki.m@gmail.com> | 2012-08-15 01:48:49 +0200 |
---|---|---|
committer | Michał Konopacki <konopacki.m@gmail.com> | 2012-08-15 01:48:49 +0200 |
commit | 10b2c562fb7635f9850f1441f08ba8b1a71e31e1 (patch) | |
tree | 34d2b49911923481a41ba8b24edf630bae27d314 /src/ui/gauge.cpp | |
parent | e942400c8bb9b6836bdfe705111f7ec63ef19e28 (diff) | |
download | colobot-10b2c562fb7635f9850f1441f08ba8b1a71e31e1.tar.gz colobot-10b2c562fb7635f9850f1441f08ba8b1a71e31e1.tar.bz2 colobot-10b2c562fb7635f9850f1441f08ba8b1a71e31e1.zip |
First approach to port 2D UI Interface
- changes in src/ui ; be CAREFUL, not every file is changed in a proper way -> bugs
- necessary changes in object/robotmain.h and common/misc.h/.cpp in order to compile
Diffstat (limited to 'src/ui/gauge.cpp')
-rw-r--r-- | src/ui/gauge.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ui/gauge.cpp b/src/ui/gauge.cpp index 13cd4f7..a4571da 100644 --- a/src/ui/gauge.cpp +++ b/src/ui/gauge.cpp @@ -17,13 +17,13 @@ // gauge.cpp -#include <windows.h> +//#include <windows.h> #include <stdio.h> -#include <d3d.h> +//#include <d3d.h> -#include "common/struct.h" -#include "old/d3dengine.h" -#include "old/math3d.h" +//#include "common/struct.h" +//#include "old/d3dengine.h" +//#include "old/math3d.h" #include "common/event.h" #include "common/misc.h" #include "common/iman.h" @@ -48,11 +48,11 @@ CGauge::~CGauge() // Creates a new button. -bool CGauge::Create(Math::Point pos, Math::Point dim, int icon, EventMsg eventMsg) +bool CGauge::Create(Math::Point pos, Math::Point dim, int icon, EventType eventType) { - if ( eventMsg == EVENT_NULL ) eventMsg = GetUniqueEventMsg(); + if ( eventType == EVENT_NULL ) eventType = GetUniqueEventType(); - CControl::Create(pos, dim, icon, eventMsg); + CControl::Create(pos, dim, icon, eventType); return true; } @@ -63,12 +63,12 @@ bool CGauge::EventProcess(const Event &event) { CControl::EventProcess(event); - if ( event.event == EVENT_LBUTTONDOWN ) + if ( event.type == EVENT_MOUSE_BUTTON_DOWN ) { if ( CControl::Detect(event.pos) ) { Event newEvent = event; - newEvent.event = m_eventMsg; + newEvent.type = m_eventType; m_event->AddEvent(newEvent); return false; } @@ -88,7 +88,7 @@ void CGauge::Draw() if ( (m_state & STATE_VISIBLE) == 0 ) return; m_engine->SetTexture("button2.tga"); - m_engine->SetState(D3DSTATENORMAL); + m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); dp = 0.5f/256.0f; @@ -149,7 +149,7 @@ void CGauge::SetLevel(float level) m_level = level; } -float CGauge::RetLevel() +float CGauge::GetLevel() { return m_level; } |