summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2014-07-11 15:24:44 +0200
committerkrzys-h <krzys_h@interia.pl>2014-07-11 15:24:44 +0200
commit96d49d84aafecd78c902681f20de6207badf7e85 (patch)
tree7a835fce4f264c6c0886441c4f79e02cdf47582c /src
parent5223ef1fb116780298495a4d2f63e6c2c39fdfbd (diff)
parent852223262055440569ecca70f1b9da46089424c4 (diff)
downloadcolobot-96d49d84aafecd78c902681f20de6207badf7e85.tar.gz
colobot-96d49d84aafecd78c902681f20de6207badf7e85.tar.bz2
colobot-96d49d84aafecd78c902681f20de6207badf7e85.zip
Merge branch 'dev' into dev-physfs
Conflicts: data src/app/gamedata.cpp src/ui/control.cpp src/ui/edit.cpp src/ui/maindialog.cpp
Diffstat (limited to 'src')
-rw-r--r--src/common/event.cpp2
-rw-r--r--src/common/event.h2
-rw-r--r--src/common/image.cpp41
-rw-r--r--src/common/image.h6
-rw-r--r--src/common/misc.cpp18
-rw-r--r--src/common/restext.cpp4
-rw-r--r--src/common/restext.h2
-rw-r--r--src/graphics/core/device.h3
-rw-r--r--src/graphics/core/vertex.h4
-rw-r--r--src/graphics/engine/camera.cpp3
-rw-r--r--src/graphics/engine/engine.cpp17
-rw-r--r--src/graphics/opengl/gldevice.cpp13
-rw-r--r--src/graphics/opengl/gldevice.h2
-rw-r--r--src/object/auto/autobase.cpp4
-rw-r--r--src/object/brain.cpp20
-rw-r--r--src/object/robotmain.cpp69
-rw-r--r--src/object/robotmain.h1
-rw-r--r--src/object/task/taskterraform.cpp23
-rw-r--r--src/physics/physics.cpp16
-rw-r--r--src/script/script.cpp22
-rw-r--r--src/ui/color.cpp34
-rw-r--r--src/ui/control.cpp4
-rw-r--r--src/ui/displayinfo.cpp6
-rw-r--r--src/ui/edit.cpp4
-rw-r--r--src/ui/maindialog.cpp377
-rw-r--r--src/ui/studio.cpp16
-rw-r--r--src/ui/window.cpp3
27 files changed, 110 insertions, 606 deletions
diff --git a/src/common/event.cpp b/src/common/event.cpp
index 9dc3943..fc5bc98 100644
--- a/src/common/event.cpp
+++ b/src/common/event.cpp
@@ -67,7 +67,6 @@ void InitializeEventTypeTexts()
EVENT_TYPE_TEXT[EVENT_BUTTON_CANCEL] = "EVENT_BUTTON_CANCEL";
EVENT_TYPE_TEXT[EVENT_BUTTON_NEXT] = "EVENT_BUTTON_NEXT";
EVENT_TYPE_TEXT[EVENT_BUTTON_PREV] = "EVENT_BUTTON_PREV";
- EVENT_TYPE_TEXT[EVENT_BUTTON_QUIT] = "EVENT_BUTTON_QUIT";
EVENT_TYPE_TEXT[EVENT_BUTTON0] = "EVENT_BUTTON0";
EVENT_TYPE_TEXT[EVENT_BUTTON1] = "EVENT_BUTTON1";
@@ -170,7 +169,6 @@ void InitializeEventTypeTexts()
EVENT_TYPE_TEXT[EVENT_INTERFACE_READ] = "EVENT_INTERFACE_READ";
EVENT_TYPE_TEXT[EVENT_INTERFACE_ABORT] = "EVENT_INTERFACE_ABORT";
EVENT_TYPE_TEXT[EVENT_INTERFACE_USER] = "EVENT_INTERFACE_USER";
- EVENT_TYPE_TEXT[EVENT_INTERFACE_TEEN] = "EVENT_INTERFACE_TEEN";
EVENT_TYPE_TEXT[EVENT_INTERFACE_CHAP] = "EVENT_INTERFACE_CHAP";
EVENT_TYPE_TEXT[EVENT_INTERFACE_LIST] = "EVENT_INTERFACE_LIST";
diff --git a/src/common/event.h b/src/common/event.h
index c5eb615..220b807 100644
--- a/src/common/event.h
+++ b/src/common/event.h
@@ -90,7 +90,6 @@ enum EventType
EVENT_BUTTON_CANCEL = 41,
EVENT_BUTTON_NEXT = 42,
EVENT_BUTTON_PREV = 43,
- EVENT_BUTTON_QUIT = 44,
EVENT_BUTTON0 = 50,
EVENT_BUTTON1 = 51,
@@ -193,7 +192,6 @@ enum EventType
EVENT_INTERFACE_READ = 411,
EVENT_INTERFACE_ABORT = 412,
EVENT_INTERFACE_USER = 413,
- EVENT_INTERFACE_TEEN = 414,
EVENT_INTERFACE_CHAP = 420,
EVENT_INTERFACE_LIST = 421,
diff --git a/src/common/image.cpp b/src/common/image.cpp
index 9916c8f..dd905a7 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -428,3 +428,44 @@ bool CImage::SavePNG(const std::string& fileName)
return true;
}
+void CImage::SetDataPixels(void *pixels){
+
+ Uint8* srcPixels = static_cast<Uint8*> (pixels);
+ Uint8* resultPixels = static_cast<Uint8*> (m_data->surface->pixels);
+
+ Uint32 pitch = m_data->surface->pitch;
+
+ for(int line = 0; line < m_data->surface->h; ++line) {
+ Uint32 pos = line * pitch;
+ memcpy(&resultPixels[pos], &srcPixels[pos], pitch);
+ }
+}
+
+void CImage::flipVertically(){
+
+ SDL_Surface* result = SDL_CreateRGBSurface( m_data->surface->flags,
+ m_data->surface->w,
+ m_data->surface->h,
+ m_data->surface->format->BytesPerPixel * 8,
+ m_data->surface->format->Rmask,
+ m_data->surface->format->Gmask,
+ m_data->surface->format->Bmask,
+ m_data->surface->format->Amask);
+
+ assert(result != nullptr);
+
+ Uint8* srcPixels = static_cast<Uint8*> (m_data->surface->pixels);
+ Uint8* resultPixels = static_cast<Uint8*> (result->pixels);
+
+ Uint32 pitch = m_data->surface->pitch;
+ Uint32 pxLength = pitch*m_data->surface->h;
+
+ for(int line = 0; line < m_data->surface->h; ++line) {
+ Uint32 pos = line * pitch;
+ memcpy(&resultPixels[pos], &srcPixels[(pxLength-pos)-pitch], pitch);
+ }
+
+ SDL_FreeSurface(m_data->surface);
+
+ m_data->surface = result;
+}
diff --git a/src/common/image.h b/src/common/image.h
index 31dab2d..b93f2f9 100644
--- a/src/common/image.h
+++ b/src/common/image.h
@@ -109,6 +109,12 @@ public:
//! Returns the last error
std::string GetError();
+ //! Flips the image vertically
+ void flipVertically();
+
+ //! sets/replaces the pixels from the surface
+ void SetDataPixels(void *pixels);
+
private:
//! Blit to new RGBA surface with given size
void BlitToNewRGBASurface(int width, int height);
diff --git a/src/common/misc.cpp b/src/common/misc.cpp
index 65689e6..92c3e9a 100644
--- a/src/common/misc.cpp
+++ b/src/common/misc.cpp
@@ -192,18 +192,6 @@ void TimeToAscii(time_t time, char *buffer)
year = when.tm_year+1900;
if ( year < 2000 ) year -= 1900;
else year -= 2000;
-/* TODO
-#if _FRENCH
- sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d",
- when.tm_mday, when.tm_mon+1, year,
- when.tm_hour, when.tm_min);
-#endif
-#if _GERMAN | _WG
- sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d",
- when.tm_mday, when.tm_mon+1, year,
- when.tm_hour, when.tm_min);
-#endif
-#if _ENGLISH*/
char format[10];
int hour;
@@ -222,12 +210,6 @@ void TimeToAscii(time_t time, char *buffer)
sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d %s",
when.tm_mon+1, when.tm_mday, year,
hour, when.tm_min, format);
-/*#endif
-#if _POLISH
- sprintf(buffer, "%.2d.%.2d.%.2d %.2d:%.2d",
- when.tm_mday, when.tm_mon+1, year,
- when.tm_hour, when.tm_min);
-#endif*/
}
// Converting time to string.
diff --git a/src/common/restext.cpp b/src/common/restext.cpp
index b63160d..2248f2b 100644
--- a/src/common/restext.cpp
+++ b/src/common/restext.cpp
@@ -61,7 +61,6 @@ void InitializeRestext()
stringsText[RT_TITLE_DEFI] = "Challenges";
stringsText[RT_TITLE_MISSION] = "Missions";
stringsText[RT_TITLE_FREE] = "Free game";
- stringsText[RT_TITLE_TEEN] = "Free game";
stringsText[RT_TITLE_USER] = "User levels";
stringsText[RT_TITLE_SETUP] = "Options";
stringsText[RT_TITLE_NAME] = "Player's name";
@@ -80,7 +79,6 @@ void InitializeRestext()
stringsText[RT_PLAY_LISTm] = " Missions on this planet:";
stringsText[RT_PLAY_LISTf] = " Free game on this planet:";
stringsText[RT_PLAY_LISTu] = " Missions on this level:";
- stringsText[RT_PLAY_LISTk] = " Free game on this chapter:";
stringsText[RT_PLAY_RESUME] = " Summary:";
stringsText[RT_SETUP_DEVICE] = " Drivers:";
@@ -141,7 +139,6 @@ void InitializeRestext()
stringsEvent[EVENT_BUTTON_CANCEL] = "Cancel";
stringsEvent[EVENT_BUTTON_NEXT] = "Next";
stringsEvent[EVENT_BUTTON_PREV] = "Previous";
- stringsEvent[EVENT_BUTTON_QUIT] = "Menu (\\key quit;)";
stringsEvent[EVENT_DIALOG_OK] = "OK";
stringsEvent[EVENT_DIALOG_CANCEL] = "Cancel";
@@ -150,7 +147,6 @@ void InitializeRestext()
stringsEvent[EVENT_INTERFACE_DEFI] = "Challenges\\Programming challenges";
stringsEvent[EVENT_INTERFACE_MISSION] = "Missions\\Select mission";
stringsEvent[EVENT_INTERFACE_FREE] = "Free game\\Free game without a specific goal";
- stringsEvent[EVENT_INTERFACE_TEEN] = "Free game\\Free game without a specific goal";
stringsEvent[EVENT_INTERFACE_USER] = "User\\User levels";
stringsEvent[EVENT_INTERFACE_NAME] = "Change player\\Change player";
stringsEvent[EVENT_INTERFACE_SETUP] = "Options\\Preferences";
diff --git a/src/common/restext.h b/src/common/restext.h
index cde7203..d145f24 100644
--- a/src/common/restext.h
+++ b/src/common/restext.h
@@ -72,7 +72,6 @@ enum ResTextType
RT_TITLE_WRITE = 50,
RT_TITLE_READ = 51,
RT_TITLE_USER = 52,
- RT_TITLE_TEEN = 53,
RT_PLAY_CHAPt = 60,
RT_PLAY_CHAPd = 61,
@@ -86,7 +85,6 @@ enum ResTextType
RT_PLAY_CHAPu = 71,
RT_PLAY_LISTu = 72,
RT_PLAY_CHAPte = 73,
- RT_PLAY_LISTk = 74,
RT_SETUP_DEVICE = 80,
RT_SETUP_MODE = 81,
diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h
index 4c1189c..a896104 100644
--- a/src/graphics/core/device.h
+++ b/src/graphics/core/device.h
@@ -400,6 +400,9 @@ public:
virtual void SetFillMode(FillMode mode) = 0;
//! Returns the current fill mode
virtual FillMode GetFillMode() = 0;
+
+ //! Returns the pixels of the entire screen
+ virtual void* GetFrameBufferPixels()const = 0;
};
diff --git a/src/graphics/core/vertex.h b/src/graphics/core/vertex.h
index c3a657a..ca68352 100644
--- a/src/graphics/core/vertex.h
+++ b/src/graphics/core/vertex.h
@@ -82,7 +82,9 @@ struct VertexCol
Math::Vector coord;
Color color;
- explicit VertexCol(Math::Vector aCoord = Math::Vector(),
+ VertexCol() = default;
+
+ explicit VertexCol(Math::Vector aCoord,
Color aColor = Color())
: coord(aCoord), color(aColor) {}
diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp
index f0c379c..fedc70a 100644
--- a/src/graphics/engine/camera.cpp
+++ b/src/graphics/engine/camera.cpp
@@ -593,9 +593,6 @@ void CCamera::EffectFrame(const Event &event)
dist = Math::Norm((dist - 100.f) / 100.0f);
force *= 1.0f-dist;
-#if _TEEN
- force *= 2.0f;
-#endif
m_effectOffset *= force;
if (m_effectProgress >= 1.0f)
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 2745068..cfb794a 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -423,9 +423,20 @@ void CEngine::FrameUpdate()
bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height)
{
- // TODO write screenshot: not very important for now
- GetLogger()->Debug("CEngine::WriteSceenShot(): stub!\n");
- return true;
+ void *pixels = m_device->GetFrameBufferPixels();
+ CImage img({width,height});
+
+ img.SetDataPixels(pixels);
+ img.flipVertically();
+
+ if ( img.SavePNG(fileName.c_str()) ){
+ GetLogger()->Info("Save SceenShot Saved Successfully!\n");
+ return true;
+ }
+ else{
+ GetLogger()->Error("%s!\n",img.GetError().c_str());
+ return false;
+ }
}
bool CEngine::GetPause()
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 9f64fab..b42f29d 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -1791,6 +1791,19 @@ FillMode CGLDevice::GetFillMode()
return FILL_POINT;
}
+void* CGLDevice::GetFrameBufferPixels()const{
+
+ GLubyte* pixels = new GLubyte [4 * m_config.size.x * m_config.size.y];
+
+ glReadPixels(0, 0, m_config.size.x, m_config.size.y, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+
+ unsigned int* p = static_cast<unsigned int*> ( static_cast<void*>(pixels) );
+
+ for (int i = 0; i < m_config.size.x * m_config.size.y; ++i)
+ p[i] |= 0xFF000000;
+
+ return static_cast<void*>(p);
+}
} // namespace Gfx
diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h
index c648161..267ee73 100644
--- a/src/graphics/opengl/gldevice.h
+++ b/src/graphics/opengl/gldevice.h
@@ -188,6 +188,8 @@ public:
virtual void SetFillMode(FillMode mode) ;
virtual FillMode GetFillMode();
+ virtual void* GetFrameBufferPixels()const;
+
private:
//! Updates internal modelview matrix
void UpdateModelviewMatrix();
diff --git a/src/object/auto/autobase.cpp b/src/object/auto/autobase.cpp
index 25320d3..af6c6e0 100644
--- a/src/object/auto/autobase.cpp
+++ b/src/object/auto/autobase.cpp
@@ -1356,11 +1356,7 @@ void CAutoBase::BeginTransit()
}
else
{
-#if _DEMO
- m_bgBack = "back46b.png"; // paintings
-#else
m_bgBack = "back46.png"; // paintings
-#endif
}
m_engine->SetFogStart(0.9f); // hardly any fog
diff --git a/src/object/brain.cpp b/src/object/brain.cpp
index b27acd1..4bd8742 100644
--- a/src/object/brain.cpp
+++ b/src/object/brain.cpp
@@ -1789,9 +1789,6 @@ bool CBrain::CreateInterface(bool bSelect)
pos.x = ox+sx*13.4f;
pos.y = oy+sy*0;
-#if _TEEN
- pw->CreateButton(pos, dim, 9, EVENT_OBJECT_RESET);
-#else
if ( m_object->GetTrainer() ) // Training?
{
pw->CreateButton(pos, dim, 9, EVENT_OBJECT_RESET);
@@ -1800,7 +1797,6 @@ bool CBrain::CreateInterface(bool bSelect)
{
pw->CreateButton(pos, dim, 10, EVENT_OBJECT_DESELECT);
}
-#endif
if ( type == OBJECT_MOBILEfa ||
type == OBJECT_MOBILEta ||
@@ -2459,17 +2455,10 @@ void CBrain::UpdateScript(Ui::CWindow *pw)
char name[100];
char title[100];
int i;
- bool bSoluce;
pl = static_cast< Ui::CList* >(pw->SearchControl(EVENT_OBJECT_PROGLIST));
if ( pl == 0 ) return;
-#if _SCHOOL
- bSoluce = m_main->GetSoluce4();
-#else
- bSoluce = true;
-#endif
-
for ( i=0 ; i<BRAINMAXSCRIPT ; i++ )
{
sprintf(name, "%d", i+1);
@@ -2477,10 +2466,6 @@ void CBrain::UpdateScript(Ui::CWindow *pw)
if ( m_script[i] != 0 )
{
m_script[i]->GetTitle(title);
- if ( !bSoluce && i == 3 )
- {
- title[0] = 0;
- }
if ( title[0] != 0 )
{
sprintf(name, "%d: %s", i+1, title);
@@ -2490,11 +2475,6 @@ void CBrain::UpdateScript(Ui::CWindow *pw)
pl->SetItemName(i, name);
}
- if ( !bSoluce )
- {
- pl->SetEnable(3, false);
- }
-
pl->SetSelect(m_selScript);
pl->ShowSelect(true);
}
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index dee52d7..8108129 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -860,8 +860,6 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
CBotProgram::DefineNum("ResearchSubber", RESEARCH_SUBM);
CBotProgram::DefineNum("ResearchSniffer", RESEARCH_SNIFFER);
-//? CBotProgram::
-
CBotProgram::DefineNum("PolskiPortalColobota", 1337);
CBotClass* bc;
@@ -1084,9 +1082,6 @@ void CRobotMain::ChangePhase(Phase phase)
m_sound->StopMusic(0.0f);
m_camera->SetControllingObject(0);
-/* TODO: #if _SCHOOL
- if ( true )
-#else*/
if (m_gameTime > 10.0f) // did you play at least 10 seconds?
{
int rank = m_dialog->GetSceneRank();
@@ -1173,12 +1168,6 @@ void CRobotMain::ChangePhase(Phase phase)
m_cmdEdit = false; // hidden for now
// Creates the speedometer.
-/* TODO: #if _TEEN
- dim.x = 30.0f/640.0f;
- dim.y = 20.0f/480.0f;
- pos.x = 4.0f/640.0f;
- pos.y = 454.0f/480.0f;
-#else*/
dim.x = 30.0f/640.0f;
dim.y = 20.0f/480.0f;
pos.x = 4.0f/640.0f;
@@ -1225,14 +1214,6 @@ void CRobotMain::ChangePhase(Phase phase)
m_app->ResetTimeAfterLoading();
- /*Math::Point ddim;
-
- pos.x = 620.0f/640.0f;
- pos.y = 460.0f/480.0f;
- ddim.x = 20.0f/640.0f;
- ddim.y = 20.0f/480.0f;
- m_interface->CreateButton(pos, ddim, 11, EVENT_BUTTON_QUIT);*/
-
if (m_immediatSatCom && !loading &&
m_infoFilename[SATCOM_HUSTON][0] != 0)
StartDisplayInfo(SATCOM_HUSTON, false); // shows the instructions
@@ -1250,10 +1231,6 @@ void CRobotMain::ChangePhase(Phase phase)
}
else
{
-/* TODO: #if _TEEN
- m_winTerminate = (m_endingWinRank == 900);
- m_dialog->SetSceneName("teenw");
-#else*/
m_winTerminate = (m_endingWinRank == 904);
m_dialog->SetSceneName("win");
@@ -1267,16 +1244,6 @@ void CRobotMain::ChangePhase(Phase phase)
if (m_winTerminate)
{
-/* TODO: #if _TEEN
- pos.x = ox+sx*3; pos.y = oy+sy*1;
- ddim.x = dim.x*15; ddim.y = dim.y*2;
- pe = m_interface->CreateEdit(pos, ddim, 0, EVENT_EDIT0);
- pe->SetFontType(FONT_COLOBOT);
- pe->SetEditCap(false);
- pe->SetHiliteCap(false);
- pe->ReadText("help/teenw.txt");
-#else*/
-
pos.x = ox+sx*3; pos.y = oy+sy*0.2f;
ddim.x = dim.x*15; ddim.y = dim.y*3.0f;
pe = m_interface->CreateEdit(pos, ddim, 0, EVENT_EDIT0);
@@ -1662,18 +1629,6 @@ bool CRobotMain::ProcessEvent(Event &event)
m_cameraZoom = 0.0f;
break;
- case EVENT_BUTTON_QUIT:
- if (m_movie->IsExist())
- StartDisplayInfo(SATCOM_HUSTON, false);
- else if (m_winDelay > 0.0f)
- ChangePhase(PHASE_WIN);
- else if (m_lostDelay > 0.0f)
-
- ChangePhase(PHASE_LOST);
- else
- m_dialog->StartAbort(); // do you want to leave?
- break;
-
case EVENT_OBJECT_LIMIT:
StartShowLimit();
break;
@@ -2107,9 +2062,6 @@ void CRobotMain::ExecuteCmd(char *cmd)
return;
}
-/* TODO: #if _TEEN
- if (strcmp(cmd, "allteens") == 0)
-#else*/
if (strcmp(cmd, "allmission") == 0)
{
m_showAll = !m_showAll;
@@ -2216,12 +2168,6 @@ void CRobotMain::StartDisplayInfo(const char *filename, int index)
m_sound->MuteAll(true);
}
- Ui::CButton* pb = static_cast<Ui::CButton*>(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if (pb != nullptr)
- {
- pb->ClearState(Ui::STATE_VISIBLE);
- }
-
bool soluce = m_dialog->GetSceneSoluce();
m_displayInfo = new Ui::CDisplayInfo();
@@ -2250,10 +2196,6 @@ void CRobotMain::StopDisplayInfo()
if (!m_editLock)
{
- Ui::CButton* pb = static_cast<Ui::CButton*>(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if (pb != nullptr)
- pb->SetState(Ui::STATE_VISIBLE);
-
SelectObject(m_infoObject, false); // gives the command buttons
m_displayText->HideText(false);
@@ -2291,20 +2233,12 @@ void CRobotMain::StartSuspend()
m_infoObject = DeselectAll(); // removes the control buttons
m_displayText->HideText(true);
- Ui::CButton* pb = static_cast<Ui::CButton*>(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if (pb != nullptr)
- pb->ClearState(Ui::STATE_VISIBLE);
-
m_suspend = true;
}
//! End of dialogue during the game
void CRobotMain::StopSuspend()
{
- Ui::CButton* pb = static_cast<Ui::CButton*>(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if (pb != nullptr)
- pb->SetState(Ui::STATE_VISIBLE);
-
SelectObject(m_infoObject, false); // gives the command buttons
m_map->ShowMap(m_mapShow);
m_displayText->HideText(false);
@@ -4770,9 +4704,6 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
{
sprintf(op, "script%d", i+1); // script1..script10
OpString(line, op, name);
-/* TODO: #if _SCHOOL
- if ( !m_dialog->GetSoluce4() && i == 3 ) continue;
-#endif*/
if (name[0] != 0)
brain->SetScriptName(i, name);
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index 71ad455..19e9e7d 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -44,7 +44,6 @@ enum Phase
PHASE_DEFI,
PHASE_MISSION,
PHASE_FREE,
- PHASE_TEEN,
PHASE_USER,
PHASE_LOADING,
PHASE_SIMUL,
diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp
index 096e5de..61ff045 100644
--- a/src/object/task/taskterraform.cpp
+++ b/src/object/task/taskterraform.cpp
@@ -76,15 +76,9 @@ bool CTaskTerraform::EventProcess(const Event &event)
{
if ( m_soundChannel == -1 )
{
-#if _TEEN
- m_soundChannel = m_sound->Play(SOUND_GGG, m_object->GetPosition(0), 1.0f, 0.5f, true);
- m_sound->AddEnvelope(m_soundChannel, 1.0f, 2.0f, 1.5f, SOPER_CONTINUE);
- m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.5f, SOPER_STOP);
-#else
m_soundChannel = m_sound->Play(SOUND_GGG, m_object->GetPosition(0), 1.0f, 0.5f, true);
m_sound->AddEnvelope(m_soundChannel, 1.0f, 2.0f, 4.0f, SOPER_CONTINUE);
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.5f, SOPER_STOP);
-#endif
}
dir.x = 0.0f;
@@ -109,11 +103,7 @@ bool CTaskTerraform::EventProcess(const Event &event)
if ( m_phase == TTP_DOWN )
{
pos.x = 9.0f;
-#if _TEEN
- pos.y = 4.0f-m_progress*4.0f;
-#else
pos.y = 4.0f-m_progress*5.8f;
-#endif
pos.z = 0.0f;
m_object->SetPosition(2, pos);
}
@@ -121,11 +111,7 @@ bool CTaskTerraform::EventProcess(const Event &event)
if ( m_phase == TTP_UP )
{
pos.x = 9.0f;
-#if _TEEN
- pos.y = 4.0f-(1.0f-m_progress)*4.0f;
-#else
pos.y = 4.0f-(1.0f-m_progress)*5.8f;
-#endif
pos.z = 0.0f;
m_object->SetPosition(2, pos);
}
@@ -230,11 +216,7 @@ Error CTaskTerraform::Start()
m_phase = TTP_CHARGE;
m_progress = 0.0f;
-#if _TEEN
- m_speed = 1.0f/1.5f;
-#else
m_speed = 1.0f/4.0f;
-#endif
m_time = 0.0f;
m_bError = false; // ok
@@ -261,9 +243,6 @@ Error CTaskTerraform::IsEnded()
if ( m_phase == TTP_CHARGE )
{
-#if _TEEN
- Terraform(); // changes the terrain.
-#endif
m_phase = TTP_DOWN;
m_speed = 1.0f/0.2f;
@@ -272,9 +251,7 @@ Error CTaskTerraform::IsEnded()
if ( m_phase == TTP_DOWN )
{
-#if !_TEEN
Terraform(); // changes the terrain.
-#endif
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
m_object->SetZoom(0, 1.0f);
diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp
index ad59ec0..a3aaa28 100644
--- a/src/physics/physics.cpp
+++ b/src/physics/physics.cpp
@@ -2581,16 +2581,10 @@ int CPhysics::ObjectAdapt(const Math::Vector &pos, const Math::Vector &angle)
(oType >= OBJECT_MUSHROOM1 && oType <= OBJECT_MUSHROOM2) ) continue;
}
-/* TODO: #if _TEEN
- if ( oType == OBJECT_WAYPOINT &&
- pObj->GetEnable() &&
- !m_object->GetResetBusy() ) // driving vehicle?
-#else */
if ( oType == OBJECT_WAYPOINT &&
pObj->GetEnable() &&
!m_object->GetResetBusy() &&
m_object->GetTrainer() ) // driving vehicle?
-/* #endif */
{
oPos = pObj->GetPosition(0);
distance = Math::DistanceProjected(oPos, iPos);
@@ -2996,15 +2990,15 @@ void CPhysics::FrameParticle(float aTime, float rTime)
{
Math::Vector pos;
CObject* power;
- float energy, intensity;
+ float energy/*, intensity*/;
int effectLight;
- bool bFlash;
+ //bool bFlash;
m_restBreakParticle -= rTime;
if ( aTime-m_lastPowerParticle < m_engine->ParticleAdapt(0.05f) ) return;
m_lastPowerParticle = aTime;
- bFlash = false;
+ //bFlash = false;
energy = 0.0f;
power = m_object->GetPower();
@@ -3018,7 +3012,7 @@ void CPhysics::FrameParticle(float aTime, float rTime)
if ( energy > m_lastEnergy ) // recharge?
{
PowerParticle(1.0f, false);
- bFlash = true;
+ //bFlash = true;
}
if ( energy == 0.0f || m_lastEnergy == 0.0f )
@@ -3032,7 +3026,7 @@ void CPhysics::FrameParticle(float aTime, float rTime)
if ( m_restBreakParticle > 0.0f )
{
PowerParticle(m_restBreakParticle/2.5f, (energy == 0));
- bFlash = true;
+ //bFlash = true;
}
effectLight = m_object->GetEffectLight();
diff --git a/src/script/script.cpp b/src/script/script.cpp
index f59d27e..578c07d 100644
--- a/src/script/script.cpp
+++ b/src/script/script.cpp
@@ -2865,7 +2865,6 @@ bool CScript::rShield(CBotVar* var, CBotVar* result, int& exception, void* user)
CBotTypResult CScript::cFire(CBotVar* &var, void* user)
{
-#if 0
CObject* pThis = static_cast<CObject *>(user);
ObjectType type;
@@ -2873,23 +2872,25 @@ CBotTypResult CScript::cFire(CBotVar* &var, void* user)
if ( type == OBJECT_ANT )
{
- return cOnePoint(var, user);
+ if ( var == 0 ) return CBotTypResult(CBotErrLowParam);
+ CBotTypResult ret = cPoint(var, user);
+ if ( ret.GetType() != 0 ) return ret;
+ if ( var != 0 ) return CBotTypResult(CBotErrOverParam);
}
else if ( type == OBJECT_SPIDER )
{
- return cNull(var, user);
+ if ( var != 0 ) return CBotTypResult(CBotErrOverParam);
}
else
{
- if ( var == 0 ) return CBotTypResult(CBotTypFloat);
- if ( var->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadNum);
- var = var->GetNext();
- if ( var != 0 ) return CBotTypResult(CBotErrOverParam);
- return CBotTypResult(CBotTypFloat);
+ if ( var != 0 )
+ {
+ if ( var->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadNum);
+ var = var->GetNext();
+ if ( var != 0 ) return CBotTypResult(CBotErrOverParam);
+ }
}
-#else
return CBotTypResult(CBotTypFloat);
-#endif
}
// Instruction "fire(delay)".
@@ -2925,6 +2926,7 @@ bool CScript::rFire(CBotVar* var, CBotVar* result, int& exception, void* user)
{
if ( var == 0 ) delay = 0.0f;
else delay = var->GetValFloat();
+ if ( delay < 0.0f ) delay = -delay;
err = script->m_primaryTask->StartTaskFire(delay);
}
diff --git a/src/ui/color.cpp b/src/ui/color.cpp
index 00af8a5..57e78d5 100644
--- a/src/ui/color.cpp
+++ b/src/ui/color.cpp
@@ -141,38 +141,7 @@ void CColor::Draw()
m_engine->SetTexture("interface/button1.png");
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
CControl::Draw();
-
-#if _TEEN
-// color = GetColor(m_color);
- color = GetColor();
-
- m_engine->SetTexture(""); // no texture
- m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
-
- device = m_engine->GetDevice();
-
- p1.x = m_pos.x + (4.0f / 640.0f);
- p1.y = m_pos.y + (4.0f / 480.0f);
- p2.x = m_pos.x + m_dim.x - (4.0f / 640.0f);
- p2.y = m_pos.y + m_dim.y - (4.0f / 480.0f);
- vertex[0] = Gfx::Vertex(Math::Vector(p1.x, p1.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[1] = Gfx::Vertex(Math::Vector(p1.x, p2.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[2] = Gfx::Vertex(Math::Vector(p2.x, p1.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[3] = Gfx::Vertex(Math::Vector(p2.x, p2.y, 0.0f), 0x00000000,0x00000000, Math::Point( 0.0f, 0.0f));
- device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
-
- p1.x = m_pos.x + (5.0f / 640.0f);
- p1.y = m_pos.y + (5.0f / 480.0f);
- p2.x = m_pos.x + m_dim.x - (5.0f / 640.0f);
- p2.y = m_pos.y + m_dim.y - (5.0f / 480.0f);
- vertex[0] = Gfx::Vertex(Math::Vector(p1.x, p1.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[1] = Gfx::Vertex(Math::Vector(p1.x, p2.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[2] = Gfx::Vertex(Math::Vector(p2.x, p1.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- vertex[3] = Gfx::Vertex(Math::Vector(p2.x, p2.y, 0.0f), color,0x00000000, Math::Point( 0.0f, 0.0f));
- device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
-
- m_engine->AddStatisticTriangle(4);
-#else
+
p1.x = m_pos.x + (3.0f / 640.0f);
p1.y = m_pos.y + (3.0f / 480.0f);
p2.x = m_pos.x + m_dim.x - (3.0f / 640.0f);
@@ -191,7 +160,6 @@ void CColor::Draw()
device = m_engine->GetDevice();
device->DrawPrimitive(Gfx::PRIMITIVE_TRIANGLE_STRIP, vertex, 4);
m_engine->AddStatisticTriangle(2);
-#endif
}
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 1eff38c..6686c55 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -506,11 +506,7 @@ void CControl::Draw()
if ( icon >= 192 )
{
icon -= 192;
-#if _POLISH
- m_engine->SetTexture("interface/textp.png");
-#else
m_engine->SetTexture("interface/text.png");
-#endif
m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_WHITE);
}
else if ( icon >= 128 )
diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp
index ee29e27..9204473 100644
--- a/src/ui/displayinfo.cpp
+++ b/src/ui/displayinfo.cpp
@@ -388,13 +388,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
button = pw->CreateButton(pos, dim, 128+57, EVENT_SATCOM_HUSTON);
button->SetState(STATE_SHADOW);
-#if _TEEN
-#if !_ENGLISH
- button = pw->CreateButton(pos, dim, 46, EVENT_SATCOM_SAT);
-#endif
-#else
button = pw->CreateButton(pos, dim, 128+58, EVENT_SATCOM_SAT);
-#endif
button->SetState(STATE_SHADOW);
//? button = pw->CreateButton(pos, dim, 128+59, EVENT_SATCOM_OBJECT);
//? button->SetState(STATE_SHADOW);
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp
index fb2fcb4..f9b7837 100644
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@ -1225,11 +1225,7 @@ void CEdit::DrawPart(Math::Point pos, Math::Point dim, int icon)
Math::Point uv1, uv2;
float dp;
-#if _POLISH
- m_engine->SetTexture("interface/textp.png");
-#else
m_engine->SetTexture("interface/text.png");
-#endif
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
uv1.x = (16.0f/256.0f)*(icon%16);
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index dffa424..fd6cd2e 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -161,9 +161,6 @@ CMainDialog::CMainDialog()
m_bMovies = true;
m_bNiceReset = true;
m_bHimselfDamage = true;
-/* TODO: #if _TEEN
- m_bCameraScroll = false;
-#else*/
m_bCameraScroll = true;
m_bCameraInvertX = false;
@@ -248,9 +245,6 @@ void CMainDialog::ChangePhase(Phase phase)
pos.y = 0.10f;
ddim.x = 0.30f;
ddim.y = 0.80f;
- /* TODO: #if _TEEN
- pw = m_interface->CreateWindows(pos, ddim, 12, EVENT_WINDOW5);
-#else*/
pw = m_interface->CreateWindows(pos, ddim, 10, EVENT_WINDOW5);
GetResource(RES_TEXT, RT_TITLE_INIT, name);
@@ -266,22 +260,7 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 0.30f;
ddim.y = 0.30f;
pw->CreateGroup(pos, ddim, 4, EVENT_INTERFACE_GLINTr); // blue corner
-
- /* TODO: #if _SCHOOL
- ddim.x = 0.20f;
- ddim.y = dim.y*2.4f;
- pos.x = 0.40f;
- pos.y = oy+sy*7.9f;
- pg = pw->CreateGroup(pos, ddim, 24, EVENT_LABEL1); // orange
- pg->SetState(STATE_SHADOW);
- pos.y = oy+sy*3.9f;
- pg = pw->CreateGroup(pos, ddim, 25, EVENT_LABEL1); // orange
- pg->SetState(STATE_SHADOW);
- ddim.y = dim.y*1.2f;
- pos.y = oy+sy*1.9f;
- pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // red
- pg->SetState(STATE_SHADOW);
-#else */
+
ddim.x = 0.20f;
ddim.y = dim.y*2.4f;
pos.x = 0.40f;
@@ -301,26 +280,7 @@ void CMainDialog::ChangePhase(Phase phase)
pos.y = oy+sy*1.9f;
pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // red
pg->SetState(STATE_SHADOW);
-
- /* TODO: #if _SCHOOL
- ddim.x = 0.18f;
- ddim.y = dim.y*1;
- pos.x = 0.41f;
- pos.y = oy+sy*9.1f;
- pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_TRAINER);
- pb->SetState(STATE_SHADOW);
-
- pos.y = oy+sy*8.0f;
-#if _TEEN
-pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_TEEN);
-#else
-pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_DEFI);
-#endif
-#if _CEEBOTDEMO
-pb->ClearState(STATE_ENABLE);
-#endif
-pb->SetState(STATE_SHADOW);
-#else */
+
ddim.x = 0.18f;
ddim.y = dim.y*1;
pos.x = 0.41f;
@@ -357,20 +317,14 @@ pb->SetState(STATE_SHADOW);
pb->SetState(STATE_SHADOW);
#if DEV_BUILD
- // TODO: #if !_DEMO & !_SCHOOL
if ( m_accessEnable && m_accessUser )
{
pos.x = 447.0f/640.0f;
pos.y = 313.0f/480.0f;
ddim.x = 0.09f;
- /*#if _POLISH
- pos.x -= 5.0f/640.0f;
- ddim.x += 10.0f/640.0f;
-#endif*/
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_USER);
pb->SetState(STATE_SHADOW);
}
- // #endif
#endif
/*pos.x = 139.0f/640.0f;
@@ -409,19 +363,6 @@ pb->SetState(STATE_SHADOW);
GetResource(RES_TEXT, RT_TITLE_NAME, name);
pw->SetName(name);
- /* TODO: #if _NEWLOOK
- pos.x = 80.0f/640.0f;
- pos.y = 93.0f/480.0f;
- ddim.x = 285.0f/640.0f;
- ddim.y = 266.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 23, EVENT_LABEL1); // blue
- pg->SetState(STATE_SHADOW);
- pos.x = 372.0f/640.0f;
- ddim.x = 188.0f/640.0f;
- pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // violet
- pg->SetState(STATE_SHADOW);
-#endif*/
-
pos.x = 0.10f;
pos.y = 0.40f;
ddim.x = 0.50f;
@@ -529,15 +470,6 @@ pb->SetState(STATE_SHADOW);
GetResource(RES_TEXT, RT_TITLE_PERSO, name);
pw->SetName(name);
- /* TODO: #if _NEWLOOK
- pos.x = 95.0f/640.0f;
- pos.y = 66.0f/480.0f;
- ddim.x = 443.0f/640.0f;
- ddim.y = 42.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // violet
- pg->SetState(STATE_SHADOW);
-#endif*/
-
pos.x = 0.10f;
pos.y = 0.40f;
ddim.x = 0.50f;
@@ -772,7 +704,6 @@ pb->SetState(STATE_SHADOW);
m_phase == PHASE_DEFI ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER )
{
if ( m_phase == PHASE_TRAINER ) m_index = 0;
@@ -780,7 +711,6 @@ pb->SetState(STATE_SHADOW);
if ( m_phase == PHASE_MISSION ) m_index = 2;
if ( m_phase == PHASE_FREE ) m_index = 3;
if ( m_phase == PHASE_USER ) m_index = 4;
- if ( m_phase == PHASE_TEEN ) m_index = 6;
if ( m_phase == PHASE_FREE )
{
@@ -793,7 +723,6 @@ pb->SetState(STATE_SHADOW);
if ( m_phase == PHASE_DEFI ) strcpy(m_sceneName, "challenges" );
if ( m_phase == PHASE_MISSION ) strcpy(m_sceneName, "missions");
if ( m_phase == PHASE_FREE ) strcpy(m_sceneName, "freemissions");
- if ( m_phase == PHASE_TEEN ) strcpy(m_sceneName, "teen");
if ( m_phase == PHASE_USER ) strcpy(m_sceneName, "user");
ReadGamerInfo();
@@ -808,34 +737,10 @@ pb->SetState(STATE_SHADOW);
if ( m_phase == PHASE_DEFI ) res = RT_TITLE_DEFI;
if ( m_phase == PHASE_MISSION ) res = RT_TITLE_MISSION;
if ( m_phase == PHASE_FREE ) res = RT_TITLE_FREE;
- if ( m_phase == PHASE_TEEN ) res = RT_TITLE_TEEN;
if ( m_phase == PHASE_USER ) res = RT_TITLE_USER;
GetResource(RES_TEXT, res, name);
pw->SetName(name);
- /* TODO: #if _NEWLOOK
- pos.x = 100.0f/640.0f;
- pos.y = 226.0f/480.0f;
- ddim.x = 216.0f/640.0f;
- ddim.y = 160.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 23, EVENT_LABEL1); // blue
- pg->SetState(STATE_SHADOW);
- pos.x = 322.0f/640.0f;
- pg = pw->CreateGroup(pos, ddim, 24, EVENT_LABEL1); // cyan
- pg->SetState(STATE_SHADOW);
-
- pos.x = 100.0f/640.0f;
- pos.y = 122.0f/480.0f;
- ddim.x = 438.0f/640.0f;
- ddim.y = 98.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 25, EVENT_LABEL1); // green
- pg->SetState(STATE_SHADOW);
- pos.y = 66.0f/480.0f;
- ddim.y = 42.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // violet
- pg->SetState(STATE_SHADOW);
-#endif */
-
pos.x = 0.10f;
pos.y = 0.40f;
ddim.x = 0.50f;
@@ -856,7 +761,6 @@ pb->SetState(STATE_SHADOW);
if ( m_phase == PHASE_DEFI ) res = RT_PLAY_CHAPd;
if ( m_phase == PHASE_MISSION ) res = RT_PLAY_CHAPm;
if ( m_phase == PHASE_FREE ) res = RT_PLAY_CHAPf;
- if ( m_phase == PHASE_TEEN ) res = RT_PLAY_CHAPte;
if ( m_phase == PHASE_USER ) res = RT_PLAY_CHAPu;
GetResource(RES_TEXT, res, name);
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL11, name);
@@ -879,7 +783,6 @@ pb->SetState(STATE_SHADOW);
if ( m_phase == PHASE_DEFI ) res = RT_PLAY_LISTd;
if ( m_phase == PHASE_MISSION ) res = RT_PLAY_LISTm;
if ( m_phase == PHASE_FREE ) res = RT_PLAY_LISTf;
- if ( m_phase == PHASE_TEEN ) res = RT_PLAY_LISTk;
if ( m_phase == PHASE_USER ) res = RT_PLAY_LISTu;
GetResource(RES_TEXT, res, name);
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL12, name);
@@ -916,8 +819,7 @@ pb->SetState(STATE_SHADOW);
// Button displays the "soluce":
if ( m_phase != PHASE_TRAINER &&
- m_phase != PHASE_FREE &&
- m_phase != PHASE_TEEN )
+ m_phase != PHASE_FREE )
{
pos.x = ox+sx*9.5f;
pos.y = oy+sy*5.8f;
@@ -1046,80 +948,6 @@ pb->SetState(STATE_SHADOW);
ddim.y = 0.05f;
pw->CreateGroup(pos, ddim, 3, EVENT_NULL); // transparent -> gray
- /* TODO: #if _NEWLOOK
- if ( m_phase == PHASE_SETUPd || // setup/display ?
- m_phase == PHASE_SETUPds )
- {
- pos.x = 100.0f/640.0f;
- pos.y = 130.0f/480.0f;
- ddim.x = 216.0f/640.0f;
- ddim.y = 212.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 23, EVENT_LABEL1); // blue
- pg->SetState(STATE_SHADOW);
- pos.x = 324.0f/640.0f;
- pg = pw->CreateGroup(pos, ddim, 24, EVENT_LABEL1); // cyan
- pg->SetState(STATE_SHADOW);
- }
- if ( m_phase == PHASE_SETUPg || // setup/graphic ?
- m_phase == PHASE_SETUPgs )
- {
- pos.x = 100.0f/640.0f;
- pos.y = 130.0f/480.0f;
- ddim.x = 174.0f/640.0f;
- ddim.y = 212.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 23, EVENT_LABEL1); // blue
- pg->SetState(STATE_SHADOW);
- pos.x = 282.0f/640.0f;
- ddim.x = 258.0f/640.0f;
- pg = pw->CreateGroup(pos, ddim, 24, EVENT_LABEL1); // cyan
- pg->SetState(STATE_SHADOW);
- }
- if ( m_phase == PHASE_SETUPp || // setup/game ?
- m_phase == PHASE_SETUPps )
- {
- pos.x = 100.0f/640.0f;
- pos.y = 130.0f/480.0f;
- ddim.x = 226.0f/640.0f;
- ddim.y = 212.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 23, EVENT_LABEL1); // blue
- pg->SetState(STATE_SHADOW);
- pos.x = 334.0f/640.0f;
- ddim.x = 206.0f/640.0f;
- pg = pw->CreateGroup(pos, ddim, 24, EVENT_LABEL1); // cyan
- pg->SetState(STATE_SHADOW);
- }
- if ( m_phase == PHASE_SETUPc || // setup/command ?
- m_phase == PHASE_SETUPcs )
- {
- pos.x = 100.0f/640.0f;
- pos.y = 125.0f/480.0f;
- ddim.x = 440.0f/640.0f;
- ddim.y = 222.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 23, EVENT_LABEL1); // blue
- pg->SetState(STATE_SHADOW);
- }
- if ( m_phase == PHASE_SETUPs || // setup/sound ?
- m_phase == PHASE_SETUPss )
- {
- pos.x = 100.0f/640.0f;
- pos.y = 130.0f/480.0f;
- ddim.x = 216.0f/640.0f;
- ddim.y = 212.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 23, EVENT_LABEL1); // blue
- pg->SetState(STATE_SHADOW);
- pos.x = 324.0f/640.0f;
- pg = pw->CreateGroup(pos, ddim, 24, EVENT_LABEL1); // cyan
- pg->SetState(STATE_SHADOW);
- }
-
- pos.x = 100.0f/640.0f;
- pos.y = 66.0f/480.0f;
- ddim.x = 440.0f/640.0f;
- ddim.y = 42.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // violet
- pg->SetState(STATE_SHADOW);
-#endif */
-
ddim.x = 0.78f/5-0.01f;
ddim.y = 0.06f;
pos.x = 0.115f;
@@ -1350,10 +1178,7 @@ pb->SetState(STATE_SHADOW);
ddim.y = dim.y*1;
pos.x = ox+sx*10;
pos.y = oy+sy*2;
- /* TODO: #if _POLISH
- ddim.x += 20.0f/640.0f;
- pos.x -= 20.0f/640.0f*3.0f;
-#endif*/
+
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_MIN);
pb->SetState(STATE_SHADOW);
pos.x += ddim.x;
@@ -1376,13 +1201,7 @@ pb->SetState(STATE_SHADOW);
//? pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_TOTO);
//? pc->SetState(STATE_SHADOW);
//? pos.y -= 0.048f;
- /*TODO: #if _SCHOOL
-#if _EDU
-pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_SOLUCE4);
-pc->SetState(STATE_SHADOW);
-pos.y -= 0.048f;
-#endif
-#else*/
+
pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_MOVIES);
pc->SetState(STATE_SHADOW);
pos.y -= 0.048f;
@@ -1504,7 +1323,6 @@ pos.y -= 0.048f;
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, name);
pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
- // TODO: #if (_FULL | _NET) & _SOUNDTRACKS
pos.x = ox+sx*3;
pos.y = 0.40f;
ddim.x = dim.x*4.0f;
@@ -1517,7 +1335,6 @@ pos.y -= 0.048f;
GetResource(RES_EVENT, EVENT_INTERFACE_VOLMUSIC, name);
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL2, name);
pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
- // #endif
ddim.x = dim.x*3;
ddim.y = dim.y*1;
@@ -1555,15 +1372,6 @@ pos.y -= 0.048f;
ddim.y = 0.50f;
pw->CreateGroup(pos, ddim, 4, EVENT_INTERFACE_GLINTr); // blue corner
- /* TODO: #if _NEWLOOK
- pos.x = 100.0f/640.0f;
- pos.y = 66.0f/480.0f;
- ddim.x = 438.0f/640.0f;
- ddim.y = 42.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // violet
- pg->SetState(STATE_SHADOW);
-#endif */
-
pos.x = 290.0f/640.0f;
ddim.x = 245.0f/640.0f;
@@ -1639,15 +1447,6 @@ pos.y -= 0.048f;
ddim.y = 0.50f;
pw->CreateGroup(pos, ddim, 4, EVENT_INTERFACE_GLINTr); // blue corner
- /* TODO: #if _NEWLOOK
- pos.x = 100.0f/640.0f;
- pos.y = 66.0f/480.0f;
- ddim.x = 438.0f/640.0f;
- ddim.y = 42.0f/480.0f;
- pg = pw->CreateGroup(pos, ddim, 26, EVENT_LABEL1); // violet
- pg->SetState(STATE_SHADOW);
-#endif*/
-
pos.x = 290.0f/640.0f;
ddim.x = 245.0f/640.0f;
@@ -1707,9 +1506,6 @@ pos.y -= 0.048f;
pos.y = 0.10f;
ddim.x = 0.30f;
ddim.y = 0.80f;
- /*TODO: #if _TEEN
- pw = m_interface->CreateWindows(pos, ddim, 12, EVENT_WINDOW5);
-#else*/
pw = m_interface->CreateWindows(pos, ddim, 10, EVENT_WINDOW5);
pw->SetName(" ");
@@ -1818,7 +1614,6 @@ pos.y -= 0.048f;
ddim.y = 0.0f;
pw = m_interface->CreateWindows(pos, ddim, -1, EVENT_WINDOW5);
- // TODO: #if _FULL | _NET
pos.x = 80.0f/640.0f;
pos.y = 240.0f/480.0f;
ddim.x = 490.0f/640.0f;
@@ -1831,54 +1626,6 @@ pos.y -= 0.048f;
pe->SetFontSize(Gfx::FONT_SIZE_SMALL);
pe->ReadText(std::string("help/") + m_app->GetLanguageChar() + std::string("/authors.txt"));
- // #endif
- /* TODO: #if _SCHOOL
- #if _CEEBOTDEMO
- pos.x = 80.0f/640.0f;
- pos.y = 210.0f/480.0f;
- ddim.x = 490.0f/640.0f;
- ddim.y = 150.0f/480.0f;
- #else
- pos.x = 80.0f/640.0f;
- pos.y = 200.0f/480.0f;
- ddim.x = 490.0f/640.0f;
- ddim.y = 150.0f/480.0f;
- #endif
- pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
- pe->SetGenericMode(true);
- pe->SetEditCap(false);
- pe->SetHighlightCap(false);
- pe->SetFontType(Gfx::FONT_COURIER);
- pe->SetFontSize(Gfx::FONT_SIZE_SMALL);
- pe->ReadText("help/authors.txt");*/
-
- /* #if _DEMO
- //? pos.x = 80.0f/640.0f;
- //? pos.y = 240.0f/480.0f;
- //? ddim.x = 490.0f/640.0f;
- //? ddim.y = 110.0f/480.0f;
- //? pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT1);
- //? pe->SetGenericMode(true);
- //? pe->SetEditCap(false);
- //? pe->SetHiliteCap(false);
- //? pe->SetFontType(Gfx::FONT_COURIER);
- //? pe->SetFontSize(Gfx::FONT_SIZE_SMALL);
- //? pe->ReadText("help/demo.txt");
-
- //? pos.x = 80.0f/640.0f;
- //? pos.y = 140.0f/480.0f;
- //? ddim.x = 490.0f/640.0f;
- //? ddim.y = 100.0f/480.0f;
- //? pe = pw->CreateEdit(pos, ddim, 0, EVENT_EDIT2);
- //? pe->SetGenericMode(true);
- //? pe->SetEditCap(false);
- //? pe->SetHiliteCap(false);
- //? pe->SetFontType(Gfx::FONT_COURIER);
- //? pe->SetFontSize(Gfx::FONT_SIZE_SMALL);
- //? pe->ReadText("help/authors.txt");
-#endif */
-
- // TODO: #if !_DEMO
pos.x = 40.0f/640.0f;
pos.y = 83.0f/480.0f;
ddim.x = 246.0f/640.0f;
@@ -1908,23 +1655,13 @@ pos.y -= 0.048f;
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL4, name);
pl->SetFontType(Gfx::FONT_COURIER);
pl->SetFontSize(Gfx::FONT_SIZE_SMALL);
- // #endif
-
- /* TODO: #if _DEMO
- pos.x = 481.0f/640.0f;
- pos.y = 51.0f/480.0f;
- ddim.x = 30.0f/640.0f;
- ddim.y = 30.0f/480.0f;
- pb = pw->CreateButton(pos, ddim, 49, EVENT_INTERFACE_ABORT);
- pb->SetState(STATE_SHADOW);
-#else */
+
pos.x = 306.0f/640.0f;
pos.y = 17.0f/480.0f;
ddim.x = 30.0f/640.0f;
ddim.y = 30.0f/480.0f;
pb = pw->CreateButton(pos, ddim, 49, EVENT_INTERFACE_ABORT);
pb->SetState(STATE_SHADOW);
- // #endif
m_engine->SetBackground("interface/generico.png",
Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f),
@@ -1941,7 +1678,6 @@ pos.y -= 0.048f;
m_phase == PHASE_DEFI ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER ||
m_phase == PHASE_SETUPd ||
m_phase == PHASE_SETUPg ||
@@ -1951,24 +1687,10 @@ pos.y -= 0.048f;
m_phase == PHASE_READ ||
m_phase == PHASE_LOADING )
{
- /*TODO: #if _SCHOOL
-#if _TEEN
-pos.x = 50.0f/640.0f;
-pos.y = 430.0f/480.0f;
-ddim.x = 200.0f/640.0f;
-ddim.y = 10.0f/480.0f;
-#else
-pos.x = 450.0f/640.0f;
-pos.y = 0.0f/480.0f;
-ddim.x = 170.0f/640.0f;
-ddim.y = 9.0f/480.0f;
-#endif
-#else */
pos.x = 540.0f/640.0f;
pos.y = 9.0f/480.0f;
ddim.x = 90.0f/640.0f;
ddim.y = 10.0f/480.0f;
- //#endif
//GetResource(RES_TEXT, RT_VERSION_ID, name);
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, COLOBOT_VERSION_DISPLAY);
pl->SetFontType(Gfx::FONT_COURIER);
@@ -2076,9 +1798,10 @@ bool CMainDialog::EventProcess(const Event &event)
{
m_shotDelay --;
if ( m_shotDelay == 0 )
- {
- m_engine->WriteScreenShot(m_shotName, 320, 240);
- //? m_engine->WriteScreenShot(m_shotName, 160, 120);
+ {
+ Math::IntPoint windowSize = m_engine->GetWindowSize();
+
+ m_engine->WriteScreenShot(m_shotName, windowSize.x, windowSize.y);
}
}
@@ -2218,10 +1941,6 @@ bool CMainDialog::EventProcess(const Event &event)
m_main->ChangePhase(PHASE_FREE);
break;
- case EVENT_INTERFACE_TEEN:
- m_main->ChangePhase(PHASE_TEEN);
- break;
-
case EVENT_INTERFACE_USER:
m_main->ChangePhase(PHASE_USER);
break;
@@ -2428,7 +2147,6 @@ bool CMainDialog::EventProcess(const Event &event)
m_phase == PHASE_DEFI ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER )
{
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
@@ -2447,7 +2165,6 @@ bool CMainDialog::EventProcess(const Event &event)
m_phase == PHASE_DEFI ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER )
{
switch( event.type )
@@ -3090,7 +2807,6 @@ void CMainDialog::GlintMove()
m_phase == PHASE_TRAINER ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER )
{
pg = static_cast<CGroup*>(pw->SearchControl(EVENT_INTERFACE_GLINTl));
@@ -3227,8 +2943,6 @@ Math::Vector SoundRand()
void CMainDialog::FrameParticle(float rTime)
{
- /* TODO: #if _NEWLOOK
-#else */
Math::Vector pos, speed;
Math::Point dim;
float *pParti, *pGlint;
@@ -3317,7 +3031,6 @@ void CMainDialog::FrameParticle(float rTime)
m_phase == PHASE_DEFI ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER ||
m_phase == PHASE_SETUPd ||
m_phase == PHASE_SETUPg ||
@@ -4690,7 +4403,6 @@ void CMainDialog::AllMissionUpdate()
m_phase == PHASE_DEFI ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER )
{
UpdateSceneChap(m_chap[m_index]);
@@ -4876,21 +4588,6 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
for ( j=0 ; j<99 ; j++ )
{
-/* TODO: #if _SCHOOL
- if ( m_phase == PHASE_MISSION ) break;
- if ( m_phase == PHASE_FREE ) break;
-#if _CEEBOTDEMO
-#if _TEEN
- if ( m_phase == PHASE_TRAINER && j >= 5 ) break;
-#else
- if ( m_phase == PHASE_TRAINER && j >= 3 ) break;
-#endif
-#endif
-#endif
-#if _DEMO
- if ( m_phase == PHASE_MISSION && j >= 3 ) break;
- if ( m_phase == PHASE_TRAINER && j >= 5 ) break;
-#endif */
BuildSceneName(fileName, m_sceneName, (chap+1)*100+(j+1));
CInputStream stream;
@@ -4936,14 +4633,6 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
j ++;
break;
}
-
-/* TODO: #if _TEEN
- if ( m_phase == PHASE_TRAINER && !m_main->GetShowAll() && !bPassed )
- {
- j ++;
- break;
- }
-#endif*/
}
/* TODO: ?????
@@ -4978,7 +4667,6 @@ void CMainDialog::ShowSoluceUpdate()
m_phase == PHASE_DEFI ||
m_phase == PHASE_MISSION ||
m_phase == PHASE_FREE ||
- m_phase == PHASE_TEEN ||
m_phase == PHASE_USER )
{
m_bSceneSoluce = false;
@@ -5572,21 +5260,7 @@ void CMainDialog::SetupMemorize()
GetProfile().SetLocalProfileString("Setup", "KeyMap", key.str());
-#if _NET
- if ( m_accessEnable )
- {
- iValue = m_accessMission;
- SetLocalProfileInt("Setup", "AccessMission", iValue);
-
- iValue = m_accessUser;
- SetLocalProfileInt("Setup", "AccessUser", iValue);
- }
-#endif
-
GetProfile().SetLocalProfileInt("Setup", "DeleteGamer", m_bDeleteGamer);
-
- // TODO: write graphic engine profile
- //m_engine->WriteProfile();
}
// Remember all the settings.
@@ -5791,21 +5465,6 @@ void CMainDialog::SetupRecall()
}
}
-#if _NET
- if ( m_accessEnable )
- {
- if ( GetProfile().GetLocalProfileInt("Setup", "AccessMission", iValue) )
- {
- m_accessMission = iValue;
- }
-
- if ( GetProfile().GetLocalProfileInt("Setup", "AccessUser", iValue) )
- {
- m_accessUser = iValue;
- }
- }
-#endif
-
if ( GetProfile().GetLocalProfileInt("Setup", "DeleteGamer", iValue) )
{
m_bDeleteGamer = iValue;
@@ -6008,10 +5667,6 @@ void CMainDialog::StartAbort()
pos.x = 0.40f;
dim.x = 0.20f;
-/* TODO: #if _POLISH
- pos.x -= 7.0f/640.0f;
- dim.x += 14.0f/640.0f;
-#endif*/
dim.y = 32.0f/480.0f;
pos.y = 0.74f;
@@ -6202,12 +5857,6 @@ void CMainDialog::StartDialog(Math::Point dim, bool bFire, bool bOK, bool bCance
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW8));
if ( pw != 0 ) pw->ClearState(STATE_ENABLE);
- pb = static_cast<CButton*>(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if ( pb != 0 )
- {
- pb->ClearState(STATE_VISIBLE);
- }
-
m_bDialogFire = bFire;
std::string name;
@@ -6390,12 +6039,6 @@ void CMainDialog::StopDialog()
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW8));
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
- pb = static_cast<CButton*>(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if ( pb != 0 )
- {
- pb->SetState(STATE_VISIBLE);
- }
-
StopSuspend();
m_interface->DeleteControl(EVENT_WINDOW9);
m_bDialog = false;
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index 5a3b403..91e4ea2 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -573,10 +573,6 @@ void CStudio::StartEditScript(CScript *script, std::string name, int rank)
m_bRealTime = m_bRunning;
m_script->SetStepMode(!m_bRealTime);
- button = static_cast< CButton* >(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if (button != nullptr)
- button->ClearState(STATE_VISIBLE);
-
pos = m_editFinalPos = m_editActualPos = m_main->GetWindowPos();
dim = m_editFinalDim = m_editActualDim = m_main->GetWindowDim();
pw = m_interface->CreateWindows(pos, dim, 8, EVENT_WINDOW3);
@@ -877,12 +873,6 @@ bool CStudio::StopEditScript(bool bCancel)
m_interface->DeleteControl(EVENT_WINDOW3);
- button = static_cast< CButton* >(m_interface->SearchControl(EVENT_BUTTON_QUIT));
- if ( button != 0 )
- {
- button->SetState(STATE_VISIBLE);
- }
-
m_pause->SetPause(m_bInitPause);
m_sound->MuteAll(false);
m_main->SetEditLock(false, true);
@@ -1111,17 +1101,11 @@ void CStudio::StartDialog(StudioDialog type)
GetResource(RES_TEXT, RT_IO_PRIVATE, name);
pc->SetName(name);
pc->SetState(STATE_SHADOW);
-#if _POLISH
- pc->SetFontSize(8.0f);
-#endif
pc = pw->CreateCheck(pos, dim, 0, EVENT_DIALOG_CHECK2);
GetResource(RES_TEXT, RT_IO_PUBLIC, name);
pc->SetName(name);
pc->SetState(STATE_SHADOW);
-#if _POLISH
- pc->SetFontSize(8.0f);
-#endif
pb = pw->CreateButton(pos, dim, -1, EVENT_DIALOG_OK);
pb->SetState(STATE_SHADOW);
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index 39612a5..9740f7f 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -1536,8 +1536,6 @@ void CWindow::DrawVertex(Math::Point pos, Math::Point dim, int icon)
void CWindow::DrawHach(Math::Point pos, Math::Point dim)
{
-#if _NEWLOOK
-#else
Math::Point ppos, ddim, uv1, uv2;
float dp, max, ndim;
bool bStop;
@@ -1575,7 +1573,6 @@ void CWindow::DrawHach(Math::Point pos, Math::Point dim)
ppos.x += ddim.x;
}
while ( !bStop );
-#endif
}
}