diff options
author | Krzysztof Dermont <erihel@gmail.com> | 2014-06-20 23:41:38 +0200 |
---|---|---|
committer | Krzysztof Dermont <erihel@gmail.com> | 2014-06-20 23:51:28 +0200 |
commit | 2260f6bf4feb62929e32a1bea9cd3f403aa034b1 (patch) | |
tree | a9f830fe8ddfa57598a0802ced6540befb8c8c75 /src/ui | |
parent | ba62e6f8be5f7008939677ce70799ecc26adf420 (diff) | |
download | colobot-2260f6bf4feb62929e32a1bea9cd3f403aa034b1.tar.gz colobot-2260f6bf4feb62929e32a1bea9cd3f403aa034b1.tar.bz2 colobot-2260f6bf4feb62929e32a1bea9cd3f403aa034b1.zip |
Big part of PhysFS support
* removed -mod argument
* removed -datadir argument
* removed -lang argument
* removed some dead ui code
* added resource manager and file loaders (stream and SDL)
* changed interface textures location to match new directory structure
* removed CGameData for mod support
* added PhysFS support
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/button.cpp | 2 | ||||
-rw-r--r-- | src/ui/check.cpp | 2 | ||||
-rw-r--r-- | src/ui/color.cpp | 2 | ||||
-rw-r--r-- | src/ui/compass.cpp | 2 | ||||
-rw-r--r-- | src/ui/control.cpp | 16 | ||||
-rw-r--r-- | src/ui/displayinfo.cpp | 282 | ||||
-rw-r--r-- | src/ui/displayinfo.h | 1 | ||||
-rw-r--r-- | src/ui/edit.cpp | 43 | ||||
-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 | 24 | ||||
-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 |
19 files changed, 121 insertions, 415 deletions
diff --git a/src/ui/button.cpp b/src/ui/button.cpp index 810d365..d859fb7 100644 --- a/src/ui/button.cpp +++ b/src/ui/button.cpp @@ -176,7 +176,7 @@ void CButton::Draw() (m_state & STATE_CARD ) == 0 && (m_state & STATE_SIMPLY) == 0 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/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 6a92554..3410d2e 100644 --- a/src/ui/check.cpp +++ b/src/ui/check.cpp @@ -102,7 +102,7 @@ void CCheck::Draw() DrawShadow(m_pos, m_dim); } - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/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 cbbc0dc..b8659e3 100644 --- a/src/ui/color.cpp +++ b/src/ui/color.cpp @@ -138,7 +138,7 @@ void CColor::Draw() DrawShadow(m_pos, m_dim); } - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); CControl::Draw(); diff --git a/src/ui/compass.cpp b/src/ui/compass.cpp index d0fe96f..ebe1908 100644 --- a/src/ui/compass.cpp +++ b/src/ui/compass.cpp @@ -88,7 +88,7 @@ void CCompass::Draw() device = m_engine->GetDevice(); - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/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 501350e..c759505 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.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/button3.png"); icon = 3; // yellow with green point pressed } @@ -507,22 +507,22 @@ void CControl::Draw() { icon -= 192; #if _POLISH - m_engine->SetTexture("textp.png"); + m_engine->SetTexture("textures/interface/textp.png"); #else - m_engine->SetTexture("text.png"); + m_engine->SetTexture("textures/interface/text.png"); #endif m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); } else if ( icon >= 128 ) { icon -= 128; - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); } else if ( icon >= 64 ) { icon -= 64; - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState( Gfx::ENG_RSTATE_TTEXTURE_WHITE); pos.x += deep * 0.010f * 0.75f; diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp index 8db53c5..ee29e27 100644 --- a/src/ui/displayinfo.cpp +++ b/src/ui/displayinfo.cpp @@ -342,8 +342,6 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc m_index = index; m_bSoluce = bSoluce; -//? CreateObjectsFile(); - m_bEditLock = m_main->GetEditLock(); if ( m_bEditLock ) // edition running program? { @@ -941,284 +939,4 @@ CObject* CDisplayInfo::SearchToto() return 0; } - -// Creating the list of objects. - -struct ObjectList -{ - int total; - ObjectType type; -}; - -void ObjectAdd(ObjectList list[], ObjectType type) -{ - int i; - - for ( i=0 ; i<200 ; i++ ) - { - if ( list[i].total == 0 ) - { - list[i].total ++; - list[i].type = type; - list[i+1].total = 0; - return; - } - if ( list[i].type == type ) - { - list[i].total ++; - return; - } - } -} - -void ObjectWrite(FILE* file, ObjectList list[], int i) -{ - std::string line; - - if ( list[i].total < 10 ) - { - line = StrUtils::Format("\\c; %dx \\n;\\l;", list[i].total); - } - else - { - line = StrUtils::Format("\\c;%dx \\n;\\l;", list[i].total); - } - - std::string res; - GetResource(RES_OBJECT, list[i].type, res); - if (res.empty()) - return; - - line += res; - - line += "\\u "; - - std::string helpFilename = GetHelpFilename(list[i].type); - if (helpFilename.empty()) - return; - - line += helpFilename.substr(7); // skip "help\?\" - - auto pos = line.find(".txt"); - if (pos != std::string::npos) - { - line = line.substr(0, pos); - } - - line += ";\n"; - - fputs(line.c_str(), file); -} - -// Creates the file containing the list of objects. - -void CDisplayInfo::CreateObjectsFile() -{ - FILE* file; - CObject* pObj; - ObjectType type; - ObjectList list[200]; - std::string line; - int i; - bool bRadar, bAtLeast; - - CInstanceManager* iMan = CInstanceManager::GetInstancePointer(); - - file = fopen((std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + std::string("objects.txt")).c_str(), "w"); - if ( file == 0 ) return; - - list[0].total = 0; // empty list - bRadar = false; - for ( i=0 ; i<1000000 ; i++ ) - { - pObj = static_cast<CObject*>(iMan->SearchInstance(CLASS_OBJECT, i)); - if ( pObj == 0 ) break; - - if ( !pObj->GetActif() ) continue; - if ( !pObj->GetSelectable() ) continue; - if ( pObj->GetProxyActivate() ) continue; - - type = pObj->GetType(); - if ( type == OBJECT_NULL ) continue; - if ( type == OBJECT_FIX ) continue; - - ObjectAdd(list, type); - - if ( type == OBJECT_RADAR ) bRadar = true; - } - - if ( bRadar ) - { - GetResource(RES_TEXT, RT_SATCOM_LIST, line); - fputs(line.c_str(), file); - bAtLeast = false; - for ( i=0 ; i<200 ; i++ ) - { - if ( list[i].total == 0 ) break; // end of the list? - - if ( list[i].type == OBJECT_BASE || - list[i].type == OBJECT_HUMAN ) - { - ObjectWrite(file, list, i); - bAtLeast = true; - } - } - if ( !bAtLeast ) - { - GetResource(RES_TEXT, RT_SATCOM_NULL, line); - fputs(line.c_str(), file); - } - - fputs("\n", file); - GetResource(RES_TEXT, RT_SATCOM_BOT, line); - fputs(line.c_str(), file); - bAtLeast = false; - for ( i=0 ; i<200 ; i++ ) - { - if ( list[i].total == 0 ) break; // end of the list? - - if ( list[i].type == OBJECT_MOBILEwt || - list[i].type == OBJECT_MOBILEtt || - list[i].type == OBJECT_MOBILEft || - list[i].type == OBJECT_MOBILEit || - list[i].type == OBJECT_MOBILEwa || - list[i].type == OBJECT_MOBILEta || - list[i].type == OBJECT_MOBILEfa || - list[i].type == OBJECT_MOBILEia || - list[i].type == OBJECT_MOBILEwc || - list[i].type == OBJECT_MOBILEtc || - list[i].type == OBJECT_MOBILEfc || - list[i].type == OBJECT_MOBILEic || - list[i].type == OBJECT_MOBILEwi || - list[i].type == OBJECT_MOBILEti || - list[i].type == OBJECT_MOBILEfi || - list[i].type == OBJECT_MOBILEii || - list[i].type == OBJECT_MOBILEws || - list[i].type == OBJECT_MOBILEts || - list[i].type == OBJECT_MOBILEfs || - list[i].type == OBJECT_MOBILEis || - list[i].type == OBJECT_MOBILErt || - list[i].type == OBJECT_MOBILErc || - list[i].type == OBJECT_MOBILErr || - list[i].type == OBJECT_MOBILErs || - list[i].type == OBJECT_MOBILEsa || - list[i].type == OBJECT_MOBILEtg || - list[i].type == OBJECT_MOBILEdr ) - { - ObjectWrite(file, list, i); - bAtLeast = true; - } - } - if ( !bAtLeast ) - { - GetResource(RES_TEXT, RT_SATCOM_NULL, line); - fputs(line.c_str(), file); - } - - fputs("\n", file); - GetResource(RES_TEXT, RT_SATCOM_BUILDING, line); - fputs(line.c_str(), file); - bAtLeast = false; - for ( i=0 ; i<200 ; i++ ) - { - if ( list[i].total == 0 ) break; // end of the list? - - if ( list[i].type == OBJECT_DERRICK || - list[i].type == OBJECT_FACTORY || - list[i].type == OBJECT_STATION || - list[i].type == OBJECT_CONVERT || - list[i].type == OBJECT_REPAIR || - list[i].type == OBJECT_DESTROYER|| - list[i].type == OBJECT_TOWER || - list[i].type == OBJECT_NEST || - list[i].type == OBJECT_RESEARCH || - list[i].type == OBJECT_RADAR || - list[i].type == OBJECT_ENERGY || - list[i].type == OBJECT_LABO || - list[i].type == OBJECT_NUCLEAR || - list[i].type == OBJECT_START || - list[i].type == OBJECT_END || - list[i].type == OBJECT_INFO || - list[i].type == OBJECT_PARA || - list[i].type == OBJECT_TARGET1 || - list[i].type == OBJECT_TARGET2 || - list[i].type == OBJECT_SAFE || - list[i].type == OBJECT_HUSTON ) - { - ObjectWrite(file, list, i); - bAtLeast = true; - } - } - if ( !bAtLeast ) - { - GetResource(RES_TEXT, RT_SATCOM_NULL, line); - fputs(line.c_str(), file); - } - - fputs("\n", file); - GetResource(RES_TEXT, RT_SATCOM_FRET, line); - fputs(line.c_str(), file); - bAtLeast = false; - for ( i=0 ; i<200 ; i++ ) - { - if ( list[i].total == 0 ) break; // end of the list? - - if ( list[i].type == OBJECT_STONE || - list[i].type == OBJECT_URANIUM || - list[i].type == OBJECT_METAL || - list[i].type == OBJECT_POWER || - list[i].type == OBJECT_ATOMIC || - list[i].type == OBJECT_BULLET || - list[i].type == OBJECT_BBOX || - list[i].type == OBJECT_TNT ) - { - ObjectWrite(file, list, i); - bAtLeast = true; - } - } - if ( !bAtLeast ) - { - GetResource(RES_TEXT, RT_SATCOM_NULL, line); - fputs(line.c_str(), file); - } - - fputs("\n", file); - GetResource(RES_TEXT, RT_SATCOM_ALIEN, line); - fputs(line.c_str(), file); - bAtLeast = false; - for ( i=0 ; i<200 ; i++ ) - { - if ( list[i].total == 0 ) break; // end of the list? - - if ( list[i].type == OBJECT_MOTHER || - list[i].type == OBJECT_ANT || - list[i].type == OBJECT_BEE || - list[i].type == OBJECT_WORM || - list[i].type == OBJECT_SPIDER ) - { - ObjectWrite(file, list, i); - bAtLeast = true; - } - } - if ( !bAtLeast ) - { - GetResource(RES_TEXT, RT_SATCOM_NULL, line); - fputs(line.c_str(), file); - } - } - else - { - GetResource(RES_TEXT, RT_SATCOM_ERROR1, line); - fputs(line.c_str(), file); - GetResource(RES_TEXT, RT_SATCOM_ERROR2, line); - fputs(line.c_str(), file); - } - - fputs("\n", file); - - fclose(file); -} - - } - diff --git a/src/ui/displayinfo.h b/src/ui/displayinfo.h index 891551b..0942497 100644 --- a/src/ui/displayinfo.h +++ b/src/ui/displayinfo.h @@ -66,7 +66,6 @@ protected: void UpdateCopyButton(); void ViewDisplayInfo(); CObject* SearchToto(); - void CreateObjectsFile(); protected: Gfx::CEngine* m_engine; diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index 6602651..287d0f3 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -19,10 +19,11 @@ #include "ui/edit.h" #include "app/app.h" -#include "app/gamedata.h" #include "clipboard/clipboard.h" +#include "common/resources/inputstream.h" + #include <string.h> namespace Ui { @@ -782,15 +783,13 @@ void CEdit::HyperJump(std::string name, std::string marker) sMarker = marker; -//? sprintf(filename, "help\\%s.txt", name); - if ( name[0] == '%' ) { filename = GetProfile().GetUserBasedPath(name, "") + ".txt"; } else { - filename = std::string("help/") + CApplication::GetInstancePointer()->GetLanguageChar() + "/" + name + std::string(".txt"); + filename = name + std::string(".txt"); } if ( ReadText(filename) ) @@ -1145,7 +1144,7 @@ void CEdit::DrawImage(Math::Point pos, std::string name, float width, float dp; std::string filename; - filename = GetProfile().GetUserBasedPath(name, "../icons") + ".png"; + filename = name + ".png"; m_engine->SetTexture(filename); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); @@ -1175,7 +1174,7 @@ void CEdit::DrawBack(Math::Point pos, Math::Point dim) if ( m_bGeneric ) return; - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); if ( m_bMulti ) @@ -1226,9 +1225,9 @@ void CEdit::DrawPart(Math::Point pos, Math::Point dim, int icon) float dp; #if _POLISH - m_engine->SetTexture("textp.png"); + m_engine->SetTexture("textures/interface/textp.png"); #else - m_engine->SetTexture("text.png"); + m_engine->SetTexture("textures/interface/text.png"); #endif m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); @@ -1427,7 +1426,7 @@ void CEdit::FreeImage() for (int i = 0 ; i < m_imageTotal; i++ ) { - filename = GetProfile().GetUserBasedPath(m_image[i].name, "../icons") + ".png"; + filename = m_image[i].name + ".png"; m_engine->DeleteTexture(filename); } } @@ -1437,7 +1436,7 @@ void CEdit::FreeImage() void CEdit::LoadImage(std::string name) { std::string filename; - filename = GetProfile().GetUserBasedPath(name, "../icons") + ".png"; + filename = name + ".png"; m_engine->LoadTexture(filename); } @@ -1445,7 +1444,6 @@ void CEdit::LoadImage(std::string name) bool CEdit::ReadText(std::string filename, int addSize) { - FILE *file = NULL; char *buffer; int len, i, j, n, font, iIndex, iLines, iCount, iLink, res; char iName[50]; @@ -1457,24 +1455,17 @@ bool CEdit::ReadText(std::string filename, int addSize) if ( filename[0] == 0 ) return false; boost::replace_all(filename, "\\", "/"); - - /* This is ugly but doesn't require many changes in code. If file doesn't - exists it's posible filename is absolute not full path */ std::string path = filename; - if (!fs::exists(path)) + + CInputStream stream; + stream.open(fs::path(path).make_preferred().string()); + + if (!stream.is_open()) { - path = CGameData::GetInstancePointer()->GetDataPath(filename); - } - - file = fopen(fs::path(path).make_preferred().string().c_str(), "rb"); - if ( file == NULL ) { - CLogger::GetInstancePointer()->Error("Unable to read text from file \"%s\"\n", path.c_str()); return false; } - fseek(file, 0, SEEK_END); - len = ftell(file); - fseek(file, 0, SEEK_SET); + len = stream.size(); m_maxChar = len+addSize+100; m_len = len; @@ -1492,7 +1483,7 @@ bool CEdit::ReadText(std::string filename, int addSize) buffer = new char[m_maxChar+1]; memset(buffer, 0, m_maxChar+1); - fread(buffer, 1, len, file); + stream.read(buffer, len); m_format.clear(); m_format.reserve(m_maxChar+1); @@ -1501,7 +1492,7 @@ bool CEdit::ReadText(std::string filename, int addSize) m_format.push_back(0); } - fclose(file); + stream.close(); bInSoluce = false; font = m_fontType; diff --git a/src/ui/gauge.cpp b/src/ui/gauge.cpp index a8ee41c..170db5b 100644 --- a/src/ui/gauge.cpp +++ b/src/ui/gauge.cpp @@ -75,7 +75,7 @@ void CGauge::Draw() if ( (m_state & STATE_VISIBLE) == 0 ) return; - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/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 64495e0..d90a9e6 100644 --- a/src/ui/group.cpp +++ b/src/ui/group.cpp @@ -87,7 +87,7 @@ void CGroup::Draw() if ( m_icon == 0 ) // hollow frame? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 160.0f / 256.0f; uv1.y = 192.0f / 256.0f; // u-v texture @@ -103,7 +103,7 @@ void CGroup::Draw() } if ( m_icon == 1 ) // orange solid opaque? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 104.0f / 256.0f; uv1.y = 48.0f / 256.0f; @@ -117,7 +117,7 @@ void CGroup::Draw() } if ( m_icon == 2 ) // orange degrade -> transparent? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 112.0f / 256.0f; uv1.y = 48.0f / 256.0f; @@ -131,7 +131,7 @@ void CGroup::Draw() } if ( m_icon == 3 ) // transparent gradient -> gray? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 120.0f / 256.0f; uv1.y = 48.0f / 256.0f; @@ -145,7 +145,7 @@ void CGroup::Draw() } if ( m_icon == 4 ) // degrade blue corner? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 192.0f / 256.0f; uv1.y = 128.0f / 256.0f; @@ -159,7 +159,7 @@ void CGroup::Draw() } if ( m_icon == 5 ) // degrade orange corner? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 224.0f / 256.0f; uv1.y = 128.0f / 256.0f; @@ -173,7 +173,7 @@ void CGroup::Draw() } if ( m_icon == 6 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 0.0f / 256.0f; // brown transparent uv1.y = 75.0f / 256.0f; @@ -189,7 +189,7 @@ void CGroup::Draw() } if ( m_icon == 7 ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; uv1.y = 0.0f / 256.0f; @@ -203,7 +203,7 @@ void CGroup::Draw() } if ( m_icon == 8 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // green transparent uv1.y = 160.0f / 256.0f; @@ -217,7 +217,7 @@ void CGroup::Draw() } if ( m_icon == 9 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // red transparent uv1.y = 176.0f/256.0f; @@ -231,7 +231,7 @@ void CGroup::Draw() } if ( m_icon == 10 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // blue transparent uv1.y = 192.0f / 256.0f; @@ -245,7 +245,7 @@ void CGroup::Draw() } if ( m_icon == 11 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f / 256.0f; // yellow transparent uv1.y = 224.0f / 256.0f; @@ -262,7 +262,7 @@ void CGroup::Draw() dim.x = m_dim.x / 2.0f; dim.y = m_dim.y / 2.0f; - m_engine->SetTexture("mouse.png"); + m_engine->SetTexture("textures/interface/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; @@ -301,7 +301,7 @@ void CGroup::Draw() } if ( m_icon == 13 ) // corner upper / left? { - m_engine->SetTexture("mouse.png"); + m_engine->SetTexture("textures/interface/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; @@ -322,7 +322,7 @@ void CGroup::Draw() } if ( m_icon == 14 ) // corner upper / right? { - m_engine->SetTexture("mouse.png"); + m_engine->SetTexture("textures/interface/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; @@ -343,7 +343,7 @@ void CGroup::Draw() } if ( m_icon == 15 ) // corner lower / left? { - m_engine->SetTexture("mouse.png"); + m_engine->SetTexture("textures/interface/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; @@ -364,7 +364,7 @@ void CGroup::Draw() } if ( m_icon == 16 ) // corner lower / left? { - m_engine->SetTexture("mouse.png"); + m_engine->SetTexture("textures/interface/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; @@ -385,7 +385,7 @@ void CGroup::Draw() } if ( m_icon == 17 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.0f / 256.0f; // blue frame uv1.y = 75.0f / 256.0f; @@ -401,7 +401,7 @@ void CGroup::Draw() } if ( m_icon == 18 ) // arrow> for SatCom? { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 0.0f / 256.0f; // > uv1.y = 192.0f / 256.0f; @@ -415,7 +415,7 @@ void CGroup::Draw() } if ( m_icon == 19 ) // SatCom symbol? { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 224.0f / 256.0f; // SatCom symbol uv1.y = 224.0f / 256.0f; @@ -429,7 +429,7 @@ void CGroup::Draw() } if ( m_icon == 20 ) // solid blue background? { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 224.0f / 256.0f; uv1.y = 32.0f / 256.0f; @@ -443,7 +443,7 @@ void CGroup::Draw() } if ( m_icon == 21 ) // stand-by symbol? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 160.0f / 256.0f; uv1.y = 32.0f / 256.0f; @@ -457,7 +457,7 @@ void CGroup::Draw() } if ( m_icon == 22 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; // opaque yellow uv1.y = 224.0f / 256.0f; @@ -474,7 +474,7 @@ void CGroup::Draw() if ( m_icon == 23 ) { - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; // yellow uv1.y = 192.0f / 256.0f; @@ -490,7 +490,7 @@ void CGroup::Draw() } if ( m_icon == 24 ) { - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 80.0f / 256.0f; // orange uv1.y = 192.0f / 256.0f; @@ -506,7 +506,7 @@ void CGroup::Draw() } if ( m_icon == 25 ) { - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; // orange uv1.y = 208.0f / 256.0f; @@ -522,7 +522,7 @@ void CGroup::Draw() } if ( m_icon == 26 ) { - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 80.0f / 256.0f; // red uv1.y = 208.0f / 256.0f; @@ -538,7 +538,7 @@ void CGroup::Draw() } if ( m_icon == 27 ) { - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 32.0f / 256.0f; uv1.y = 0.0f / 256.0f; @@ -556,7 +556,7 @@ void CGroup::Draw() pos = m_pos; dim = m_dim; - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 32.0f / 256.0f; uv1.y = 32.0f / 256.0f; @@ -568,7 +568,7 @@ void CGroup::Draw() uv2.y -= dp; DrawIcon(pos, dim, uv1, uv2); - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/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 8f9b5ca..bd261b3 100644 --- a/src/ui/image.cpp +++ b/src/ui/image.cpp @@ -110,7 +110,7 @@ void CImage::Draw() if ( m_icon == 0 ) // hollow frame? { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/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 aacc8d8..0b86a91 100644 --- a/src/ui/key.cpp +++ b/src/ui/key.cpp @@ -136,7 +136,7 @@ void CKey::Draw() DrawShadow(m_pos, m_dim); - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); // was D3DSTATENORMAL float zoomExt = 1.00f; diff --git a/src/ui/list.cpp b/src/ui/list.cpp index f6c3ed9..b5f7599 100644 --- a/src/ui/list.cpp +++ b/src/ui/list.cpp @@ -388,7 +388,7 @@ void CList::Draw() if (m_icon == 0) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f / 256.0f; @@ -398,7 +398,7 @@ void CList::Draw() } else { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 132.0f / 256.0f; @@ -434,7 +434,7 @@ void CList::Draw() dim.y *= 0.4f; pos.y -= dim.y; - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); // was D3DSTATETTw uv1.x = 120.0f / 256.0f; uv1.y = 64.0f / 256.0f; @@ -509,7 +509,7 @@ void CList::Draw() if ( m_check[i + m_firstLine] ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f / 256.0f; uv1.y = 0.0f / 256.0f; @@ -534,7 +534,7 @@ void CList::Draw() } else { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); // was D3DSTATETTw if ( i + m_firstLine == m_selectLine ) { diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp index 1964531..9afad80 100644 --- a/src/ui/maindialog.cpp +++ b/src/ui/maindialog.cpp @@ -18,7 +18,6 @@ #include "ui/maindialog.h" #include "app/app.h" -#include "app/gamedata.h" #include "app/system.h" #include "common/config.h" @@ -182,7 +181,7 @@ CMainDialog::CMainDialog() #if DEV_BUILD m_savegameDir = "savegame"; #else - m_savegameDir = GetSystemUtils()->GetSavegameDirectoryLocation(); + m_savegameDir = "savegame"; #endif m_publicDir = "program"; @@ -389,7 +388,7 @@ pb->SetState(STATE_SHADOW); pl->SetFontType(Gfx::FONT_COURIER); pl->SetFontSize(Gfx::FONT_SIZE_SMALL); - m_engine->SetBackground("interface.png", + m_engine->SetBackground("textures/interface/interface.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -509,7 +508,7 @@ pb->SetState(STATE_SHADOW); UpdateNameControl(); UpdateNameFace(); - m_engine->SetBackground("interface.png", + m_engine->SetBackground("textures/interface/interface.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -973,7 +972,7 @@ pb->SetState(STATE_SHADOW); pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_BACK); pb->SetState(STATE_SHADOW); - m_engine->SetBackground("interface.png", + m_engine->SetBackground("textures/interface/interface.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -1172,7 +1171,7 @@ pb->SetState(STATE_SHADOW); if ( !m_bSimulSetup ) { - m_engine->SetBackground("interface.png", + m_engine->SetBackground("textures/interface/interface.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -1690,7 +1689,7 @@ pos.y -= 0.048f; if ( m_phase == PHASE_READ ) { - m_engine->SetBackground("interface.png", + m_engine->SetBackground("textures/interface/interface.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -1740,7 +1739,7 @@ pos.y -= 0.048f; pl->SetFontSize(12.0f); pl->SetTextAlign(Gfx::TEXT_ALIGN_CENTER); - m_engine->SetBackground("interface.png", + m_engine->SetBackground("textures/interface/interface.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -1762,7 +1761,7 @@ pos.y -= 0.048f; m_engine->SetOverColor(Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f), Gfx::ENG_RSTATE_TCOLOR_BLACK); // TODO: color ok? m_engine->SetOverFront(true); - m_engine->SetBackground("ppc.png", + m_engine->SetBackground("textures/interface/ppc.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -1781,7 +1780,7 @@ pos.y -= 0.048f; m_engine->SetOverColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::ENG_RSTATE_TCOLOR_WHITE); // TODO: color ok? m_engine->SetOverFront(true); - m_engine->SetBackground("colobot.png", + m_engine->SetBackground("textures/interface/colobot.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -1800,7 +1799,7 @@ pos.y -= 0.048f; m_engine->SetOverColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::ENG_RSTATE_TCOLOR_WHITE); // TODO: color ok? m_engine->SetOverFront(true); - m_engine->SetBackground("epsitec.png", + m_engine->SetBackground("textures/interface/epsitec.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -1925,7 +1924,7 @@ pos.y -= 0.048f; pb->SetState(STATE_SHADOW); // #endif - m_engine->SetBackground("generico.png", + m_engine->SetBackground("textures/interface/generico.png", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f), @@ -3589,7 +3588,6 @@ void CMainDialog::BuildSceneName(std::string &filename, char *base, int rank) { rankStream << std::setfill('0') << std::setw(3) << rank; filename = base + rankStream.str() + ".txt"; - filename = CGameData::GetInstancePointer()->GetFilePath(DIR_LEVEL, filename); } } diff --git a/src/ui/map.cpp b/src/ui/map.cpp index c5f0062..1e77c08 100644 --- a/src/ui/map.cpp +++ b/src/ui/map.cpp @@ -322,7 +322,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.png"); + m_engine->SetTexture("textures/interface/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); @@ -469,7 +469,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.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); bEnding = false; @@ -529,7 +529,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo return; // flashes } - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); if ( bUp ) { @@ -672,7 +672,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo { if ( bSelect ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); if ( m_bToy ) { @@ -698,7 +698,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo { if ( m_bRadar ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 64.5f/256.0f; // blue triangle uv1.y = 240.5f/256.0f; @@ -718,7 +718,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo if ( color == MAPCOLOR_WAYPOINTb ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 192.5f/256.0f; // blue cross uv1.y = 240.5f/256.0f; @@ -728,7 +728,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTr ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 208.5f/256.0f; // red cross uv1.y = 240.5f/256.0f; @@ -738,7 +738,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTg ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 224.5f/256.0f; // green cross uv1.y = 240.5f/256.0f; @@ -748,7 +748,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTy ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 240.5f/256.0f; // yellow cross uv1.y = 240.5f/256.0f; @@ -758,7 +758,7 @@ void CMap::DrawObject(Math::Point pos, float dir, ObjectType type, MapColor colo } if ( color == MAPCOLOR_WAYPOINTv ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 192.5f/256.0f; // violet cross uv1.y = 224.5f/256.0f; @@ -779,7 +779,7 @@ void CMap::DrawObjectIcon(Math::Point pos, Math::Point dim, MapColor color, dp = 0.5f/256.0f; - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); if ( color == MAPCOLOR_MOVE ) { @@ -894,7 +894,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.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 160.5f/256.0f; // hilite uv1.y = 224.5f/256.0f; @@ -1052,8 +1052,8 @@ void CMap::UpdateTerrain() } } - m_engine->DeleteTexture("map.png"); - m_engine->LoadTexture("map.png", &img); + m_engine->DeleteTexture("textures/interface/map.png"); + m_engine->LoadTexture("textures/interface/map.png", &img); } // Updates the field in the map. diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp index b3422ec..680f647 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.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/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 a01864a..8971e9d 100644 --- a/src/ui/shortcut.cpp +++ b/src/ui/shortcut.cpp @@ -114,7 +114,7 @@ void CShortcut::Draw() zoom = 1.0f; } - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/button3.png"); if ( icon != -1 ) { @@ -130,7 +130,7 @@ void CShortcut::Draw() Math::Point p1, p2, c, uv1, uv2; float dp; - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); zoom = 0.9f+sinf(m_time*8.0f)*0.1f; @@ -170,7 +170,7 @@ void CShortcut::Draw() Math::Point uv1, uv2; float dp; - m_engine->SetTexture("button3.png"); + m_engine->SetTexture("textures/interface/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 33293d1..7e41083 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.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/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.png"); + m_engine->SetTexture("textures/interface/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 ed18ce4..70bb2d5 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -1174,7 +1174,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) if ( icon == 0 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/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; @@ -1190,7 +1190,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 1 ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f/256.0f; // white tooltip uv1.y = 0.0f/256.0f; @@ -1204,7 +1204,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 2 ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f/256.0f; // yellow uv1.y = 16.0f/256.0f; @@ -1218,7 +1218,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 3 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/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; @@ -1237,7 +1237,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.png"); + m_engine->SetTexture("textures/interface/human.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 140.0f/256.0f; uv1.y = 32.0f/256.0f; @@ -1254,7 +1254,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.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE); uv1.x = 192.0f/256.0f; uv1.y = 32.0f/256.0f; @@ -1273,7 +1273,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.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f/256.0f; uv1.y = 0.0f/256.0f; @@ -1309,7 +1309,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.png"); + m_engine->SetTexture("textures/interface/button3.png"); uv1.x = 0.0f/256.0f; uv1.y = 224.0f/256.0f; uv2.x = 32.0f/256.0f; @@ -1320,7 +1320,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.png"); + m_engine->SetTexture("textures/interface/button2.png"); uv1.x = 224.0f/256.0f; uv1.y = 224.0f/256.0f; uv2.x = 249.0f/256.0f; @@ -1392,7 +1392,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 5 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent green uv1.y = 160.0f/256.0f; @@ -1406,7 +1406,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 6 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent red uv1.y = 176.0f/256.0f; @@ -1420,7 +1420,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 7 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent blue uv1.y = 192.0f/256.0f; @@ -1434,7 +1434,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 8 ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 0.0f/256.0f; // opaque orange uv1.y = 0.0f/256.0f; @@ -1450,7 +1450,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 9 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 32.0f/256.0f; // opaque gray uv1.y = 32.0f/256.0f; @@ -1470,7 +1470,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 11 ) { - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK); uv1.x = 64.0f/256.0f; // transparent yellow uv1.y = 224.0f/256.0f; @@ -1484,7 +1484,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 12 ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 128.0f/256.0f; // dirty opaque gray uv1.y = 128.0f/256.0f; @@ -1500,7 +1500,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 13 ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 192.0f/256.0f; // dirty opaque blue uv1.y = 128.0f/256.0f; @@ -1516,7 +1516,7 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon) } else if ( icon == 14 ) { - m_engine->SetTexture("button1.png"); + m_engine->SetTexture("textures/interface/button1.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 160.0f/256.0f; // dirty opaque red uv1.y = 128.0f/256.0f; @@ -1544,7 +1544,7 @@ void CWindow::DrawHach(Math::Point pos, Math::Point dim) dp = 0.5f/256.0f; - m_engine->SetTexture("button2.png"); + m_engine->SetTexture("textures/interface/button2.png"); m_engine->SetState(Gfx::ENG_RSTATE_NORMAL); uv1.x = 64.0f/256.0f; // hatching uv1.y = 208.0f/256.0f; |