diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-16 10:38:08 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-09-16 10:38:08 +0200 |
commit | 6a0d150539897ec65ccc161305db48de10ea35ba (patch) | |
tree | 7064e569459bd8d704edd28552f48bf2978d61a0 /src/ui | |
parent | af9af56bb007050c969af310c4e816d260b9ce7f (diff) | |
download | colobot-6a0d150539897ec65ccc161305db48de10ea35ba.tar.gz colobot-6a0d150539897ec65ccc161305db48de10ea35ba.tar.bz2 colobot-6a0d150539897ec65ccc161305db48de10ea35ba.zip |
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
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/button.cpp | 8 | ||||
-rw-r--r-- | src/ui/check.cpp | 2 | ||||
-rw-r--r-- | src/ui/color.cpp | 6 | ||||
-rw-r--r-- | src/ui/compass.cpp | 2 | ||||
-rw-r--r-- | src/ui/control.cpp | 16 | ||||
-rw-r--r-- | src/ui/edit.cpp | 18 | ||||
-rw-r--r-- | src/ui/gauge.cpp | 2 | ||||
-rw-r--r-- | src/ui/group.cpp | 60 | ||||
-rw-r--r-- | src/ui/image.cpp | 2 | ||||
-rw-r--r-- | src/ui/key.cpp | 2 | ||||
-rw-r--r-- | src/ui/list.cpp | 10 | ||||
-rw-r--r-- | src/ui/maindialog.cpp | 2 | ||||
-rw-r--r-- | src/ui/map.cpp | 28 | ||||
-rw-r--r-- | src/ui/scroll.cpp | 8 | ||||
-rw-r--r-- | src/ui/shortcut.cpp | 6 | ||||
-rw-r--r-- | src/ui/slider.cpp | 6 | ||||
-rw-r--r-- | src/ui/window.cpp | 38 |
17 files changed, 108 insertions, 108 deletions
diff --git a/src/ui/button.cpp b/src/ui/button.cpp index d6a5c40..7473409 100644 --- a/src/ui/button.cpp +++ b/src/ui/button.cpp @@ -101,7 +101,7 @@ bool CButton::EventProcess(const Event &event) } if ( event.type == EVENT_MOUSE_BUTTON_DOWN && - event.mouseButton.button == 1 && + event.mouseButton.button == 1 && (m_state & STATE_VISIBLE) && (m_state & STATE_ENABLE) ) { @@ -125,8 +125,8 @@ bool CButton::EventProcess(const Event &event) } if ( event.type == EVENT_MOUSE_BUTTON_UP && //left - event.mouseButton.button == 1 && - m_bCapture ) + event.mouseButton.button == 1 && + m_bCapture ) { if ( CControl::Detect(event.pos) ) { @@ -182,7 +182,7 @@ void CButton::Draw() (m_state & STATE_CARD ) == 0 && (m_state & STATE_SIMPLY) == 0 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); dp = 0.5f / 256.0f; diff --git a/src/ui/check.cpp b/src/ui/check.cpp index 43db0d1..e9732a4 100644 --- a/src/ui/check.cpp +++ b/src/ui/check.cpp @@ -108,7 +108,7 @@ void CCheck::Draw() DrawShadow(m_pos, m_dim); } - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); zoomExt = 1.00f; diff --git a/src/ui/color.cpp b/src/ui/color.cpp index 2666f84..4d071c6 100644 --- a/src/ui/color.cpp +++ b/src/ui/color.cpp @@ -145,7 +145,7 @@ void CColor::Draw() DrawShadow(m_pos, m_dim); } - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); CControl::Draw(); @@ -153,7 +153,7 @@ void CColor::Draw() // color = GetColor(m_color); color = GetColor(); - m_engine->SetTexture("xxx.tga"); // no texture + m_engine->SetTexture("xxx.png"); // no texture m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); device = m_engine->GetDevice(); @@ -187,7 +187,7 @@ void CColor::Draw() color = GetColor(); - m_engine->SetTexture("xxx.tga"); // no texture + m_engine->SetTexture("xxx.png"); // no texture m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); vertex[0] = Gfx::VertexCol(Math::Vector(p1.x, p1.y, 0.0f), color, Gfx::Color(), Math::Point(0.0f, 0.0f)); diff --git a/src/ui/compass.cpp b/src/ui/compass.cpp index 102b697..f7be764 100644 --- a/src/ui/compass.cpp +++ b/src/ui/compass.cpp @@ -89,7 +89,7 @@ void CCompass::Draw() device = m_engine->GetDevice(); - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); p1.x = m_pos.x; diff --git a/src/ui/control.cpp b/src/ui/control.cpp index c5d505e..c4bf6ea 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -437,7 +437,7 @@ void CControl::Draw() if ( (m_state & STATE_VISIBLE) == 0 ) return; - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); zoomExt = 1.00f; @@ -491,7 +491,7 @@ void CControl::Draw() if ( m_state & STATE_OKAY ) { - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); icon = 3; // yellow with green point pressed } @@ -507,22 +507,22 @@ void CControl::Draw() { icon -= 192; #if _POLISH - m_engine->SetTexture("textp.tga"); + m_engine->SetTexture("textp.png"); #else - m_engine->SetTexture("text.tga"); + m_engine->SetTexture("text.png"); #endif m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); } else if ( icon >= 128 ) { icon -= 128; - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); } else if ( icon >= 64 ) { icon -= 64; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); } else @@ -755,7 +755,7 @@ void CControl::DrawWarning(Math::Point pos, Math::Point dim) dp = 0.5f / 256.0f; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; @@ -799,7 +799,7 @@ void CControl::DrawShadow(Math::Point pos, Math::Point dim, float deep) dp = 0.5f/256.0f; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState( Gfx::ENG_RSTATE_TTEXTURE_WHITE); pos.x += deep * 0.010f * 0.75f; diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index d298ad3..cde3aee 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -1131,9 +1131,9 @@ void CEdit::DrawImage(Math::Point pos, const char *name, float width, float dp; char filename[100]; -//? sprintf(filename, "diagram\\%s.bmp", name); +//? sprintf(filename, "diagram\\%s.png", name); UserDir(filename, name, "diagram"); - strcat(filename, ".bmp"); + strcat(filename, ".png"); m_engine->SetTexture(filename); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); @@ -1163,7 +1163,7 @@ void CEdit::DrawBack(Math::Point pos, Math::Point dim) if ( m_bGeneric ) return; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); if ( m_bMulti ) @@ -1214,9 +1214,9 @@ void CEdit::DrawPart(Math::Point pos, Math::Point dim, int icon) float dp; #if _POLISH - m_engine->SetTexture("textp.tga"); + m_engine->SetTexture("textp.png"); #else - m_engine->SetTexture("text.tga"); + m_engine->SetTexture("text.png"); #endif m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); @@ -1426,9 +1426,9 @@ void CEdit::FreeImage() for ( i=0 ; i<m_imageTotal ; i++ ) { -//? sprintf(filename, "diagram\\%s.bmp", m_image[i].name); +//? sprintf(filename, "diagram\\%s.png", m_image[i].name); UserDir(filename, m_image[i].name, "diagram"); - strcat(filename, ".bmp"); + strcat(filename, ".png"); m_engine->DeleteTexture(filename); } } @@ -1439,9 +1439,9 @@ void CEdit::LoadImage(const char *name) { char filename[100]; -//? sprintf(filename, "diagram\\%s.bmp", name); +//? sprintf(filename, "diagram\\%s.png", name); UserDir(filename, name, "diagram"); - strcat(filename, ".bmp"); + strcat(filename, ".png"); m_engine->LoadTexture(filename); } diff --git a/src/ui/gauge.cpp b/src/ui/gauge.cpp index 20904f7..3e93166 100644 --- a/src/ui/gauge.cpp +++ b/src/ui/gauge.cpp @@ -78,7 +78,7 @@ void CGauge::Draw() if ( (m_state & STATE_VISIBLE) == 0 ) return; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); dp = 0.5f/256.0f; diff --git a/src/ui/group.cpp b/src/ui/group.cpp index facf208..67369d9 100644 --- a/src/ui/group.cpp +++ b/src/ui/group.cpp @@ -94,7 +94,7 @@ void CGroup::Draw() if ( m_icon == 0 ) // hollow frame? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 160.0f / 256.0f; uv1.y = 192.0f / 256.0f; // u-v texture @@ -110,7 +110,7 @@ void CGroup::Draw() } if ( m_icon == 1 ) // orange solid opaque? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 104.0f / 256.0f; uv1.y = 48.0f / 256.0f; @@ -124,7 +124,7 @@ void CGroup::Draw() } if ( m_icon == 2 ) // orange degrade -> transparent? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 112.0f / 256.0f; uv1.y = 48.0f / 256.0f; @@ -138,7 +138,7 @@ void CGroup::Draw() } if ( m_icon == 3 ) // transparent gradient -> gray? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 120.0f / 256.0f; uv1.y = 48.0f / 256.0f; @@ -152,7 +152,7 @@ void CGroup::Draw() } if ( m_icon == 4 ) // degrade blue corner? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 192.0f / 256.0f; uv1.y = 128.0f / 256.0f; @@ -166,7 +166,7 @@ void CGroup::Draw() } if ( m_icon == 5 ) // degrade orange corner? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 224.0f / 256.0f; uv1.y = 128.0f / 256.0f; @@ -180,7 +180,7 @@ void CGroup::Draw() } if ( m_icon == 6 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 0.0f / 256.0f; // brown transparent uv1.y = 75.0f / 256.0f; @@ -196,7 +196,7 @@ void CGroup::Draw() } if ( m_icon == 7 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; uv1.y = 0.0f / 256.0f; @@ -210,7 +210,7 @@ void CGroup::Draw() } if ( m_icon == 8 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // green transparent uv1.y = 160.0f / 256.0f; @@ -224,7 +224,7 @@ void CGroup::Draw() } if ( m_icon == 9 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // red transparent uv1.y = 176.0f/256.0f; @@ -238,7 +238,7 @@ void CGroup::Draw() } if ( m_icon == 10 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // blue transparent uv1.y = 192.0f / 256.0f; @@ -252,7 +252,7 @@ void CGroup::Draw() } if ( m_icon == 11 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // yellow transparent uv1.y = 224.0f / 256.0f; @@ -269,7 +269,7 @@ void CGroup::Draw() dim.x = m_dim.x / 2.0f; dim.y = m_dim.y / 2.0f; - m_engine->SetTexture("mouse.tga"); + m_engine->SetTexture("mouse.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); pos.x = m_pos.x-m_dim.x/300.0f; pos.y = m_pos.y+m_dim.y/300.0f+dim.y; @@ -308,7 +308,7 @@ void CGroup::Draw() } if ( m_icon == 13 ) // corner upper / left? { - m_engine->SetTexture("mouse.tga"); + m_engine->SetTexture("mouse.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); pos.x = m_pos.x-m_dim.x/150.0f; pos.y = m_pos.y+m_dim.y/150.0f; @@ -329,7 +329,7 @@ void CGroup::Draw() } if ( m_icon == 14 ) // corner upper / right? { - m_engine->SetTexture("mouse.tga"); + m_engine->SetTexture("mouse.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); pos.x = m_pos.x-m_dim.x/150.0f; pos.y = m_pos.y+m_dim.y/150.0f; @@ -350,7 +350,7 @@ void CGroup::Draw() } if ( m_icon == 15 ) // corner lower / left? { - m_engine->SetTexture("mouse.tga"); + m_engine->SetTexture("mouse.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); pos.x = m_pos.x-m_dim.x/150.0f; pos.y = m_pos.y+m_dim.y/150.0f; @@ -371,7 +371,7 @@ void CGroup::Draw() } if ( m_icon == 16 ) // corner lower / left? { - m_engine->SetTexture("mouse.tga"); + m_engine->SetTexture("mouse.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); pos.x = m_pos.x-m_dim.x/150.0f; pos.y = m_pos.y+m_dim.y/150.0f; @@ -392,7 +392,7 @@ void CGroup::Draw() } if ( m_icon == 17 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.0f / 256.0f; // blue frame uv1.y = 75.0f / 256.0f; @@ -408,7 +408,7 @@ void CGroup::Draw() } if ( m_icon == 18 ) // arrow> for SatCom? { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 0.0f / 256.0f; // > uv1.y = 192.0f / 256.0f; @@ -422,7 +422,7 @@ void CGroup::Draw() } if ( m_icon == 19 ) // SatCom symbol? { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 224.0f / 256.0f; // SatCom symbol uv1.y = 224.0f / 256.0f; @@ -436,7 +436,7 @@ void CGroup::Draw() } if ( m_icon == 20 ) // solid blue background? { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 224.0f / 256.0f; uv1.y = 32.0f / 256.0f; @@ -450,7 +450,7 @@ void CGroup::Draw() } if ( m_icon == 21 ) // stand-by symbol? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 160.0f / 256.0f; uv1.y = 32.0f / 256.0f; @@ -464,7 +464,7 @@ void CGroup::Draw() } if ( m_icon == 22 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; // opaque yellow uv1.y = 224.0f / 256.0f; @@ -481,7 +481,7 @@ void CGroup::Draw() if ( m_icon == 23 ) { - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; // yellow uv1.y = 192.0f / 256.0f; @@ -497,7 +497,7 @@ void CGroup::Draw() } if ( m_icon == 24 ) { - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 80.0f / 256.0f; // orange uv1.y = 192.0f / 256.0f; @@ -513,7 +513,7 @@ void CGroup::Draw() } if ( m_icon == 25 ) { - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; // orange uv1.y = 208.0f / 256.0f; @@ -529,7 +529,7 @@ void CGroup::Draw() } if ( m_icon == 26 ) { - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 80.0f / 256.0f; // red uv1.y = 208.0f / 256.0f; @@ -545,7 +545,7 @@ void CGroup::Draw() } if ( m_icon == 27 ) { - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 32.0f / 256.0f; uv1.y = 0.0f / 256.0f; @@ -563,7 +563,7 @@ void CGroup::Draw() pos = m_pos; dim = m_dim; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 32.0f / 256.0f; uv1.y = 32.0f / 256.0f; @@ -575,7 +575,7 @@ void CGroup::Draw() uv2.y -= dp; DrawIcon(pos, dim, uv1, uv2); - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); pos.x += 8.0f / 640.0f; pos.y += 8.0f / 480.0f; diff --git a/src/ui/image.cpp b/src/ui/image.cpp index 473492f..aff2dcb 100644 --- a/src/ui/image.cpp +++ b/src/ui/image.cpp @@ -117,7 +117,7 @@ void CImage::Draw() if ( m_icon == 0 ) // hollow frame? { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 160.0f / 256.0f; uv1.y = 192.0f / 256.0f; // u-v texture diff --git a/src/ui/key.cpp b/src/ui/key.cpp index 77c17b0..b38b2f4 100644 --- a/src/ui/key.cpp +++ b/src/ui/key.cpp @@ -154,7 +154,7 @@ void CKey::Draw() DrawShadow(m_pos, m_dim); - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); // was D3DSTATENORMAL zoomExt = 1.00f; diff --git a/src/ui/list.cpp b/src/ui/list.cpp index cbf8268..80609d7 100644 --- a/src/ui/list.cpp +++ b/src/ui/list.cpp @@ -341,7 +341,7 @@ void CList::Draw() dim = m_dim; if (m_icon == 0) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f / 256.0f; @@ -349,7 +349,7 @@ void CList::Draw() uv2.x = 160.0f / 256.0f; uv2.y = 96.0f / 256.0f; } else { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 132.0f / 256.0f; @@ -382,7 +382,7 @@ void CList::Draw() dim.y *= 0.4f; pos.y -= dim.y; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); // was D3DSTATETTw uv1.x = 120.0f / 256.0f; uv1.y = 64.0f / 256.0f; @@ -448,7 +448,7 @@ void CList::Draw() dim.y -= 4.0f / 480.0f; if ( m_check[i + m_firstLine] ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; uv1.y = 0.0f / 256.0f; @@ -471,7 +471,7 @@ void CList::Draw() uv2.y -= dp; DrawIcon(pos, dim, uv1, uv2); // draws v } else { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); // was D3DSTATETTw if ( i + m_firstLine == m_selectLine ) { uv1.x =224.0f / 256.0f; // < diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index c6b70cb..5ed1216 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -2207,7 +2207,7 @@ bool CMainDialog::EventProcess(const Event &event) return false; } - if ( m_engine->GetMouseVisible() && + if ( /*TODO: m_engine->GetMouseVisible() &&*/ !m_interface->EventProcess(event) ) { return false; diff --git a/src/ui/map.cpp b/src/ui/map.cpp index 5440854..1cb4405 100644 --- a/src/ui/map.cpp +++ b/src/ui/map.cpp @@ -315,7 +315,7 @@ void CMap::Draw() m_offset = AdjustOffset(m_map[MAPMAXOBJECT - 1].pos); if ( m_fixImage[0] == 0 ) { // drawing of the relief? - m_engine->SetTexture("map.tga"); + m_engine->SetTexture("map.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.5f + (m_offset.x - (m_half / m_zoom)) / (m_half * 2.0f); uv1.y = 0.5f - (m_offset.y + (m_half / m_zoom)) / (m_half * 2.0f); @@ -455,7 +455,7 @@ void CMap::DrawFocus(Math::Point pos, float dir, ObjectType type, MapColor color uv2.x = 126.0f/256.0f; uv2.y = 255.0f/256.0f; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); bEnding = false; @@ -515,7 +515,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo return; // flashes } - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); if ( bUp ) { @@ -658,7 +658,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo { if ( bSelect ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); if ( m_bToy ) { @@ -684,7 +684,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo { if ( m_bRadar ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 64.5f/256.0f; // blue triangle uv1.y = 240.5f/256.0f; @@ -704,7 +704,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo if ( color == MAPCOLOR_WAYPOINTb ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 192.5f/256.0f; // blue cross uv1.y = 240.5f/256.0f; @@ -714,7 +714,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTr ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 208.5f/256.0f; // red cross uv1.y = 240.5f/256.0f; @@ -724,7 +724,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTg ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 224.5f/256.0f; // green cross uv1.y = 240.5f/256.0f; @@ -734,7 +734,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTy ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 240.5f/256.0f; // yellow cross uv1.y = 240.5f/256.0f; @@ -744,7 +744,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTv ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 192.5f/256.0f; // violet cross uv1.y = 224.5f/256.0f; @@ -765,7 +765,7 @@ void CMap::DrawObjectIcon(Math::Point pos, Math::Point dim, MapColor color, dp = 0.5f/256.0f; - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); if ( color == MAPCOLOR_MOVE ) { @@ -887,7 +887,7 @@ void CMap::DrawHighlight(Math::Point pos) dim.x *= 2.0f+cosf(m_time*8.0f)*0.5f; dim.y *= 2.0f+cosf(m_time*8.0f)*0.5f; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 160.5f/256.0f; // hilite uv1.y = 224.5f/256.0f; @@ -1003,7 +1003,7 @@ void CMap::UpdateTerrain() // TODO: map texture manipulation return; - // if ( !m_engine->OpenImage("map.tga") ) return; + // if ( !m_engine->OpenImage("map.png") ) return; scale = m_terrain->GetReliefScale(); water = m_water->GetLevel(); @@ -1066,7 +1066,7 @@ void CMap::UpdateTerrain(int bx, int by, int ex, int ey) // TODO: map texture manipulation return; - //if ( !m_engine->OpenImage("map.tga") ) return; + //if ( !m_engine->OpenImage("map.png") ) return; //m_engine->LoadImage(); scale = m_terrain->GetReliefScale(); diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp index 86595f9..21f8158 100644 --- a/src/ui/scroll.cpp +++ b/src/ui/scroll.cpp @@ -379,7 +379,7 @@ void CScroll::DrawVertex(Math::Point pos, Math::Point dim, int icon) if ( icon == 0 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.0f/256.0f; // yellow rectangle uv1.y = 32.0f/256.0f; @@ -389,7 +389,7 @@ void CScroll::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 1 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f/256.0f; // gray rectangle uv1.y = 32.0f/256.0f; @@ -399,7 +399,7 @@ void CScroll::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 2 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f/256.0f; // blue rectangle uv1.y = 0.0f/256.0f; @@ -409,7 +409,7 @@ void CScroll::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 104.0f/256.0f; // blue line - uv1.y = 32.0f/256.0f; diff --git a/src/ui/shortcut.cpp b/src/ui/shortcut.cpp index 7001e97..8fe62ba 100644 --- a/src/ui/shortcut.cpp +++ b/src/ui/shortcut.cpp @@ -116,7 +116,7 @@ void CShortcut::Draw() zoom = 1.0f; } - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); if ( icon != -1 ) { @@ -132,7 +132,7 @@ void CShortcut::Draw() Math::Point p1, p2, c, uv1, uv2; float zoom, dp; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); zoom = 0.9f+sinf(m_time*8.0f)*0.1f; @@ -172,7 +172,7 @@ void CShortcut::Draw() Math::Point uv1, uv2; float dp; - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 160.0f/256.0f; diff --git a/src/ui/slider.cpp b/src/ui/slider.cpp index 2bf0cc8..4394cc2 100644 --- a/src/ui/slider.cpp +++ b/src/ui/slider.cpp @@ -498,7 +498,7 @@ void CSlider::DrawVertex(Math::Point pos, Math::Point dim, int icon) if ( icon == 0 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.0f/256.0f; // yellow rectangle uv1.y = 32.0f/256.0f; @@ -510,7 +510,7 @@ void CSlider::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 1 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f/256.0f; // gray rectangle uv1.y = 32.0f/256.0f; @@ -522,7 +522,7 @@ void CSlider::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 224.0f/256.0f; // cursor uv1.y = 32.0f/256.0f; diff --git a/src/ui/window.cpp b/src/ui/window.cpp index f922569..6755909 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -1186,7 +1186,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) if ( icon == 0 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 64.0f/256.0f; // dark blue transparent uv1.y = 64.0f/256.0f; @@ -1202,7 +1202,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 1 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 128.0f/256.0f; // yellow tooltip uv1.y = 0.0f/256.0f; @@ -1216,7 +1216,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 2 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f/256.0f; // yellow uv1.y = 16.0f/256.0f; @@ -1230,7 +1230,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 3 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 0.0f/256.0f; // transparent blue bar with yellow upper uv1.y = 64.0f/256.0f; @@ -1249,7 +1249,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) dim.x += 100.0f/640.0f; dim.y += 60.0f/480.0f; - m_engine->SetTexture("human.tga"); + m_engine->SetTexture("human.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 140.0f/256.0f; uv1.y = 32.0f/256.0f; @@ -1266,7 +1266,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) dim.x -= 20.0f/640.0f; dim.y += 0.0f/480.0f; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 192.0f/256.0f; uv1.y = 32.0f/256.0f; @@ -1285,7 +1285,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) dim.x -= 20.0f/640.0f; dim.y -= 20.0f/480.0f; - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f/256.0f; uv1.y = 0.0f/256.0f; @@ -1321,7 +1321,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) dim.x -= 20.0f/640.0f; dim.y -= 20.0f/480.0f; - m_engine->SetTexture("button3.tga"); + m_engine->SetTexture("button3.png"); uv1.x = 0.0f/256.0f; uv1.y = 224.0f/256.0f; uv2.x = 32.0f/256.0f; @@ -1332,7 +1332,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) uv2.y -= dp; DrawIcon(pos, dim, uv1, uv2); // dark blue background - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); uv1.x = 224.0f/256.0f; uv1.y = 224.0f/256.0f; uv2.x = 249.0f/256.0f; @@ -1404,7 +1404,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 5 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent green uv1.y = 160.0f/256.0f; @@ -1418,7 +1418,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 6 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent red uv1.y = 176.0f/256.0f; @@ -1432,7 +1432,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 7 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent blue uv1.y = 192.0f/256.0f; @@ -1446,7 +1446,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 8 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.0f/256.0f; // opaque orange uv1.y = 0.0f/256.0f; @@ -1462,7 +1462,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 9 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 32.0f/256.0f; // opaque gray uv1.y = 32.0f/256.0f; @@ -1482,7 +1482,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 11 ) { - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent yellow uv1.y = 224.0f/256.0f; @@ -1496,7 +1496,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 12 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f/256.0f; // dirty opaque gray uv1.y = 128.0f/256.0f; @@ -1512,7 +1512,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 13 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 192.0f/256.0f; // dirty opaque blue uv1.y = 128.0f/256.0f; @@ -1528,7 +1528,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 14 ) { - m_engine->SetTexture("button1.tga"); + m_engine->SetTexture("button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 160.0f/256.0f; // dirty opaque red uv1.y = 128.0f/256.0f; @@ -1556,7 +1556,7 @@ void CWindow::DrawHach(Math::Point pos, Math::Point dim) dp = 0.5f/256.0f; - m_engine->SetTexture("button2.tga"); + m_engine->SetTexture("button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f/256.0f; // hatching uv1.y = 208.0f/256.0f; |