summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-05-20 23:31:33 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-05-20 23:31:33 +0200
commitf509312bfe078d18b6f57af8011999231864d7fe (patch)
treea197c0da3ef01902c8c2bb6b40daedf113302a6c
parent5d15d37ef23a43ebe595674b7503112407356cb0 (diff)
parente2be034ec369dbe23b17281a21338282a0258ff2 (diff)
downloadcolobot-f509312bfe078d18b6f57af8011999231864d7fe.tar.gz
colobot-f509312bfe078d18b6f57af8011999231864d7fe.tar.bz2
colobot-f509312bfe078d18b6f57af8011999231864d7fe.zip
Merge commit 'colobot-gold-0.1.4-alpha' into debian
* commit 'colobot-gold-0.1.4-alpha': (159 commits) Release alpha-0.1.4 Fixed console spam when music files are not installed Updated data submodule Fixed amount of fireball damage done to allies, close issue #356 Fixed icon on Windows; updated properties in .rc file COLOBOT: Gold Edition -> Colobot: Gold Edition Updated data submodule #335, #348, #352 Updated INSTALL.md to reflect latest changes to music repository Added oggenc to Travis config Fallback to English files if translated ones are not available Removed duplicate license header Tools for measuring mission time without opening game window Fixed m_exitAfterMission Fixed #335 and #348 Added -headless Changing resolution from commandline -runscene for userlevels Increased mission end accuracy Added some debug stuff, possible fix for #348 and #335 ...
-rw-r--r--.gitignore3
-rw-r--r--.travis.yml4
-rw-r--r--CMakeLists.txt80
-rw-r--r--INSTALL-MXE.md1
-rw-r--r--INSTALL.md8
-rw-r--r--LICENSE-HEADER.txt18
-rw-r--r--README.md30
-rw-r--r--cmake/FindPhysFS.cmake36
m---------data0
-rw-r--r--desktop/.gitignore3
-rw-r--r--desktop/CMakeLists.txt10
-rw-r--r--desktop/colobot.rc.cmake8
-rw-r--r--lib/localename/.gitignore1
-rw-r--r--po/CMakeLists.txt5
-rw-r--r--po/colobot.pot129
-rw-r--r--po/de.po390
-rw-r--r--po/fr.po379
-rw-r--r--po/pl.po385
-rw-r--r--po/ru.po149
-rw-r--r--src/CBot/CBot.cpp33
-rw-r--r--src/CBot/CBot.h33
-rw-r--r--src/CBot/CBotAddExpr.cpp33
-rw-r--r--src/CBot/CBotClass.cpp33
-rw-r--r--src/CBot/CBotCompExpr.cpp33
-rw-r--r--src/CBot/CBotDll.h33
-rw-r--r--src/CBot/CBotFunction.cpp33
-rw-r--r--src/CBot/CBotIf.cpp33
-rw-r--r--src/CBot/CBotProgram.cpp33
-rw-r--r--src/CBot/CBotStack.cpp42
-rw-r--r--src/CBot/CBotString.cpp33
-rw-r--r--src/CBot/CBotToken.cpp35
-rw-r--r--src/CBot/CBotToken.h33
-rw-r--r--src/CBot/CBotTwoOpExpr.cpp33
-rw-r--r--src/CBot/CBotVar.cpp33
-rw-r--r--src/CBot/CBotWhile.cpp33
-rw-r--r--src/CBot/ClassFILE.cpp426
-rw-r--r--src/CBot/StringFunctions.cpp33
-rw-r--r--src/CBot/resource.h33
-rw-r--r--src/CMakeLists.txt351
-rw-r--r--src/app/app.cpp301
-rw-r--r--src/app/app.h66
-rw-r--r--src/app/gamedata.cpp136
-rw-r--r--src/app/gamedata.h66
-rw-r--r--src/app/main.cpp98
-rw-r--r--src/app/pausemanager.cpp52
-rw-r--r--src/app/pausemanager.h34
-rw-r--r--src/app/system.cpp44
-rw-r--r--src/app/system.h41
-rw-r--r--src/app/system_linux.cpp68
-rw-r--r--src/app/system_linux.h37
-rw-r--r--src/app/system_macosx.cpp48
-rw-r--r--src/app/system_macosx.h37
-rw-r--r--src/app/system_other.cpp34
-rw-r--r--src/app/system_other.h34
-rw-r--r--src/app/system_windows.cpp59
-rw-r--r--src/app/system_windows.h37
-rw-r--r--src/common/config.h.cmake2
-rw-r--r--src/common/event.cpp35
-rw-r--r--src/common/event.h36
-rw-r--r--src/common/global.h33
-rw-r--r--src/common/image.cpp47
-rw-r--r--src/common/image.h33
-rw-r--r--src/common/iman.cpp37
-rw-r--r--src/common/iman.h33
-rw-r--r--src/common/ioutils.h33
-rw-r--r--src/common/key.h33
-rw-r--r--src/common/logger.cpp33
-rw-r--r--src/common/logger.h33
-rw-r--r--src/common/misc.cpp78
-rw-r--r--src/common/misc.h36
-rw-r--r--src/common/profile.cpp176
-rw-r--r--src/common/profile.h151
-rw-r--r--src/common/resources/inputstream.cpp61
-rw-r--r--src/common/resources/inputstream.h37
-rw-r--r--src/common/resources/inputstreambuffer.cpp134
-rw-r--r--src/common/resources/inputstreambuffer.h51
-rw-r--r--src/common/resources/outputstream.cpp55
-rw-r--r--src/common/resources/outputstream.h36
-rw-r--r--src/common/resources/outputstreambuffer.cpp91
-rw-r--r--src/common/resources/outputstreambuffer.h46
-rw-r--r--src/common/resources/resourcemanager.cpp295
-rw-r--r--src/common/resources/resourcemanager.h66
-rw-r--r--src/common/resources/sndfile.cpp133
-rw-r--r--src/common/resources/sndfile.h49
-rw-r--r--src/common/restext.cpp1401
-rw-r--r--src/common/restext.h35
-rw-r--r--src/common/singleton.h38
-rw-r--r--src/common/stringutils.cpp33
-rw-r--r--src/common/stringutils.h33
-rw-r--r--src/graphics/core/color.cpp33
-rw-r--r--src/graphics/core/color.h33
-rw-r--r--src/graphics/core/device.h74
-rw-r--r--src/graphics/core/light.h34
-rw-r--r--src/graphics/core/material.h33
-rw-r--r--src/graphics/core/nulldevice.cpp343
-rw-r--r--src/graphics/core/nulldevice.h145
-rw-r--r--src/graphics/core/texture.h33
-rw-r--r--src/graphics/core/vertex.h33
-rw-r--r--src/graphics/engine/camera.cpp44
-rw-r--r--src/graphics/engine/camera.h38
-rw-r--r--src/graphics/engine/cloud.cpp40
-rw-r--r--src/graphics/engine/cloud.h34
-rw-r--r--src/graphics/engine/engine.cpp213
-rw-r--r--src/graphics/engine/engine.h45
-rw-r--r--src/graphics/engine/lightman.cpp34
-rw-r--r--src/graphics/engine/lightman.h34
-rw-r--r--src/graphics/engine/lightning.cpp36
-rw-r--r--src/graphics/engine/lightning.h34
-rw-r--r--src/graphics/engine/modelfile.cpp74
-rw-r--r--src/graphics/engine/modelfile.h34
-rw-r--r--src/graphics/engine/modelmanager.cpp41
-rw-r--r--src/graphics/engine/modelmanager.h34
-rw-r--r--src/graphics/engine/particle.cpp44
-rw-r--r--src/graphics/engine/particle.h34
-rw-r--r--src/graphics/engine/planet.cpp38
-rw-r--r--src/graphics/engine/planet.h34
-rw-r--r--src/graphics/engine/pyro.cpp44
-rw-r--r--src/graphics/engine/pyro.h34
-rw-r--r--src/graphics/engine/terrain.cpp56
-rw-r--r--src/graphics/engine/terrain.h34
-rw-r--r--src/graphics/engine/text.cpp56
-rw-r--r--src/graphics/engine/text.h34
-rw-r--r--src/graphics/engine/water.cpp40
-rw-r--r--src/graphics/engine/water.h34
-rw-r--r--src/graphics/opengl/gldevice.cpp411
-rw-r--r--src/graphics/opengl/gldevice.h159
-rw-r--r--src/math/all.h33
-rw-r--r--src/math/const.h33
-rw-r--r--src/math/func.h34
-rw-r--r--src/math/geometry.h34
-rw-r--r--src/math/intpoint.h33
-rw-r--r--src/math/matrix.h33
-rw-r--r--src/math/point.h33
-rw-r--r--src/math/vector.h33
-rw-r--r--src/object/auto/auto.cpp33
-rw-r--r--src/object/auto/auto.h33
-rw-r--r--src/object/auto/autobase.cpp37
-rw-r--r--src/object/auto/autobase.h34
-rw-r--r--src/object/auto/autoconvert.cpp34
-rw-r--r--src/object/auto/autoconvert.h34
-rw-r--r--src/object/auto/autoderrick.cpp34
-rw-r--r--src/object/auto/autoderrick.h34
-rw-r--r--src/object/auto/autodestroyer.cpp34
-rw-r--r--src/object/auto/autodestroyer.h34
-rw-r--r--src/object/auto/autoegg.cpp34
-rw-r--r--src/object/auto/autoegg.h34
-rw-r--r--src/object/auto/autoenergy.cpp34
-rw-r--r--src/object/auto/autoenergy.h34
-rw-r--r--src/object/auto/autofactory.cpp34
-rw-r--r--src/object/auto/autofactory.h34
-rw-r--r--src/object/auto/autoflag.cpp34
-rw-r--r--src/object/auto/autoflag.h34
-rw-r--r--src/object/auto/autohuston.cpp34
-rw-r--r--src/object/auto/autohuston.h34
-rw-r--r--src/object/auto/autoinfo.cpp34
-rw-r--r--src/object/auto/autoinfo.h34
-rw-r--r--src/object/auto/autojostle.cpp34
-rw-r--r--src/object/auto/autojostle.h34
-rw-r--r--src/object/auto/autokid.cpp34
-rw-r--r--src/object/auto/autokid.h34
-rw-r--r--src/object/auto/autolabo.cpp34
-rw-r--r--src/object/auto/autolabo.h34
-rw-r--r--src/object/auto/automush.cpp34
-rw-r--r--src/object/auto/automush.h34
-rw-r--r--src/object/auto/autonest.cpp34
-rw-r--r--src/object/auto/autonest.h34
-rw-r--r--src/object/auto/autonuclear.cpp34
-rw-r--r--src/object/auto/autonuclear.h34
-rw-r--r--src/object/auto/autopara.cpp34
-rw-r--r--src/object/auto/autopara.h34
-rw-r--r--src/object/auto/autoportico.cpp34
-rw-r--r--src/object/auto/autoportico.h34
-rw-r--r--src/object/auto/autoradar.cpp34
-rw-r--r--src/object/auto/autoradar.h34
-rw-r--r--src/object/auto/autorepair.cpp34
-rw-r--r--src/object/auto/autorepair.h34
-rw-r--r--src/object/auto/autoresearch.cpp34
-rw-r--r--src/object/auto/autoresearch.h34
-rw-r--r--src/object/auto/autoroot.cpp33
-rw-r--r--src/object/auto/autoroot.h34
-rw-r--r--src/object/auto/autosafe.cpp34
-rw-r--r--src/object/auto/autosafe.h34
-rw-r--r--src/object/auto/autostation.cpp34
-rw-r--r--src/object/auto/autostation.h34
-rw-r--r--src/object/auto/autotower.cpp34
-rw-r--r--src/object/auto/autotower.h34
-rw-r--r--src/object/brain.cpp208
-rw-r--r--src/object/brain.h36
-rw-r--r--src/object/level/parser.cpp250
-rw-r--r--src/object/level/parser.h71
-rw-r--r--src/object/level/parserexceptions.cpp45
-rw-r--r--src/object/level/parserexceptions.h55
-rw-r--r--src/object/level/parserline.cpp90
-rw-r--r--src/object/level/parserline.h62
-rw-r--r--src/object/level/parserparam.cpp950
-rw-r--r--src/object/level/parserparam.h137
-rw-r--r--src/object/mainmovie.cpp33
-rw-r--r--src/object/mainmovie.h33
-rw-r--r--src/object/motion/motion.cpp33
-rw-r--r--src/object/motion/motion.h33
-rw-r--r--src/object/motion/motionant.cpp33
-rw-r--r--src/object/motion/motionant.h33
-rw-r--r--src/object/motion/motionbee.cpp33
-rw-r--r--src/object/motion/motionbee.h33
-rw-r--r--src/object/motion/motiondummy.cpp34
-rw-r--r--src/object/motion/motiondummy.h34
-rw-r--r--src/object/motion/motionhuman.cpp33
-rw-r--r--src/object/motion/motionhuman.h33
-rw-r--r--src/object/motion/motionmother.cpp33
-rw-r--r--src/object/motion/motionmother.h33
-rw-r--r--src/object/motion/motionspider.cpp33
-rw-r--r--src/object/motion/motionspider.h33
-rw-r--r--src/object/motion/motiontoto.cpp33
-rw-r--r--src/object/motion/motiontoto.h33
-rw-r--r--src/object/motion/motionvehicle.cpp33
-rw-r--r--src/object/motion/motionvehicle.h33
-rw-r--r--src/object/motion/motionworm.cpp33
-rw-r--r--src/object/motion/motionworm.h33
-rw-r--r--src/object/object.cpp33
-rw-r--r--src/object/object.h33
-rw-r--r--src/object/objman.cpp33
-rw-r--r--src/object/objman.h33
-rw-r--r--src/object/robotmain.cpp1851
-rw-r--r--src/object/robotmain.h57
-rw-r--r--src/object/task/task.cpp33
-rw-r--r--src/object/task/task.h33
-rw-r--r--src/object/task/taskadvance.cpp33
-rw-r--r--src/object/task/taskadvance.h33
-rw-r--r--src/object/task/taskbuild.cpp33
-rw-r--r--src/object/task/taskbuild.h33
-rw-r--r--src/object/task/taskfire.cpp33
-rw-r--r--src/object/task/taskfire.h33
-rw-r--r--src/object/task/taskfireant.cpp33
-rw-r--r--src/object/task/taskfireant.h33
-rw-r--r--src/object/task/taskflag.cpp33
-rw-r--r--src/object/task/taskflag.h33
-rw-r--r--src/object/task/taskgoto.cpp44
-rw-r--r--src/object/task/taskgoto.h33
-rw-r--r--src/object/task/taskgungoal.cpp33
-rw-r--r--src/object/task/taskgungoal.h33
-rw-r--r--src/object/task/taskinfo.cpp33
-rw-r--r--src/object/task/taskinfo.h33
-rw-r--r--src/object/task/taskmanager.cpp33
-rw-r--r--src/object/task/taskmanager.h33
-rw-r--r--src/object/task/taskmanip.cpp33
-rw-r--r--src/object/task/taskmanip.h33
-rw-r--r--src/object/task/taskpen.cpp33
-rw-r--r--src/object/task/taskpen.h33
-rw-r--r--src/object/task/taskrecover.cpp33
-rw-r--r--src/object/task/taskrecover.h33
-rw-r--r--src/object/task/taskreset.cpp33
-rw-r--r--src/object/task/taskreset.h33
-rw-r--r--src/object/task/tasksearch.cpp33
-rw-r--r--src/object/task/tasksearch.h33
-rw-r--r--src/object/task/taskshield.cpp33
-rw-r--r--src/object/task/taskshield.h33
-rw-r--r--src/object/task/taskspiderexplo.cpp33
-rw-r--r--src/object/task/taskspiderexplo.h33
-rw-r--r--src/object/task/tasktake.cpp33
-rw-r--r--src/object/task/tasktake.h33
-rw-r--r--src/object/task/taskterraform.cpp33
-rw-r--r--src/object/task/taskterraform.h33
-rw-r--r--src/object/task/taskturn.cpp33
-rw-r--r--src/object/task/taskturn.h33
-rw-r--r--src/object/task/taskwait.cpp33
-rw-r--r--src/object/task/taskwait.h33
-rw-r--r--src/physics/physics.cpp33
-rw-r--r--src/physics/physics.h34
-rw-r--r--src/script/cbottoken.cpp33
-rw-r--r--src/script/cbottoken.h33
-rw-r--r--src/script/cmdtoken.cpp35
-rw-r--r--src/script/cmdtoken.h33
-rw-r--r--src/script/dd.cpp33
-rw-r--r--src/script/script.cpp85
-rw-r--r--src/script/script.h33
-rw-r--r--src/sound/oalsound/alsound.cpp82
-rw-r--r--src/sound/oalsound/alsound.h103
-rw-r--r--src/sound/oalsound/buffer.cpp66
-rw-r--r--src/sound/oalsound/buffer.h33
-rw-r--r--src/sound/oalsound/channel.cpp33
-rw-r--r--src/sound/oalsound/channel.h33
-rw-r--r--src/sound/oalsound/check.h33
-rw-r--r--src/sound/sound.cpp46
-rw-r--r--src/sound/sound.h46
-rw-r--r--src/tools/convert_model.cpp18
-rw-r--r--src/ui/button.cpp36
-rw-r--r--src/ui/button.h34
-rw-r--r--src/ui/check.cpp36
-rw-r--r--src/ui/check.h34
-rw-r--r--src/ui/color.cpp36
-rw-r--r--src/ui/color.h34
-rw-r--r--src/ui/compass.cpp36
-rw-r--r--src/ui/compass.h34
-rw-r--r--src/ui/control.cpp48
-rw-r--r--src/ui/control.h34
-rw-r--r--src/ui/displayinfo.cpp334
-rw-r--r--src/ui/displayinfo.h35
-rw-r--r--src/ui/displaytext.cpp34
-rw-r--r--src/ui/displaytext.h34
-rw-r--r--src/ui/edit.cpp142
-rw-r--r--src/ui/edit.h34
-rw-r--r--src/ui/editvalue.cpp34
-rw-r--r--src/ui/editvalue.h34
-rw-r--r--src/ui/gauge.cpp36
-rw-r--r--src/ui/gauge.h34
-rw-r--r--src/ui/group.cpp93
-rw-r--r--src/ui/group.h33
-rw-r--r--src/ui/image.cpp42
-rw-r--r--src/ui/image.h34
-rw-r--r--src/ui/interface.cpp41
-rw-r--r--src/ui/interface.h34
-rw-r--r--src/ui/key.cpp36
-rw-r--r--src/ui/key.h34
-rw-r--r--src/ui/label.cpp34
-rw-r--r--src/ui/label.h34
-rw-r--r--src/ui/list.cpp50
-rw-r--r--src/ui/list.h34
-rw-r--r--src/ui/maindialog.cpp747
-rw-r--r--src/ui/maindialog.h46
-rw-r--r--src/ui/mainmap.cpp34
-rw-r--r--src/ui/mainmap.h34
-rw-r--r--src/ui/mainshort.cpp34
-rw-r--r--src/ui/mainshort.h34
-rw-r--r--src/ui/map.cpp68
-rw-r--r--src/ui/map.h34
-rw-r--r--src/ui/scroll.cpp42
-rw-r--r--src/ui/scroll.h34
-rw-r--r--src/ui/shortcut.cpp40
-rw-r--r--src/ui/shortcut.h34
-rw-r--r--src/ui/slider.cpp40
-rw-r--r--src/ui/slider.h34
-rw-r--r--src/ui/studio.cpp75
-rw-r--r--src/ui/studio.h36
-rw-r--r--src/ui/target.cpp33
-rw-r--r--src/ui/target.h33
-rw-r--r--src/ui/window.cpp125
-rw-r--r--src/ui/window.h34
-rw-r--r--test/cbot/CBot_console/CBotConsole.cpp18
-rw-r--r--test/cbot/CBot_console/CBotConsole.h18
-rw-r--r--test/cbot/CBot_console/CBotDoc.cpp18
-rw-r--r--test/cbot/CBot_console/CBotDoc.h18
-rw-r--r--test/cbot/CBot_console/CClass.cpp18
-rw-r--r--test/cbot/CBot_console/CClass.h18
-rw-r--r--test/cbot/CBot_console/main.cpp18
-rw-r--r--test/cbot/CBot_console/routines.cpp33
-rw-r--r--test/envs/CMakeLists.txt3
-rw-r--r--test/envs/opengl/light_test.cpp18
-rw-r--r--test/envs/opengl/model_test.cpp18
-rw-r--r--test/envs/opengl/texture_test.cpp18
-rw-r--r--test/envs/opengl/transform_test.cpp18
-rw-r--r--test/unit/CMakeLists.txt258
-rw-r--r--test/unit/app/app_test.cpp18
-rw-r--r--test/unit/app/system_linux_test.cpp18
-rw-r--r--test/unit/app/system_mock.h18
-rw-r--r--test/unit/app/system_windows_test.cpp18
-rw-r--r--test/unit/common/CMakeLists.txt21
-rw-r--r--test/unit/common/image_test.cpp57
-rw-r--r--test/unit/common/profile_test.cpp38
-rw-r--r--test/unit/graphics/core/device_mock.h35
-rw-r--r--test/unit/graphics/engine/engine_mock.h18
-rw-r--r--test/unit/graphics/engine/lightman_test.cpp18
-rw-r--r--test/unit/graphics/engine/modelfile_test.cpp18
-rw-r--r--test/unit/main.cpp33
-rw-r--r--test/unit/math/func_test.cpp18
-rw-r--r--test/unit/math/geometry_test.cpp18
-rw-r--r--test/unit/math/matrix_test.cpp18
-rw-r--r--test/unit/math/vector_test.cpp18
-rw-r--r--test/unit/ui/CMakeLists.txt46
-rw-r--r--test/unit/ui/edit_test.cpp90
-rw-r--r--test/unit/ui/mocks/text_mock.h35
-rw-r--r--test/unit/ui/stubs/app_stub.cpp42
-rw-r--r--test/unit/ui/stubs/engine_stub.cpp104
-rw-r--r--test/unit/ui/stubs/particle_stub.cpp205
-rw-r--r--test/unit/ui/stubs/restext_stub.cpp12
-rw-r--r--test/unit/ui/stubs/robotmain_stub.cpp25
-rw-r--r--tools/blender-scripts.py4
-rwxr-xr-xtools/check-levels.sh18
-rwxr-xr-xtools/mission-time-loop.sh5
-rwxr-xr-xtools/mission-time.sh9
-rwxr-xr-xtools/update-license.sh12
380 files changed, 12519 insertions, 11297 deletions
diff --git a/.gitignore b/.gitignore
index 6a031c6..40d97d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,9 @@ Makefile
/install_manifest.txt
/Testing
/CTestTestfile.cmake
+/CPackConfig.cmake
+/CPackSourceConfig.cmake
+/src/libcolobotbase.a
# Ignore the generated documentation
/doc
diff --git a/.travis.yml b/.travis.yml
index 086a590..2dbed35 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,8 +7,6 @@ before_install:
- git submodule update --init --recursive
- sudo add-apt-repository ppa:mapnik/boost -y
- sudo apt-get update -qq
- - sudo apt-get install -qq --no-install-recommends devscripts dpkg-dev lintian equivs
- - mk-build-deps --root-cmd sudo --tool "apt-get -qq --no-install-recommends" --install --remove
- - dch -b -v 0.1.2~git$(date +%Y%m%d%H%M)00-1~travis0 -m "Automated test-build."
+ - sudo apt-get install -qq --no-install-recommends libgl1-mesa-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libpng12-dev libglew-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev google-mock libgtest-dev doxygen graphviz po4a librsvg2-bin libsndfile-dev libopenal-dev libphysfs-dev vorbis-tools
notifications:
email: false
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d40a1b9..16aa2e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ project(colobot C CXX)
set(COLOBOT_VERSION_CODENAME "Gold")
set(COLOBOT_VERSION_MAJOR 0)
set(COLOBOT_VERSION_MINOR 1)
-set(COLOBOT_VERSION_REVISION 3)
+set(COLOBOT_VERSION_REVISION 4)
# Used on official releases
set(COLOBOT_VERSION_RELEASE_CODENAME "-alpha")
@@ -156,6 +156,9 @@ option(ASSERTS "Enable assert()s" ON)
# Development build can be enabled/disabled regardless of build type
option(DEV_BUILD "Enable development build (enables some debugging tools, local setting paths, etc.)" OFF)
+# Portable build - load all data from current directory
+option(PORTABLE "Portable build" OFF)
+
# Building tests can be enabled/disabled
option(TESTS "Build tests" OFF)
@@ -206,6 +209,7 @@ find_package(SDL_image 1.2 REQUIRED)
find_package(SDL_ttf 2.0 REQUIRED)
find_package(PNG 1.2 REQUIRED)
find_package(Gettext REQUIRED)
+find_package(PhysFS REQUIRED)
set(Boost_USE_STATIC_LIBS ${BOOST_STATIC})
set(Boost_USE_MULTITHREADED ON)
@@ -294,43 +298,6 @@ endif()
# Targets
##
-if(TESTS)
- # Google Test library
- find_path(GTEST_SRC_DIR NAMES src/gtest.cc src/gtest-all.cc PATHS /usr/src PATH_SUFFIXES gtest)
- find_path(GTEST_INCLUDE_DIR gtest/gtest.h PATHS /usr/include)
- if(NOT(FORCE_BUNDLED_GTEST) AND GTEST_SRC_DIR AND GTEST_INCLUDE_DIR)
- message(STATUS "Using system gtest library in ${GTEST_SRC_DIR}")
- else()
- message(STATUS "Using bundled gtest library")
- set(GTEST_SRC_DIR ${colobot_SOURCE_DIR}/lib/gtest)
- set(GTEST_INCLUDE_DIR ${colobot_SOURCE_DIR}/lib/gtest/include)
- endif()
-
- add_subdirectory(${GTEST_SRC_DIR} lib/gtest)
-
- # Google Mock library
- find_path(GMOCK_SRC_DIR NAMES src/gmock.cc src/gmock-all.cc PATHS /usr/src PATH_SUFFIXES gmock)
- find_path(GMOCK_INCLUDE_DIR gmock/gmock.h PATHS /usr/include)
- if(NOT(FORCE_BUNDLED_GMOCK) AND GMOCK_SRC_DIR AND GMOCK_INCLUDE_DIR)
- message(STATUS "Using system gmock library in ${GMOCK_SRC_DIR}")
-
- include_directories(${GMOCK_SRC_DIR})
- # gmock-all.cc includes all other sources
- add_library(gmock STATIC ${GMOCK_SRC_DIR}/src/gmock-all.cc)
- else()
- message(STATUS "Using bundled gmock library")
- set(GMOCK_SRC_DIR ${colobot_SOURCE_DIR}/lib/gmock)
- set(GMOCK_INCLUDE_DIR ${colobot_SOURCE_DIR}/lib/gmock/include)
- add_subdirectory(${GMOCK_SRC_DIR} lib/gmock)
- endif()
-
-
- # Tests targets
- enable_testing()
- add_subdirectory(test)
-
-endif()
-
# Installation paths defined before compiling sources
if(PLATFORM_WINDOWS)
if(MXE)
@@ -370,6 +337,43 @@ if(DESKTOP)
add_subdirectory(desktop)
endif()
+if(TESTS)
+ # Google Test library
+ find_path(GTEST_SRC_DIR NAMES src/gtest.cc src/gtest-all.cc PATHS /usr/src PATH_SUFFIXES gtest)
+ find_path(GTEST_INCLUDE_DIR gtest/gtest.h PATHS /usr/include)
+ if(NOT(FORCE_BUNDLED_GTEST) AND GTEST_SRC_DIR AND GTEST_INCLUDE_DIR)
+ message(STATUS "Using system gtest library in ${GTEST_SRC_DIR}")
+ else()
+ message(STATUS "Using bundled gtest library")
+ set(GTEST_SRC_DIR ${colobot_SOURCE_DIR}/lib/gtest)
+ set(GTEST_INCLUDE_DIR ${colobot_SOURCE_DIR}/lib/gtest/include)
+ endif()
+
+ add_subdirectory(${GTEST_SRC_DIR} lib/gtest)
+
+ # Google Mock library
+ find_path(GMOCK_SRC_DIR NAMES src/gmock.cc src/gmock-all.cc PATHS /usr/src PATH_SUFFIXES gmock)
+ find_path(GMOCK_INCLUDE_DIR gmock/gmock.h PATHS /usr/include)
+ if(NOT(FORCE_BUNDLED_GMOCK) AND GMOCK_SRC_DIR AND GMOCK_INCLUDE_DIR)
+ message(STATUS "Using system gmock library in ${GMOCK_SRC_DIR}")
+
+ include_directories(${GMOCK_SRC_DIR})
+ # gmock-all.cc includes all other sources
+ add_library(gmock STATIC ${GMOCK_SRC_DIR}/src/gmock-all.cc)
+ else()
+ message(STATUS "Using bundled gmock library")
+ set(GMOCK_SRC_DIR ${colobot_SOURCE_DIR}/lib/gmock)
+ set(GMOCK_INCLUDE_DIR ${colobot_SOURCE_DIR}/lib/gmock/include)
+ add_subdirectory(${GMOCK_SRC_DIR} lib/gmock)
+ endif()
+
+
+ # Tests targets
+ enable_testing()
+ add_subdirectory(test)
+
+endif()
+
##
# Installation
diff --git a/INSTALL-MXE.md b/INSTALL-MXE.md
index 89bec0e..d4b0bff 100644
--- a/INSTALL-MXE.md
+++ b/INSTALL-MXE.md
@@ -44,6 +44,7 @@ To cross-compile Colobot using MXE:
* mingwrt
* ogg
* openal
+ * physfs
* portaudio
* sdl
* sdl_image
diff --git a/INSTALL.md b/INSTALL.md
index 81037c5..4537e8f 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -115,11 +115,13 @@ You will need:
* libvorbis >= 1.3.2
* libogg >= 1.3.0
* OpenAL (OpenAL-Soft) >= 1.13
+ * PhysFS
* po4a >= 0.45 (to generate translated data files)
+ * oggenc (to generate music files)
On Ubuntu (and probably any other Debian-based system), you can use the following command to install all required packages:
```
- $ apt-get install build-essential cmake libsdl1.2debian libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsndfile1-dev libvorbis-dev libogg-dev libpng12-dev libglew-dev libopenal-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev git
+ $ apt-get install build-essential cmake libsdl1.2debian libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsndfile1-dev libvorbis-dev libogg-dev libpng12-dev libglew-dev libopenal-dev libboost-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libphysfs-dev gettext git po4a vorbis-tools
```
Make sure you install the packages along with header files (often distributed in separate *-dev packages). If you miss any requirements,
@@ -135,6 +137,10 @@ If you want to compile development branch, change the first command to:
```
$ git clone -b dev https://github.com/colobot/colobot.git /path/to/colobot/sources
```
+If you also want to download optional music files, add --recursive to third command like so:
+```
+ $ git submodule update --init --recursive
+```
It is recommended that you create a build directory:
```
$ mkdir build
diff --git a/LICENSE-HEADER.txt b/LICENSE-HEADER.txt
new file mode 100644
index 0000000..bd65abe
--- /dev/null
+++ b/LICENSE-HEADER.txt
@@ -0,0 +1,18 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
diff --git a/README.md b/README.md
index 7961e90..7987b7e 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
# English
-Welcome to the Colobot project code repository
+Welcome to the Colobot: Gold Edition project code repository
-This is official repository for the open-source Colobot project developed by Polish Portal of Colobot (PPC; in Polish: Polski Portal Colobota) with the official site at: [colobot.info](http://colobot.info/joomla).
+This is official repository for the open-source Colobot: Gold Edition project developed by TerranovaTeam, part of International Colobot Community (ICC, previously known as Polish Portal of Colobot/PPC) with the official site at: [colobot.info](http://colobot.info/).
-The source code contained here was released by Epsitec -- the original creator of the game -- on open source (GPLv3) license. The code was given and the rights granted specifically to PPC community in March 2012. Since then, we have been developing the game further.
+The source code contained here was released by Epsitec -- the original creator of the game -- on open source (GPLv3) license. The code was given and the rights granted specifically to ICC community in March 2012. Since then, we have been developing the game further.
-More information for developers (in English) can be found on the [developer wiki](http://colobot.info/wiki/Dev:Main_Page) or (in Polish) [our forum](http://colobot.info/forum/). However, the freshest source of information is our IRC channels (see below).
+More information for developers (in English) can be found on the [developer wiki](http://colobot.info/wiki/dev/) or [our forum](http://colobot.info/forum/). However, the freshest source of information is our IRC channels (see below).
This repository contains only the source code of the project. The game requires also data files which are now provided as git submodule and are hosted in [separate repository](https://github.com/colobot/colobot-data).
@@ -24,7 +24,7 @@ In the future, we will begin development on a new installment in the Colobot ser
## Download packages
-We provide compiled packages of most recent versions using an [automated build bot service](http://colobot.info/files/compiled.php). Available versions include packages for Windows and Linux in both Release and Debug configurations.
+We provide compiled packages of most recent versions using an [automated build bot service](http://compiled.colobot.info/). Available versions include packages for Windows and Linux in both Release and Debug configurations.
On some Linux distributions there are also distribution packages available:
* Debian Sid (unstable): http://packages.debian.org/sid/colobot
@@ -38,7 +38,7 @@ If you want to compile colobot yourself, see [INSTALL.md](https://github.com/col
## Contact
-If you want to help in the project, please contact us on our IRC channels or [our forum](http://colobot.info/forum/) (Polish, though there is an English board as well).
+If you want to help in the project, please contact us on our IRC channels or [our forum](http://colobot.info/forum/).
### IRC channels
@@ -48,15 +48,15 @@ If you want to help in the project, please contact us on our IRC channels or [ou
# Polski
-Witamy w repozytorium projektu Colobot
+Witamy w repozytorium projektu Colobot: Gold Edition
-To jest oficjalne repozytorium z kodem projektu open-source Colobot rozwijanego przez Polski Portal Colobota (PPC; po angielsku: Polish Portal of Colobot) z oficjalną stroną: [colobot.info](http://colobot.info/joomla/?lang=pl).
+To jest oficjalne repozytorium z kodem otwartoźródłowego projektu Colobot: Gold Edition rozwijanego przez TerranovaTeam (część International Colobot Community, dawniej znanej jako Polski Portal Colobota/PPC) z oficjalną stroną: [colobot.info](http://colobot.info/).
-Kod źródłowy zawarty tutaj został wydany przez Epsitec -- oryginalnego twórcę gry -- na otwartej licencji (GPLv3). Kod został wydany i prawa nadane specjalnie dla społeczności PPC w marcu 2012. Od tamtej pory, zajmowaliśmy się dalszym rozwojem gry.
+Kod źródłowy zawarty tutaj został wydany przez Epsitec -- oryginalnego twórcę gry -- na otwartej licencji (GPLv3). Kod został wydany i prawa nadane specjalnie dla społeczności ICC w marcu 2012. Od tamtej pory, zajmowaliśmy się dalszym rozwojem gry.
-Więcej informacji dla developerów projektu (po angielsku) można znaleźć na [wiki dla developerów](htt://colobot.info/wiki/Dev:Main_Page) lub (po polsku) na [naszym forum](http://colobot.info/forum/). Jednak źródłem najświeższych informacji są nasze kanały IRC (patrz niżej).
+Więcej informacji dla developerów projektu (po angielsku) można znaleźć na [wiki dla developerów](htt://colobot.info/wiki/dev/) lub (po polsku) na [naszym forum](http://colobot.info/forum/). Jednak źródłem najświeższych informacji są nasze kanały IRC (patrz niżej).
-To repozytorium zawiera jedynie kod źródłowy projektu. Gra wymaga jeszcze plików danych, które są teraz udostępniane jako submoduł gita i hostowane w [osobnym repozytorium]((https://github.com/colobot/colobot-data).
+To repozytorium zawiera jedynie kod źródłowy projektu. Gra wymaga jeszcze plików danych, które są teraz udostępniane jako submoduł gita i hostowane w [osobnym repozytorium](https://github.com/colobot/colobot-data).
## Status
@@ -72,7 +72,7 @@ W przyszłości, planujemy rozpocząć prace nad nową częścią z serii Colobo
## Paczki do pobrania
-Udostępniamy gotowe skompilowane paczki z ostatnich wersji używając [automatycznego build bota](http://colobot.info/files/compiled.php?lang=pl). Dostępne są paczki dla Windowsa i Linuksa w konfiguracjach Release i Debug.
+Udostępniamy gotowe skompilowane paczki z ostatnich wersji używając [automatycznego build bota](http://compiled.colobot.info/?lang=pl). Dostępne są paczki dla Windowsa i Linuksa w konfiguracjach Release i Debug.
Dla niektórych dystrybucji Linuksa, dostępne są pakiety danej dystrybucji:
* Debian Sid (unstable): http://packages.debian.org/sid/colobot
@@ -86,10 +86,10 @@ Jeżeli chcesz sam skompilować colobota, zobacz plik [INSTALL.md](https://githu
## Kontakt
-Jeżeli chcesz pomóc w projekcie, prosimy o kontakt na naszych kanałach IRC lub [naszym forum](http://colobot.info/forum/).
+Jeżeli chcesz pomóc w projekcie, prosimy o kontakt na naszych kanałach IRC lub [naszym forum](http://colobot.info/forum/).
### Kanały IRC
-* [#colobot on pirc.pl](irc://pirc.pl#colobot) polski;
-* [#colobot on Freenode](irc://freenode.net#colobot) angielski;
+* [#colobot na pirc.pl](irc://pirc.pl#colobot) (polski);
+* [#colobot na Freenode](irc://freenode.net#colobot) (angielski);
diff --git a/cmake/FindPhysFS.cmake b/cmake/FindPhysFS.cmake
new file mode 100644
index 0000000..fae8378
--- /dev/null
+++ b/cmake/FindPhysFS.cmake
@@ -0,0 +1,36 @@
+# PHYSFS_FOUND
+# PHYSFS_INCLUDE_PATH
+# PHYSFS_LIBRARY
+#
+
+IF (WIN32)
+ FIND_PATH( PHYSFS_INCLUDE_PATH physfs.h
+ DOC "The directory where physfs.h resides")
+ FIND_LIBRARY( PHYSFS_LIBRARY
+ NAMES physfs
+ PATHS /mingw/lib
+ DOC "The PhysFS library")
+ELSE (WIN32)
+ FIND_PATH( PHYSFS_INCLUDE_PATH physfs.h
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ DOC "The directory where physfs.h resides")
+ FIND_LIBRARY( PHYSFS_LIBRARY
+ NAMES physfs
+ PATHS
+ /usr/lib64
+ /usr/lib
+ /usr/local/lib64
+ /usr/local/lib
+ /opt/local/lib
+ DOC "The PhysFS library")
+ENDIF (WIN32)
+
+IF (PHYSFS_INCLUDE_PATH)
+ SET( PHYSFS_FOUND 1 CACHE STRING "Set to 1 if PhysFS is found, 0 otherwise")
+ELSE (GLEW_INCLUDE_PATH)
+ SET( PHYSFS_FOUND 0 CACHE STRING "Set to 1 if PhysFS is found, 0 otherwise")
+ENDIF (PHYSFS_INCLUDE_PATH)
+
+MARK_AS_ADVANCED( PHYSFS_FOUND )
diff --git a/data b/data
-Subproject beff41878d617640c21035c66ea9ddb2e82e658
+Subproject c5926eaa422b683bf5a5b380527987258b8a744
diff --git a/desktop/.gitignore b/desktop/.gitignore
index e6649e0..b3d4193 100644
--- a/desktop/.gitignore
+++ b/desktop/.gitignore
@@ -3,5 +3,8 @@ fr/
16/
32/
48/
+128/
+256/
+512/
colobot.6
colobot.desktop
diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt
index 87c8a4b..37a4b99 100644
--- a/desktop/CMakeLists.txt
+++ b/desktop/CMakeLists.txt
@@ -127,11 +127,11 @@ endif(PLATFORM_WINDOWS)
##
# Packaging
##
-set(CPACK_BUNDLE_NAME "Colobot")
+set(CPACK_BUNDLE_NAME "Colobot: Gold Edition")
set(CPACK_PACKAGE_FILE_NAME "colobot-${COLOBOT_VERSION_FULL}")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../README.md")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Colobot - Colonize with Bots")
-set(CPACK_PACKAGE_VENDOR "Polish Portal of Colobot")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Colobot: Gold Edition")
+set(CPACK_PACKAGE_VENDOR "TerranovaTeam")
set(CPACK_PACKAGE_VERSION_MAJOR ${COLOBOT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${COLOBOT_VERSION_MINOR})
@@ -142,10 +142,10 @@ if(PLATFORM_WINDOWS)
# Don't version the install directory, and allow overwriting
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Colobot")
- set(CPACK_NSIS_DEFINES "SetOverwrite on\nBrandingText \\\"Colobot ${COLOBOT_VERSION_CODENAME} (${COLOBOT_VERSION_FULL})\\\"")
+ set(CPACK_NSIS_DEFINES "SetOverwrite on\nBrandingText \\\"Colobot: Gold Edition (${COLOBOT_VERSION_FULL})\\\"")
# Install the executable directly in Program Files/Colobot/
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
- set(CPACK_PACKAGE_EXECUTABLES "colobot" "Colobot ${COLOBOT_VERSION_CODENAME}")
+ set(CPACK_PACKAGE_EXECUTABLES "colobot" "Colobot: Gold Edition")
# Branding
## Installation and uninstallation icons
diff --git a/desktop/colobot.rc.cmake b/desktop/colobot.rc.cmake
index 40860e5..b40fcab 100644
--- a/desktop/colobot.rc.cmake
+++ b/desktop/colobot.rc.cmake
@@ -10,10 +10,10 @@ BEGIN
BEGIN
VALUE "OriginalFilename", "colobot.exe\0"
VALUE "InternalName", "colobot\0"
- VALUE "FileDescription", "Colobot - Colonize with Bots\0"
- VALUE "ProductName", "Colobot\0"
- VALUE "CompanyName", "Polish Portal of Colobot\0"
- VALUE "LegalCopyright", "Copyright (c) 2012-2013 Polish Portal of Colobot\0"
+ VALUE "FileDescription", "Colobot: Gold Edition - Colonize with Bots\0"
+ VALUE "ProductName", "Colobot: Gold Edition\0"
+ VALUE "CompanyName", "TerranovaTeam\0"
+ VALUE "LegalCopyright", "Copyright (c) 2012-2014 TerranovaTeam\0"
VALUE "FileVersion", "@COLOBOT_VERSION_FULL@\0"
VALUE "ProductVersion", "@COLOBOT_VERSION_FULL@\0"
END
diff --git a/lib/localename/.gitignore b/lib/localename/.gitignore
new file mode 100644
index 0000000..c42756f
--- /dev/null
+++ b/lib/localename/.gitignore
@@ -0,0 +1 @@
+liblocalename.a
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
index 2bd7461..def5473 100644
--- a/po/CMakeLists.txt
+++ b/po/CMakeLists.txt
@@ -6,10 +6,12 @@ find_program(XGETTEXT_CMD xgettext)
add_custom_command(OUTPUT ${_potFile}
COMMAND ${XGETTEXT_CMD} ${colobot_SOURCE_DIR}/src/app/app.cpp --output=${_potFile}
- COMMAND ${XGETTEXT_CMD} ${colobot_SOURCE_DIR}/src/common/restext.cpp --output=${_potFile} --join-existing --extract-all --no-location
+ COMMAND ${XGETTEXT_CMD} ${colobot_SOURCE_DIR}/src/common/restext.cpp --output=${_potFile} --join-existing --keyword=TR --no-location
+ COMMAND sed -i -e "s|^\\(\"POT-Creation-Date:\\).*$|\\1 DATE\\\\n\"|" ${_potFile}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Extract translatable messages to ${_potFile}"
+ VERBATIM
)
add_custom_target(update-pot DEPENDS ${_potFile})
@@ -17,4 +19,3 @@ add_custom_target(update-pot DEPENDS ${_potFile})
file(GLOB _poFiles *.po)
set(GETTEXT_INSTALL_PREFIX ${COLOBOT_INSTALL_I18N_DIR})
gettext_create_translations(${_potFile} ALL ${_poFiles})
-
diff --git a/po/colobot.pot b/po/colobot.pot
index f062658..3a1ddea 100644
--- a/po/colobot.pot
+++ b/po/colobot.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-27 17:09+0100\n"
+"POT-Creation-Date: DATE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -50,10 +50,7 @@ msgstr ""
msgid " or "
msgstr ""
-msgid "COLOBOT"
-msgstr ""
-
-msgid "COLOBOT: Gold Edition"
+msgid "Colobot: Gold Edition"
msgstr ""
msgid "Programming exercises"
@@ -110,9 +107,6 @@ msgstr ""
msgid " Missions on this level:"
msgstr ""
-msgid " Free game on this chapter:"
-msgstr ""
-
msgid " Summary:"
msgstr ""
@@ -143,10 +137,10 @@ msgstr ""
msgid "Strip color:"
msgstr ""
-msgid "Do you want to quit COLOBOT ?"
+msgid "Do you want to quit Colobot: Gold Edition?"
msgstr ""
-msgid "Quit\\Quit COLOBOT"
+msgid "Quit\\Quit Colobot: Gold Edition"
msgstr ""
msgid "Quit the mission?"
@@ -255,9 +249,6 @@ msgstr ""
msgid "Previous"
msgstr ""
-msgid "Menu (\\key quit;)"
-msgstr ""
-
msgid "Exercises\\Programming exercises"
msgstr ""
@@ -288,7 +279,7 @@ msgstr ""
msgid "Load\\Load a saved mission"
msgstr ""
-msgid "\\Return to COLOBOT"
+msgid "\\Return to Colobot: Gold Edition"
msgstr ""
msgid "<< Back \\Back to the previous screen"
@@ -408,6 +399,9 @@ msgstr ""
msgid "Access to solutions\\Show program \"4: Solution\" in the exercises"
msgstr ""
+msgid "Blood\\Display blood when the astronaut or the alien queen is hit"
+msgstr ""
+
msgid "Standard controls\\Standard key functions"
msgstr ""
@@ -641,6 +635,9 @@ msgstr ""
msgid "Take off to finish the mission"
msgstr ""
+msgid "Destroy"
+msgstr ""
+
msgid "Build a derrick"
msgstr ""
@@ -680,6 +677,9 @@ msgstr ""
msgid "Build a exchange post"
msgstr ""
+msgid "Build a destroyer"
+msgstr ""
+
msgid "Show if the ground is flat"
msgstr ""
@@ -809,6 +809,9 @@ msgstr ""
msgid "Shoot (\\key action;)"
msgstr ""
+msgid "Explode (\\key action;)"
+msgstr ""
+
msgid "Recycle (\\key action;)"
msgstr ""
@@ -1280,6 +1283,9 @@ msgstr ""
msgid "Lunar Roving Vehicle"
msgstr ""
+msgid "Internal error - tell the developers"
+msgstr ""
+
msgid "Unknown command"
msgstr ""
@@ -1340,6 +1346,12 @@ msgstr ""
msgid "Too close to a building"
msgstr ""
+msgid "Can not produce this object in this mission"
+msgstr ""
+
+msgid "Can not produce not researched object"
+msgstr ""
+
msgid "Ground inappropriate"
msgstr ""
@@ -1445,6 +1457,12 @@ msgstr ""
msgid "No flag nearby"
msgstr ""
+msgid "Not found anything to destroy"
+msgstr ""
+
+msgid "Inappropriate object"
+msgstr ""
+
msgid ""
"The mission is not accomplished yet (press \\key help; for more details)"
msgstr ""
@@ -1726,88 +1744,5 @@ msgstr ""
msgid "Write error"
msgstr ""
-msgid "left;"
-msgstr ""
-
-msgid "right;"
-msgstr ""
-
-msgid "up;"
-msgstr ""
-
-msgid "down;"
-msgstr ""
-
-msgid "gup;"
-msgstr ""
-
-msgid "gdown;"
-msgstr ""
-
-msgid "camera;"
-msgstr ""
-
-msgid "desel;"
-msgstr ""
-
-msgid "action;"
-msgstr ""
-
-msgid "near;"
-msgstr ""
-
-msgid "away;"
-msgstr ""
-
-msgid "next;"
-msgstr ""
-
-msgid "human;"
-msgstr ""
-
-msgid "quit;"
-msgstr ""
-
-msgid "help;"
-msgstr ""
-
-msgid "prog;"
-msgstr ""
-
-msgid "cbot;"
-msgstr ""
-
-msgid "visit;"
-msgstr ""
-
-msgid "speed10;"
-msgstr ""
-
-msgid "speed15;"
-msgstr ""
-
-msgid "speed20;"
-msgstr ""
-
-#, c-format
-msgid "GetResource event num out of range: %d\n"
-msgstr ""
-
-msgid "Ctrl"
-msgstr ""
-
-msgid "Shift"
-msgstr ""
-
-msgid "Alt"
-msgstr ""
-
-msgid "Win"
-msgstr ""
-
msgid "Button %1"
msgstr ""
-
-msgid "%1"
-msgstr ""
-
diff --git a/po/de.po b/po/de.po
index 93a1d7b..5a63f51 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1,13 +1,24 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
msgid ""
msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-27 17:09+0100\n"
+"POT-Creation-Date: DATE\n"
+"PO-Revision-Date: 2014-07-28 09:27+0200\n"
+"Last-Translator: krzys_h <krzys_h@interia.pl>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Pootle 2.5.1.1\n"
"X-Language: de_DE\n"
"X-Source-Language: en_US\n"
+"X-POOTLE-MTIME: 1406536037.000000\n"
msgid " "
msgstr " "
@@ -24,9 +35,6 @@ msgstr " Driver:"
msgid " Exercises in the chapter:"
msgstr " Liste der Übungen des Kapitels:"
-msgid " Free game on this chapter:"
-msgstr " Liste der freien Levels des Kapitel:"
-
msgid " Free game on this planet:"
msgstr " Liste der freien Levels des Planeten:"
@@ -61,9 +69,6 @@ msgstr "Es fehlt eine geschlossene eckige Klammer \" ] \""
msgid "\"%s\" missing in this exercise"
msgstr "Es fehlt \"%s\" in Ihrem Programm"
-msgid "%1"
-msgstr ""
-
msgid "..behind"
msgstr "..hinten"
@@ -122,9 +127,6 @@ msgstr "Insektenkönigin tödlich verwundet"
msgid "Already carrying something"
msgstr "Trägt schon etwas"
-msgid "Alt"
-msgstr "Alt"
-
msgid "Analysis already performed"
msgstr "Analyse schon durchgeführt"
@@ -179,6 +181,9 @@ msgstr "Einrücken mit 4 Leerstellen\\Einrücken mit 2 oder 4 Leerstellen"
msgid "Black box"
msgstr "Flugschreiber"
+msgid "Blood\\Display blood when the astronaut or the alien queen is hit"
+msgstr ""
+
msgid "Blue"
msgstr "Blau"
@@ -203,6 +208,9 @@ msgstr "Baut einen Geschützturm"
msgid "Build a derrick"
msgstr "Baut einen Bohrturm"
+msgid "Build a destroyer"
+msgstr "Baue einen Zerstörer"
+
msgid "Build a exchange post"
msgstr "Baut einen Infoserver"
@@ -305,12 +313,6 @@ msgstr "Gebäude zu nahe"
msgid "Button %1"
msgstr "Knopf %1"
-msgid "COLOBOT"
-msgstr "COLOBOT"
-
-msgid "COLOBOT: Gold Edition"
-msgstr "COLOBOT: Gold Edition"
-
msgid "Calling an unknown function"
msgstr "Die aufgerufene Funktion existiert nicht"
@@ -338,6 +340,12 @@ msgstr "Kamera rechts"
msgid "Can not create this; there are too many objects"
msgstr "Kein neues Objekt kann erstellt werden (zu viele vorhanden)"
+msgid "Can not produce not researched object"
+msgstr "Das erforschte Objekt kann nicht produziert werden"
+
+msgid "Can not produce this object in this mission"
+msgstr "Das Objekt kann in dieser Mission nicht produziert werden"
+
msgid "Can't open file"
msgstr "Die Datei kann nicht geöffnet werden"
@@ -380,6 +388,10 @@ msgstr "Es fehlt eine geschlossene Klammer \")\""
msgid "Colobot rules!"
msgstr "Colobot ist wunderbar!"
+#, fuzzy
+msgid "Colobot: Gold Edition"
+msgstr "COLOBOT: Gold Edition"
+
msgid "Command line"
msgstr "Befehleingabe"
@@ -413,9 +425,6 @@ msgstr "Kopieren"
msgid "Copy (Ctrl+c)"
msgstr "Kopieren (Ctrl+c)"
-msgid "Ctrl"
-msgstr "Ctrl"
-
msgid "Current mission saved"
msgstr "Mission gespeichert"
@@ -446,6 +455,9 @@ msgstr "Bohrturm"
msgid "Descend\\Reduces the power of the jet"
msgstr "Sinken\\Leistung des Triebwerks drosseln"
+msgid "Destroy"
+msgstr "Zerstören"
+
msgid "Destroy the building"
msgstr "Gebäude sprengen"
@@ -474,7 +486,8 @@ msgstr "Wollen Sie das angewählte Gebäude wirklich zerstören ?"
msgid "Do you want to delete %s's saved games? "
msgstr "Wollen Sie die gespeicherten Missionen von %s löschen ?"
-msgid "Do you want to quit COLOBOT ?"
+#, fuzzy
+msgid "Do you want to quit Colobot: Gold Edition?"
msgstr "Wollen Sie COLOBOT schließen ?"
msgid "Doors blocked by a robot or another object "
@@ -525,6 +538,9 @@ msgstr "Programmieren\\Programmierübungen"
msgid "Exit film\\Film at the exit of exercises"
msgstr "Zurücksetzen \\Kleine Show beim Zurücksetzen in den Übungen"
+msgid "Explode (\\key action;)"
+msgstr "Explodieren (\\key action;)"
+
msgid "Explosive"
msgstr "Sprengstoff"
@@ -622,10 +638,6 @@ msgstr "Spiel\\Gameplay Einstellungen"
msgid "Gantry crane"
msgstr "Träger"
-#, c-format
-msgid "GetResource event num out of range: %d\n"
-msgstr ""
-
msgid "Goto: destination occupied"
msgstr "Ziel ist schon besetzt"
@@ -695,6 +707,10 @@ msgstr "Roboter ungeeignet"
msgid "Inappropriate cell type"
msgstr "Falscher Batterietyp"
+#, fuzzy
+msgid "Inappropriate object"
+msgstr "Roboter ungeeignet"
+
msgid "Incorrect index type"
msgstr "Falscher Typ für einen Index"
@@ -731,6 +747,9 @@ msgstr "Anweisungen von Houston"
msgid "Instructions\\Shows the instructions for the current mission"
msgstr "Anweisungen\\Anweisungen für die Mission oder Übung"
+msgid "Internal error - tell the developers"
+msgstr "Interner Fehler - Benachrichtige die Entwickler"
+
msgid "Jet temperature"
msgstr "Triebwerktemperatur"
@@ -756,7 +775,7 @@ msgid "Keyword help(\\key cbot;)"
msgstr "Hilfe über den Begriff (\\key cbot;)"
msgid "LOADING"
-msgstr "Laden"
+msgstr "LADEN"
msgid "Legged grabber"
msgstr "Transporter"
@@ -800,9 +819,6 @@ msgstr "Markierungen\\Markierungen auf dem Boden"
msgid "Maximize"
msgstr "Großes Fenster"
-msgid "Menu (\\key quit;)"
-msgstr "Menü (\\key quit;)"
-
msgid "Minimize"
msgstr "Reduzieren"
@@ -911,6 +927,9 @@ msgstr "Nicht genug Energie"
msgid "Not enough energy yet"
msgstr "Noch nicht genug Energie"
+msgid "Not found anything to destroy"
+msgstr "Nichts zum Zerstampfen gefunden"
+
msgid "Not yet enough energy"
msgstr "Noch nicht genug Energie"
@@ -1121,8 +1140,8 @@ msgstr "Beben bei Explosionen\\Die Kamera bebt bei Explosionen"
msgid "Quit the mission?"
msgstr "Mission abbrechen ?"
-msgid "Quit\\Quit COLOBOT"
-msgstr "Schließen\\COLOBOT schließen"
+msgid "Quit\\Quit Colobot: Gold Edition"
+msgstr ""
msgid "Quit\\Quit the current mission or exercise"
msgstr "Mission verlassen\\Eine Mission oder Übung verlassen"
@@ -1169,6 +1188,7 @@ msgstr "Forschungsprogramm schon ausgeführt"
msgid "Research program completed"
msgstr "Forschungsprogramm abgeschlossen"
+#, fuzzy
msgid "Reserved keyword of CBOT language"
msgstr "Dieses Wort ist reserviert"
@@ -1263,9 +1283,6 @@ msgstr "Reichweite Schutzschild"
msgid "Shielder"
msgstr "Schutzschild"
-msgid "Shift"
-msgstr "Shift"
-
msgid "Shoot (\\key action;)"
msgstr "Feuer (\\key action;)"
@@ -1575,9 +1592,6 @@ msgstr "Shooter"
msgid "Wheeled sniffer"
msgstr "Schnüffler"
-msgid "Win"
-msgstr ""
-
msgid "Winged grabber"
msgstr "Transporter"
@@ -1674,8 +1688,8 @@ msgstr "\\Bleistift abheben"
msgid "\\Red flags"
msgstr "\\Rote Fahne"
-msgid "\\Return to COLOBOT"
-msgstr "\\Zurück zu COLOBOT"
+msgid "\\Return to Colobot: Gold Edition"
+msgstr ""
msgid "\\SatCom on standby"
msgstr "\\SatCom in Standby"
@@ -1743,302 +1757,14 @@ msgstr "\\b;Liste der Roboter\n"
msgid "\\c; (none)\\n;\n"
msgstr "\\c; (keine)\\n;\n"
-msgid "action;"
-msgstr ""
-
-msgid "away;"
-msgstr ""
-
-msgid "camera;"
-msgstr ""
-
-msgid "cbot;"
-msgstr ""
-
-msgid "desel;"
-msgstr ""
-
-msgid "down;"
-msgstr ""
-
-msgid "gdown;"
-msgstr ""
-
-msgid "gup;"
-msgstr ""
-
-msgid "help;"
-msgstr ""
-
-msgid "human;"
-msgstr ""
-
-msgid "left;"
-msgstr ""
-
-msgid "near;"
-msgstr ""
-
-msgid "next;"
-msgstr ""
-
-msgid "prog;"
-msgstr ""
-
-msgid "quit;"
-msgstr ""
-
-msgid "right;"
-msgstr ""
-
-msgid "speed10;"
-msgstr ""
-
-msgid "speed15;"
-msgstr ""
-
-msgid "speed20;"
-msgstr ""
-
-msgid "up;"
-msgstr ""
-
-msgid "visit;"
-msgstr ""
-
msgid "www.epsitec.com"
msgstr "www.epsitec.com"
-#~ msgid "< none >"
-#~ msgstr "< keine >"
-
-#~ msgid "<--"
-#~ msgstr "<--"
-
-#~ msgid "Application key"
-#~ msgstr "Application key"
-
-#~ msgid "Arrow down"
-#~ msgstr "Pfeil nach unten"
-
-#~ msgid "Arrow left"
-#~ msgstr "Pfeiltaste links"
-
-#~ msgid "Arrow right"
-#~ msgstr "Pfeiltaste rechts"
-
-#~ msgid "Arrow up"
-#~ msgstr "Pfeil nach oben"
-
-#~ msgid "Attn"
-#~ msgstr "Attn"
-
-#~ msgid "Caps Lock"
-#~ msgstr "Caps Lock"
-
-#~ msgid "Clear"
-#~ msgstr "Clear"
-
-#~ msgid "Control-break"
-#~ msgstr "Ctrl-Break"
-
-#~ msgid "CrSel"
-#~ msgstr "CrSel"
-
-#~ msgid "Delete Key"
-#~ msgstr "Delete"
-
-#~ msgid "Dictionnary"
-#~ msgstr "Wörterbuch Englisch-Deutsch"
-
-#~ msgid "Disintegrator"
-#~ msgstr "Auflöser"
-
-#~ msgid "End"
-#~ msgstr "End"
-
-#~ msgid "Enter"
-#~ msgstr "Eingabe"
-
-#~ msgid "Erase EOF"
-#~ msgstr "Erase EOF"
-
-#~ msgid "Error"
-#~ msgstr "Fehler"
-
-#~ msgid "Esc"
-#~ msgstr "Esc"
-
-#~ msgid "ExSel"
-#~ msgstr "ExSel"
-
-#~ msgid "Execute"
-#~ msgstr "Execute"
-
-#~ msgid "F1"
-#~ msgstr "F1"
-
-#~ msgid "F10"
-#~ msgstr "F10"
-
-#~ msgid "F11"
-#~ msgstr "F11"
-
-#~ msgid "F12"
-#~ msgstr "F12"
-
-#~ msgid "F13"
-#~ msgstr "F13"
-
-#~ msgid "F14"
-#~ msgstr "F14"
-
-#~ msgid "F15"
-#~ msgstr "F15"
-
-#~ msgid "F16"
-#~ msgstr "F16"
-
-#~ msgid "F17"
-#~ msgstr "F17"
-
-#~ msgid "F18"
-#~ msgstr "F18"
-
-#~ msgid "F19"
-#~ msgstr "F19"
-
-#~ msgid "F2"
-#~ msgstr "F2"
-
-#~ msgid "F20"
-#~ msgstr "F20"
-
-#~ msgid "F3"
-#~ msgstr "F3"
-
-#~ msgid "F4"
-#~ msgstr "F4"
-
-#~ msgid "F5"
-#~ msgstr "F5"
-
-#~ msgid "F6"
-#~ msgstr "F6"
-
-#~ msgid "F7"
-#~ msgstr "F7"
-
-#~ msgid "F8"
-#~ msgstr "F8"
-
-#~ msgid "F9"
-#~ msgstr "F9"
-
-#~ msgid "Help"
-#~ msgstr "Help"
-
-#~ msgid "Home Key"
-#~ msgstr "Home"
-
-#~ msgid "Insert"
-#~ msgstr "Insert"
-
-#~ msgid "Left Windows"
-#~ msgstr "Left Windows"
-
-#~ msgid "Mini-map"
-#~ msgstr "Minikarte"
-
-#~ msgid "Num Lock"
-#~ msgstr "Num Lock"
-
-#~ msgid "NumPad *"
-#~ msgstr "NumPad *"
-
-#~ msgid "NumPad +"
-#~ msgstr "NumPad +"
-
-#~ msgid "NumPad -"
-#~ msgstr "NumPad -"
-
-#~ msgid "NumPad ."
-#~ msgstr "NumPad ."
-
-#~ msgid "NumPad /"
-#~ msgstr "NumPad /"
-
-#~ msgid "NumPad 0"
-#~ msgstr "NumPad 0"
-
-#~ msgid "NumPad 1"
-#~ msgstr "NumPad 1"
-
-#~ msgid "NumPad 2"
-#~ msgstr "NumPad 2"
-
-#~ msgid "NumPad 3"
-#~ msgstr "NumPad 3"
-
-#~ msgid "NumPad 4"
-#~ msgstr "NumPad 4"
-
-#~ msgid "NumPad 5"
-#~ msgstr "NumPad 5"
-
-#~ msgid "NumPad 6"
-#~ msgstr "NumPad 6"
-
-#~ msgid "NumPad 7"
-#~ msgstr "NumPad 7"
-
-#~ msgid "NumPad 8"
-#~ msgstr "NumPad 8"
-
-#~ msgid "NumPad 9"
-#~ msgstr "NumPad 9"
-
-#~ msgid "NumPad sep"
-#~ msgstr "NumPad sep"
-
-#~ msgid "PA1"
-#~ msgstr "PA1"
-
-#~ msgid "Page Down"
-#~ msgstr "Page Down"
-
-#~ msgid "Page Up"
-#~ msgstr "Page Up"
-
-#~ msgid "Pause"
-#~ msgstr "Pause"
-
-#~ msgid "Play"
-#~ msgstr "Play"
-
-#~ msgid "Print Scrn"
-#~ msgstr "Print Scrn"
-
-#~ msgid "Right Windows"
-#~ msgstr "Right Windows"
-
-#~ msgid "Scroll"
-#~ msgstr "Scroll"
-
-#~ msgid "Select"
-#~ msgstr "Select"
-
-#~ msgid "Space"
-#~ msgstr "Leertaste"
-
-#~ msgid "Tab"
-#~ msgstr "Tab"
-
-#~ msgid "Wheel down"
-#~ msgstr "Mausrad zurück"
+#~ msgid "COLOBOT"
+#~ msgstr "COLOBOT"
-#~ msgid "Wheel up"
-#~ msgstr "Mausrad nach vorne"
+#~ msgid "Quit\\Quit COLOBOT"
+#~ msgstr "Schließen\\COLOBOT schließen"
-#~ msgid "Zoom"
-#~ msgstr "Zoom"
+#~ msgid "\\Return to COLOBOT"
+#~ msgstr "\\Zurück zu COLOBOT"
diff --git a/po/fr.po b/po/fr.po
index e6be922..a72fc23 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1,18 +1,20 @@
# Didier Raboud <odyx@debian.org>, 2012.
msgid ""
msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-27 17:09+0100\n"
+"POT-Creation-Date: DATE\n"
"PO-Revision-Date: 2012-12-27 14:07+0100\n"
"Last-Translator: Didier Raboud <odyx@debian.org>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Lokalize 1.4\n"
"X-Language: fr_FR\n"
"X-Source-Language: en_US\n"
-"X-Generator: Lokalize 1.4\n"
msgid " "
msgstr " "
@@ -29,9 +31,6 @@ msgstr " Pilotes :"
msgid " Exercises in the chapter:"
msgstr " Liste des exercices du chapitre :"
-msgid " Free game on this chapter:"
-msgstr " Liste des jeux libres du chapitre :"
-
msgid " Free game on this planet:"
msgstr " Liste des jeux libres du chapitre :"
@@ -66,9 +65,6 @@ msgstr "\" ] \" attendu"
msgid "\"%s\" missing in this exercise"
msgstr "Il manque \"%s\" dans le programme"
-msgid "%1"
-msgstr "%1"
-
msgid "..behind"
msgstr "..derrière"
@@ -126,9 +122,6 @@ msgstr "Pondeuse mortellement touchée"
msgid "Already carrying something"
msgstr "Porte déjà quelque chose"
-msgid "Alt"
-msgstr "Alt"
-
msgid "Analysis already performed"
msgstr "Analyse déjà effectuée"
@@ -183,6 +176,9 @@ msgstr "Grande indentation\\Indente avec 2 ou 4 espaces"
msgid "Black box"
msgstr "Boîte noire"
+msgid "Blood\\Display blood when the astronaut or the alien queen is hit"
+msgstr "Sang\\Afficher du sang quand le cosmonaute ou la pondeuse sont touchés"
+
msgid "Blue"
msgstr "Bleu"
@@ -207,6 +203,9 @@ msgstr "Construit une tour"
msgid "Build a derrick"
msgstr "Construit un derrick"
+msgid "Build a destroyer"
+msgstr "Construit un destructeur"
+
msgid "Build a exchange post"
msgstr "Construit une borne d'information"
@@ -309,12 +308,6 @@ msgstr "Bâtiment trop proche"
msgid "Button %1"
msgstr "Bouton %1"
-msgid "COLOBOT"
-msgstr "COLOBOT"
-
-msgid "COLOBOT: Gold Edition"
-msgstr "COLOBOT: Gold Edition"
-
msgid "Calling an unknown function"
msgstr "Appel d'une fonction inexistante"
@@ -342,6 +335,12 @@ msgstr "Caméra à droite"
msgid "Can not create this; there are too many objects"
msgstr "Création impossible; il y a trop d'objets"
+msgid "Can not produce not researched object"
+msgstr ""
+
+msgid "Can not produce this object in this mission"
+msgstr "Impossible de créer cet objet dans cette mission"
+
msgid "Can't open file"
msgstr "Ouverture du fichier impossible"
@@ -384,6 +383,10 @@ msgstr "Il manque une parenthèse fermante"
msgid "Colobot rules!"
msgstr "Colobot est super!"
+#, fuzzy
+msgid "Colobot: Gold Edition"
+msgstr "COLOBOT: Gold Edition"
+
msgid "Command line"
msgstr "Console de commande"
@@ -417,9 +420,6 @@ msgstr "Copier"
msgid "Copy (Ctrl+c)"
msgstr "Copier (Ctrl+c)"
-msgid "Ctrl"
-msgstr "Ctrl"
-
msgid "Current mission saved"
msgstr "Enregistrement effectué"
@@ -450,6 +450,9 @@ msgstr "Derrick"
msgid "Descend\\Reduces the power of the jet"
msgstr "Descendre\\Diminuer la puissance du réacteur"
+msgid "Destroy"
+msgstr "Détruire"
+
msgid "Destroy the building"
msgstr "Démolit le bâtiment"
@@ -478,7 +481,8 @@ msgstr "Voulez-vous vraiment détruire le bâtiment sélectionné ?"
msgid "Do you want to delete %s's saved games? "
msgstr "Voulez-vous détruire les sauvegardes de %s ?"
-msgid "Do you want to quit COLOBOT ?"
+#, fuzzy
+msgid "Do you want to quit Colobot: Gold Edition?"
msgstr "Voulez-vous quitter COLOBOT ?"
msgid "Doors blocked by a robot or another object "
@@ -529,6 +533,9 @@ msgstr "Programmation\\Exercices de programmation"
msgid "Exit film\\Film at the exit of exercises"
msgstr "Retour animé\\Retour animé dans les exercices"
+msgid "Explode (\\key action;)"
+msgstr "Exploser (\\key action;)"
+
msgid "Explosive"
msgstr "Explosif"
@@ -626,10 +633,6 @@ msgstr "Jeu\\Options de jouabilité"
msgid "Gantry crane"
msgstr "Portique"
-#, c-format
-msgid "GetResource event num out of range: %d\n"
-msgstr ""
-
msgid "Goto: destination occupied"
msgstr "Goto: Destination occupée"
@@ -699,6 +702,9 @@ msgstr "Robot inadapté"
msgid "Inappropriate cell type"
msgstr "Pas le bon type de pile"
+msgid "Inappropriate object"
+msgstr "Pas le bon objet"
+
msgid "Incorrect index type"
msgstr "Mauvais type d'index"
@@ -735,6 +741,9 @@ msgstr "Instructions de Houston"
msgid "Instructions\\Shows the instructions for the current mission"
msgstr "Instructions mission\\Marche à suivre"
+msgid "Internal error - tell the developers"
+msgstr "Erreur interne - contacter les développeurs"
+
msgid "Jet temperature"
msgstr "Température du réacteur"
@@ -804,9 +813,6 @@ msgstr "Marques sur le sol\\Marques dessinées sur le sol"
msgid "Maximize"
msgstr "Taille maximale"
-msgid "Menu (\\key quit;)"
-msgstr "Menu (\\key quit;)"
-
msgid "Minimize"
msgstr "Taille réduite"
@@ -917,6 +923,9 @@ msgstr "Pas assez d'énergie"
msgid "Not enough energy yet"
msgstr "Pas encore assez d'énergie"
+msgid "Not found anything to destroy"
+msgstr ""
+
msgid "Not yet enough energy"
msgstr "Pas encore assez d'énergie"
@@ -1127,8 +1136,8 @@ msgstr "Secousses lors d'explosions\\L'écran vibre lors d'une explosion"
msgid "Quit the mission?"
msgstr "Quitter la mission ?"
-msgid "Quit\\Quit COLOBOT"
-msgstr "Quitter\\Quitter COLOBOT"
+msgid "Quit\\Quit Colobot: Gold Edition"
+msgstr ""
msgid "Quit\\Quit the current mission or exercise"
msgstr "Quitter la mission en cours\\Terminer un exercice ou une mssion"
@@ -1270,9 +1279,6 @@ msgstr "Rayon du bouclier"
msgid "Shielder"
msgstr "Robot bouclier"
-msgid "Shift"
-msgstr "Shift"
-
msgid "Shoot (\\key action;)"
msgstr "Tir (\\key action;)"
@@ -1581,9 +1587,6 @@ msgstr "Robot shooter"
msgid "Wheeled sniffer"
msgstr "Robot renifleur"
-msgid "Win"
-msgstr "Gagné"
-
msgid "Winged grabber"
msgstr "Robot déménageur"
@@ -1681,8 +1684,8 @@ msgstr "\\Relève le crayon"
msgid "\\Red flags"
msgstr "\\Drapeaux rouges"
-msgid "\\Return to COLOBOT"
-msgstr "\\Retourner dans COLOBOT"
+msgid "\\Return to Colobot: Gold Edition"
+msgstr ""
msgid "\\SatCom on standby"
msgstr "\\Mettre le SatCom en veille"
@@ -1750,302 +1753,14 @@ msgstr "\\b;Listes des robots\n"
msgid "\\c; (none)\\n;\n"
msgstr "\\c; (aucun)\\n;\n"
-msgid "action;"
-msgstr ""
-
-msgid "away;"
-msgstr ""
-
-msgid "camera;"
-msgstr ""
-
-msgid "cbot;"
-msgstr ""
-
-msgid "desel;"
-msgstr ""
-
-msgid "down;"
-msgstr ""
-
-msgid "gdown;"
-msgstr ""
-
-msgid "gup;"
-msgstr ""
-
-msgid "help;"
-msgstr ""
-
-msgid "human;"
-msgstr ""
-
-msgid "left;"
-msgstr ""
-
-msgid "near;"
-msgstr ""
-
-msgid "next;"
-msgstr ""
-
-msgid "prog;"
-msgstr ""
-
-msgid "quit;"
-msgstr ""
-
-msgid "right;"
-msgstr ""
-
-msgid "speed10;"
-msgstr ""
-
-msgid "speed15;"
-msgstr ""
-
-msgid "speed20;"
-msgstr ""
-
-msgid "up;"
-msgstr ""
-
-msgid "visit;"
-msgstr ""
-
msgid "www.epsitec.com"
msgstr "www.epsitec.com"
-#~ msgid "< none >"
-#~ msgstr "< aucune >"
-
-#~ msgid "<--"
-#~ msgstr "<--"
-
-#~ msgid "Application key"
-#~ msgstr "Application key"
-
-#~ msgid "Arrow down"
-#~ msgstr "Flèche Bas"
-
-#~ msgid "Arrow left"
-#~ msgstr "Flèche Gauche"
-
-#~ msgid "Arrow right"
-#~ msgstr "Flèche Droite"
-
-#~ msgid "Arrow up"
-#~ msgstr "Flèche Haut"
-
-#~ msgid "Attn"
-#~ msgstr "Attn"
-
-#~ msgid "Caps Lock"
-#~ msgstr "Caps Lock"
-
-#~ msgid "Clear"
-#~ msgstr "Clear"
-
-#~ msgid "Control-break"
-#~ msgstr "Control-break"
-
-#~ msgid "CrSel"
-#~ msgstr "CrSel"
-
-#~ msgid "Delete Key"
-#~ msgstr "Delete"
-
-#~ msgid "Dictionnary"
-#~ msgstr "Dictionnaire anglais-français"
-
-#~ msgid "Disintegrator"
-#~ msgstr "Désintégrateur"
-
-#~ msgid "End"
-#~ msgstr "End"
-
-#~ msgid "Enter"
-#~ msgstr "Entrée"
-
-#~ msgid "Erase EOF"
-#~ msgstr "Erase EOF"
-
-#~ msgid "Error"
-#~ msgstr "Erreur"
-
-#~ msgid "Esc"
-#~ msgstr "Esc"
-
-#~ msgid "ExSel"
-#~ msgstr "ExSel"
-
-#~ msgid "Execute"
-#~ msgstr "Execute"
-
-#~ msgid "F1"
-#~ msgstr "F1"
-
-#~ msgid "F10"
-#~ msgstr "F10"
-
-#~ msgid "F11"
-#~ msgstr "F11"
-
-#~ msgid "F12"
-#~ msgstr "F12"
-
-#~ msgid "F13"
-#~ msgstr "F13"
-
-#~ msgid "F14"
-#~ msgstr "F14"
-
-#~ msgid "F15"
-#~ msgstr "F15"
-
-#~ msgid "F16"
-#~ msgstr "F16"
-
-#~ msgid "F17"
-#~ msgstr "F17"
-
-#~ msgid "F18"
-#~ msgstr "F18"
-
-#~ msgid "F19"
-#~ msgstr "F19"
-
-#~ msgid "F2"
-#~ msgstr "F2"
-
-#~ msgid "F20"
-#~ msgstr "F20"
-
-#~ msgid "F3"
-#~ msgstr "F3"
-
-#~ msgid "F4"
-#~ msgstr "F4"
-
-#~ msgid "F5"
-#~ msgstr "F5"
-
-#~ msgid "F6"
-#~ msgstr "F6"
-
-#~ msgid "F7"
-#~ msgstr "F7"
-
-#~ msgid "F8"
-#~ msgstr "F8"
-
-#~ msgid "F9"
-#~ msgstr "F9"
-
-#~ msgid "Help"
-#~ msgstr "Help"
-
-#~ msgid "Home Key"
-#~ msgstr "Home"
-
-#~ msgid "Insert"
-#~ msgstr "Insert"
-
-#~ msgid "Left Windows"
-#~ msgstr "Left Windows"
-
-#~ msgid "Mini-map"
-#~ msgstr "Mini-carte"
-
-#~ msgid "Num Lock"
-#~ msgstr "Num Lock"
-
-#~ msgid "NumPad *"
-#~ msgstr "NumPad *"
-
-#~ msgid "NumPad +"
-#~ msgstr "NumPad +"
-
-#~ msgid "NumPad -"
-#~ msgstr "NumPad -"
-
-#~ msgid "NumPad ."
-#~ msgstr "NumPad ."
-
-#~ msgid "NumPad /"
-#~ msgstr "NumPad /"
-
-#~ msgid "NumPad 0"
-#~ msgstr "NumPad 0"
-
-#~ msgid "NumPad 1"
-#~ msgstr "NumPad 1"
-
-#~ msgid "NumPad 2"
-#~ msgstr "NumPad 2"
-
-#~ msgid "NumPad 3"
-#~ msgstr "NumPad 3"
-
-#~ msgid "NumPad 4"
-#~ msgstr "NumPad 4"
-
-#~ msgid "NumPad 5"
-#~ msgstr "NumPad 5"
-
-#~ msgid "NumPad 6"
-#~ msgstr "NumPad 6"
-
-#~ msgid "NumPad 7"
-#~ msgstr "NumPad 7"
-
-#~ msgid "NumPad 8"
-#~ msgstr "NumPad 8"
-
-#~ msgid "NumPad 9"
-#~ msgstr "NumPad 9"
-
-#~ msgid "NumPad sep"
-#~ msgstr "NumPad sep"
-
-#~ msgid "PA1"
-#~ msgstr "PA1"
-
-#~ msgid "Page Down"
-#~ msgstr "Page Down"
-
-#~ msgid "Page Up"
-#~ msgstr "Page Up"
-
-#~ msgid "Pause"
-#~ msgstr "Pause"
-
-#~ msgid "Play"
-#~ msgstr "Play"
-
-#~ msgid "Print Scrn"
-#~ msgstr "Print Scrn"
-
-#~ msgid "Right Windows"
-#~ msgstr "Right Windows"
-
-#~ msgid "Scroll"
-#~ msgstr "Scroll"
-
-#~ msgid "Select"
-#~ msgstr "Select"
-
-#~ msgid "Space"
-#~ msgstr "Espace"
-
-#~ msgid "Tab"
-#~ msgstr "Tab"
-
-#~ msgid "Wheel down"
-#~ msgstr "Molette bas"
+#~ msgid "COLOBOT"
+#~ msgstr "COLOBOT"
-#~ msgid "Wheel up"
-#~ msgstr "Molette haut"
+#~ msgid "Quit\\Quit COLOBOT"
+#~ msgstr "Quitter\\Quitter COLOBOT"
-#~ msgid "Zoom"
-#~ msgstr "Zoom"
+#~ msgid "\\Return to COLOBOT"
+#~ msgstr "\\Retourner dans COLOBOT"
diff --git a/po/pl.po b/po/pl.po
index 0b13dbb..322bd92 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -1,14 +1,25 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
msgid ""
msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-27 17:09+0100\n"
+"POT-Creation-Date: DATE\n"
+"PO-Revision-Date: 2014-07-10 15:30+0200\n"
+"Last-Translator: krzys_h <krzys_h@interia.pl>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
+"X-Generator: Pootle 2.5.1.1\n"
"X-Language: pl_PL\n"
"X-Source-Language: en_US\n"
+"X-POOTLE-MTIME: 1405002617.000000\n"
msgid " "
msgstr " "
@@ -25,9 +36,6 @@ msgstr " Sterowniki:"
msgid " Exercises in the chapter:"
msgstr " Ćwiczenia w tym rozdziale:"
-msgid " Free game on this chapter:"
-msgstr " Swobodna gra na tej planecie:"
-
msgid " Free game on this planet:"
msgstr " Swobodna gra na tej planecie:"
@@ -60,10 +68,7 @@ msgstr "Brak \" ] \""
#, c-format
msgid "\"%s\" missing in this exercise"
-msgstr "It misses \"%s\" in this exercise"
-
-msgid "%1"
-msgstr ""
+msgstr "Brakuje \"%s\" w tym ćwiczeniu"
msgid "..behind"
msgstr "..za"
@@ -122,9 +127,6 @@ msgstr "Królowa Obcych została zabita"
msgid "Already carrying something"
msgstr "Nie można nieść więcej przedmiotów"
-msgid "Alt"
-msgstr "Alt"
-
msgid "Analysis already performed"
msgstr "Analiza została już wykonana"
@@ -181,6 +183,9 @@ msgstr ""
msgid "Black box"
msgstr "Czarna skrzynka"
+msgid "Blood\\Display blood when the astronaut or the alien queen is hit"
+msgstr "Krew\\Pokazuj krew gdy astronauta lub Królowa Obcych zostaje trafiona"
+
msgid "Blue"
msgstr "Niebieski"
@@ -205,6 +210,9 @@ msgstr "Zbuduj wieżę obronną"
msgid "Build a derrick"
msgstr "Zbuduj kopalnię"
+msgid "Build a destroyer"
+msgstr "Zbuduj niszczarkę"
+
msgid "Build a exchange post"
msgstr "Zbuduj stację przekaźnikową"
@@ -307,12 +315,6 @@ msgstr "Budynek za blisko"
msgid "Button %1"
msgstr "Przycisk %1"
-msgid "COLOBOT"
-msgstr "COLOBOT"
-
-msgid "COLOBOT: Gold Edition"
-msgstr "COLOBOT: Gold Edition"
-
msgid "Calling an unknown function"
msgstr "Odwołanie do nieznanej funkcji"
@@ -340,6 +342,12 @@ msgstr "Camera to right"
msgid "Can not create this; there are too many objects"
msgstr "Nie można tego utworzyć, za dużo obiektów"
+msgid "Can not produce not researched object"
+msgstr "Nie można wyprodukować nie wynalezionego obiektu"
+
+msgid "Can not produce this object in this mission"
+msgstr "Nie można utworzyć tego obiektu w tej misji"
+
msgid "Can't open file"
msgstr "Nie można otworzyć pliku"
@@ -382,6 +390,9 @@ msgstr "Brak nawiasu zamykającego"
msgid "Colobot rules!"
msgstr "Colobot rządzi!"
+msgid "Colobot: Gold Edition"
+msgstr "Colobot: Gold Edition"
+
msgid "Command line"
msgstr "Linia polecenia"
@@ -415,9 +426,6 @@ msgstr "Kopiuj"
msgid "Copy (Ctrl+c)"
msgstr "Kopiuj (Ctrl+C)"
-msgid "Ctrl"
-msgstr "Ctrl"
-
msgid "Current mission saved"
msgstr "Bieżąca misja zapisana"
@@ -448,6 +456,9 @@ msgstr "Kopalnia"
msgid "Descend\\Reduces the power of the jet"
msgstr "W dół\\Zmniejsza moc silnika"
+msgid "Destroy"
+msgstr "Zniszcz"
+
msgid "Destroy the building"
msgstr "Zniszcz budynek"
@@ -476,8 +487,8 @@ msgstr "Czy na pewno chcesz zniszczyć zaznaczony budynek?"
msgid "Do you want to delete %s's saved games? "
msgstr "Czy na pewno chcesz skasować zapisane gry gracza %s? "
-msgid "Do you want to quit COLOBOT ?"
-msgstr "Czy na pewno chcesz opuścić grę COLOBOT?"
+msgid "Do you want to quit Colobot: Gold Edition?"
+msgstr "Czy na pewno chcesz opuścić grę Colobot: Gold Edition?"
msgid "Doors blocked by a robot or another object "
msgstr "Drzwi zablokowane przez robota lub inny obiekt "
@@ -527,6 +538,9 @@ msgstr "Ćwiczenia\\Ćwiczenia programistyczne"
msgid "Exit film\\Film at the exit of exercises"
msgstr "Końcowy film\\Film na zakończenie ćwiczeń"
+msgid "Explode (\\key action;)"
+msgstr "Wysadź (\\key action;)"
+
msgid "Explosive"
msgstr "Materiały wybuchowe"
@@ -624,10 +638,6 @@ msgstr "Gra\\Ustawienia gry"
msgid "Gantry crane"
msgstr "Żuraw przesuwalny"
-#, c-format
-msgid "GetResource event num out of range: %d\n"
-msgstr ""
-
msgid "Goto: destination occupied"
msgstr "Goto: miejsce docelowe zajęte"
@@ -698,6 +708,9 @@ msgstr "Nieodpowiedni robot"
msgid "Inappropriate cell type"
msgstr "Nieodpowiedni rodzaj ogniw"
+msgid "Inappropriate object"
+msgstr "Nieodpowiedni obiekt"
+
msgid "Incorrect index type"
msgstr "Nieprawidłowy typ indeksu"
@@ -734,6 +747,9 @@ msgstr "Rozkazy z Houston"
msgid "Instructions\\Shows the instructions for the current mission"
msgstr "Rozkazy\\Pokazuje rozkazy dotyczące bieżącej misji"
+msgid "Internal error - tell the developers"
+msgstr "Błąd wewnętrzny - powiadom twórców gry"
+
msgid "Jet temperature"
msgstr "Temperatura silnika"
@@ -805,9 +821,6 @@ msgstr "Znaki na ziemi\\Znaki na ziemi"
msgid "Maximize"
msgstr "Powiększ"
-msgid "Menu (\\key quit;)"
-msgstr "Menu (\\key quit;)"
-
msgid "Minimize"
msgstr "Pomniejsz"
@@ -916,6 +929,9 @@ msgstr "Za mało energii"
msgid "Not enough energy yet"
msgstr "Wciąż za mało energii"
+msgid "Not found anything to destroy"
+msgstr "Nie znaleziono nic do zniszczenia"
+
msgid "Not yet enough energy"
msgstr "Wciąż za mało energii"
@@ -1128,8 +1144,8 @@ msgstr "Wstrząsy przy wybuchach\\Ekran trzęsie się podczas wybuchów"
msgid "Quit the mission?"
msgstr "Opuścić misję?"
-msgid "Quit\\Quit COLOBOT"
-msgstr "Zakończ\\Kończy grę COLOBOT"
+msgid "Quit\\Quit Colobot: Gold Edition"
+msgstr "Wyjdź\\Kończy grę Colobot: Gold Edition"
msgid "Quit\\Quit the current mission or exercise"
msgstr "Zakończ\\Kończy bieżącą misję lub ćwiczenie"
@@ -1271,9 +1287,6 @@ msgstr "Zasięg osłony"
msgid "Shielder"
msgstr "Osłaniacz"
-msgid "Shift"
-msgstr "Shift"
-
msgid "Shoot (\\key action;)"
msgstr "Strzelaj (\\key action;)"
@@ -1585,9 +1598,6 @@ msgstr "Działo na kołach"
msgid "Wheeled sniffer"
msgstr "Szperacz na kołach"
-msgid "Win"
-msgstr ""
-
msgid "Winged grabber"
msgstr "Transporter latający"
@@ -1684,8 +1694,8 @@ msgstr "\\Relčve le crayon"
msgid "\\Red flags"
msgstr "\\Czerwone flagi"
-msgid "\\Return to COLOBOT"
-msgstr "\\Powróć do gry COLOBOT"
+msgid "\\Return to Colobot: Gold Edition"
+msgstr "\\Powróć do gry Colobot: Gold Edition"
msgid "\\SatCom on standby"
msgstr "\\Przełącz przekaźnik SatCom w stan gotowości"
@@ -1753,302 +1763,5 @@ msgstr "\\b;Roboty\n"
msgid "\\c; (none)\\n;\n"
msgstr "\\c; (brak)\\n;\n"
-msgid "action;"
-msgstr ""
-
-msgid "away;"
-msgstr ""
-
-msgid "camera;"
-msgstr ""
-
-msgid "cbot;"
-msgstr ""
-
-msgid "desel;"
-msgstr ""
-
-msgid "down;"
-msgstr ""
-
-msgid "gdown;"
-msgstr ""
-
-msgid "gup;"
-msgstr ""
-
-msgid "help;"
-msgstr ""
-
-msgid "human;"
-msgstr ""
-
-msgid "left;"
-msgstr ""
-
-msgid "near;"
-msgstr ""
-
-msgid "next;"
-msgstr ""
-
-msgid "prog;"
-msgstr ""
-
-msgid "quit;"
-msgstr ""
-
-msgid "right;"
-msgstr ""
-
-msgid "speed10;"
-msgstr ""
-
-msgid "speed15;"
-msgstr ""
-
-msgid "speed20;"
-msgstr ""
-
-msgid "up;"
-msgstr ""
-
-msgid "visit;"
-msgstr ""
-
msgid "www.epsitec.com"
msgstr "www.epsitec.com"
-
-#~ msgid "< none >"
-#~ msgstr "< brak >"
-
-#~ msgid "<--"
-#~ msgstr "<--"
-
-#~ msgid "Application key"
-#~ msgstr "Klawisz menu kontekstowego"
-
-#~ msgid "Arrow down"
-#~ msgstr "Strzałka w dół"
-
-#~ msgid "Arrow left"
-#~ msgstr "Strzałka w lewo"
-
-#~ msgid "Arrow right"
-#~ msgstr "Strzałka w prawo"
-
-#~ msgid "Arrow up"
-#~ msgstr "Strzałka w górę"
-
-#~ msgid "Attn"
-#~ msgstr "Attn"
-
-#~ msgid "Caps Lock"
-#~ msgstr "Caps Lock"
-
-#~ msgid "Clear"
-#~ msgstr "Delete"
-
-#~ msgid "Control-break"
-#~ msgstr "Ctrl-break"
-
-#~ msgid "CrSel"
-#~ msgstr "CrSel"
-
-#~ msgid "Delete Key"
-#~ msgstr "Delete"
-
-#~ msgid "Dictionnary"
-#~ msgstr "Raport z satelity"
-
-#~ msgid "Disintegrator"
-#~ msgstr "Fabryka ogniw elektrycznych"
-
-#~ msgid "End"
-#~ msgstr "End"
-
-#~ msgid "Enter"
-#~ msgstr "Enter"
-
-#~ msgid "Erase EOF"
-#~ msgstr "Erase EOF"
-
-#~ msgid "Error"
-#~ msgstr "Błąd"
-
-#~ msgid "Esc"
-#~ msgstr "Esc"
-
-#~ msgid "ExSel"
-#~ msgstr "ExSel"
-
-#~ msgid "Execute"
-#~ msgstr "Wykonaj"
-
-#~ msgid "F1"
-#~ msgstr "F1"
-
-#~ msgid "F10"
-#~ msgstr "F10"
-
-#~ msgid "F11"
-#~ msgstr "F11"
-
-#~ msgid "F12"
-#~ msgstr "F12"
-
-#~ msgid "F13"
-#~ msgstr "F13"
-
-#~ msgid "F14"
-#~ msgstr "F14"
-
-#~ msgid "F15"
-#~ msgstr "F15"
-
-#~ msgid "F16"
-#~ msgstr "F16"
-
-#~ msgid "F17"
-#~ msgstr "F17"
-
-#~ msgid "F18"
-#~ msgstr "F18"
-
-#~ msgid "F19"
-#~ msgstr "F19"
-
-#~ msgid "F2"
-#~ msgstr "F2"
-
-#~ msgid "F20"
-#~ msgstr "F20"
-
-#~ msgid "F3"
-#~ msgstr "F3"
-
-#~ msgid "F4"
-#~ msgstr "F4"
-
-#~ msgid "F5"
-#~ msgstr "F5"
-
-#~ msgid "F6"
-#~ msgstr "F6"
-
-#~ msgid "F7"
-#~ msgstr "F7"
-
-#~ msgid "F8"
-#~ msgstr "F8"
-
-#~ msgid "F9"
-#~ msgstr "F9"
-
-#~ msgid "Help"
-#~ msgstr "Pomoc"
-
-#~ msgid "Home Key"
-#~ msgstr "Home"
-
-#~ msgid "Insert"
-#~ msgstr "Insert"
-
-#~ msgid "Left Windows"
-#~ msgstr "Lewy klawisz Windows"
-
-#~ msgid "Mini-map"
-#~ msgstr "Mapka"
-
-#~ msgid "Num Lock"
-#~ msgstr "Num Lock"
-
-#~ msgid "NumPad *"
-#~ msgstr "Klaw. Num. *"
-
-#~ msgid "NumPad +"
-#~ msgstr "Klaw. Num. +"
-
-#~ msgid "NumPad -"
-#~ msgstr "Klaw. Num. -"
-
-#~ msgid "NumPad ."
-#~ msgstr "Klaw. Num. ."
-
-#~ msgid "NumPad /"
-#~ msgstr "Klaw. Num. /"
-
-#~ msgid "NumPad 0"
-#~ msgstr "Klaw. Num. 0"
-
-#~ msgid "NumPad 1"
-#~ msgstr "Klaw. Num. 1"
-
-#~ msgid "NumPad 2"
-#~ msgstr "Klaw. Num. 2"
-
-#~ msgid "NumPad 3"
-#~ msgstr "Klaw. Num. 3"
-
-#~ msgid "NumPad 4"
-#~ msgstr "Klaw. Num. 4"
-
-#~ msgid "NumPad 5"
-#~ msgstr "Klaw. Num. 5"
-
-#~ msgid "NumPad 6"
-#~ msgstr "Klaw. Num. 6"
-
-#~ msgid "NumPad 7"
-#~ msgstr "Klaw. Num. 7"
-
-#~ msgid "NumPad 8"
-#~ msgstr "Klaw. Num. 8"
-
-#~ msgid "NumPad 9"
-#~ msgstr "Klaw. Num. 9"
-
-#~ msgid "NumPad sep"
-#~ msgstr "Klaw. Num. separator"
-
-#~ msgid "PA1"
-#~ msgstr "PA1"
-
-#~ msgid "Page Down"
-#~ msgstr "Page Down"
-
-#~ msgid "Page Up"
-#~ msgstr "Page Up"
-
-#~ msgid "Pause"
-#~ msgstr "Pause"
-
-#~ msgid "Play"
-#~ msgstr "Graj"
-
-#~ msgid "Print Scrn"
-#~ msgstr "Print Scrn"
-
-#~ msgid "Right Windows"
-#~ msgstr "Prawy klawisz Windows"
-
-#~ msgid "Scroll"
-#~ msgstr "Scroll Lock"
-
-#~ msgid "Select"
-#~ msgstr "Zaznacz"
-
-#~ msgid "Space"
-#~ msgstr "Spacja"
-
-#~ msgid "Tab"
-#~ msgstr "Tab"
-
-#~ msgid "Wheel down"
-#~ msgstr "Kółko w dół"
-
-#~ msgid "Wheel up"
-#~ msgstr "Kółko w górę"
-
-#~ msgid "Zoom"
-#~ msgstr "Powiększenie"
diff --git a/po/ru.po b/po/ru.po
index 22f84a8..f0276bf 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -2,20 +2,19 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-27 17:09+0100\n"
+"POT-Creation-Date: DATE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
+"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Translate Toolkit 1.11.0\n"
"X-Language: ru_RU\n"
"X-Source-Language: en_US\n"
@@ -34,9 +33,6 @@ msgstr " Драйверы:"
msgid " Exercises in the chapter:"
msgstr " Упражнения в разделе:"
-msgid " Free game on this chapter:"
-msgstr " Свободная игра на этой главе:"
-
msgid " Free game on this planet:"
msgstr " Свободная игра на этой планете:"
@@ -71,9 +67,6 @@ msgstr "Отсутствует \"]\" "
msgid "\"%s\" missing in this exercise"
msgstr "\"%s\" отсутствует в этом упражнении"
-msgid "%1"
-msgstr "%1"
-
msgid "..behind"
msgstr "Сзади"
@@ -129,9 +122,6 @@ msgstr "Королева чужих убита"
msgid "Already carrying something"
msgstr "Уже что-то несу"
-msgid "Alt"
-msgstr "Alt"
-
msgid "Analysis already performed"
msgstr "Анализ уже выполнен"
@@ -186,6 +176,9 @@ msgstr "Большой отступ\\Отступать на 2 или 4 проб
msgid "Black box"
msgstr "Черный ящик"
+msgid "Blood\\Display blood when the astronaut or the alien queen is hit"
+msgstr ""
+
msgid "Blue"
msgstr "Синий"
@@ -210,6 +203,9 @@ msgstr "Построить защитную башню"
msgid "Build a derrick"
msgstr "Построить буровую вышку"
+msgid "Build a destroyer"
+msgstr ""
+
msgid "Build a exchange post"
msgstr "Построить пост по обмену сообщениями"
@@ -312,12 +308,6 @@ msgstr "Здание слишком близко"
msgid "Button %1"
msgstr "Кнопка %1"
-msgid "COLOBOT"
-msgstr "КОЛОБОТ"
-
-msgid "COLOBOT: Gold Edition"
-msgstr ""
-
msgid "Calling an unknown function"
msgstr "Вызов неизвестной функции"
@@ -345,6 +335,12 @@ msgstr "Камеру вправо"
msgid "Can not create this; there are too many objects"
msgstr "Не удается это создать, слишком много объектов"
+msgid "Can not produce not researched object"
+msgstr ""
+
+msgid "Can not produce this object in this mission"
+msgstr ""
+
msgid "Can't open file"
msgstr "Невозможно открыть файл"
@@ -387,6 +383,9 @@ msgstr "Закрывающая скобка отсутствует"
msgid "Colobot rules!"
msgstr "Правила игры!"
+msgid "Colobot: Gold Edition"
+msgstr ""
+
msgid "Command line"
msgstr "Командная строка"
@@ -420,9 +419,6 @@ msgstr "Копировать"
msgid "Copy (Ctrl+c)"
msgstr "Копировать (Ctrl+C)"
-msgid "Ctrl"
-msgstr "Ctrl"
-
msgid "Current mission saved"
msgstr "Текущая миссия сохранена"
@@ -453,6 +449,9 @@ msgstr "Космический корабль"
msgid "Descend\\Reduces the power of the jet"
msgstr "Снижение и посадка\\Понижение мощности реактивного двигателя"
+msgid "Destroy"
+msgstr ""
+
msgid "Destroy the building"
msgstr "Уничтожить здание"
@@ -481,7 +480,8 @@ msgstr "Вы действительно хотите уничтожить выб
msgid "Do you want to delete %s's saved games? "
msgstr "Вы действительно хотите удалить сохраненные игры игрока %s?"
-msgid "Do you want to quit COLOBOT ?"
+#, fuzzy
+msgid "Do you want to quit Colobot: Gold Edition?"
msgstr "Вы хотите закрыть COLOBOT?"
msgid "Doors blocked by a robot or another object "
@@ -532,6 +532,9 @@ msgstr "Упражнения\\Упражнения по программиров
msgid "Exit film\\Film at the exit of exercises"
msgstr "Ролик при выходе\\Ролик во время выхода из упражнения"
+msgid "Explode (\\key action;)"
+msgstr ""
+
msgid "Explosive"
msgstr "Взрывчатка"
@@ -629,10 +632,6 @@ msgstr "Игра\\Настройки игры"
msgid "Gantry crane"
msgstr "Козловой кран"
-#, c-format
-msgid "GetResource event num out of range: %d\n"
-msgstr "событие GetResource, число вне диапазона: %d\n"
-
msgid "Goto: destination occupied"
msgstr "Перейти: место занято"
@@ -702,6 +701,9 @@ msgstr "Неверный бот"
msgid "Inappropriate cell type"
msgstr "Батарея не подходит"
+msgid "Inappropriate object"
+msgstr ""
+
msgid "Incorrect index type"
msgstr "Неверный тип индекса"
@@ -738,6 +740,9 @@ msgstr "Инструкции из Хьюстона"
msgid "Instructions\\Shows the instructions for the current mission"
msgstr "Инструкции\\Показывает инструкции по текущей миссии"
+msgid "Internal error - tell the developers"
+msgstr ""
+
msgid "Jet temperature"
msgstr "Температура реактивного двигателя"
@@ -807,9 +812,6 @@ msgstr "Метки на земле\\Метки на земле"
msgid "Maximize"
msgstr "Развернуть"
-msgid "Menu (\\key quit;)"
-msgstr "Меню (\\key выйти;)"
-
msgid "Minimize"
msgstr "Свернуть"
@@ -918,6 +920,9 @@ msgstr "Не хватает энергии"
msgid "Not enough energy yet"
msgstr "Не хватает энергии"
+msgid "Not found anything to destroy"
+msgstr ""
+
msgid "Not yet enough energy"
msgstr "Не хватает энергии"
@@ -1131,8 +1136,8 @@ msgstr "Землетряс. при взрывах\\Тряска экрана п
msgid "Quit the mission?"
msgstr "Завершить миссию?"
-msgid "Quit\\Quit COLOBOT"
-msgstr "Выход\\Выход из COLOBOT"
+msgid "Quit\\Quit Colobot: Gold Edition"
+msgstr ""
msgid "Quit\\Quit the current mission or exercise"
msgstr "Выход\\Выход из текущей миссии"
@@ -1272,9 +1277,6 @@ msgstr "Радиус щита"
msgid "Shielder"
msgstr "Передвижной щит"
-msgid "Shift"
-msgstr "Shift"
-
msgid "Shoot (\\key action;)"
msgstr "Огонь (\\key action;)"
@@ -1586,9 +1588,6 @@ msgstr "Колесный стрелок"
msgid "Wheeled sniffer"
msgstr "Колесный искатель"
-msgid "Win"
-msgstr "Win"
-
msgid "Winged grabber"
msgstr "Летающий сборщик"
@@ -1685,8 +1684,8 @@ msgstr "\\Поднять перо"
msgid "\\Red flags"
msgstr "\\Красный флаг"
-msgid "\\Return to COLOBOT"
-msgstr "\\Вернуться в COLOBOT"
+msgid "\\Return to Colobot: Gold Edition"
+msgstr ""
msgid "\\SatCom on standby"
msgstr "\\SatCom ждет"
@@ -1754,68 +1753,14 @@ msgstr "\\b;Роботы\n"
msgid "\\c; (none)\\n;\n"
msgstr "\\c; (нет)\\n;\n"
-msgid "action;"
-msgstr "действие"
-
-msgid "away;"
-msgstr "дальше"
-
-msgid "camera;"
-msgstr "камера"
-
-msgid "cbot;"
-msgstr "cobt"
-
-msgid "desel;"
-msgstr "отмена"
-
-msgid "down;"
-msgstr "вниз"
-
-msgid "gdown;"
-msgstr "вниз"
-
-msgid "gup;"
-msgstr "вверх"
-
-msgid "help;"
-msgstr "помощь"
-
-msgid "human;"
-msgstr "человек"
-
-msgid "left;"
-msgstr "влево"
-
-msgid "near;"
-msgstr "ближе"
-
-msgid "next;"
-msgstr "следующий"
-
-msgid "prog;"
-msgstr "прог."
-
-msgid "quit;"
-msgstr "выйти"
-
-msgid "right;"
-msgstr "вправо"
-
-msgid "speed10;"
-msgstr "скорость10"
-
-msgid "speed15;"
-msgstr "скорость15"
-
-msgid "speed20;"
-msgstr "скорость20"
+msgid "www.epsitec.com"
+msgstr "www.epsitec.com"
-msgid "up;"
-msgstr "вверх"
+#~ msgid "COLOBOT"
+#~ msgstr "КОЛОБОТ"
-msgid "visit;"
-msgstr "посетить"
+#~ msgid "Quit\\Quit COLOBOT"
+#~ msgstr "Выход\\Выход из COLOBOT"
-msgid "www.epsitec.com"
-msgstr "www.epsitec.com"
+#~ msgid "\\Return to COLOBOT"
+#~ msgstr "\\Вернуться в COLOBOT"
diff --git a/src/CBot/CBot.cpp b/src/CBot/CBot.cpp
index 403be6e..72bdef7 100644
--- a/src/CBot/CBot.cpp
+++ b/src/CBot/CBot.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
///////////////////////////////////////////////////////////////////////
// compilation of various instructions
diff --git a/src/CBot/CBot.h b/src/CBot/CBot.h
index df6614e..3355881 100644
--- a/src/CBot/CBot.h
+++ b/src/CBot/CBot.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
////////////////////////////////////////////////////////////////////
/**
* \file CBot.h
diff --git a/src/CBot/CBotAddExpr.cpp b/src/CBot/CBotAddExpr.cpp
index ec007ae..03317f8 100644
--- a/src/CBot/CBotAddExpr.cpp
+++ b/src/CBot/CBotAddExpr.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
///////////////////////////////////////////////////
// expressions of type Operand1 + Operand2
diff --git a/src/CBot/CBotClass.cpp b/src/CBot/CBotClass.cpp
index 12765ba..5369b77 100644
--- a/src/CBot/CBotClass.cpp
+++ b/src/CBot/CBotClass.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.//
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/////////////////////////////////////////////////////////////////////
// Management of variables of class type
diff --git a/src/CBot/CBotCompExpr.cpp b/src/CBot/CBotCompExpr.cpp
index c9a977c..6217638 100644
--- a/src/CBot/CBotCompExpr.cpp
+++ b/src/CBot/CBotCompExpr.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
///////////////////////////////////////////////////
// expression of type Opérande1 > Opérande2
diff --git a/src/CBot/CBotDll.h b/src/CBot/CBotDll.h
index 8858559..8ae0a14 100644
--- a/src/CBot/CBotDll.h
+++ b/src/CBot/CBotDll.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
////////////////////////////////////////////////////////////////////////
/**
diff --git a/src/CBot/CBotFunction.cpp b/src/CBot/CBotFunction.cpp
index e6aa2c9..9c8a2ce 100644
--- a/src/CBot/CBotFunction.cpp
+++ b/src/CBot/CBotFunction.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
///////////////////////////////////////////////////////////////////////
// compilation of various functions declared by the user
diff --git a/src/CBot/CBotIf.cpp b/src/CBot/CBotIf.cpp
index bc58af1..2bd6448 100644
--- a/src/CBot/CBotIf.cpp
+++ b/src/CBot/CBotIf.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
///////////////////////////////////////////////////////////////////////
// instruction if (condition) operation1 else operation2;
diff --git a/src/CBot/CBotProgram.cpp b/src/CBot/CBotProgram.cpp
index 1944f92..d3c5eb3 100644
--- a/src/CBot/CBotProgram.cpp
+++ b/src/CBot/CBotProgram.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
//////////////////////////////////////////////////////////////////////
// database management of CBoT program
diff --git a/src/CBot/CBotStack.cpp b/src/CBot/CBotStack.cpp
index 1679e5e..42d5617 100644
--- a/src/CBot/CBotStack.cpp
+++ b/src/CBot/CBotStack.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
//Management of the stack
@@ -788,7 +791,7 @@ void CBotStack::GetRunPos(const char* &FunctionName, int &start, int &end)
while (p->m_next != NULL)
{
if ( p->m_instr != NULL ) instr = p->m_instr;
- if ( p->m_bFunc == 1 ) funct = p->m_instr;
+ if ( p->m_bFunc == 1 && p->m_instr != NULL ) funct = p->m_instr;
if ( p->m_next->m_prog != prog ) break ;
if (p->m_next2 && p->m_next2->m_state != 0) p = p->m_next2 ;
@@ -796,7 +799,7 @@ void CBotStack::GetRunPos(const char* &FunctionName, int &start, int &end)
}
if ( p->m_instr != NULL ) instr = p->m_instr;
- if ( p->m_bFunc == 1 ) funct = p->m_instr;
+ if ( p->m_bFunc == 1 && p->m_instr != NULL ) funct = p->m_instr;
if ( funct == NULL ) return;
@@ -807,7 +810,7 @@ void CBotStack::GetRunPos(const char* &FunctionName, int &start, int &end)
t = instr->GetToken();
start = t->GetStart();
- end = t->GetEnd();
+ end = t->GetEnd();
}
CBotVar* CBotStack::GetStackVars(const char* &FunctionName, int level)
@@ -825,16 +828,19 @@ CBotVar* CBotStack::GetStackVars(const char* &FunctionName, int level)
if (p->m_next2 && p->m_next2->m_state != 0) p = p->m_next2 ;
else p = p->m_next;
}
+ // Now p is the highest element on the stack
// descends upon the elements of block
while ( p != NULL && !p->m_bBlock ) p = p->m_prev;
+ // Now p is on the beggining of the top block (with local variables)
while ( p != NULL && level++ < 0 )
{
p = p->m_prev;
while ( p != NULL && !p->m_bBlock ) p = p->m_prev;
}
+ // Now p is on the block "level"
if ( p == NULL ) return NULL;
diff --git a/src/CBot/CBotString.cpp b/src/CBot/CBotString.cpp
index 2929977..ef3950a 100644
--- a/src/CBot/CBotString.cpp
+++ b/src/CBot/CBotString.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/////////////////////////////////////////////////////
//strings management
diff --git a/src/CBot/CBotToken.cpp b/src/CBot/CBotToken.cpp
index 48033a3..40c020a 100644
--- a/src/CBot/CBotToken.cpp
+++ b/src/CBot/CBotToken.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
//////////////////////////////////////////////////////////////////
@@ -105,7 +108,7 @@ void CBotToken::Free()
const CBotToken& CBotToken::operator=(const CBotToken& src)
{
- if (m_next != NULL) delete(m_next);
+ delete m_next;
m_next = NULL;
m_prev = NULL;
diff --git a/src/CBot/CBotToken.h b/src/CBot/CBotToken.h
index a423375..d789734 100644
--- a/src/CBot/CBotToken.h
+++ b/src/CBot/CBotToken.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// interpreter of the lanuage CBot for game COLOBOT
diff --git a/src/CBot/CBotTwoOpExpr.cpp b/src/CBot/CBotTwoOpExpr.cpp
index 4d4add8..e4e98ec 100644
--- a/src/CBot/CBotTwoOpExpr.cpp
+++ b/src/CBot/CBotTwoOpExpr.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
///////////////////////////////////////////////////
// expression of type Opérande1 + Opérande2
diff --git a/src/CBot/CBotVar.cpp b/src/CBot/CBotVar.cpp
index b84006f..f696db7 100644
--- a/src/CBot/CBotVar.cpp
+++ b/src/CBot/CBotVar.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
////////////////////////////////////////////////////////////////////
// Definition for the class CBotVar
diff --git a/src/CBot/CBotWhile.cpp b/src/CBot/CBotWhile.cpp
index 73bcab9..f94cf74 100644
--- a/src/CBot/CBotWhile.cpp
+++ b/src/CBot/CBotWhile.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
///////////////////////////////////////////////////////////////////////
// This file defined the following statements:
diff --git a/src/CBot/ClassFILE.cpp b/src/CBot/ClassFILE.cpp
deleted file mode 100644
index 6906bd4..0000000
--- a/src/CBot/ClassFILE.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
-
-// definition of methods for class FILE
-
-
-
-// Static variables
-
-static CBotClass* m_pClassFILE;
-static CBotProgram* m_pFuncFile;
-static int m_CompteurFileOpen = 0;
-
-
-
-// Prepares a file name.
-
-void PrepareFilename(CBotString &filename) //DD!
-{
- int pos;
-
- pos = filename.ReverseFind('\\');
- if ( pos > 0 )
- {
- filename = filename.Mid(pos+1); // remove the records (files)??
- }
-
- pos = filename.ReverseFind('/');
- if ( pos > 0 )
- {
- filename = filename.Mid(pos+1); // also those with /
- }
-
- pos = filename.ReverseFind(':');
- if ( pos > 0 )
- {
- filename = filename.Mid(pos+1); // also removes the drive letter C:
- }
-
- filename = CBotString("files\\") + filename;
-}
-
-
-// constructor of the class
-// gets the filename as a parameter
-
-// execution
-bool rfconstruct (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
-{
- CBotString mode;
-
- // accepts no parameters
- if ( pVar == NULL ) return true;
-
- // must be a string
- if ( pVar->GetType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
-
- CBotString filename = pVar->GetValString();
- PrepareFilename(filename); //DR
-
- // there may be a second parameter
- pVar = pVar->GetNext();
- if ( pVar != NULL )
- {
- // recovers the mode
- mode = pVar->GetValString();
- if ( mode != "r" && mode != "w" ) { Exception = CBotErrBadParam; return false; }
-
- // no third parameter, only two or one possible
- if ( pVar->GetNext() != NULL ) { Exception = CBotErrOverParam; return false; }
- }
-
- // save the file name
- pVar = pThis->GetItem("filename");
- pVar->SetValString(filename);
-
- if ( ! mode.IsEmpty() )
- {
- // open the called file
- FILE* pFile = fopen( filename, mode );
- if ( pFile == NULL ) { Exception = CBotErrFileOpen; return false; }
-
- m_CompteurFileOpen ++;
-
- // save the handle of file
- pVar = pThis->GetItem("handle");
- pVar->SetValInt((long)pFile);
- }
-
- return true;
-}
-
-// compilation
-CBotTypResult cfconstruct (CBotVar* pThis, CBotVar* &pVar)
-{
- // accepts no parameters
- if ( pVar == NULL ) return CBotTypResult( 0 );
-
- // must be a string
- if ( pVar->GetType() != CBotTypString )
- return CBotTypResult( CBotErrBadString );
-
- // there may be a second parameter
- pVar = pVar->GetNext();
- if ( pVar != NULL )
- {
- // must be a string
- if ( pVar->GetType() != CBotTypString )
- return CBotTypResult( CBotErrBadString );
- // no third parameter
- if ( pVar->GetNext() != NULL ) return CBotTypResult( CBotErrOverParam );
- }
-
- // le r�sultat est de type void (constructeur)
- return CBotTypResult( 0 );
-}
-
-
-// destructor of the class
-
-// execution
-bool rfdestruct (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
-{
- // retrieves the element "handle"
- pVar = pThis->GetItem("handle");
-
- // not open? no problem
- if ( pVar->GetInit() != IS_DEF) return true;
-
- FILE* pFile= (FILE*)pVar->GetValInt();
- fclose(pFile);
- m_CompteurFileOpen --;
-
- pVar->SetInit(IS_NAN);
-
- return true;
-}
-
-
-// FILE :: open method
-// get the r / w mode as a parameter
-
-// execution
-bool rfopen (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
-{
- // there must be a parameter
- if ( pVar == NULL ) { Exception = CBotErrLowParam; return false; }
-
- // must be a string
- if ( pVar->GetType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
-
- // there may be a second parameter
- if ( pVar->GetNext() != NULL )
- {
- // in this case the first parameter is the file name
- CBotString filename = pVar->GetValString();
- PrepareFilename(filename); //DR
-
- // saves the file name
- CBotVar* pVar2 = pThis->GetItem("filename");
- pVar2->SetValString(filename);
-
- // next parameter is the mode
- pVar = pVar -> GetNext();
- }
-
- CBotString mode = pVar->GetValString();
- if ( mode != "r" && mode != "w" ) { Exception = CBotErrBadParam; return false; }
-
- // No third parameter
- if ( pVar->GetNext() != NULL ) { Exception = CBotErrOverParam; return false; }
-
- // retrieves the element "handle"
- pVar = pThis->GetItem("handle");
-
- // which must not be initialized
- if ( pVar->GetInit() == IS_DEF) { Exception = CBotErrFileOpen; return false; }
-
- // contains filename
- pVar = pThis->GetItem("filename");
- CBotString filename = pVar->GetValString();
-
- PrepareFilename(filename); //DD! (if the name was assigned by h.filename = "...";
-
- // open requsted file
- FILE* pFile = fopen( filename, mode );
- if ( pFile == NULL ) //DR
- {
- pResult->SetValInt(false); //DR
- return true; //DR
- }
-
- m_CompteurFileOpen ++;
-
- // saves the handle of file
- pVar = pThis->GetItem("handle");
- pVar->SetValInt((long)pFile);
-
- pResult->SetValInt(true); //DR
- return true;
-}
-
-// compilation
-CBotTypResult cfopen (CBotVar* pThis, CBotVar* &pVar)
-{
- // there must be a parameter
- if ( pVar == NULL ) return CBotTypResult( CBotErrLowParam );
-
- // must be a string
- if ( pVar->GetType() != CBotTypString )
- return CBotTypResult( CBotErrBadString );
-
- // there may be a second parameter
- pVar = pVar->GetNext();
- if ( pVar != NULL )
- {
- // must be a string
- if ( pVar->GetType() != CBotTypString )
- return CBotTypResult( CBotErrBadString );
-
- // no third parameter
- if ( pVar->GetNext() != NULL ) return CBotTypResult( CBotErrOverParam );
- }
-
- // the result is of type bool
- return CBotTypResult(CBotTypBoolean); //DR
-}
-
-
-// FILE :: close method
-
-// execution
-bool rfclose (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
-{
- // it should not be any parameter
- if ( pVar != NULL ) return CBotErrOverParam;
-
- // retrieves the element "handle"
- pVar = pThis->GetItem("handle");
-
- if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
-
- FILE* pFile= (FILE*)pVar->GetValInt();
- fclose(pFile);
- m_CompteurFileOpen --;
-
- pVar->SetInit(IS_NAN);
-
- return true;
-}
-
-// compilation
-CBotTypResult cfclose (CBotVar* pThis, CBotVar* &pVar)
-{
- // it should not be any parameter
- if ( pVar != NULL ) return CBotTypResult( CBotErrOverParam );
-
- // function returns a result "void"
- return CBotTypResult( 0 );
-}
-
-// FILE :: writeln method
-
-// execution
-bool rfwrite (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
-{
- // there must be a parameter
- if ( pVar == NULL ) { Exception = CBotErrLowParam; return false; }
-
- // must be a string
- if ( pVar->GetType() != CBotTypString ) { Exception = CBotErrBadString; return false; }
-
- CBotString param = pVar->GetValString();
-
- //retrieves the element "handle"
- pVar = pThis->GetItem("handle");
-
- if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
-
- FILE* pFile= (FILE*)pVar->GetValInt();
-
- int res = fputs(param+CBotString("\n"), pFile);
-
- // on error throws an exception
- if ( res < 0 ) { Exception = CBotErrWrite; return false; }
-
- return true;
-}
-
-// compilation
-CBotTypResult cfwrite (CBotVar* pThis, CBotVar* &pVar)
-{
- // there must be a parameter
- if ( pVar == NULL ) return CBotTypResult( CBotErrLowParam );
-
- // must be a string
- if ( pVar->GetType() != CBotTypString ) return CBotTypResult( CBotErrBadString );
-
- // no other parameter
- if ( pVar->GetNext() != NULL ) return CBotTypResult( CBotErrOverParam );
-
- // function returns "void" result
- return CBotTypResult( 0 );
-}
-
-// FILE :: readln method
-
-// execution
-bool rfread (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
-{
- // there shouldn't be any parameter
- if ( pVar != NULL ) { Exception = CBotErrOverParam; return false; }
-
- //retrieves the element "handle"
- pVar = pThis->GetItem("handle");
-
- if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
-
- FILE* pFile= (FILE*)pVar->GetValInt();
-
- char chaine[2000];
- int i;
- for ( i = 0 ; i < 2000 ; i++ ) chaine[i] = 0;
-
- fgets(chaine, 1999, pFile);
-
- for ( i = 0 ; i < 2000 ; i++ ) if (chaine[i] == '\n') chaine[i] = 0;
-
- // on error throws an exception
- if ( ferror(pFile) ) { Exception = CBotErrRead; return false; }
-
- pResult->SetValString( chaine );
-
- return true;
-}
-
-// compilation
-CBotTypResult cfread (CBotVar* pThis, CBotVar* &pVar)
-{
- // there shouldn't be any parameter
- if ( pVar != NULL ) return CBotTypResult( CBotErrOverParam );
-
- // function return "string" result
- return CBotTypResult( CBotTypString );
-}
-// FILE :: readln method
-
-
-// execution
-bool rfeof (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception)
-{
- // there shouldn't be any parameter
- if ( pVar != NULL ) { Exception = CBotErrOverParam; return false; }
-
- // retrieves the element "handle"
- pVar = pThis->GetItem("handle");
-
- if ( pVar->GetInit() != IS_DEF) { Exception = CBotErrNotOpen; return false; }
-
- FILE* pFile= (FILE*)pVar->GetValInt();
-
- pResult->SetValInt( feof( pFile ) );
-
- return true;
-}
-
-// compilation
-CBotTypResult cfeof (CBotVar* pThis, CBotVar* &pVar)
-{
- // there shouldn't be any parameter
- if ( pVar != NULL ) return CBotTypResult( CBotErrOverParam );
-
- // function return boolean result
- return CBotTypResult( CBotTypBoolean );
-}
-
-
-
-
-
-void InitClassFILE()
-{
-// creates a class for file management
-// the usage is as follows:
-// file canal( "NomFichier.txt" )
-// canal.open( "r" ); // open reading
-// s = canal.readln( ); // reads a line
-// canal.close(); // closes the file
-
- // create class FILE
- m_pClassFILE = new CBotClass("file", NULL);
- // add the component ".filename"
- m_pClassFILE->AddItem("filename", CBotTypString);
- // add the component ".handle"
- m_pClassFILE->AddItem("handle", CBotTypInt, PR_PRIVATE);
-
- // define a constructor and destructor
- m_pClassFILE->AddFunction("file", rfconstruct, cfconstruct );
- m_pClassFILE->AddFunction("~file", rfdestruct, NULL );
-
- // defined associated methods
- m_pClassFILE->AddFunction("open", rfopen, cfopen );
- m_pClassFILE->AddFunction("close", rfclose, cfclose );
- m_pClassFILE->AddFunction("writeln", rfwrite, cfwrite );
- m_pClassFILE->AddFunction("readln", rfread, cfread );
- m_pClassFILE->AddFunction("eof", rfeof, cfeof );
-
- m_pFuncFile = new CBotProgram( );
- CBotStringArray ListFonctions;
- m_pFuncFile->Compile( "public file openfile(string name, string mode) {return new file(name, mode);}", ListFonctions);
- m_pFuncFile->SetIdent(-2); // restoreState as a special identifier for this function
-}
-
diff --git a/src/CBot/StringFunctions.cpp b/src/CBot/StringFunctions.cpp
index abdcc18..d897c04 100644
--- a/src/CBot/StringFunctions.cpp
+++ b/src/CBot/StringFunctions.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// definition of string functions
diff --git a/src/CBot/resource.h b/src/CBot/resource.h
index 9c7e82e..8b2e149 100644
--- a/src/CBot/resource.h
+++ b/src/CBot/resource.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#pragma once
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 12171f3..613d92a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -59,178 +59,209 @@ if(PLATFORM_WINDOWS)
endif()
# Source files
-set(SOURCES
-app/app.cpp
-app/gamedata.cpp
-app/main.cpp
-app/pausemanager.cpp
-app/system.cpp
-app/${SYSTEM_CPP_MODULE}
-app/system_other.cpp
-common/event.cpp
-common/image.cpp
-common/iman.cpp
-common/logger.cpp
-common/misc.cpp
-common/profile.cpp
-common/restext.cpp
-common/stringutils.cpp
-graphics/core/color.cpp
-graphics/engine/camera.cpp
-graphics/engine/cloud.cpp
-graphics/engine/engine.cpp
-graphics/engine/lightman.cpp
-graphics/engine/lightning.cpp
-graphics/engine/modelfile.cpp
-graphics/engine/modelmanager.cpp
-graphics/engine/particle.cpp
-graphics/engine/planet.cpp
-graphics/engine/pyro.cpp
-graphics/engine/terrain.cpp
-graphics/engine/text.cpp
-graphics/engine/water.cpp
-graphics/opengl/gldevice.cpp
-object/auto/auto.cpp
-object/auto/autobase.cpp
-object/auto/autoconvert.cpp
-object/auto/autoderrick.cpp
-object/auto/autodestroyer.cpp
-object/auto/autoegg.cpp
-object/auto/autoenergy.cpp
-object/auto/autofactory.cpp
-object/auto/autoflag.cpp
-object/auto/autohuston.cpp
-object/auto/autoinfo.cpp
-object/auto/autojostle.cpp
-object/auto/autokid.cpp
-object/auto/autolabo.cpp
-object/auto/automush.cpp
-object/auto/autonest.cpp
-object/auto/autonuclear.cpp
-object/auto/autopara.cpp
-object/auto/autoportico.cpp
-object/auto/autoradar.cpp
-object/auto/autorepair.cpp
-object/auto/autoresearch.cpp
-object/auto/autoroot.cpp
-object/auto/autosafe.cpp
-object/auto/autostation.cpp
-object/auto/autotower.cpp
-object/brain.cpp
-object/mainmovie.cpp
-object/motion/motion.cpp
-object/motion/motionant.cpp
-object/motion/motionbee.cpp
-object/motion/motiondummy.cpp
-object/motion/motionhuman.cpp
-object/motion/motionmother.cpp
-object/motion/motionspider.cpp
-object/motion/motiontoto.cpp
-object/motion/motionvehicle.cpp
-object/motion/motionworm.cpp
-object/object.cpp
-object/robotmain.cpp
-object/objman.cpp
-object/task/task.cpp
-object/task/taskadvance.cpp
-object/task/taskbuild.cpp
-object/task/taskfire.cpp
-object/task/taskfireant.cpp
-object/task/taskflag.cpp
-object/task/taskgoto.cpp
-object/task/taskgungoal.cpp
-object/task/taskinfo.cpp
-object/task/taskmanager.cpp
-object/task/taskmanip.cpp
-object/task/taskpen.cpp
-object/task/taskrecover.cpp
-object/task/taskreset.cpp
-object/task/tasksearch.cpp
-object/task/taskshield.cpp
-object/task/taskspiderexplo.cpp
-object/task/tasktake.cpp
-object/task/taskterraform.cpp
-object/task/taskturn.cpp
-object/task/taskwait.cpp
-physics/physics.cpp
-script/cbottoken.cpp
-script/cmdtoken.cpp
-script/script.cpp
-sound/sound.cpp
-ui/button.cpp
-ui/check.cpp
-ui/color.cpp
-ui/compass.cpp
-ui/control.cpp
-ui/displayinfo.cpp
-ui/displaytext.cpp
-ui/edit.cpp
-ui/editvalue.cpp
-ui/gauge.cpp
-ui/group.cpp
-ui/image.cpp
-ui/interface.cpp
-ui/key.cpp
-ui/label.cpp
-ui/list.cpp
-ui/maindialog.cpp
-ui/mainmap.cpp
-ui/mainshort.cpp
-ui/map.cpp
-ui/scroll.cpp
-ui/shortcut.cpp
-ui/slider.cpp
-ui/studio.cpp
-ui/target.cpp
-ui/window.cpp
-${OPENAL_SRC}
-${RES_FILES}
+set(BASE_SOURCES
+ app/app.cpp
+ app/pausemanager.cpp
+ app/system.cpp
+ app/${SYSTEM_CPP_MODULE}
+ app/system_other.cpp
+ common/event.cpp
+ common/image.cpp
+ common/iman.cpp
+ common/logger.cpp
+ common/misc.cpp
+ common/profile.cpp
+ common/restext.cpp
+ common/stringutils.cpp
+ common/resources/resourcemanager.cpp
+ common/resources/inputstreambuffer.cpp
+ common/resources/outputstreambuffer.cpp
+ common/resources/inputstream.cpp
+ common/resources/outputstream.cpp
+ common/resources/sndfile.cpp
+ graphics/core/color.cpp
+ graphics/core/nulldevice.cpp
+ graphics/engine/camera.cpp
+ graphics/engine/cloud.cpp
+ graphics/engine/engine.cpp
+ graphics/engine/lightman.cpp
+ graphics/engine/lightning.cpp
+ graphics/engine/modelfile.cpp
+ graphics/engine/modelmanager.cpp
+ graphics/engine/particle.cpp
+ graphics/engine/planet.cpp
+ graphics/engine/pyro.cpp
+ graphics/engine/terrain.cpp
+ graphics/engine/text.cpp
+ graphics/engine/water.cpp
+ graphics/opengl/gldevice.cpp
+ object/auto/auto.cpp
+ object/auto/autobase.cpp
+ object/auto/autoconvert.cpp
+ object/auto/autoderrick.cpp
+ object/auto/autodestroyer.cpp
+ object/auto/autoegg.cpp
+ object/auto/autoenergy.cpp
+ object/auto/autofactory.cpp
+ object/auto/autoflag.cpp
+ object/auto/autohuston.cpp
+ object/auto/autoinfo.cpp
+ object/auto/autojostle.cpp
+ object/auto/autokid.cpp
+ object/auto/autolabo.cpp
+ object/auto/automush.cpp
+ object/auto/autonest.cpp
+ object/auto/autonuclear.cpp
+ object/auto/autopara.cpp
+ object/auto/autoportico.cpp
+ object/auto/autoradar.cpp
+ object/auto/autorepair.cpp
+ object/auto/autoresearch.cpp
+ object/auto/autoroot.cpp
+ object/auto/autosafe.cpp
+ object/auto/autostation.cpp
+ object/auto/autotower.cpp
+ object/brain.cpp
+ object/level/parser.cpp
+ object/level/parserline.cpp
+ object/level/parserparam.cpp
+ object/level/parserexceptions.cpp
+ object/mainmovie.cpp
+ object/motion/motion.cpp
+ object/motion/motionant.cpp
+ object/motion/motionbee.cpp
+ object/motion/motiondummy.cpp
+ object/motion/motionhuman.cpp
+ object/motion/motionmother.cpp
+ object/motion/motionspider.cpp
+ object/motion/motiontoto.cpp
+ object/motion/motionvehicle.cpp
+ object/motion/motionworm.cpp
+ object/object.cpp
+ object/robotmain.cpp
+ object/objman.cpp
+ object/task/task.cpp
+ object/task/taskadvance.cpp
+ object/task/taskbuild.cpp
+ object/task/taskfire.cpp
+ object/task/taskfireant.cpp
+ object/task/taskflag.cpp
+ object/task/taskgoto.cpp
+ object/task/taskgungoal.cpp
+ object/task/taskinfo.cpp
+ object/task/taskmanager.cpp
+ object/task/taskmanip.cpp
+ object/task/taskpen.cpp
+ object/task/taskrecover.cpp
+ object/task/taskreset.cpp
+ object/task/tasksearch.cpp
+ object/task/taskshield.cpp
+ object/task/taskspiderexplo.cpp
+ object/task/tasktake.cpp
+ object/task/taskterraform.cpp
+ object/task/taskturn.cpp
+ object/task/taskwait.cpp
+ physics/physics.cpp
+ script/cbottoken.cpp
+ script/cmdtoken.cpp
+ script/script.cpp
+ sound/sound.cpp
+ ui/button.cpp
+ ui/check.cpp
+ ui/color.cpp
+ ui/compass.cpp
+ ui/control.cpp
+ ui/displayinfo.cpp
+ ui/displaytext.cpp
+ ui/edit.cpp
+ ui/editvalue.cpp
+ ui/gauge.cpp
+ ui/group.cpp
+ ui/image.cpp
+ ui/interface.cpp
+ ui/key.cpp
+ ui/label.cpp
+ ui/list.cpp
+ ui/maindialog.cpp
+ ui/mainmap.cpp
+ ui/mainshort.cpp
+ ui/map.cpp
+ ui/scroll.cpp
+ ui/shortcut.cpp
+ ui/slider.cpp
+ ui/studio.cpp
+ ui/target.cpp
+ ui/window.cpp
+ ${OPENAL_SRC}
+)
+
+set(MAIN_SOURCES
+ app/main.cpp
+ ${RES_FILES}
)
+# Libraries
set(LIBS
-CBot
-clipboard
-localename
-${SDL_LIBRARY}
-${SDLIMAGE_LIBRARY}
-${SDLTTF_LIBRARY}
-${OPENGL_LIBRARY}
-${PNG_LIBRARIES}
-${GLEW_LIBRARY}
-${Boost_LIBRARIES}
-${LIBSNDFILE_LIBRARY}
-${OPTIONAL_LIBS}
-${PLATFORM_LIBS}
+ CBot
+ clipboard
+ localename
+ ${SDL_LIBRARY}
+ ${SDLIMAGE_LIBRARY}
+ ${SDLTTF_LIBRARY}
+ ${OPENGL_LIBRARY}
+ ${PNG_LIBRARIES}
+ ${GLEW_LIBRARY}
+ ${Boost_LIBRARIES}
+ ${LIBSNDFILE_LIBRARY}
+ ${OPTIONAL_LIBS}
+ ${PLATFORM_LIBS}
+ ${PHYSFS_LIBRARY}
+)
+
+set(COLOBOT_LIBS ${LIBS} PARENT_SCOPE)
+
+
+# Includes
+set(LOCAL_INCLUDES
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/..
+ ${CMAKE_CURRENT_BINARY_DIR}
)
-# Local
-include_directories(
-.
-..
-${CMAKE_CURRENT_BINARY_DIR}
+set(SYSTEM_INCLUDES
+ ${SDL_INCLUDE_DIR}
+ ${SDLIMAGE_INCLUDE_DIR}
+ ${SDLTTF_INCLUDE_DIR}
+ ${PNG_INCLUDE_DIRS}
+ ${GLEW_INCLUDE_PATH}
+ ${Boost_INCLUDE_DIRS}
+ ${LIBSNDFILE_INCLUDE_DIR}
+ ${LOCALENAME_INCLUDE_DIR}
+ ${OPTIONAL_INCLUDE_DIRS}
+ ${CLIPBOARD_INCLUDE_DIR}
+ ${PHYSFS_INCLUDE_PATH}
)
-# System
-include_directories(
-SYSTEM
-${SDL_INCLUDE_DIR}
-${SDLIMAGE_INCLUDE_DIR}
-${SDLTTF_INCLUDE_DIR}
-${PNG_INCLUDE_DIRS}
-${GLEW_INCLUDE_PATH}
-${Boost_INCLUDE_DIRS}
-${LIBSNDFILE_INCLUDE_DIR}
-${LOCALENAME_INCLUDE_DIR}
-${OPTIONAL_INCLUDE_DIRS}
-${CLIPBOARD_INCLUDE_DIR}
+set(COLOBOT_LOCAL_INCLUDES ${LOCAL_INCLUDES} PARENT_SCOPE)
+set(COLOBOT_SYSTEM_INCLUDES ${SYSTEM_INCLUDES} PARENT_SCOPE)
+
+include_directories(${LOCAL_INCLUDES})
+include_directories(SYSTEM ${SYSTEM_INCLUDES})
+
+
+# Link directories
+link_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}/CBot
)
-link_directories(${CMAKE_CURRENT_SOURCE_DIR}/CBot)
-add_executable(colobot ${SOURCES})
+# Targets
+
+add_library(colobotbase STATIC ${BASE_SOURCES})
-target_link_libraries(colobot ${LIBS})
+add_executable(colobot ${MAIN_SOURCES})
+target_link_libraries(colobot colobotbase ${LIBS})
install(TARGETS colobot RUNTIME DESTINATION ${COLOBOT_INSTALL_BIN_DIR})
if(NOT CBOT_STATIC)
diff --git a/src/app/app.cpp b/src/app/app.cpp
index 8b310c9..6f33389 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -1,25 +1,26 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/config.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "app/system.h"
#include "common/logger.h"
@@ -27,8 +28,10 @@
#include "common/image.h"
#include "common/key.h"
#include "common/stringutils.h"
+#include "common/resources/resourcemanager.h"
#include "graphics/engine/modelmanager.h"
+#include "graphics/core/nulldevice.h"
#include "graphics/opengl/gldevice.h"
#include "object/robotmain.h"
@@ -101,7 +104,6 @@ CApplication::CApplication()
m_objMan = new CObjectManager();
m_eventQueue = new CEventQueue();
m_profile = new CProfile();
- m_gameData = new CGameData();
m_engine = nullptr;
m_device = nullptr;
@@ -112,9 +114,9 @@ CApplication::CApplication()
m_exitCode = 0;
m_active = false;
m_debugModes = 0;
- m_customDataPath = false;
+ m_restart = false;
- m_windowTitle = "COLOBOT GOLD";
+ m_windowTitle = "Colobot: Gold Edition";
m_simulationSuspended = false;
@@ -149,19 +151,30 @@ CApplication::CApplication()
m_mouseButtonsState = 0;
m_trackedKeys = 0;
+ #ifdef PORTABLE
+ m_dataPath = "./data";
+ m_langPath = "./lang";
+ #else
m_dataPath = GetSystemUtils()->GetDataPath();
m_langPath = GetSystemUtils()->GetLangPath();
+ #endif
+
+ #ifdef DEV_BUILD
+ m_savePath = "./saves";
+ #else
+ m_savePath = GetSystemUtils()->GetSaveDir();
+ #endif
m_runSceneName = "";
m_runSceneRank = 0;
-
+
m_sceneTest = false;
+ m_headless = false;
+ m_resolutionOverride = false;
m_language = LANGUAGE_ENV;
m_lowCPU = true;
-
- m_protoMode = false;
}
CApplication::~CApplication()
@@ -180,9 +193,6 @@ CApplication::~CApplication()
delete m_iMan;
m_iMan = nullptr;
-
- delete m_gameData;
- m_gameData = nullptr;
GetSystemUtils()->DestroyTimeStamp(m_baseTimeStamp);
GetSystemUtils()->DestroyTimeStamp(m_curTimeStamp);
@@ -215,10 +225,13 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
OPT_SCENETEST,
OPT_LOGLEVEL,
OPT_LANGUAGE,
+ OPT_LANGDIR,
OPT_DATADIR,
+ OPT_SAVEDIR,
OPT_MOD,
- OPT_LANGDIR,
- OPT_VBO
+ OPT_VBO,
+ OPT_RESOLUTION,
+ OPT_HEADLESS
};
option options[] =
@@ -229,10 +242,13 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
{ "scenetest", no_argument, nullptr, OPT_SCENETEST },
{ "loglevel", required_argument, nullptr, OPT_LOGLEVEL },
{ "language", required_argument, nullptr, OPT_LANGUAGE },
+ { "langdir", required_argument, nullptr, OPT_LANGDIR },
{ "datadir", required_argument, nullptr, OPT_DATADIR },
+ { "savedir", required_argument, nullptr, OPT_SAVEDIR },
{ "mod", required_argument, nullptr, OPT_MOD },
- { "langdir", required_argument, nullptr, OPT_LANGDIR },
{ "vbo", required_argument, nullptr, OPT_VBO },
+ { "resolution", required_argument, nullptr, OPT_RESOLUTION },
+ { "headless", no_argument, nullptr, OPT_HEADLESS },
{ nullptr, 0, nullptr, 0}
};
@@ -269,10 +285,13 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
GetLogger()->Message(" -scenetest win every mission right after it's loaded\n");
GetLogger()->Message(" -loglevel level set log level to level (one of: trace, debug, info, warn, error, none)\n");
GetLogger()->Message(" -language lang set language (one of: en, de, fr, pl, ru)\n");
- GetLogger()->Message(" -datadir path set custom data directory path\n");
- GetLogger()->Message(" -mod path run mod\n");
GetLogger()->Message(" -langdir path set custom language directory path\n");
+ GetLogger()->Message(" -datadir path set custom data directory path\n");
+ GetLogger()->Message(" -savedir path set custom save directory path (must be writable)\n");
+ GetLogger()->Message(" -mod path load datadir mod from given path\n");
GetLogger()->Message(" -vbo mode set OpenGL VBO mode (one of: auto, enable, disable)\n");
+ GetLogger()->Message(" -resolution WxH set resolution\n");
+ GetLogger()->Message(" -headless headless mode - disables graphics, sound and user interaction\n");
return PARSE_ARGS_HELP;
}
case OPT_DEBUG:
@@ -334,25 +353,6 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
m_language = language;
break;
}
- case OPT_DATADIR:
- {
- m_dataPath = optarg;
- m_customDataPath = true;
- GetLogger()->Info("Using datadir: '%s'\n", optarg);
- break;
- }
- case OPT_MOD:
- {
- m_gameData->AddMod(std::string(optarg));
- GetLogger()->Info("Running mod from path: '%s'\n", optarg);
- break;
- }
- case OPT_LANGDIR:
- {
- m_langPath = optarg;
- GetLogger()->Info("Using language dir: '%s'\n", m_langPath.c_str());
- break;
- }
case OPT_VBO:
{
std::string vbo;
@@ -371,6 +371,47 @@ ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[])
break;
}
+ case OPT_DATADIR:
+ {
+ m_dataPath = optarg;
+ GetLogger()->Info("Using data dir: '%s'\n", optarg);
+ break;
+ }
+ case OPT_LANGDIR:
+ {
+ m_langPath = optarg;
+ GetLogger()->Info("Using language dir: '%s'\n", optarg);
+ break;
+ }
+ case OPT_SAVEDIR:
+ {
+ m_savePath = optarg;
+ GetLogger()->Info("Using save dir: '%s'\n", optarg);
+ break;
+ }
+ case OPT_MOD:
+ {
+ GetLogger()->Info("Loading mod: '%s'\n", optarg);
+ CResourceManager::AddLocation(optarg, true);
+ break;
+ }
+ case OPT_RESOLUTION:
+ {
+ std::istringstream resolution(optarg);
+ std::string w, h;
+ std::getline(resolution, w, 'x');
+ std::getline(resolution, h, 'x');
+
+ m_deviceConfig.size.x = atoi(w.c_str());
+ m_deviceConfig.size.y = atoi(h.c_str());
+ m_resolutionOverride = true;
+ break;
+ }
+ case OPT_HEADLESS:
+ {
+ m_headless = true;
+ break;
+ }
default:
assert(false); // should never get here
}
@@ -386,32 +427,36 @@ bool CApplication::Create()
GetLogger()->Info("Creating CApplication\n");
- if (!GetProfile().InitCurrentDirectory())
- {
- GetLogger()->Warn("Config not found. Default values will be used!\n");
- defaultValues = true;
- }
- else
- {
- if (!m_customDataPath && GetProfile().GetLocalProfileString("Resources", "Data", path))
- m_dataPath = path;
- }
-
boost::filesystem::path dataPath(m_dataPath);
if (! (boost::filesystem::exists(dataPath) && boost::filesystem::is_directory(dataPath)) )
{
GetLogger()->Error("Data directory '%s' doesn't exist or is not a directory\n", m_dataPath.c_str());
m_errorMessage = std::string("Could not read from data directory:\n") +
- std::string("'") + m_dataPath + std::string("'\n") +
- std::string("Please check your installation, or supply a valid data directory by -datadir option.");
+ std::string("'") + m_dataPath + std::string("'\n") +
+ std::string("Please check your installation, or supply a valid data directory by -datadir option.");
m_exitCode = 1;
return false;
}
-
- m_gameData->SetDataDir(std::string(m_dataPath));
- m_gameData->Init();
- if (GetProfile().GetLocalProfileString("Language", "Lang", path)) {
+ boost::filesystem::create_directories(m_savePath);
+ boost::filesystem::create_directories(m_savePath+"/mods");
+
+ LoadModsFromDir(m_dataPath+"/mods");
+ LoadModsFromDir(m_savePath+"/mods");
+
+ GetLogger()->Info("Data path: %s\n", m_dataPath.c_str());
+ GetLogger()->Info("Save path: %s\n", m_savePath.c_str());
+ CResourceManager::AddLocation(m_dataPath, false);
+ CResourceManager::SetSaveLocation(m_savePath);
+ CResourceManager::AddLocation(m_savePath, true);
+
+ if (!GetProfile().Init())
+ {
+ GetLogger()->Warn("Config not found. Default values will be used!\n");
+ defaultValues = true;
+ }
+
+ if (GetProfile().GetStringProperty("Language", "Lang", path)) {
Language language;
if (ParseLanguage(path, language)) {
m_language = language;
@@ -425,7 +470,11 @@ bool CApplication::Create()
//Create the sound instance.
#ifdef OPENAL_SOUND
- m_sound = static_cast<CSoundInterface *>(new ALSound());
+ if(!m_headless) {
+ m_sound = static_cast<CSoundInterface *>(new ALSound());
+ } else {
+ m_sound = new CSoundInterface();
+ }
#else
GetLogger()->Info("No sound support.\n");
m_sound = new CSoundInterface();
@@ -470,35 +519,37 @@ bool CApplication::Create()
return false;
}
- // load settings from profile
- int iValue;
- if ( GetProfile().GetLocalProfileInt("Setup", "Resolution", iValue) )
- {
- std::vector<Math::IntPoint> modes;
- GetVideoResolutionList(modes, true, true);
- if (static_cast<unsigned int>(iValue) < modes.size())
- m_deviceConfig.size = modes.at(iValue);
- }
+ if(!m_headless) {
+ // load settings from profile
+ int iValue;
+ if ( GetProfile().GetIntProperty("Setup", "Resolution", iValue) && !m_resolutionOverride )
+ {
+ std::vector<Math::IntPoint> modes;
+ GetVideoResolutionList(modes, true, true);
+ if (static_cast<unsigned int>(iValue) < modes.size())
+ m_deviceConfig.size = modes.at(iValue);
+ }
- if ( GetProfile().GetLocalProfileInt("Setup", "Fullscreen", iValue) )
- {
- m_deviceConfig.fullScreen = (iValue == 1);
- }
+ if ( GetProfile().GetIntProperty("Setup", "Fullscreen", iValue) && !m_resolutionOverride )
+ {
+ m_deviceConfig.fullScreen = (iValue == 1);
+ }
- if (! CreateVideoSurface())
- return false; // dialog is in function
+ if (! CreateVideoSurface())
+ return false; // dialog is in function
- if (m_private->surface == nullptr)
- {
- m_errorMessage = std::string("SDL error while setting video mode:\n") +
- std::string(SDL_GetError());
- GetLogger()->Error(m_errorMessage.c_str());
- m_exitCode = 4;
- return false;
+ if (m_private->surface == nullptr)
+ {
+ m_errorMessage = std::string("SDL error while setting video mode:\n") +
+ std::string(SDL_GetError());
+ GetLogger()->Error(m_errorMessage.c_str());
+ m_exitCode = 4;
+ return false;
+ }
+
+ SDL_WM_SetCaption(m_windowTitle.c_str(), m_windowTitle.c_str());
}
- SDL_WM_SetCaption(m_windowTitle.c_str(), m_windowTitle.c_str());
-
// Enable translating key codes of key press events to unicode chars
SDL_EnableUNICODE(1);
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
@@ -506,8 +557,12 @@ bool CApplication::Create()
// Don't generate joystick events
SDL_JoystickEventState(SDL_IGNORE);
- // The video is ready, we can create and initalize the graphics device
- m_device = new Gfx::CGLDevice(m_deviceConfig);
+ if(!m_headless) {
+ // The video is ready, we can create and initalize the graphics device
+ m_device = new Gfx::CGLDevice(m_deviceConfig);
+ } else {
+ m_device = new Gfx::CNullDevice();
+ }
if (! m_device->Create() )
{
m_errorMessage = std::string("Error in CDevice::Create()\n") + standardInfoMessage;
@@ -568,8 +623,8 @@ bool CApplication::CreateVideoSurface()
if (m_deviceConfig.fullScreen)
videoFlags |= SDL_FULLSCREEN;
- if (m_deviceConfig.resizeable)
- videoFlags |= SDL_RESIZABLE;
+ //if (m_deviceConfig.resizeable)
+ // videoFlags |= SDL_RESIZABLE;
// Set OpenGL attributes
@@ -594,27 +649,35 @@ bool CApplication::CreateVideoSurface()
return true;
}
+void CApplication::LoadModsFromDir(const std::string &dir)
+{
+ try {
+ boost::filesystem::directory_iterator iterator(dir);
+ for(; iterator != boost::filesystem::directory_iterator(); ++iterator)
+ {
+ std::string fn = iterator->path().string();
+ CLogger::GetInstancePointer()->Info("Loading mod: '%s'\n", fn.c_str());
+ CResourceManager::AddLocation(fn, false);
+ }
+ }
+ catch(std::exception &e)
+ {
+ CLogger::GetInstancePointer()->Warn("Unable to load mods from directory '%s': %s\n", dir.c_str(), e.what());
+ }
+}
+
void CApplication::Destroy()
{
m_joystickEnabled = false;
- if (m_robotMain != nullptr)
- {
- delete m_robotMain;
- m_robotMain = nullptr;
- }
+ delete m_robotMain;
+ m_robotMain = nullptr;
- if (m_sound != nullptr)
- {
- delete m_sound;
- m_sound = nullptr;
- }
+ delete m_sound;
+ m_sound = nullptr;
- if (m_modelManager != nullptr)
- {
- delete m_modelManager;
- m_modelManager = nullptr;
- }
+ delete m_modelManager;
+ m_modelManager = nullptr;
if (m_engine != nullptr)
{
@@ -649,6 +712,17 @@ void CApplication::Destroy()
SDL_Quit();
}
+void CApplication::Restart()
+{
+ m_restart = true;
+ m_eventQueue->AddEvent(Event(EVENT_SYS_QUIT));
+}
+
+bool CApplication::IsRestarting()
+{
+ return m_restart;
+}
+
bool CApplication::ChangeVideoConfig(const Gfx::GLDeviceConfig &newConfig)
{
static bool restore = false;
@@ -674,7 +748,7 @@ bool CApplication::ChangeVideoConfig(const Gfx::GLDeviceConfig &newConfig)
std::string(SDL_GetError()) + std::string("\n") +
std::string("Previous mode will be restored");
GetLogger()->Error(error.c_str());
- GetSystemUtils()->SystemDialog( SDT_ERROR, "COLOBT - Error", error);
+ GetSystemUtils()->SystemDialog( SDT_ERROR, "COLOBOT - Error", error);
restore = true;
ChangeVideoConfig(m_lastDeviceConfig);
@@ -687,7 +761,7 @@ bool CApplication::ChangeVideoConfig(const Gfx::GLDeviceConfig &newConfig)
std::string error = std::string("SDL error while restoring previous video mode:\n") +
std::string(SDL_GetError());
GetLogger()->Error(error.c_str());
- GetSystemUtils()->SystemDialog( SDT_ERROR, "COLOBT - Fatal Error", error);
+ GetSystemUtils()->SystemDialog( SDT_ERROR, "COLOBOT - Fatal Error", error);
// Fatal error, so post the quit event
@@ -699,6 +773,7 @@ bool CApplication::ChangeVideoConfig(const Gfx::GLDeviceConfig &newConfig)
( static_cast<Gfx::CGLDevice*>(m_device) )->ConfigChanged(m_deviceConfig);
m_engine->ResetAfterDeviceChanged();
+ m_robotMain->ResetAfterDeviceChanged();
return true;
}
diff --git a/src/app/app.h b/src/app/app.h
index 86a757f..52ed77a 100644
--- a/src/app/app.h
+++ b/src/app/app.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/app.h
@@ -42,7 +44,6 @@ class CInstanceManager;
class CEventQueue;
class CRobotMain;
class CSoundInterface;
-class CGameData;
namespace Gfx {
class CModelManager;
@@ -226,6 +227,11 @@ public:
//! Cleans up before exit
void Destroy();
+
+ //! Restart
+ void Restart();
+ //! Should we restart after app quits?
+ bool IsRestarting();
//! Returns a list of possible video modes
VideoQueryResult GetVideoResolutionList(std::vector<Math::IntPoint> &resolutions,
@@ -355,6 +361,9 @@ public:
protected:
//! Creates the window's SDL_Surface
bool CreateVideoSurface();
+
+ //! Loads all mods from given directory
+ void LoadModsFromDir(const std::string &dir);
//! Processes the captured SDL event to Event struct
Event ProcessSystemEvent();
@@ -402,8 +411,6 @@ protected:
CRobotMain* m_robotMain;
//! Profile (INI) reader/writer
CProfile* m_profile;
- //! Game data
- CGameData* m_gameData;
//! Code to return at exit
int m_exitCode;
@@ -411,6 +418,8 @@ protected:
bool m_active;
//! Bit array of active debug modes
long m_debugModes;
+ //! If we are restarting the app
+ bool m_restart;
//! Message to be displayed as error to the user
std::string m_errorMessage;
@@ -467,16 +476,16 @@ protected:
std::vector<int> m_joyAxeState;
//! Current state of joystick buttons; may be updated from another thread
std::vector<bool> m_joyButtonState;
-
+
//! Path to directory with data files
std::string m_dataPath;
-
- //! True if datadir was passed in command line
- bool m_customDataPath;
-
+
//! Path to directory with language files
std::string m_langPath;
+ //! Path to directory with save files
+ std::string m_savePath;
+
//@{
//! Scene to run on startup
std::string m_runSceneName;
@@ -491,8 +500,11 @@ protected:
//! Low cpu mode
bool m_lowCPU;
-
- //! Show prototype levels
- bool m_protoMode;
+
+ //! Screen resoultion overriden by commandline
+ bool m_resolutionOverride;
+
+ //! Headles mode
+ bool m_headless;
};
diff --git a/src/app/gamedata.cpp b/src/app/gamedata.cpp
deleted file mode 100644
index ceeb7b3..0000000
--- a/src/app/gamedata.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2014, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
-
-#include "app/gamedata.h"
-
-
-#include "app/app.h"
-
-#include <boost/filesystem.hpp>
-
-template<> CGameData* CSingleton<CGameData>::m_instance = nullptr;
-
-CGameData::CGameData()
-{
- m_dataDirSet = false;
-
- for (int i = 0; i < DIR_MAX; ++i)
- m_standardDataDirs[i] = nullptr;
-
- m_standardDataDirs[DIR_AI] = "ai";
- m_standardDataDirs[DIR_FONT] = "fonts";
- m_standardDataDirs[DIR_HELP] = "help";
- m_standardDataDirs[DIR_ICON] = "icons";
- m_standardDataDirs[DIR_LEVEL] = "levels";
- m_standardDataDirs[DIR_MODEL] = "models";
- m_standardDataDirs[DIR_MUSIC] = "music";
- m_standardDataDirs[DIR_SOUND] = "sounds";
- m_standardDataDirs[DIR_TEXTURE] = "textures";
-}
-
-CGameData::~CGameData()
-{
-}
-
-void CGameData::SetDataDir(std::string path)
-{
- assert(!m_dataDirSet);
- m_dataDirSet = true;
-
- m_dataDirs.insert(m_dataDirs.begin(), path);
-}
-
-void CGameData::AddMod(std::string path)
-{
- m_dataDirs.push_back(path);
-}
-
-void CGameData::Init()
-{
- std::string out = "Using datadirs: ";
- bool first = true;
- for(std::vector<std::string>::reverse_iterator rit = m_dataDirs.rbegin(); rit != m_dataDirs.rend(); ++rit) {
- if(!first) out += ", ";
- first = false;
- out += *rit;
- }
- out += "\n";
- CLogger::GetInstancePointer()->Info(out.c_str());
-}
-
-std::string CGameData::GetFilePath(DataDir dir, const std::string& subpath)
-{
- int index = static_cast<int>(dir);
- assert(index >= 0 && index < DIR_MAX);
-
- for(std::vector<std::string>::reverse_iterator rit = m_dataDirs.rbegin(); rit != m_dataDirs.rend(); ++rit) {
- std::stringstream str;
-
- if ( subpath.find("save") == std::string::npos ){ // if its NOT a path to a savefile screenshot
- str << *rit;
- str << "/";
- str << m_standardDataDirs[index];
-
- if (dir == DIR_HELP)
- {
- str << "/";
- str << CApplication::GetInstancePointer()->GetLanguageChar();
- }
- str << "/";
- }
-
- str << subpath;
-
- boost::filesystem::path path(str.str());
- if(boost::filesystem::exists(path))
- {
- return str.str();
- }
- }
-
- if(m_dataDirs.size() > 0) {
- std::stringstream str;
- if ( subpath.find("save") == std::string::npos ){ // if its NOT a path to a savefile screenshot
- str << m_dataDirs[0];
- str << "/";
- str << m_standardDataDirs[index];
-
- if (dir == DIR_HELP)
- {
- str << "/";
- str << CApplication::GetInstancePointer()->GetLanguageChar();
- }
- str << "/";
- }
- str << subpath;
- return str.str();
- }
-
- return subpath;
-}
-
-std::string CGameData::GetDataPath(const std::string &subpath)
-{
- for(std::vector<std::string>::reverse_iterator rit = m_dataDirs.rbegin(); rit != m_dataDirs.rend(); ++rit) {
- std::string path = *rit + "/" + subpath;
- boost::filesystem::path boostPath(path);
- if(boost::filesystem::exists(boostPath))
- {
- return path;
- }
- }
- return m_dataDirs[0] + "/" + subpath;
-}
diff --git a/src/app/gamedata.h b/src/app/gamedata.h
deleted file mode 100644
index b7536a2..0000000
--- a/src/app/gamedata.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2014, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
-
-/**
- * \file app/gamedata.h
- * \brief Game data
- */
-
-#pragma once
-
-#include "common/singleton.h"
-
-#include <string>
-#include <vector>
-
-/**
- * \enum DataDir
- * \brief Directories in data directory
- */
-enum DataDir
-{
- DIR_AI, //! < ai scripts
- DIR_FONT, //! < fonts
- DIR_HELP, //! < help files
- DIR_ICON, //! < icons & images
- DIR_LEVEL, //! < levels
- DIR_MODEL, //! < models
- DIR_MUSIC, //! < music
- DIR_SOUND, //! < sounds
- DIR_TEXTURE, //! < textures
-
- DIR_MAX //! < number of dirs
-};
-
-class CGameData : public CSingleton<CGameData>
-{
-public:
- CGameData();
- ~CGameData();
-
- void Init();
- void SetDataDir(std::string path);
- void AddMod(std::string path);
-
- std::string GetFilePath(DataDir dir, const std::string &subpath);
- std::string GetDataPath(const std::string &subpath);
-
-private:
- bool m_dataDirSet;
- std::vector<std::string> m_dataDirs;
- const char* m_standardDataDirs[DIR_MAX];
-};
-
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 5c0afd3..88a7a73 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/main.cpp
@@ -69,6 +71,7 @@ The current layout is the following:
- src/script - link with the CBot library
*/
+#include "common/resources/resourcemanager.h"
//! Entry point to the program
extern "C"
@@ -77,47 +80,52 @@ extern "C"
int SDL_MAIN_FUNC(int argc, char *argv[])
{
CLogger logger; // single istance of logger
+ CResourceManager manager(argv[0]);
// Initialize static string arrays
InitializeRestext();
InitializeEventTypeTexts();
- CSystemUtils* systemUtils = CSystemUtils::Create(); // platform-specific utils
- systemUtils->Init();
-
logger.Info("Colobot starting\n");
-
- CApplication* app = new CApplication(); // single instance of the application
-
- ParseArgsStatus status = app->ParseArguments(argc, argv);
- if (status == PARSE_ARGS_FAIL)
- {
- systemUtils->SystemDialog(SDT_ERROR, "COLOBOT - Fatal Error", "Invalid commandline arguments!\n");
- return app->GetExitCode();
- }
- else if (status == PARSE_ARGS_HELP)
- {
- return app->GetExitCode();
- }
-
+
int code = 0;
+ while(true) {
+ CSystemUtils* systemUtils = CSystemUtils::Create(); // platform-specific utils
+ systemUtils->Init();
+
+ CApplication* app = new CApplication(); // single instance of the application
+
+ ParseArgsStatus status = app->ParseArguments(argc, argv);
+ if (status == PARSE_ARGS_FAIL)
+ {
+ systemUtils->SystemDialog(SDT_ERROR, "COLOBOT - Fatal Error", "Invalid commandline arguments!\n");
+ return app->GetExitCode();
+ }
+ else if (status == PARSE_ARGS_HELP)
+ {
+ return app->GetExitCode();
+ }
- if (! app->Create())
- {
- app->Destroy(); // ensure a clean exit
- code = app->GetExitCode();
- if ( code != 0 && !app->GetErrorMessage().empty() )
+
+ if (! app->Create())
{
- systemUtils->SystemDialog(SDT_ERROR, "COLOBOT - Fatal Error", app->GetErrorMessage());
+ app->Destroy(); // ensure a clean exit
+ code = app->GetExitCode();
+ if ( code != 0 && !app->GetErrorMessage().empty() )
+ {
+ systemUtils->SystemDialog(SDT_ERROR, "COLOBOT - Fatal Error", app->GetErrorMessage());
+ }
+ logger.Info("Didn't run main loop. Exiting with code %d\n", code);
+ return code;
}
- logger.Info("Didn't run main loop. Exiting with code %d\n", code);
- return code;
- }
- code = app->Run();
+ code = app->Run();
+ bool restarting = app->IsRestarting();
- delete app;
- delete systemUtils;
+ delete app;
+ delete systemUtils;
+ if(!restarting) break;
+ }
logger.Info("Exiting with code %d\n", code);
return code;
diff --git a/src/app/pausemanager.cpp b/src/app/pausemanager.cpp
index d357bba..b28565f 100644
--- a/src/app/pausemanager.cpp
+++ b/src/app/pausemanager.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/app.h"
#include "app/pausemanager.h"
@@ -29,7 +31,7 @@ template<> CPauseManager* CSingleton<CPauseManager>::m_instance = nullptr;
CPauseManager::CPauseManager()
{
m_sound = CApplication::GetInstancePointer()->GetSound();
-
+
m_pause = PAUSE_NONE;
}
@@ -40,24 +42,28 @@ CPauseManager::~CPauseManager()
void CPauseManager::SetPause(PauseType pause)
{
- if(pause != PAUSE_NONE) {
- if(m_pause != pause) {
+ if (pause != PAUSE_NONE)
+ {
+ if (m_pause != pause)
+ {
CLogger::GetInstancePointer()->Info("Game paused - %s\n", GetPauseName(pause).c_str());
CRobotMain::GetInstancePointer()->StartPauseMusic(pause);
}
-
+
m_pause = pause;
- } else
+ }
+ else
ClearPause();
}
void CPauseManager::ClearPause()
{
- if(m_pause != PAUSE_NONE) {
+ if(m_pause != PAUSE_NONE)
+ {
CLogger::GetInstancePointer()->Info("Game resumed\n");
m_sound->StopPauseMusic();
}
-
+
m_pause = PAUSE_NONE;
}
diff --git a/src/app/pausemanager.h b/src/app/pausemanager.h
index fefc4a5..411742e 100644
--- a/src/app/pausemanager.h
+++ b/src/app/pausemanager.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/pausemanager.h
diff --git a/src/app/system.cpp b/src/app/system.cpp
index eaa9e4c..2ceea6a 100644
--- a/src/app/system.cpp
+++ b/src/app/system.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system.h"
@@ -202,13 +204,7 @@ std::string CSystemUtils::GetLangPath()
return COLOBOT_I18N_DIR;
}
-std::string CSystemUtils::GetProfileFileLocation()
+std::string CSystemUtils::GetSaveDir()
{
- return std::string("colobot.ini");
+ return std::string("save");
}
-
-std::string CSystemUtils::GetSavegameDirectoryLocation()
-{
- return std::string("savegame");
-}
-
diff --git a/src/app/system.h b/src/app/system.h
index c2125fe..d52020b 100644
--- a/src/app/system.h
+++ b/src/app/system.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/system.h
@@ -136,11 +138,8 @@ public:
//! Returns the translations path
virtual std::string GetLangPath();
- //! Returns the profile (colobot.ini) file location
- virtual std::string GetProfileFileLocation();
-
- //! Returns the savegame directory location
- virtual std::string GetSavegameDirectoryLocation();
+ //! Returns the save dir location
+ virtual std::string GetSaveDir();
};
//! Global function to get CSystemUtils instance
diff --git a/src/app/system_linux.cpp b/src/app/system_linux.cpp
index 492af7d..6fbfb05 100644
--- a/src/app/system_linux.cpp
+++ b/src/app/system_linux.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system_linux.h"
@@ -25,7 +27,7 @@
void CSystemUtilsLinux::Init()
{
m_zenityAvailable = true;
- if (system("zenity --version") != 0)
+ if (system("zenity --version 1> /dev/null 2> /dev/null") != 0)
{
m_zenityAvailable = false;
GetLogger()->Warn("Zenity not available, will fallback to console users dialogs.\n");
@@ -95,34 +97,7 @@ long long CSystemUtilsLinux::TimeStampExactDiff(SystemTimeStamp *before, SystemT
(after->clockTime.tv_sec - before->clockTime.tv_sec) * 1000000000ll;
}
-std::string CSystemUtilsLinux::GetProfileFileLocation()
-{
- std::string profileFile;
-
- // Determine profileFile according to XDG Base Directory Specification
- char* envXDG_CONFIG_HOME = getenv("XDG_CONFIG_HOME");
- if (envXDG_CONFIG_HOME == NULL)
- {
- char *envHOME = getenv("HOME");
- if (envHOME == NULL)
- {
- profileFile = "colobot.ini";
- }
- else
- {
- profileFile = std::string(envHOME) + "/.config/colobot.ini";
- }
- }
- else
- {
- profileFile = std::string(envXDG_CONFIG_HOME) + "/colobot.ini";
- }
- GetLogger()->Trace("Profile configuration is %s\n", profileFile.c_str());
-
- return profileFile;
-}
-
-std::string CSystemUtilsLinux::GetSavegameDirectoryLocation()
+std::string CSystemUtilsLinux::GetSaveDir()
{
std::string savegameDir;
@@ -133,7 +108,7 @@ std::string CSystemUtilsLinux::GetSavegameDirectoryLocation()
char *envHOME = getenv("HOME");
if (envHOME == NULL)
{
- savegameDir = "/tmp/colobot-savegame";
+ savegameDir = "/tmp/colobot-save";
}
else
{
@@ -148,4 +123,3 @@ std::string CSystemUtilsLinux::GetSavegameDirectoryLocation()
return savegameDir;
}
-
diff --git a/src/app/system_linux.h b/src/app/system_linux.h
index 212d840..5f4fcc3 100644
--- a/src/app/system_linux.h
+++ b/src/app/system_linux.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/system_linux.h
@@ -46,8 +48,7 @@ public:
virtual long long GetTimeStampExactResolution() override;
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) override;
- virtual std::string GetProfileFileLocation() override;
- virtual std::string GetSavegameDirectoryLocation() override;
+ virtual std::string GetSaveDir() override;
private:
bool m_zenityAvailable;
diff --git a/src/app/system_macosx.cpp b/src/app/system_macosx.cpp
index 68f5c79..208b4a7 100644
--- a/src/app/system_macosx.cpp
+++ b/src/app/system_macosx.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2013, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system_macosx.h"
@@ -97,20 +99,10 @@ std::string CSystemUtilsMacOSX::GetLangPath()
return m_dataPath + "/i18n";
}
-std::string CSystemUtilsMacOSX::GetProfileFileLocation()
+std::string CSystemUtilsMacOSX::GetSaveDir()
{
- std::string profileFile = m_ASPath + "/colobot.ini";
-
- GetLogger()->Trace("Profile file is %s\n", profileFile.c_str());
- return profileFile;
-}
-
-std::string CSystemUtilsMacOSX::GetSavegameDirectoryLocation()
-{
- std::string savegameDir = m_ASPath + "/savegame";
- boost::filesystem::create_directories(savegameDir.c_str());
+ std::string savegameDir = m_ASPath;
GetLogger()->Trace("Saved game files are going to %s\n", savegameDir.c_str());
return savegameDir;
}
-
diff --git a/src/app/system_macosx.h b/src/app/system_macosx.h
index b6a044b..9063aab 100644
--- a/src/app/system_macosx.h
+++ b/src/app/system_macosx.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/system_macosx.h
@@ -30,8 +32,7 @@ public:
virtual std::string GetDataPath() override;
virtual std::string GetLangPath() override;
- virtual std::string GetProfileFileLocation() override;
- virtual std::string GetSavegameDirectoryLocation() override;
+ virtual std::string GetSaveDir() override;
private:
std::string m_ASPath;
std::string m_dataPath;
diff --git a/src/app/system_other.cpp b/src/app/system_other.cpp
index 9d9f76a..c21314c 100644
--- a/src/app/system_other.cpp
+++ b/src/app/system_other.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system_other.h"
diff --git a/src/app/system_other.h b/src/app/system_other.h
index 7eccf3f..3be6d59 100644
--- a/src/app/system_other.h
+++ b/src/app/system_other.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/system_other.h
diff --git a/src/app/system_windows.cpp b/src/app/system_windows.cpp
index f48d4e0..a2ea18f 100644
--- a/src/app/system_windows.cpp
+++ b/src/app/system_windows.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system_windows.h"
@@ -111,39 +113,20 @@ std::wstring CSystemUtilsWindows::UTF8_Decode(const std::string& str)
}
-std::string CSystemUtilsWindows::GetProfileFileLocation()
-{
- std::string profileFile;
-
- char* envUSERPROFILE = getenv("USERPROFILE");
- if (envUSERPROFILE == NULL)
- {
- profileFile = "colobot.ini";
- }
- else
- {
- profileFile = std::string(envUSERPROFILE) + "\\colobot\\colobot.ini";
- }
- GetLogger()->Trace("Profile configuration is %s\n", profileFile.c_str());
-
- return profileFile;
-}
-
-std::string CSystemUtilsWindows::GetSavegameDirectoryLocation()
+std::string CSystemUtilsWindows::GetSaveDir()
{
std::string savegameDir;
char* envUSERPROFILE = getenv("USERPROFILE");
if (envUSERPROFILE == NULL)
{
- savegameDir = "savegame";
+ savegameDir = "save";
}
else
{
- savegameDir = std::string(envUSERPROFILE) + "\\colobot\\savegame";
+ savegameDir = std::string(envUSERPROFILE) + "\\colobot";
}
GetLogger()->Trace("Saved game files are going to %s\n", savegameDir.c_str());
return savegameDir;
}
-
diff --git a/src/app/system_windows.h b/src/app/system_windows.h
index fbc71a1..9175a44 100644
--- a/src/app/system_windows.h
+++ b/src/app/system_windows.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file app/system_windows.h
@@ -44,8 +46,7 @@ public:
virtual long long GetTimeStampExactResolution() override;
virtual long long TimeStampExactDiff(SystemTimeStamp *before, SystemTimeStamp *after) override;
- virtual std::string GetProfileFileLocation() override;
- virtual std::string GetSavegameDirectoryLocation() override;
+ virtual std::string GetSaveDir() override;
private:
std::string UTF8_Encode(const std::wstring &wstr);
diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake
index 98ccefe..44c1085 100644
--- a/src/common/config.h.cmake
+++ b/src/common/config.h.cmake
@@ -24,6 +24,8 @@
#define SDL_MAIN_FUNC main
#endif
+#cmakedefine PORTABLE @PORTABLE@
+
#define COLOBOT_VERSION "@COLOBOT_VERSION_FULL@"
#define COLOBOT_CODENAME "@COLOBOT_VERSION_CODENAME@"
#define COLOBOT_FULLNAME "Colobot @COLOBOT_VERSION_CODENAME@"
diff --git a/src/common/event.cpp b/src/common/event.cpp
index 9dc3943..37a6fe8 100644
--- a/src/common/event.cpp
+++ b/src/common/event.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/event.h"
@@ -67,7 +70,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 +172,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..bb9e123 100644
--- a/src/common/event.h
+++ b/src/common/event.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/event.h
@@ -90,7 +93,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 +195,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,
@@ -239,6 +240,7 @@ enum EventType
EVENT_INTERFACE_EDITMODE= 476,
EVENT_INTERFACE_EDITVALUE= 477,
EVENT_INTERFACE_SOLUCE4 = 478,
+ EVENT_INTERFACE_BLOOD = 479,
EVENT_INTERFACE_KINFO1 = 500,
EVENT_INTERFACE_KINFO2 = 501,
diff --git a/src/common/global.h b/src/common/global.h
index 4049bdc..b41ea53 100644
--- a/src/common/global.h
+++ b/src/common/global.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/global.h
diff --git a/src/common/image.cpp b/src/common/image.cpp
index e3d1ef7..f241f83 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -1,23 +1,27 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/image.h"
#include "math/func.h"
+#include "common/resources/resourcemanager.h"
#include <stdlib.h>
#include <stdio.h>
@@ -381,7 +385,16 @@ bool CImage::Load(const std::string& fileName)
m_error = "";
- m_data->surface = IMG_Load(fileName.c_str());
+ SDL_RWops* pointer = CResourceManager::GetSDLFileHandler(fileName.c_str());
+ if (pointer == nullptr)
+ {
+ delete m_data;
+ m_data = nullptr;
+
+ m_error = "Unable to open file";
+ return false;
+ }
+ m_data->surface = IMG_Load_RW(pointer, 1);
if (m_data->surface == nullptr)
{
delete m_data;
@@ -458,4 +471,4 @@ void CImage::flipVertically(){
SDL_FreeSurface(m_data->surface);
m_data->surface = result;
-} \ No newline at end of file
+}
diff --git a/src/common/image.h b/src/common/image.h
index b93f2f9..e0e270a 100644
--- a/src/common/image.h
+++ b/src/common/image.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/image.h
diff --git a/src/common/iman.cpp b/src/common/iman.cpp
index 88fbb9b..d85c313 100644
--- a/src/common/iman.cpp
+++ b/src/common/iman.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/iman.h"
@@ -42,9 +45,7 @@ void CInstanceManager::Flush()
{
for (int i = 0; i < CLASS_MAX; i++)
{
- if (m_table[i].instances != nullptr)
- delete[] m_table[i].instances;
-
+ delete[] m_table[i].instances;
m_table[i].instances = nullptr;
}
}
diff --git a/src/common/iman.h b/src/common/iman.h
index bfa2204..112ca12 100644
--- a/src/common/iman.h
+++ b/src/common/iman.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/iman.h
diff --git a/src/common/ioutils.h b/src/common/ioutils.h
index 823b720..12c2943 100644
--- a/src/common/ioutils.h
+++ b/src/common/ioutils.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/ioutils.h
diff --git a/src/common/key.h b/src/common/key.h
index 82b3fbd..d4d2a55 100644
--- a/src/common/key.h
+++ b/src/common/key.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/key.h
diff --git a/src/common/logger.cpp b/src/common/logger.cpp
index 7fc8fb0..fd0d418 100644
--- a/src/common/logger.cpp
+++ b/src/common/logger.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/logger.h"
diff --git a/src/common/logger.h b/src/common/logger.h
index 1a5f3b9..bca0845 100644
--- a/src/common/logger.h
+++ b/src/common/logger.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/logger.h
diff --git a/src/common/misc.cpp b/src/common/misc.cpp
index 92c3e9a..35a5560 100644
--- a/src/common/misc.cpp
+++ b/src/common/misc.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/misc.h"
@@ -23,6 +26,8 @@
#include <string.h>
#include <ctype.h>
#include <time.h>
+#include <sstream>
+#include <iomanip>
// Returns a non-accented letter.
@@ -229,42 +234,15 @@ void TimeToAsciiClean(time_t time, char *buffer)
when.tm_hour, when.tm_min);
}
-// Copy a list of numbered files into the temporary folder.
-
-bool CopyFileListToTemp(char* filename, int* list, int total)
+std::string TimeFormat(float time)
{
- /*char name[100];
- char ext[10];
- char file[100];
- char save[100];
- char* p;
- int i;
-
- strcpy(name, filename);
- p = strchr(name, '.');
- if ( p == 0 )
- {
- strcpy(ext, ".tga");
- }
- else
- {
- strcpy(ext, p);
- *p = 0;
- }
-
- for ( i=0 ; i<total ; i++ )
- {
- sprintf(file, "%s%.3d%s", name, list[i], ext); // nameNNN.ext
- CopyFileToTemp(file);
- }
-
- strcpy(save, g_userDir);
- strcpy(g_userDir, "temp");
- UserDir(file, filename, "textures");
- strcpy(filename, file);
- strcpy(g_userDir, save);
-*/
- return false;
+ int minutes = floor(time/60);
+ double time2 = fmod(time, 60);
+ double seconds;
+ double fraction = modf(time2, &seconds)*100;
+ std::ostringstream sstream;
+ sstream << std::setfill('0') << std::setw(2) << minutes << ":" << std::setfill('0') << std::setw(2) << floor(seconds) << "." << std::setfill('0') << std::setw(2) << floor(fraction);
+ return sstream.str();
}
diff --git a/src/common/misc.h b/src/common/misc.h
index 3c147b1..b53bbdd 100644
--- a/src/common/misc.h
+++ b/src/common/misc.h
@@ -1,24 +1,28 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#pragma once
#include <time.h>
+#include <string>
// TODO: rewrite/refactor or remove
@@ -29,7 +33,7 @@ extern char GetToLower(char letter);
extern void TimeToAscii(time_t time, char *buffer);
extern void TimeToAsciiClean(time_t time, char *buffer);
+extern std::string TimeFormat(float time);
-extern bool CopyFileListToTemp(char* filename, int* list, int total);
extern void AddExt(char* filename, const char* ext);
diff --git a/src/common/profile.cpp b/src/common/profile.cpp
index ee3e873..75ab135 100644
--- a/src/common/profile.cpp
+++ b/src/common/profile.cpp
@@ -1,26 +1,32 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/profile.h"
-#include "common/logger.h"
-
+#include "common/resources/inputstream.h"
+#include "common/resources/outputstream.h"
#include "app/system.h"
+#include "common/logger.h"
+
+#include <memory>
#include <utility>
#include <cstring>
#include <boost/property_tree/ini_parser.hpp>
@@ -31,27 +37,51 @@ template<> CProfile* CSingleton<CProfile>::m_instance = nullptr;
namespace bp = boost::property_tree;
-CProfile::CProfile() :
- m_profileNeedSave(false)
+CProfile::CProfile()
+ : m_profileNeedSave(false)
+ , m_useCurrentDirectory(false)
{
}
CProfile::~CProfile()
{
- SaveCurrentDirectory();
+ Save();
}
+void CProfile::SetUseCurrentDirectory(bool useCurrentDirectory)
+{
+ m_useCurrentDirectory = useCurrentDirectory;
+}
-bool CProfile::InitCurrentDirectory()
+bool CProfile::Init()
{
try
{
- #if DEV_BUILD
- bp::ini_parser::read_ini("colobot.ini", m_propertyTree);
- #else
- bp::ini_parser::read_ini(GetSystemUtils()->GetProfileFileLocation(), m_propertyTree);
- #endif
+ std::unique_ptr<std::istream> stream;
+ bool good;
+ if (m_useCurrentDirectory)
+ {
+ std::ifstream* inputStream = new std::ifstream("./colobot.ini");
+ stream = std::unique_ptr<std::istream>(inputStream);
+ good = inputStream->good();
+ }
+ else
+ {
+ CInputStream* inputStream = new CInputStream("colobot.ini");
+ stream = std::unique_ptr<std::istream>(inputStream);
+ good = inputStream->is_open();
+ }
+
+ if (good)
+ {
+ bp::ini_parser::read_ini(*stream, m_propertyTree);
+ }
+ else
+ {
+ GetLogger()->Error("Error on parsing profile: failed to open file\n");
+ return false;
+ }
}
catch (std::exception & e)
{
@@ -61,17 +91,36 @@ bool CProfile::InitCurrentDirectory()
return true;
}
-bool CProfile::SaveCurrentDirectory()
+bool CProfile::Save()
{
if (m_profileNeedSave)
{
try
{
- #if DEV_BUILD
- bp::ini_parser::write_ini("colobot.ini", m_propertyTree);
- #else
- bp::ini_parser::write_ini(GetSystemUtils()->GetProfileFileLocation(), m_propertyTree);
- #endif
+ std::unique_ptr<std::ostream> stream;
+ bool good;
+ if (m_useCurrentDirectory)
+ {
+ std::ofstream* outputStream = new std::ofstream("./colobot.ini");
+ stream = std::unique_ptr<std::ostream>(outputStream);
+ good = outputStream->good();
+ }
+ else
+ {
+ COutputStream* outputStream = new COutputStream("colobot.ini");
+ stream = std::unique_ptr<std::ostream>(outputStream);
+ good = outputStream->is_open();
+ }
+
+ if (good)
+ {
+ bp::ini_parser::write_ini(*stream, m_propertyTree);
+ }
+ else
+ {
+ GetLogger()->Error("Error on storing profile: failed to open file\n");
+ return false;
+ }
}
catch (std::exception & e)
{
@@ -82,7 +131,7 @@ bool CProfile::SaveCurrentDirectory()
return true;
}
-bool CProfile::SetLocalProfileString(std::string section, std::string key, std::string value)
+bool CProfile::SetStringProperty(std::string section, std::string key, std::string value)
{
try
{
@@ -98,7 +147,7 @@ bool CProfile::SetLocalProfileString(std::string section, std::string key, std::
}
-bool CProfile::GetLocalProfileString(std::string section, std::string key, std::string &buffer)
+bool CProfile::GetStringProperty(std::string section, std::string key, std::string &buffer)
{
try
{
@@ -113,7 +162,7 @@ bool CProfile::GetLocalProfileString(std::string section, std::string key, std::
}
-bool CProfile::SetLocalProfileInt(std::string section, std::string key, int value)
+bool CProfile::SetIntProperty(std::string section, std::string key, int value)
{
try
{
@@ -129,7 +178,7 @@ bool CProfile::SetLocalProfileInt(std::string section, std::string key, int valu
}
-bool CProfile::GetLocalProfileInt(std::string section, std::string key, int &value)
+bool CProfile::GetIntProperty(std::string section, std::string key, int &value)
{
try
{
@@ -144,7 +193,7 @@ bool CProfile::GetLocalProfileInt(std::string section, std::string key, int &val
}
-bool CProfile::SetLocalProfileFloat(std::string section, std::string key, float value)
+bool CProfile::SetFloatProperty(std::string section, std::string key, float value)
{
try
{
@@ -160,7 +209,7 @@ bool CProfile::SetLocalProfileFloat(std::string section, std::string key, float
}
-bool CProfile::GetLocalProfileFloat(std::string section, std::string key, float &value)
+bool CProfile::GetFloatProperty(std::string section, std::string key, float &value)
{
try
{
@@ -175,7 +224,7 @@ bool CProfile::GetLocalProfileFloat(std::string section, std::string key, float
}
-std::vector< std::string > CProfile::GetLocalProfileSection(std::string section, std::string key)
+std::vector< std::string > CProfile::GetSection(std::string section, std::string key)
{
std::vector< std::string > ret_list;
boost::regex re(key + "[0-9]*"); //we want to match all key followed by any number
@@ -198,52 +247,3 @@ std::vector< std::string > CProfile::GetLocalProfileSection(std::string section,
return ret_list;
}
-
-void CProfile::SetUserDir(std::string dir)
-{
- m_userDirectory = dir;
-}
-
-
-std::string CProfile::GetUserBasedPath(std::string dir, std::string default_dir)
-{
- std::string path = dir;
- boost::replace_all(path, "\\", "/");
- if (dir.find("/") == std::string::npos)
- {
- path = default_dir + "/" + dir;
- }
-
- if (m_userDirectory.length() > 0)
- {
- boost::replace_all(path, "%user%", m_userDirectory);
- }
- else
- {
- boost::replace_all(path, "%user%", default_dir);
- }
-
- return fs::path(path).make_preferred().string();
-}
-
-
-bool CProfile::CopyFileToTemp(std::string filename)
-{
- std::string src, dst;
- std::string tmp_user_dir = m_userDirectory;
-
- src = GetUserBasedPath(filename, "textures");
- SetUserDir("temp");
- dst = GetUserBasedPath(filename, "textures");
- SetUserDir(tmp_user_dir);
-
- fs::create_directory(fs::path(dst).parent_path().make_preferred().string());
- fs::copy_file(src, dst, fs::copy_option::overwrite_if_exists);
- if (fs::exists(dst))
- {
- return true;
- }
-
- return false;
-}
-
diff --git a/src/common/profile.h b/src/common/profile.h
index f084ece..d89c5d1 100644
--- a/src/common/profile.h
+++ b/src/common/profile.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/profile.h
@@ -45,94 +48,78 @@ public:
CProfile();
virtual ~CProfile();
+ /** Set flag to force using ini file from current directory */
+ void SetUseCurrentDirectory(bool useCurrentDirectory);
+
/** Loads colobot.ini from current directory
- * \return return true on success
- */
- bool InitCurrentDirectory();
+ * \return return true on success
+ */
+ bool Init();
/** Saves colobot.ini to current directory
- * \return return true on success
- */
- bool SaveCurrentDirectory();
+ * \return return true on success
+ */
+ bool Save();
/** Sets string value in section under specified key
- * \param section
- * \param key
- * \param value
- * \return return true on success
- */
- bool SetLocalProfileString(std::string section, std::string key, std::string value);
+ * \param section
+ * \param key
+ * \param value
+ * \return return true on success
+ */
+ bool SetStringProperty(std::string section, std::string key, std::string value);
/** Gets string value in section under specified key
- * \param section
- * \param key
- * \param buffer
- * \return return true on success
- */
- bool GetLocalProfileString(std::string section, std::string key, std::string& buffer);
+ * \param section
+ * \param key
+ * \param buffer
+ * \return return true on success
+ */
+ bool GetStringProperty(std::string section, std::string key, std::string& buffer);
/** Sets int value in section under specified key
- * \param section
- * \param key
- * \param value
- * \return return true on success
- */
- bool SetLocalProfileInt(std::string section, std::string key, int value);
+ * \param section
+ * \param key
+ * \param value
+ * \return return true on success
+ */
+ bool SetIntProperty(std::string section, std::string key, int value);
/** Gets int value in section under specified key
- * \param section
- * \param key
- * \param value
- * \return return true on success
- */
- bool GetLocalProfileInt(std::string section, std::string key, int &value);
+ * \param section
+ * \param key
+ * \param value
+ * \return return true on success
+ */
+ bool GetIntProperty(std::string section, std::string key, int &value);
/** Sets float value in section under specified key
- * \param section
- * \param key
- * \param value
- * \return return true on success
- */
- bool SetLocalProfileFloat(std::string section, std::string key, float value);
+ * \param section
+ * \param key
+ * \param value
+ * \return return true on success
+ */
+ bool SetFloatProperty(std::string section, std::string key, float value);
/** Gets float value in section under specified key
- * \param section
- * \param key
- * \param value
- * \return return true on success
- */
- bool GetLocalProfileFloat(std::string section, std::string key, float &value);
+ * \param section
+ * \param key
+ * \param value
+ * \return return true on success
+ */
+ bool GetFloatProperty(std::string section, std::string key, float &value);
/** Gets all values in section under specified key
- * \param section
- * \param key
- * \return vector of values
- */
- std::vector< std::string > GetLocalProfileSection(std::string section, std::string key);
-
- /** Sets current user directory
- * \param dir
- */
- void SetUserDir(std::string dir);
-
- /** Returns path based on current user. Replaces %user% in path with current user dir or
- * uses default_dir param if no user dir is specified
- * \param dir
- * \param default_dir
- * \return path
- */
- std::string GetUserBasedPath(std::string dir, std::string default_dir);
-
- /** opy a file into the temporary folder.
- * \param filename
- * \return true on success
- */
- bool CopyFileToTemp(std::string filename);
+ * \param section
+ * \param key
+ * \return vector of values
+ */
+ std::vector< std::string > GetSection(std::string section, std::string key);
private:
boost::property_tree::ptree m_propertyTree;
bool m_profileNeedSave;
- std::string m_userDirectory;
+ bool m_useCurrentDirectory;
};
//! Global function to get profile instance
diff --git a/src/common/resources/inputstream.cpp b/src/common/resources/inputstream.cpp
new file mode 100644
index 0000000..57d1305
--- /dev/null
+++ b/src/common/resources/inputstream.cpp
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "common/resources/inputstream.h"
+#include "common/resources/inputstreambuffer.h"
+
+
+CInputStream::CInputStream() : std::istream(new CInputStreamBuffer())
+{
+}
+
+CInputStream::CInputStream(const std::string& filename) : std::istream(new CInputStreamBuffer())
+{
+ open(filename);
+}
+
+
+CInputStream::~CInputStream()
+{
+ delete rdbuf();
+}
+
+
+void CInputStream::open(const std::string& filename)
+{
+ static_cast<CInputStreamBuffer *>(rdbuf())->open(filename);
+}
+
+
+void CInputStream::close()
+{
+ static_cast<CInputStreamBuffer *>(rdbuf())->close();
+}
+
+
+bool CInputStream::is_open()
+{
+ return static_cast<CInputStreamBuffer *>(rdbuf())->is_open();
+}
+
+
+size_t CInputStream::size()
+{
+ return static_cast<CInputStreamBuffer *>(rdbuf())->size();
+}
diff --git a/src/common/resources/inputstream.h b/src/common/resources/inputstream.h
new file mode 100644
index 0000000..74e17b2
--- /dev/null
+++ b/src/common/resources/inputstream.h
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#pragma once
+
+#include <istream>
+#include <string>
+
+
+class CInputStream : public std::istream
+{
+public:
+ CInputStream();
+ CInputStream(const std::string& filename);
+ virtual ~CInputStream();
+
+ void open(const std::string& filename);
+ void close();
+ bool is_open();
+ size_t size();
+};
diff --git a/src/common/resources/inputstreambuffer.cpp b/src/common/resources/inputstreambuffer.cpp
new file mode 100644
index 0000000..9ac1fec
--- /dev/null
+++ b/src/common/resources/inputstreambuffer.cpp
@@ -0,0 +1,134 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "common/resources/inputstreambuffer.h"
+
+#include "common/resources/resourcemanager.h"
+
+#include <stdexcept>
+#include <sstream>
+
+CInputStreamBuffer::CInputStreamBuffer(size_t buffer_size) : m_buffer_size(buffer_size)
+{
+ if (buffer_size <= 0)
+ {
+ throw std::runtime_error("File buffer must be larger then 0 bytes");
+ }
+
+ m_buffer = new char[buffer_size];
+ m_file = nullptr;
+}
+
+
+CInputStreamBuffer::~CInputStreamBuffer()
+{
+ close();
+ delete m_buffer;
+}
+
+
+void CInputStreamBuffer::open(const std::string &filename)
+{
+ if (PHYSFS_isInit())
+ m_file = PHYSFS_openRead(CResourceManager::CleanPath(filename).c_str());
+}
+
+
+void CInputStreamBuffer::close()
+{
+ if (is_open())
+ PHYSFS_close(m_file);
+}
+
+
+bool CInputStreamBuffer::is_open()
+{
+ return m_file;
+}
+
+
+size_t CInputStreamBuffer::size()
+{
+ return PHYSFS_fileLength(m_file);
+}
+
+
+std::streambuf::int_type CInputStreamBuffer::underflow()
+{
+ if (gptr() < egptr())
+ return traits_type::to_int_type(*gptr());
+
+ if (PHYSFS_eof(m_file))
+ return traits_type::eof();
+
+ PHYSFS_sint64 read_count = PHYSFS_read(m_file, m_buffer, sizeof(char), m_buffer_size);
+ if (read_count <= 0)
+ return traits_type::eof();
+
+ setg(m_buffer, m_buffer, m_buffer + read_count);
+
+ return traits_type::to_int_type(*gptr());
+}
+
+
+std::streampos CInputStreamBuffer::seekpos(std::streampos sp, std::ios_base::openmode which)
+{
+ return seekoff(off_type(sp), std::ios_base::beg, which);
+}
+
+
+std::streampos CInputStreamBuffer::seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which)
+{
+ /* A bit of explanation:
+ We are reading file by m_buffer_size parts so our 3 internal pointers will be
+ * eback (not used here) - start of block
+ * gptr - position of read cursor in block
+ * egtpr - end of block
+ off argument is relative to way */
+
+ std::streamoff new_position;
+
+ switch (way)
+ {
+ case std::ios_base::beg:
+ new_position = off;
+ break;
+
+ case std::ios_base::cur:
+ // tell will give cursor at begining of block so we have to add where in block we currently are
+ new_position = off + static_cast<off_type>(PHYSFS_tell(m_file)) - static_cast<off_type> (egptr() - gptr());
+ break;
+
+ case std::ios_base::end:
+ new_position = off + static_cast<off_type>(PHYSFS_fileLength(m_file));
+ break;
+
+ default:
+ break;
+ }
+
+ if (PHYSFS_seek(m_file, new_position))
+ {
+ setg(m_buffer, m_buffer, m_buffer); // reset buffer
+
+ return pos_type(new_position);
+ }
+
+ return pos_type(off_type(-1));
+}
diff --git a/src/common/resources/inputstreambuffer.h b/src/common/resources/inputstreambuffer.h
new file mode 100644
index 0000000..8c45c22
--- /dev/null
+++ b/src/common/resources/inputstreambuffer.h
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#pragma once
+
+#include <streambuf>
+#include <string>
+#include <physfs.h>
+
+class CInputStreamBuffer : public std::streambuf
+{
+public:
+ CInputStreamBuffer(size_t buffer_size = 512);
+ virtual ~CInputStreamBuffer();
+
+ void open(const std::string &filename);
+ void close();
+ bool is_open();
+ size_t size();
+
+private:
+ int_type underflow();
+
+ std::streampos seekpos(std::streampos sp, std::ios_base::openmode which);
+ std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which);
+
+ // copy ctor and assignment not implemented;
+ // copying not allowed
+ CInputStreamBuffer(const CInputStreamBuffer &);
+ CInputStreamBuffer &operator= (const CInputStreamBuffer &);
+
+ PHYSFS_File *m_file;
+ char *m_buffer;
+ size_t m_buffer_size;
+};
diff --git a/src/common/resources/outputstream.cpp b/src/common/resources/outputstream.cpp
new file mode 100644
index 0000000..e88520e
--- /dev/null
+++ b/src/common/resources/outputstream.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "common/resources/outputstream.h"
+#include "common/resources/outputstreambuffer.h"
+
+
+COutputStream::COutputStream() : std::ostream(new COutputStreamBuffer())
+{
+}
+
+COutputStream::COutputStream(const std::string& filename) : std::ostream(new COutputStreamBuffer())
+{
+ open(filename);
+}
+
+
+COutputStream::~COutputStream()
+{
+ delete rdbuf();
+}
+
+
+void COutputStream::open(const std::string& filename)
+{
+ static_cast<COutputStreamBuffer *>(rdbuf())->open(filename);
+}
+
+
+void COutputStream::close()
+{
+ static_cast<COutputStreamBuffer *>(rdbuf())->close();
+}
+
+
+bool COutputStream::is_open()
+{
+ return static_cast<COutputStreamBuffer *>(rdbuf())->is_open();
+}
diff --git a/src/common/resources/outputstream.h b/src/common/resources/outputstream.h
new file mode 100644
index 0000000..30b9429
--- /dev/null
+++ b/src/common/resources/outputstream.h
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#pragma once
+
+#include <ostream>
+#include <string>
+
+
+class COutputStream : public std::ostream
+{
+public:
+ COutputStream();
+ COutputStream(const std::string& filename);
+ virtual ~COutputStream();
+
+ void open(const std::string& filename);
+ void close();
+ bool is_open();
+};
diff --git a/src/common/resources/outputstreambuffer.cpp b/src/common/resources/outputstreambuffer.cpp
new file mode 100644
index 0000000..157e17d
--- /dev/null
+++ b/src/common/resources/outputstreambuffer.cpp
@@ -0,0 +1,91 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "common/resources/outputstreambuffer.h"
+
+#include "common/resources/resourcemanager.h"
+
+#include <stdexcept>
+#include <sstream>
+
+COutputStreamBuffer::COutputStreamBuffer(size_t buffer_size) : m_buffer_size(buffer_size)
+{
+ m_file = nullptr;
+ m_buffer = new char[buffer_size];
+ setp(m_buffer, m_buffer + buffer_size);
+}
+
+
+COutputStreamBuffer::~COutputStreamBuffer()
+{
+ close();
+ delete m_buffer;
+}
+
+
+void COutputStreamBuffer::open(const std::string &filename)
+{
+ if (PHYSFS_isInit())
+ m_file = PHYSFS_openWrite(CResourceManager::CleanPath(filename).c_str());
+}
+
+
+void COutputStreamBuffer::close()
+{
+ sync();
+ if (is_open())
+ PHYSFS_close(m_file);
+}
+
+
+bool COutputStreamBuffer::is_open()
+{
+ return m_file;
+}
+
+
+std::streambuf::int_type COutputStreamBuffer::overflow(std::streambuf::int_type ch)
+{
+ /* This function should be called when pptr() == epptr(). We use it also in sync()
+ so we also have to write data if buffer is not full. */
+
+ if (pbase() == pptr()) // no data to write, sync() called with empty buffer
+ return 0;
+
+ // save buffer
+ PHYSFS_sint64 bytes_written = PHYSFS_write(m_file, pbase(), 1, pptr() - pbase());
+ if (bytes_written <= 0)
+ return traits_type::eof();
+
+ pbump(-bytes_written);
+ // write final char
+ if (ch != traits_type::eof()) {
+ bytes_written = PHYSFS_write(m_file, &ch, 1, 1);
+ if (bytes_written <= 0)
+ return traits_type::eof();
+ }
+
+ return ch;
+}
+
+
+int COutputStreamBuffer::sync()
+{
+ return overflow(traits_type::eof());
+}
diff --git a/src/common/resources/outputstreambuffer.h b/src/common/resources/outputstreambuffer.h
new file mode 100644
index 0000000..758c4df
--- /dev/null
+++ b/src/common/resources/outputstreambuffer.h
@@ -0,0 +1,46 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#pragma once
+
+#include <streambuf>
+#include <string>
+#include <physfs.h>
+
+class COutputStreamBuffer : public std::streambuf
+{
+public:
+ COutputStreamBuffer(size_t buffer_size = 512);
+ virtual ~COutputStreamBuffer();
+ void open(const std::string &filename);
+ void close();
+ bool is_open();
+
+private:
+ int_type overflow(int_type ch);
+ int sync();
+
+ // copy ctor and assignment not implemented;
+ // copying not allowed
+ COutputStreamBuffer(const COutputStreamBuffer &);
+ COutputStreamBuffer &operator= (const COutputStreamBuffer &);
+ PHYSFS_File *m_file;
+ char *m_buffer;
+ size_t m_buffer_size;
+};
diff --git a/src/common/resources/resourcemanager.cpp b/src/common/resources/resourcemanager.cpp
new file mode 100644
index 0000000..475d71e
--- /dev/null
+++ b/src/common/resources/resourcemanager.cpp
@@ -0,0 +1,295 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+
+#include "common/resources/resourcemanager.h"
+
+#include "common/config.h"
+#include "common/logger.h"
+
+#include <physfs.h>
+
+#include <boost/filesystem.hpp>
+#include <boost/regex.hpp>
+
+namespace fs = boost::filesystem;
+
+namespace
+{
+ const Uint32 PHYSFS_RWOPS_TYPE = 0xc010b04f;
+}
+
+
+CResourceManager::CResourceManager(const char *argv0)
+{
+ if (!PHYSFS_init(argv0))
+ {
+ CLogger::GetInstancePointer()->Error("Error while initializing physfs\n");
+ }
+}
+
+
+CResourceManager::~CResourceManager()
+{
+ if (PHYSFS_isInit())
+ {
+ if (!PHYSFS_deinit())
+ {
+ CLogger::GetInstancePointer()->Error("Error while deinitializing physfs\n");
+ }
+ }
+}
+
+std::string CResourceManager::CleanPath(const std::string& path)
+{
+ return boost::regex_replace(path, boost::regex("(.*)/\\.\\./"), "");
+}
+
+
+bool CResourceManager::AddLocation(const std::string &location, bool prepend)
+{
+ if (PHYSFS_isInit())
+ {
+ if (!PHYSFS_mount(location.c_str(), nullptr, prepend ? 0 : 1))
+ {
+ CLogger::GetInstancePointer()->Error("Error while mounting \"%s\"\n", location.c_str());
+ }
+ }
+
+ return false;
+}
+
+
+bool CResourceManager::RemoveLocation(const std::string &location)
+{
+ if (PHYSFS_isInit())
+ {
+ if (!PHYSFS_removeFromSearchPath(location.c_str()))
+ {
+ CLogger::GetInstancePointer()->Error("Error while unmounting \"%s\"\n", location.c_str());
+ }
+ }
+
+ return false;
+}
+
+
+bool CResourceManager::SetSaveLocation(const std::string &location)
+{
+ if (PHYSFS_isInit())
+ {
+ if (!PHYSFS_setWriteDir(location.c_str()))
+ {
+ CLogger::GetInstancePointer()->Error("Error while setting save location to \"%s\"\n", location.c_str());
+ }
+ }
+
+ return false;
+}
+
+std::string CResourceManager::GetSaveLocation()
+{
+ if(PHYSFS_isInit()) {
+ return PHYSFS_getWriteDir();
+ }
+ return "";
+}
+
+
+SDL_RWops* CResourceManager::GetSDLFileHandler(const std::string &filename)
+{
+ SDL_RWops *handler = SDL_AllocRW();
+ if (!handler)
+ {
+ CLogger::GetInstancePointer()->Error("Unable to allocate SDL_RWops for \"%s\"\n", filename.c_str());
+ return nullptr;
+ }
+
+ if (!PHYSFS_isInit())
+ {
+ SDL_FreeRW(handler);
+ return nullptr;
+ }
+
+ PHYSFS_File *file = PHYSFS_openRead(CleanPath(filename).c_str());
+ if (!file)
+ {
+ SDL_FreeRW(handler);
+ return nullptr;
+ }
+
+ handler->seek = SDLSeek;
+ handler->read = SDLRead;
+ handler->write = SDLWrite;
+ handler->close = SDLClose;
+ handler->type = PHYSFS_RWOPS_TYPE;
+ handler->hidden.unknown.data1 = file;
+
+ return handler;
+}
+
+
+CSNDFile* CResourceManager::GetSNDFileHandler(const std::string &filename)
+{
+ return new CSNDFile(CleanPath(filename));
+}
+
+
+bool CResourceManager::Exists(const std::string &filename)
+{
+ return PHYSFS_exists(CleanPath(filename).c_str());
+}
+
+bool CResourceManager::DirectoryExists(const std::string& directory)
+{
+ return PHYSFS_exists(CleanPath(directory).c_str()) && PHYSFS_isDirectory(CleanPath(directory).c_str());
+}
+
+bool CResourceManager::CreateDirectory(const std::string& directory)
+{
+ return PHYSFS_mkdir(CleanPath(directory).c_str());
+}
+
+//TODO: Don't use boost filesystem here
+bool CResourceManager::RemoveDirectory(const std::string& directory)
+{
+ bool success = true;
+ std::string writeDir = PHYSFS_getWriteDir();
+ try
+ {
+ fs::remove_all(writeDir + "/" + CleanPath(directory));
+ }
+ catch (std::exception & e)
+ {
+ success = false;
+ }
+ return success;
+}
+
+std::vector<std::string> CResourceManager::ListFiles(const std::string &directory)
+{
+ std::vector<std::string> result;
+
+ char **files = PHYSFS_enumerateFiles(CleanPath(directory).c_str());
+
+ for (char **i = files; *i != nullptr; i++)
+ {
+ result.push_back(*i);
+ }
+
+ PHYSFS_freeList(files);
+
+ return result;
+}
+
+std::vector<std::string> CResourceManager::ListDirectories(const std::string &directory)
+{
+ std::vector<std::string> result;
+
+ char **files = PHYSFS_enumerateFiles(CleanPath(directory).c_str());
+
+ for (char **i = files; *i != nullptr; i++)
+ {
+ std::string path = CleanPath(directory) + "/" + (*i);
+ if (PHYSFS_isDirectory(path.c_str()))
+ {
+ result.push_back(*i);
+ }
+ }
+
+ PHYSFS_freeList(files);
+
+ return result;
+}
+
+
+int CResourceManager::SDLClose(SDL_RWops *context)
+{
+ if (CheckSDLContext(context))
+ {
+ PHYSFS_close(static_cast<PHYSFS_File *>(context->hidden.unknown.data1));
+ SDL_FreeRW(context);
+
+ return 0;
+ }
+
+ return 1;
+}
+
+
+int CResourceManager::SDLRead(SDL_RWops *context, void *ptr, int size, int maxnum)
+{
+ if (CheckSDLContext(context))
+ {
+ PHYSFS_File *file = static_cast<PHYSFS_File *>(context->hidden.unknown.data1);
+ SDL_memset(ptr, 0, size * maxnum);
+
+ return PHYSFS_read(file, ptr, size, maxnum);
+ }
+
+ return 0;
+}
+
+
+int CResourceManager::SDLWrite(SDL_RWops *context, const void *ptr, int size, int num)
+{
+ return 0;
+}
+
+
+int CResourceManager::SDLSeek(SDL_RWops *context, int offset, int whence)
+{
+ if (CheckSDLContext(context))
+ {
+ PHYSFS_File *file = static_cast<PHYSFS_File *>(context->hidden.unknown.data1);
+ int position, result;
+
+ switch (whence)
+ {
+ default:
+ case RW_SEEK_SET:
+ result = PHYSFS_seek(file, offset);
+ return result > 0 ? offset : -1;
+
+ case RW_SEEK_CUR:
+ position = offset + PHYSFS_tell(file);
+ result = PHYSFS_seek(file, position);
+ return result > 0 ? position : -1;
+
+ case RW_SEEK_END:
+ position = PHYSFS_fileLength(file) - offset;
+ result = PHYSFS_seek(file, position);
+ return result > 0 ? position : -1;
+ }
+ }
+
+ return -1;
+}
+
+
+bool CResourceManager::CheckSDLContext(SDL_RWops *context)
+{
+ if (context->type != PHYSFS_RWOPS_TYPE)
+ {
+ SDL_SetError("Wrong kind of RWops");
+ return false;
+ }
+
+ return true;
+}
diff --git a/src/common/resources/resourcemanager.h b/src/common/resources/resourcemanager.h
new file mode 100644
index 0000000..4d79e9b
--- /dev/null
+++ b/src/common/resources/resourcemanager.h
@@ -0,0 +1,66 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#pragma once
+
+#include <vector>
+#include <string>
+#include <SDL.h>
+
+#include "common/resources/sndfile.h"
+
+class CResourceManager
+{
+public:
+ CResourceManager(const char *argv0);
+ ~CResourceManager();
+
+ static std::string CleanPath(const std::string &path);
+
+ static bool AddLocation(const std::string &location, bool prepend = true);
+ static bool RemoveLocation(const std::string &location);
+
+ static bool SetSaveLocation(const std::string &location);
+ static std::string GetSaveLocation();
+
+ static SDL_RWops* GetSDLFileHandler(const std::string &filename);
+ static CSNDFile* GetSNDFileHandler(const std::string &filename);
+
+ //! Check if file exists
+ static bool Exists(const std::string &filename);
+ //! Check if file exists and is a directory
+ static bool DirectoryExists(const std::string& directory);
+
+ //! Create directory in write directory
+ static bool CreateDirectory(const std::string& directory);
+ //! Remove directory in write directory, recursively
+ static bool RemoveDirectory(const std::string& directory);
+
+ //! List files contained in directory
+ static std::vector<std::string> ListFiles(const std::string &directory);
+ //! List directories contained in directory
+ static std::vector<std::string> ListDirectories(const std::string &directory);
+
+private:
+ static int SDLSeek(SDL_RWops *context, int offset, int whence);
+ static int SDLRead(SDL_RWops *context, void *ptr, int size, int maxnum);
+ static int SDLWrite(SDL_RWops *context, const void *ptr, int size, int num);
+ static int SDLClose(SDL_RWops *context);
+ static bool CheckSDLContext(SDL_RWops *context);
+};
diff --git a/src/common/resources/sndfile.cpp b/src/common/resources/sndfile.cpp
new file mode 100644
index 0000000..d2330e1
--- /dev/null
+++ b/src/common/resources/sndfile.cpp
@@ -0,0 +1,133 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "common/resources/sndfile.h"
+
+#include <cstring>
+
+
+CSNDFile::CSNDFile(const std::string& filename)
+ : m_file_info{}
+ , m_snd_file{nullptr}
+ , m_file{nullptr}
+ , m_last_error{}
+ , m_snd_callbacks{SNDLength, SNDSeek, SNDRead, SNDWrite, SNDTell}
+{
+ if (PHYSFS_isInit())
+ {
+ m_file = PHYSFS_openRead(filename.c_str());
+ }
+ else
+ {
+ m_last_error = "Resource system not started!";
+ }
+ if (m_file)
+ {
+ m_snd_file = sf_open_virtual(&m_snd_callbacks, SFM_READ, &m_file_info, m_file);
+ if (!m_snd_file)
+ {
+ m_last_error = "Could not load file";
+ }
+ }
+ else
+ {
+ m_last_error = std::string(PHYSFS_getLastError());
+ }
+}
+
+
+CSNDFile::~CSNDFile()
+{
+ if (m_file)
+ {
+ PHYSFS_close(m_file);
+ if (m_snd_file)
+ {
+ sf_close(m_snd_file);
+ }
+ }
+}
+
+
+bool CSNDFile::IsOpen()
+{
+ return m_file && m_snd_file;
+}
+
+
+SF_INFO &CSNDFile::GetFileInfo()
+{
+ return m_file_info;
+}
+
+
+std::string& CSNDFile::GetLastError()
+{
+ return m_last_error;
+}
+
+
+sf_count_t CSNDFile::Read(short int *ptr, sf_count_t items)
+{
+ return sf_read_short(m_snd_file, ptr, items);
+}
+
+
+sf_count_t CSNDFile::SNDLength(void *data)
+{
+ return PHYSFS_fileLength(static_cast<PHYSFS_File *>(data));
+}
+
+
+sf_count_t CSNDFile::SNDRead(void *ptr, sf_count_t count, void *data)
+{
+ return PHYSFS_read(static_cast<PHYSFS_File *>(data), ptr, 1, count);
+}
+
+
+sf_count_t CSNDFile::SNDSeek(sf_count_t offset, int whence, void *data)
+{
+ PHYSFS_File *file = static_cast<PHYSFS_File *>(data);
+ switch(whence)
+ {
+ case SEEK_CUR:
+ PHYSFS_seek(file, PHYSFS_tell(file) + offset);
+ break;
+ case SEEK_SET:
+ PHYSFS_seek(file, offset);
+ break;
+ case SEEK_END:
+ PHYSFS_seek(file, PHYSFS_fileLength(file) + offset);
+ break;
+ }
+
+ return PHYSFS_tell(file);
+}
+
+
+sf_count_t CSNDFile::SNDTell(void *data)
+{
+ return PHYSFS_tell(static_cast<PHYSFS_File *>(data));
+}
+
+
+sf_count_t CSNDFile::SNDWrite(const void *ptr, sf_count_t count, void *data)
+{
+ return PHYSFS_write(static_cast<PHYSFS_File *>(data), ptr, 1, count);
+}
diff --git a/src/common/resources/sndfile.h b/src/common/resources/sndfile.h
new file mode 100644
index 0000000..f083666
--- /dev/null
+++ b/src/common/resources/sndfile.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#pragma once
+
+#include <string>
+#include <physfs.h>
+#include <sndfile.h>
+
+
+class CSNDFile
+{
+public:
+ CSNDFile(const std::string &filename);
+ virtual ~CSNDFile();
+
+ SF_INFO &GetFileInfo();
+ bool IsOpen();
+ std::string &GetLastError();
+ sf_count_t Read(short int *ptr, sf_count_t items);
+
+private:
+ static sf_count_t SNDLength(void *data);
+ static sf_count_t SNDSeek(sf_count_t offset, int whence, void *data);
+ static sf_count_t SNDRead(void *ptr, sf_count_t count, void *data);
+ static sf_count_t SNDWrite(const void *ptr, sf_count_t count, void *data);
+ static sf_count_t SNDTell(void *data);
+ SF_INFO m_file_info;
+ SNDFILE *m_snd_file;
+ PHYSFS_File *m_file;
+ std::string m_last_error;
+ SF_VIRTUAL_IO m_snd_callbacks;
+};
diff --git a/src/common/restext.cpp b/src/common/restext.cpp
index b63160d..66e3606 100644
--- a/src/common/restext.cpp
+++ b/src/common/restext.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/restext.h"
@@ -38,693 +41,697 @@ const char* stringsObject[OBJECT_MAX] = { nullptr };
const char* stringsErr[ERR_MAX] = { nullptr };
const char* stringsCbot[TX_MAX] = { nullptr };
+/* Macro to mark which texts are translatable by gettext
+ * It doesn't do anything at compile-time, as all texts represented here are used later
+ * in explicit call to gettext(), but it is used by xgettext executable to filter extracted
+ * texts from this file.
+ */
+#define TR(x) x
+
void InitializeRestext()
{
stringsText[RT_VERSION_ID] = COLOBOT_FULLNAME;
- stringsText[RT_DISINFO_TITLE] = "SatCom";
- stringsText[RT_WINDOW_MAXIMIZED] = "Maximize";
- stringsText[RT_WINDOW_MINIMIZED] = "Minimize";
- stringsText[RT_WINDOW_STANDARD] = "Normal size";
- stringsText[RT_WINDOW_CLOSE] = "Close";
-
- stringsText[RT_STUDIO_TITLE] = "Program editor";
- stringsText[RT_SCRIPT_NEW] = "New";
- stringsText[RT_NAME_DEFAULT] = "Player";
- stringsText[RT_IO_NEW] = "New ...";
- stringsText[RT_KEY_OR] = " or ";
-
- stringsText[RT_TITLE_BASE] = "COLOBOT";
- stringsText[RT_TITLE_INIT] = "COLOBOT: Gold Edition";
- stringsText[RT_TITLE_TRAINER] = "Programming exercises";
- 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";
- stringsText[RT_TITLE_PERSO] = "Customize your appearance";
- stringsText[RT_TITLE_WRITE] = "Save the current mission";
- stringsText[RT_TITLE_READ] = "Load a saved mission";
-
- stringsText[RT_PLAY_CHAPt] = " Chapters:";
- stringsText[RT_PLAY_CHAPd] = " Chapters:";
- stringsText[RT_PLAY_CHAPm] = " Planets:";
- stringsText[RT_PLAY_CHAPf] = " Planets:";
- stringsText[RT_PLAY_CHAPu] = " User levels:";
- stringsText[RT_PLAY_CHAPte] = " Chapters:";
- stringsText[RT_PLAY_LISTt] = " Exercises in the chapter:";
- stringsText[RT_PLAY_LISTd] = " Challenges in the chapter:";
- 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:";
- stringsText[RT_SETUP_MODE] = " Resolution:";
- stringsText[RT_SETUP_KEY1] = "1) First click on the key you want to redefine.";
- stringsText[RT_SETUP_KEY2] = "2) Then press the key you want to use instead.";
-
- stringsText[RT_PERSO_FACE] = "Face type:";
- stringsText[RT_PERSO_GLASSES] = "Eyeglasses:";
- stringsText[RT_PERSO_HAIR] = "Hair color:";
- stringsText[RT_PERSO_COMBI] = "Suit color:";
- stringsText[RT_PERSO_BAND] = "Strip color:";
-
- stringsText[RT_DIALOG_QUIT] = "Do you want to quit COLOBOT ?";
- stringsText[RT_DIALOG_TITLE] = "COLOBOT";
- stringsText[RT_DIALOG_YESQUIT] = "Quit\\Quit COLOBOT";
- stringsText[RT_DIALOG_ABORT] = "Quit the mission?";
- stringsText[RT_DIALOG_YES] = "Abort\\Abort the current mission";
- stringsText[RT_DIALOG_NO] = "Continue\\Continue the current mission";
- stringsText[RT_DIALOG_NOQUIT] = "Continue\\Continue the game";
- stringsText[RT_DIALOG_DELOBJ] = "Do you really want to destroy the selected building?";
- stringsText[RT_DIALOG_DELGAME] = "Do you want to delete %s's saved games? ";
- stringsText[RT_DIALOG_YESDEL] = "Delete";
- stringsText[RT_DIALOG_NODEL] = "Cancel";
- stringsText[RT_DIALOG_LOADING] = "LOADING";
-
- stringsText[RT_STUDIO_LISTTT] = "Keyword help(\\key cbot;)";
- stringsText[RT_STUDIO_COMPOK] = "Compilation ok (0 errors)";
- stringsText[RT_STUDIO_PROGSTOP] = "Program finished";
-
- stringsText[RT_SATCOM_LIST] = "\\b;List of objects\n";
- stringsText[RT_SATCOM_BOT] = "\\b;Robots\n";
- stringsText[RT_SATCOM_BUILDING] = "\\b;Buildings\n";
- stringsText[RT_SATCOM_FRET] = "\\b;Moveable objects\n";
- stringsText[RT_SATCOM_ALIEN] = "\\b;Aliens\n";
- stringsText[RT_SATCOM_NULL] = "\\c; (none)\\n;\n";
- stringsText[RT_SATCOM_ERROR1] = "\\b;Error\n";
- stringsText[RT_SATCOM_ERROR2] = "The list is only available if a \\l;radar station\\u object\\radar; is working.\n";
-
- stringsText[RT_IO_OPEN] = "Open";
- stringsText[RT_IO_SAVE] = "Save";
- stringsText[RT_IO_LIST] = "Folder: %s";
- stringsText[RT_IO_NAME] = "Name:";
- stringsText[RT_IO_DIR] = "Folder:";
- stringsText[RT_IO_PRIVATE] = "Private\\Private folder";
- stringsText[RT_IO_PUBLIC] = "Public\\Common folder";
-
- stringsText[RT_GENERIC_DEV1] = "Developed by :";
- stringsText[RT_GENERIC_DEV2] = "www.epsitec.com";
- stringsText[RT_GENERIC_EDIT1] = " ";
- stringsText[RT_GENERIC_EDIT2] = " ";
-
- stringsText[RT_INTERFACE_REC] = "Recorder";
-
-
-
- stringsEvent[EVENT_BUTTON_OK] = "OK";
- 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";
-
- stringsEvent[EVENT_INTERFACE_TRAINER] = "Exercises\\Programming exercises";
- 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";
- stringsEvent[EVENT_INTERFACE_AGAIN] = "Restart\\Restart the mission from the beginning";
- stringsEvent[EVENT_INTERFACE_WRITE] = "Save\\Save the current mission ";
- stringsEvent[EVENT_INTERFACE_READ] = "Load\\Load a saved mission";
- stringsEvent[EVENT_INTERFACE_ABORT] = "\\Return to COLOBOT";
- stringsEvent[EVENT_INTERFACE_QUIT] = "Quit\\Quit COLOBOT";
- stringsEvent[EVENT_INTERFACE_BACK] = "<< Back \\Back to the previous screen";
- stringsEvent[EVENT_INTERFACE_PLAY] = "Play\\Start mission!";
- stringsEvent[EVENT_INTERFACE_SETUPd] = "Device\\Driver and resolution settings";
- stringsEvent[EVENT_INTERFACE_SETUPg] = "Graphics\\Graphics settings";
- stringsEvent[EVENT_INTERFACE_SETUPp] = "Game\\Game settings";
- stringsEvent[EVENT_INTERFACE_SETUPc] = "Controls\\Keyboard, joystick and mouse settings";
- stringsEvent[EVENT_INTERFACE_SETUPs] = "Sound\\Music and game sound volume";
- stringsEvent[EVENT_INTERFACE_DEVICE] = "Unit";
- stringsEvent[EVENT_INTERFACE_RESOL] = "Resolution";
- stringsEvent[EVENT_INTERFACE_FULL] = "Full screen\\Full screen or window mode";
- stringsEvent[EVENT_INTERFACE_APPLY] = "Apply changes\\Activates the changed settings";
-
- stringsEvent[EVENT_INTERFACE_TOTO] = "Robbie\\Your assistant";
- stringsEvent[EVENT_INTERFACE_SHADOW] = "Shadows\\Shadows on the ground";
- stringsEvent[EVENT_INTERFACE_GROUND] = "Marks on the ground\\Marks on the ground";
- stringsEvent[EVENT_INTERFACE_DIRTY] = "Dust\\Dust and dirt on bots and buildings";
- stringsEvent[EVENT_INTERFACE_FOG] = "Fog\\Fog";
- stringsEvent[EVENT_INTERFACE_LENS] = "Sunbeams\\Sunbeams in the sky";
- stringsEvent[EVENT_INTERFACE_SKY] = "Sky\\Clouds and nebulae";
- stringsEvent[EVENT_INTERFACE_PLANET] = "Planets and stars\\Astronomical objects in the sky";
- stringsEvent[EVENT_INTERFACE_LIGHT] = "Dynamic lighting\\Mobile light sources";
- stringsEvent[EVENT_INTERFACE_PARTI] = "Number of particles\\Explosions, dust, reflections, etc.";
- stringsEvent[EVENT_INTERFACE_CLIP] = "Depth of field\\Maximum visibility";
- stringsEvent[EVENT_INTERFACE_DETAIL] = "Details\\Visual quality of 3D objects";
- stringsEvent[EVENT_INTERFACE_TEXTURE] = "Textures\\Quality of textures ";
- stringsEvent[EVENT_INTERFACE_GADGET] = "Num of decorative objects\\Number of purely ornamental objects";
- stringsEvent[EVENT_INTERFACE_RAIN] = "Particles in the interface\\Steam clouds and sparks in the interface";
- stringsEvent[EVENT_INTERFACE_GLINT] = "Reflections on the buttons \\Shiny buttons";
- stringsEvent[EVENT_INTERFACE_TOOLTIP] = "Help balloons\\Explain the function of the buttons";
- stringsEvent[EVENT_INTERFACE_MOVIES] = "Film sequences\\Films before and after the missions";
- stringsEvent[EVENT_INTERFACE_NICERST] = "Exit film\\Film at the exit of exercises";
- stringsEvent[EVENT_INTERFACE_HIMSELF] = "Friendly fire\\Your shooting can damage your own objects ";
- stringsEvent[EVENT_INTERFACE_SCROLL] = "Scrolling\\Scrolling when the mouse touches right or left border";
- stringsEvent[EVENT_INTERFACE_INVERTX] = "Mouse inversion X\\Inversion of the scrolling direction on the X axis";
- stringsEvent[EVENT_INTERFACE_INVERTY] = "Mouse inversion Y\\Inversion of the scrolling direction on the Y axis";
- stringsEvent[EVENT_INTERFACE_EFFECT] = "Quake at explosions\\The screen shakes at explosions";
- stringsEvent[EVENT_INTERFACE_MOUSE] = "Mouse shadow\\Gives the mouse a shadow";
- stringsEvent[EVENT_INTERFACE_EDITMODE] = "Automatic indent\\When program editing";
- stringsEvent[EVENT_INTERFACE_EDITVALUE] = "Big indent\\Indent 2 or 4 spaces per level defined by braces";
- stringsEvent[EVENT_INTERFACE_SOLUCE4] = "Access to solutions\\Show program \"4: Solution\" in the exercises";
-
- stringsEvent[EVENT_INTERFACE_KDEF] = "Standard controls\\Standard key functions";
- stringsEvent[EVENT_INTERFACE_KLEFT] = "Turn left\\turns the bot to the left";
- stringsEvent[EVENT_INTERFACE_KRIGHT] = "Turn right\\turns the bot to the right";
- stringsEvent[EVENT_INTERFACE_KUP] = "Forward\\Moves forward";
- stringsEvent[EVENT_INTERFACE_KDOWN] = "Backward\\Moves backward";
- stringsEvent[EVENT_INTERFACE_KGUP] = "Climb\\Increases the power of the jet";
- stringsEvent[EVENT_INTERFACE_KGDOWN] = "Descend\\Reduces the power of the jet";
- stringsEvent[EVENT_INTERFACE_KCAMERA] = "Change camera\\Switches between onboard camera and following camera";
- stringsEvent[EVENT_INTERFACE_KDESEL] = "Previous object\\Selects the previous object";
- stringsEvent[EVENT_INTERFACE_KACTION] = "Standard action\\Standard action of the bot (take/grab, shoot, sniff, etc)";
- stringsEvent[EVENT_INTERFACE_KNEAR] = "Camera closer\\Moves the camera forward";
- stringsEvent[EVENT_INTERFACE_KAWAY] = "Camera back\\Moves the camera backward";
- stringsEvent[EVENT_INTERFACE_KNEXT] = "Next object\\Selects the next object";
- stringsEvent[EVENT_INTERFACE_KHUMAN] = "Select the astronaut\\Selects the astronaut";
- stringsEvent[EVENT_INTERFACE_KQUIT] = "Quit\\Quit the current mission or exercise";
- stringsEvent[EVENT_INTERFACE_KHELP] = "Instructions\\Shows the instructions for the current mission";
- stringsEvent[EVENT_INTERFACE_KPROG] = "Programming help\\Gives more detailed help with programming";
- stringsEvent[EVENT_INTERFACE_KCBOT] = "Key word help\\More detailed help about key words";
- stringsEvent[EVENT_INTERFACE_KVISIT] = "Origin of last message\\Shows where the last message was sent from";
- stringsEvent[EVENT_INTERFACE_KSPEED10] = "Speed 1.0x\\Normal speed";
- stringsEvent[EVENT_INTERFACE_KSPEED15] = "Speed 1.5x\\1.5 times faster";
- stringsEvent[EVENT_INTERFACE_KSPEED20] = "Speed 2.0x\\Double speed";
- stringsEvent[EVENT_INTERFACE_KSPEED30] = "Speed 3.0x\\Three times faster";
-
- stringsEvent[EVENT_INTERFACE_VOLSOUND] = "Sound effects:\\Volume of engines, voice, shooting, etc.";
- stringsEvent[EVENT_INTERFACE_VOLMUSIC] = "Background sound :\\Volume of audio tracks on the CD";
- stringsEvent[EVENT_INTERFACE_SOUND3D] = "3D sound\\3D positioning of the sound";
-
- stringsEvent[EVENT_INTERFACE_MIN] = "Lowest\\Minimum graphic quality (highest frame rate)";
- stringsEvent[EVENT_INTERFACE_NORM] = "Normal\\Normal graphic quality";
- stringsEvent[EVENT_INTERFACE_MAX] = "Highest\\Highest graphic quality (lowest frame rate)";
-
- stringsEvent[EVENT_INTERFACE_SILENT] = "Mute\\No sound";
- stringsEvent[EVENT_INTERFACE_NOISY] = "Normal\\Normal sound volume";
-
- stringsEvent[EVENT_INTERFACE_JOYSTICK] = "Use a joystick\\Joystick or keyboard";
- stringsEvent[EVENT_INTERFACE_SOLUCE] = "Access to solution\\Shows the solution (detailed instructions for missions)";
-
- stringsEvent[EVENT_INTERFACE_NEDIT] = "\\New player name";
- stringsEvent[EVENT_INTERFACE_NOK] = "OK\\Choose the selected player";
- stringsEvent[EVENT_INTERFACE_NCANCEL] = "Cancel\\Keep current player name";
- stringsEvent[EVENT_INTERFACE_NDELETE] = "Delete player\\Deletes the player from the list";
- stringsEvent[EVENT_INTERFACE_NLABEL] = "Player name";
-
- stringsEvent[EVENT_INTERFACE_IOWRITE] = "Save\\Saves the current mission";
- stringsEvent[EVENT_INTERFACE_IOREAD] = "Load\\Loads the selected mission";
- stringsEvent[EVENT_INTERFACE_IOLIST] = "List of saved missions";
- stringsEvent[EVENT_INTERFACE_IOLABEL] = "Filename:";
- stringsEvent[EVENT_INTERFACE_IONAME] = "Mission name";
- stringsEvent[EVENT_INTERFACE_IOIMAGE] = "Photography";
- stringsEvent[EVENT_INTERFACE_IODELETE] = "Delete\\Deletes the selected file";
-
- stringsEvent[EVENT_INTERFACE_PERSO] = "Appearance\\Choose your appearance";
- stringsEvent[EVENT_INTERFACE_POK] = "OK";
- stringsEvent[EVENT_INTERFACE_PCANCEL] = "Cancel";
- stringsEvent[EVENT_INTERFACE_PDEF] = "Standard\\Standard appearance settings";
- stringsEvent[EVENT_INTERFACE_PHEAD] = "Head\\Face and hair";
- stringsEvent[EVENT_INTERFACE_PBODY] = "Suit\\Astronaut suit";
- stringsEvent[EVENT_INTERFACE_PLROT] = "\\Turn left";
- stringsEvent[EVENT_INTERFACE_PRROT] = "\\Turn right";
- stringsEvent[EVENT_INTERFACE_PCRa] = "Red";
- stringsEvent[EVENT_INTERFACE_PCGa] = "Green";
- stringsEvent[EVENT_INTERFACE_PCBa] = "Blue";
- stringsEvent[EVENT_INTERFACE_PCRb] = "Red";
- stringsEvent[EVENT_INTERFACE_PCGb] = "Green";
- stringsEvent[EVENT_INTERFACE_PCBb] = "Blue";
- stringsEvent[EVENT_INTERFACE_PFACE1] = "\\Face 1";
- stringsEvent[EVENT_INTERFACE_PFACE2] = "\\Face 4";
- stringsEvent[EVENT_INTERFACE_PFACE3] = "\\Face 3";
- stringsEvent[EVENT_INTERFACE_PFACE4] = "\\Face 2";
- stringsEvent[EVENT_INTERFACE_PGLASS0] = "\\No eyeglasses";
- stringsEvent[EVENT_INTERFACE_PGLASS1] = "\\Eyeglasses 1";
- stringsEvent[EVENT_INTERFACE_PGLASS2] = "\\Eyeglasses 2";
- stringsEvent[EVENT_INTERFACE_PGLASS3] = "\\Eyeglasses 3";
- stringsEvent[EVENT_INTERFACE_PGLASS4] = "\\Eyeglasses 4";
- stringsEvent[EVENT_INTERFACE_PGLASS5] = "\\Eyeglasses 5";
-
- stringsEvent[EVENT_OBJECT_DESELECT] = "Previous selection (\\key desel;)";
- stringsEvent[EVENT_OBJECT_LEFT] = "Turn left (\\key left;)";
- stringsEvent[EVENT_OBJECT_RIGHT] = "Turn right (\\key right;)";
- stringsEvent[EVENT_OBJECT_UP] = "Forward (\\key up;)";
- stringsEvent[EVENT_OBJECT_DOWN] = "Backward (\\key down;)";
- stringsEvent[EVENT_OBJECT_GASUP] = "Up (\\key gup;)";
- stringsEvent[EVENT_OBJECT_GASDOWN] = "Down (\\key gdown;)";
- stringsEvent[EVENT_OBJECT_HTAKE] = "Grab or drop (\\key action;)";
- stringsEvent[EVENT_OBJECT_MTAKE] = "Grab or drop (\\key action;)";
- stringsEvent[EVENT_OBJECT_MFRONT] = "..in front";
- stringsEvent[EVENT_OBJECT_MBACK] = "..behind";
- stringsEvent[EVENT_OBJECT_MPOWER] = "..power cell";
- stringsEvent[EVENT_OBJECT_BHELP] = "Instructions for the mission (\\key help;)";
- stringsEvent[EVENT_OBJECT_BTAKEOFF] = "Take off to finish the mission";
- stringsEvent[EVENT_OBJECT_BDESTROY] = "Destroy";
- stringsEvent[EVENT_OBJECT_BDERRICK] = "Build a derrick";
- stringsEvent[EVENT_OBJECT_BSTATION] = "Build a power station";
- stringsEvent[EVENT_OBJECT_BFACTORY] = "Build a bot factory";
- stringsEvent[EVENT_OBJECT_BREPAIR] = "Build a repair center";
- stringsEvent[EVENT_OBJECT_BCONVERT] = "Build a converter";
- stringsEvent[EVENT_OBJECT_BTOWER] = "Build a defense tower";
- stringsEvent[EVENT_OBJECT_BRESEARCH] = "Build a research center";
- stringsEvent[EVENT_OBJECT_BRADAR] = "Build a radar station";
- stringsEvent[EVENT_OBJECT_BENERGY] = "Build a power cell factory";
- stringsEvent[EVENT_OBJECT_BLABO] = "Build an autolab";
- stringsEvent[EVENT_OBJECT_BNUCLEAR] = "Build a nuclear power plant";
- stringsEvent[EVENT_OBJECT_BPARA] = "Build a lightning conductor";
- stringsEvent[EVENT_OBJECT_BINFO] = "Build a exchange post";
- stringsEvent[EVENT_OBJECT_BDESTROYER] = "Build a destroyer";
- stringsEvent[EVENT_OBJECT_GFLAT] = "Show if the ground is flat";
- stringsEvent[EVENT_OBJECT_FCREATE] = "Plant a flag";
- stringsEvent[EVENT_OBJECT_FDELETE] = "Remove a flag";
- stringsEvent[EVENT_OBJECT_FCOLORb] = "\\Blue flags";
- stringsEvent[EVENT_OBJECT_FCOLORr] = "\\Red flags";
- stringsEvent[EVENT_OBJECT_FCOLORg] = "\\Green flags";
- stringsEvent[EVENT_OBJECT_FCOLORy] = "\\Yellow flags";
- stringsEvent[EVENT_OBJECT_FCOLORv] = "\\Violet flags";
- stringsEvent[EVENT_OBJECT_FACTORYfa] = "Build a winged grabber";
- stringsEvent[EVENT_OBJECT_FACTORYta] = "Build a tracked grabber";
- stringsEvent[EVENT_OBJECT_FACTORYwa] = "Build a wheeled grabber";
- stringsEvent[EVENT_OBJECT_FACTORYia] = "Build a legged grabber";
- stringsEvent[EVENT_OBJECT_FACTORYfc] = "Build a winged shooter";
- stringsEvent[EVENT_OBJECT_FACTORYtc] = "Build a tracked shooter";
- stringsEvent[EVENT_OBJECT_FACTORYwc] = "Build a wheeled shooter";
- stringsEvent[EVENT_OBJECT_FACTORYic] = "Build a legged shooter";
- stringsEvent[EVENT_OBJECT_FACTORYfi] = "Build a winged orga shooter";
- stringsEvent[EVENT_OBJECT_FACTORYti] = "Build a tracked orga shooter";
- stringsEvent[EVENT_OBJECT_FACTORYwi] = "Build a wheeled orga shooter";
- stringsEvent[EVENT_OBJECT_FACTORYii] = "Build a legged orga shooter";
- stringsEvent[EVENT_OBJECT_FACTORYfs] = "Build a winged sniffer";
- stringsEvent[EVENT_OBJECT_FACTORYts] = "Build a tracked sniffer";
- stringsEvent[EVENT_OBJECT_FACTORYws] = "Build a wheeled sniffer";
- stringsEvent[EVENT_OBJECT_FACTORYis] = "Build a legged sniffer";
- stringsEvent[EVENT_OBJECT_FACTORYrt] = "Build a thumper";
- stringsEvent[EVENT_OBJECT_FACTORYrc] = "Build a phazer shooter";
- stringsEvent[EVENT_OBJECT_FACTORYrr] = "Build a recycler";
- stringsEvent[EVENT_OBJECT_FACTORYrs] = "Build a shielder";
- stringsEvent[EVENT_OBJECT_FACTORYsa] = "Build a subber";
- stringsEvent[EVENT_OBJECT_RTANK] = "Run research program for tracked bots";
- stringsEvent[EVENT_OBJECT_RFLY] = "Run research program for winged bots";
- stringsEvent[EVENT_OBJECT_RTHUMP] = "Run research program for thumper";
- stringsEvent[EVENT_OBJECT_RCANON] = "Run research program for shooter";
- stringsEvent[EVENT_OBJECT_RTOWER] = "Run research program for defense tower";
- stringsEvent[EVENT_OBJECT_RPHAZER] = "Run research program for phazer shooter";
- stringsEvent[EVENT_OBJECT_RSHIELD] = "Run research program for shielder";
- stringsEvent[EVENT_OBJECT_RATOMIC] = "Run research program for nuclear power";
- stringsEvent[EVENT_OBJECT_RiPAW] = "Run research program for legged bots";
- stringsEvent[EVENT_OBJECT_RiGUN] = "Run research program for orga shooter";
- stringsEvent[EVENT_OBJECT_RESET] = "Return to start";
- stringsEvent[EVENT_OBJECT_SEARCH] = "Sniff (\\key action;)";
- stringsEvent[EVENT_OBJECT_TERRAFORM] = "Thump (\\key action;)";
- stringsEvent[EVENT_OBJECT_FIRE] = "Shoot (\\key action;)";
- stringsEvent[EVENT_OBJECT_SPIDEREXPLO] = "Explode (\\key action;)";
- stringsEvent[EVENT_OBJECT_RECOVER] = "Recycle (\\key action;)";
- stringsEvent[EVENT_OBJECT_BEGSHIELD] = "Extend shield (\\key action;)";
- stringsEvent[EVENT_OBJECT_ENDSHIELD] = "Withdraw shield (\\key action;)";
- stringsEvent[EVENT_OBJECT_DIMSHIELD] = "Shield radius";
- stringsEvent[EVENT_OBJECT_PROGRUN] = "Execute the selected program";
- stringsEvent[EVENT_OBJECT_PROGEDIT] = "Edit the selected program";
- stringsEvent[EVENT_OBJECT_INFOOK] = "\\SatCom on standby";
- stringsEvent[EVENT_OBJECT_DELETE] = "Destroy the building";
- stringsEvent[EVENT_OBJECT_GENERGY] = "Energy level";
- stringsEvent[EVENT_OBJECT_GSHIELD] = "Shield level";
- stringsEvent[EVENT_OBJECT_GRANGE] = "Jet temperature";
- stringsEvent[EVENT_OBJECT_GPROGRESS] = "Still working ...";
- stringsEvent[EVENT_OBJECT_GRADAR] = "Number of insects detected";
- stringsEvent[EVENT_OBJECT_GINFO] = "Transmitted information";
- stringsEvent[EVENT_OBJECT_COMPASS] = "Compass";
- stringsEvent[EVENT_OBJECT_MAPZOOM] = "Zoom mini-map";
- stringsEvent[EVENT_OBJECT_CAMERA] = "Camera (\\key camera;)";
- stringsEvent[EVENT_OBJECT_CAMERAleft] = "Camera to left";
- stringsEvent[EVENT_OBJECT_CAMERAright] = "Camera to right";
- stringsEvent[EVENT_OBJECT_CAMERAnear] = "Camera nearest";
- stringsEvent[EVENT_OBJECT_CAMERAaway] = "Camera awayest";
- stringsEvent[EVENT_OBJECT_HELP] = "Help about selected object";
- stringsEvent[EVENT_OBJECT_SOLUCE] = "Show the solution";
- stringsEvent[EVENT_OBJECT_SHORTCUT00] = "Switch bots <-> buildings";
- stringsEvent[EVENT_OBJECT_LIMIT] = "Show the range";
- stringsEvent[EVENT_OBJECT_PEN0] = "\\Raise the pencil";
- stringsEvent[EVENT_OBJECT_PEN1] = "\\Use the black pencil";
- stringsEvent[EVENT_OBJECT_PEN2] = "\\Use the yellow pencil";
- stringsEvent[EVENT_OBJECT_PEN3] = "\\Use the orange pencil";
- stringsEvent[EVENT_OBJECT_PEN4] = "\\Use the red pencil";
- stringsEvent[EVENT_OBJECT_PEN5] = "\\Use the purple pencil";
- stringsEvent[EVENT_OBJECT_PEN6] = "\\Use the blue pencil";
- stringsEvent[EVENT_OBJECT_PEN7] = "\\Use the green pencil";
- stringsEvent[EVENT_OBJECT_PEN8] = "\\Use the brown pencil";
- stringsEvent[EVENT_OBJECT_REC] = "\\Start recording";
- stringsEvent[EVENT_OBJECT_STOP] = "\\Stop recording";
- stringsEvent[EVENT_DT_VISIT0] = "Show the place";
- stringsEvent[EVENT_DT_VISIT1] = "Show the place";
- stringsEvent[EVENT_DT_VISIT2] = "Show the place";
- stringsEvent[EVENT_DT_VISIT3] = "Show the place";
- stringsEvent[EVENT_DT_VISIT4] = "Show the place";
- stringsEvent[EVENT_DT_END] = "Continue";
- stringsEvent[EVENT_CMD] = "Command line";
- stringsEvent[EVENT_SPEED] = "Game speed";
-
- stringsEvent[EVENT_HYPER_PREV] = "Back";
- stringsEvent[EVENT_HYPER_NEXT] = "Forward";
- stringsEvent[EVENT_HYPER_HOME] = "Home";
- stringsEvent[EVENT_HYPER_COPY] = "Copy";
- stringsEvent[EVENT_HYPER_SIZE1] = "Size 1";
- stringsEvent[EVENT_HYPER_SIZE2] = "Size 2";
- stringsEvent[EVENT_HYPER_SIZE3] = "Size 3";
- stringsEvent[EVENT_HYPER_SIZE4] = "Size 4";
- stringsEvent[EVENT_HYPER_SIZE5] = "Size 5";
- stringsEvent[EVENT_SATCOM_HUSTON] = "Instructions from Houston";
- stringsEvent[EVENT_SATCOM_SAT] = "Satellite report";
- stringsEvent[EVENT_SATCOM_LOADING] = "Programs dispatched by Houston";
- stringsEvent[EVENT_SATCOM_OBJECT] = "List of objects";
- stringsEvent[EVENT_SATCOM_PROG] = "Programming help";
- stringsEvent[EVENT_SATCOM_SOLUCE] = "Solution";
-
- stringsEvent[EVENT_STUDIO_OK] = "OK\\Close program editor and return to game";
- stringsEvent[EVENT_STUDIO_CANCEL] = "Cancel\\Cancel all changes";
- stringsEvent[EVENT_STUDIO_NEW] = "New";
- stringsEvent[EVENT_STUDIO_OPEN] = "Open (Ctrl+o)";
- stringsEvent[EVENT_STUDIO_SAVE] = "Save (Ctrl+s)";
- stringsEvent[EVENT_STUDIO_UNDO] = "Undo (Ctrl+z)";
- stringsEvent[EVENT_STUDIO_CUT] = "Cut (Ctrl+x)";
- stringsEvent[EVENT_STUDIO_COPY] = "Copy (Ctrl+c)";
- stringsEvent[EVENT_STUDIO_PASTE] = "Paste (Ctrl+v)";
- stringsEvent[EVENT_STUDIO_SIZE] = "Font size";
- stringsEvent[EVENT_STUDIO_TOOL] = "Instructions (\\key help;)";
- stringsEvent[EVENT_STUDIO_HELP] = "Programming help (\\key prog;)";
- stringsEvent[EVENT_STUDIO_COMPILE] = "Compile";
- stringsEvent[EVENT_STUDIO_RUN] = "Execute/stop";
- stringsEvent[EVENT_STUDIO_REALTIME] = "Pause/continue";
- stringsEvent[EVENT_STUDIO_STEP] = "One step";
-
-
-
- stringsObject[OBJECT_PORTICO] = "Gantry crane";
- stringsObject[OBJECT_BASE] = "Spaceship";
- stringsObject[OBJECT_DERRICK] = "Derrick";
- stringsObject[OBJECT_FACTORY] = "Bot factory";
- stringsObject[OBJECT_REPAIR] = "Repair center";
- stringsObject[OBJECT_DESTROYER] = "Destroyer";
- stringsObject[OBJECT_STATION] = "Power station";
- stringsObject[OBJECT_CONVERT] = "Converts ore to titanium";
- stringsObject[OBJECT_TOWER] = "Defense tower";
- stringsObject[OBJECT_NEST] = "Nest";
- stringsObject[OBJECT_RESEARCH] = "Research center";
- stringsObject[OBJECT_RADAR] = "Radar station";
- stringsObject[OBJECT_INFO] = "Information exchange post";
- stringsObject[OBJECT_ENERGY] = "Power cell factory";
- stringsObject[OBJECT_LABO] = "Autolab";
- stringsObject[OBJECT_NUCLEAR] = "Nuclear power station";
- stringsObject[OBJECT_PARA] = "Lightning conductor";
- stringsObject[OBJECT_SAFE] = "Vault";
- stringsObject[OBJECT_HUSTON] = "Houston Mission Control";
- stringsObject[OBJECT_TARGET1] = "Target";
- stringsObject[OBJECT_TARGET2] = "Target";
- stringsObject[OBJECT_START] = "Start";
- stringsObject[OBJECT_END] = "Finish";
- stringsObject[OBJECT_STONE] = "Titanium ore";
- stringsObject[OBJECT_URANIUM] = "Uranium ore";
- stringsObject[OBJECT_BULLET] = "Organic matter";
- stringsObject[OBJECT_METAL] = "Titanium";
- stringsObject[OBJECT_POWER] = "Power cell";
- stringsObject[OBJECT_ATOMIC] = "Nuclear power cell";
- stringsObject[OBJECT_BBOX] = "Black box";
- stringsObject[OBJECT_KEYa] = "Key A";
- stringsObject[OBJECT_KEYb] = "Key B";
- stringsObject[OBJECT_KEYc] = "Key C";
- stringsObject[OBJECT_KEYd] = "Key D";
- stringsObject[OBJECT_TNT] = "Explosive";
- stringsObject[OBJECT_BOMB] = "Fixed mine";
- stringsObject[OBJECT_BAG] = "Survival kit";
- stringsObject[OBJECT_WAYPOINT] = "Checkpoint";
- stringsObject[OBJECT_FLAGb] = "Blue flag";
- stringsObject[OBJECT_FLAGr] = "Red flag";
- stringsObject[OBJECT_FLAGg] = "Green flag";
- stringsObject[OBJECT_FLAGy] = "Yellow flag";
- stringsObject[OBJECT_FLAGv] = "Violet flag";
- stringsObject[OBJECT_MARKPOWER] = "Energy deposit (site for power station)";
- stringsObject[OBJECT_MARKURANIUM] = "Uranium deposit (site for derrick)";
- stringsObject[OBJECT_MARKKEYa] = "Found key A (site for derrick)";
- stringsObject[OBJECT_MARKKEYb] = "Found key B (site for derrick)";
- stringsObject[OBJECT_MARKKEYc] = "Found key C (site for derrick)";
- stringsObject[OBJECT_MARKKEYd] = "Found key D (site for derrick)";
- stringsObject[OBJECT_MARKSTONE] = "Titanium deposit (site for derrick)";
- stringsObject[OBJECT_MOBILEft] = "Practice bot";
- stringsObject[OBJECT_MOBILEtt] = "Practice bot";
- stringsObject[OBJECT_MOBILEwt] = "Practice bot";
- stringsObject[OBJECT_MOBILEit] = "Practice bot";
- stringsObject[OBJECT_MOBILEfa] = "Winged grabber";
- stringsObject[OBJECT_MOBILEta] = "Tracked grabber";
- stringsObject[OBJECT_MOBILEwa] = "Wheeled grabber";
- stringsObject[OBJECT_MOBILEia] = "Legged grabber";
- stringsObject[OBJECT_MOBILEfc] = "Winged shooter";
- stringsObject[OBJECT_MOBILEtc] = "Tracked shooter";
- stringsObject[OBJECT_MOBILEwc] = "Wheeled shooter";
- stringsObject[OBJECT_MOBILEic] = "Legged shooter";
- stringsObject[OBJECT_MOBILEfi] = "Winged orga shooter";
- stringsObject[OBJECT_MOBILEti] = "Tracked orga shooter";
- stringsObject[OBJECT_MOBILEwi] = "Wheeled orga shooter";
- stringsObject[OBJECT_MOBILEii] = "Legged orga shooter";
- stringsObject[OBJECT_MOBILEfs] = "Winged sniffer";
- stringsObject[OBJECT_MOBILEts] = "Tracked sniffer";
- stringsObject[OBJECT_MOBILEws] = "Wheeled sniffer";
- stringsObject[OBJECT_MOBILEis] = "Legged sniffer";
- stringsObject[OBJECT_MOBILErt] = "Thumper";
- stringsObject[OBJECT_MOBILErc] = "Phazer shooter";
- stringsObject[OBJECT_MOBILErr] = "Recycler";
- stringsObject[OBJECT_MOBILErs] = "Shielder";
- stringsObject[OBJECT_MOBILEsa] = "Subber";
- stringsObject[OBJECT_MOBILEtg] = "Target bot";
- stringsObject[OBJECT_MOBILEdr] = "Drawer bot";
- stringsObject[OBJECT_TECH] = "Engineer";
- stringsObject[OBJECT_TOTO] = "Robbie";
- stringsObject[OBJECT_MOTHER] = "Alien Queen";
- stringsObject[OBJECT_ANT] = "Ant";
- stringsObject[OBJECT_SPIDER] = "Spider";
- stringsObject[OBJECT_BEE] = "Wasp";
- stringsObject[OBJECT_WORM] = "Worm";
- stringsObject[OBJECT_EGG] = "Egg";
- stringsObject[OBJECT_RUINmobilew1] = "Wreckage";
- stringsObject[OBJECT_RUINmobilew2] = "Wreckage";
- stringsObject[OBJECT_RUINmobilet1] = "Wreckage";
- stringsObject[OBJECT_RUINmobilet2] = "Wreckage";
- stringsObject[OBJECT_RUINmobiler1] = "Wreckage";
- stringsObject[OBJECT_RUINmobiler2] = "Wreckage";
- stringsObject[OBJECT_RUINfactory] = "Ruin";
- stringsObject[OBJECT_RUINdoor] = "Ruin";
- stringsObject[OBJECT_RUINsupport] = "Waste";
- stringsObject[OBJECT_RUINradar] = "Ruin";
- stringsObject[OBJECT_RUINconvert] = "Ruin";
- stringsObject[OBJECT_RUINbase] = "Spaceship ruin";
- stringsObject[OBJECT_RUINhead] = "Spaceship ruin";
- stringsObject[OBJECT_APOLLO1] = "Remains of Apollo mission";
- stringsObject[OBJECT_APOLLO3] = "Remains of Apollo mission";
- stringsObject[OBJECT_APOLLO4] = "Remains of Apollo mission";
- stringsObject[OBJECT_APOLLO5] = "Remains of Apollo mission";
- stringsObject[OBJECT_APOLLO2] = "Lunar Roving Vehicle";
-
-
-
- stringsErr[ERR_GENERIC] = "Internal error - tell the developers";
- stringsErr[ERR_CMD] = "Unknown command";
- stringsErr[ERR_MANIP_VEH] = "Inappropriate bot";
- stringsErr[ERR_MANIP_FLY] = "Impossible when flying";
- stringsErr[ERR_MANIP_BUSY] = "Already carrying something";
- stringsErr[ERR_MANIP_NIL] = "Nothing to grab";
- stringsErr[ERR_MANIP_MOTOR] = "Impossible when moving";
- stringsErr[ERR_MANIP_OCC] = "Place occupied";
- stringsErr[ERR_MANIP_FRIEND] = "No other robot";
- stringsErr[ERR_MANIP_RADIO] = "You can not carry a radioactive object";
- stringsErr[ERR_MANIP_WATER] = "You can not carry an object under water";
- stringsErr[ERR_MANIP_EMPTY] = "Nothing to drop";
- stringsErr[ERR_BUILD_FLY] = "Impossible when flying";
- stringsErr[ERR_BUILD_WATER] = "Impossible under water";
- stringsErr[ERR_BUILD_ENERGY] = "Not enough energy";
- stringsErr[ERR_BUILD_METALAWAY] = "Titanium too far away";
- stringsErr[ERR_BUILD_METALNEAR] = "Titanium too close";
- stringsErr[ERR_BUILD_METALINEX] = "No titanium around";
- stringsErr[ERR_BUILD_FLAT] = "Ground not flat enough";
- stringsErr[ERR_BUILD_FLATLIT] = "Flat ground not large enough";
- stringsErr[ERR_BUILD_BUSY] = "Place occupied";
- stringsErr[ERR_BUILD_BASE] = "Too close to space ship";
- stringsErr[ERR_BUILD_NARROW] = "Too close to a building";
- stringsErr[ERR_BUILD_MOTOR] = "Impossible when moving";
- stringsErr[ERR_SEARCH_FLY] = "Impossible when flying";
- stringsErr[ERR_BUILD_DISABLED] = "Can not produce this object in this mission";
- stringsErr[ERR_BUILD_RESEARCH] = "Can not produce not researched object";
- stringsErr[ERR_SEARCH_VEH] = "Inappropriate bot";
- stringsErr[ERR_SEARCH_MOTOR] = "Impossible when moving";
- stringsErr[ERR_TERRA_VEH] = "Inappropriate bot";
- stringsErr[ERR_TERRA_ENERGY] = "Not enough energy";
- stringsErr[ERR_TERRA_FLOOR] = "Ground inappropriate";
- stringsErr[ERR_TERRA_BUILDING] = "Building too close";
- stringsErr[ERR_TERRA_OBJECT] = "Object too close";
- stringsErr[ERR_RECOVER_VEH] = "Inappropriate bot";
- stringsErr[ERR_RECOVER_ENERGY] = "Not enough energy";
- stringsErr[ERR_RECOVER_NULL] = "Nothing to recycle";
- stringsErr[ERR_SHIELD_VEH] = "Inappropriate bot";
- stringsErr[ERR_SHIELD_ENERGY] = "No more energy";
- stringsErr[ERR_MOVE_IMPOSSIBLE] = "Error in instruction move";
- stringsErr[ERR_FIND_IMPOSSIBLE] = "Object not found";
- stringsErr[ERR_GOTO_IMPOSSIBLE] = "Goto: inaccessible destination";
- stringsErr[ERR_GOTO_ITER] = "Goto: inaccessible destination";
- stringsErr[ERR_GOTO_BUSY] = "Goto: destination occupied";
- stringsErr[ERR_FIRE_VEH] = "Inappropriate bot";
- stringsErr[ERR_FIRE_ENERGY] = "Not enough energy";
- stringsErr[ERR_FIRE_FLY] = "Impossible when flying";
- stringsErr[ERR_CONVERT_EMPTY] = "No titanium ore to convert";
- stringsErr[ERR_DERRICK_NULL] = "No ore in the subsoil";
- stringsErr[ERR_STATION_NULL] = "No energy in the subsoil";
- stringsErr[ERR_TOWER_POWER] = "No power cell";
- stringsErr[ERR_TOWER_ENERGY] = "No more energy";
- stringsErr[ERR_RESEARCH_POWER] = "No power cell";
- stringsErr[ERR_RESEARCH_ENERGY] = "Not enough energy";
- stringsErr[ERR_RESEARCH_TYPE] = "Inappropriate cell type";
- stringsErr[ERR_RESEARCH_ALREADY]= "Research program already performed";
- stringsErr[ERR_ENERGY_NULL] = "No energy in the subsoil";
- stringsErr[ERR_ENERGY_LOW] = "Not enough energy yet";
- stringsErr[ERR_ENERGY_EMPTY] = "No titanium to transform";
- stringsErr[ERR_ENERGY_BAD] = "Transforms only titanium";
- stringsErr[ERR_BASE_DLOCK] = "Doors blocked by a robot or another object ";
- stringsErr[ERR_BASE_DHUMAN] = "You must get on the spaceship to take off ";
- stringsErr[ERR_LABO_NULL] = "Nothing to analyze";
- stringsErr[ERR_LABO_BAD] = "Analyzes only organic matter";
- stringsErr[ERR_LABO_ALREADY] = "Analysis already performed";
- stringsErr[ERR_NUCLEAR_NULL] = "No energy in the subsoil";
- stringsErr[ERR_NUCLEAR_LOW] = "Not yet enough energy";
- stringsErr[ERR_NUCLEAR_EMPTY] = "No uranium to transform";
- stringsErr[ERR_NUCLEAR_BAD] = "Transforms only uranium";
- stringsErr[ERR_FACTORY_NULL] = "No titanium";
- stringsErr[ERR_FACTORY_NEAR] = "Object too close";
- stringsErr[ERR_RESET_NEAR] = "Place occupied";
- stringsErr[ERR_INFO_NULL] = "No information exchange post within range";
- stringsErr[ERR_VEH_VIRUS] = "Program infected by a virus";
- stringsErr[ERR_BAT_VIRUS] = "Infected by a virus; temporarily out of order";
- stringsErr[ERR_VEH_POWER] = "No power cell";
- stringsErr[ERR_VEH_ENERGY] = "No more energy";
- stringsErr[ERR_FLAG_FLY] = "Impossible when flying";
- stringsErr[ERR_FLAG_WATER] = "Impossible when swimming";
- stringsErr[ERR_FLAG_MOTOR] = "Impossible when moving";
- stringsErr[ERR_FLAG_BUSY] = "Impossible when carrying an object";
- stringsErr[ERR_FLAG_CREATE] = "Too many flags of this color (maximum 5)";
- stringsErr[ERR_FLAG_PROXY] = "Too close to an existing flag";
- stringsErr[ERR_FLAG_DELETE] = "No flag nearby";
- stringsErr[ERR_DESTROY_NOTFOUND]= "Not found anything to destroy";
- stringsErr[ERR_WRONG_OBJ] = "Inappropriate object";
- stringsErr[ERR_MISSION_NOTERM] = "The mission is not accomplished yet (press \\key help; for more details)";
- stringsErr[ERR_DELETEMOBILE] = "Bot destroyed";
- stringsErr[ERR_DELETEBUILDING] = "Building destroyed";
- stringsErr[ERR_TOOMANY] = "Can not create this; there are too many objects";
- stringsErr[ERR_OBLIGATORYTOKEN] = "\"%s\" missing in this exercise";
- stringsErr[ERR_PROHIBITEDTOKEN] = "Do not use in this exercise";
-
- stringsErr[INFO_BUILD] = "Building completed";
- stringsErr[INFO_CONVERT] = "Titanium available";
- stringsErr[INFO_RESEARCH] = "Research program completed";
- stringsErr[INFO_RESEARCHTANK] = "Plans for tracked robots available ";
- stringsErr[INFO_RESEARCHFLY] = "You can fly with the keys (\\key gup;) and (\\key gdown;)";
- stringsErr[INFO_RESEARCHTHUMP] = "Plans for thumper available";
- stringsErr[INFO_RESEARCHCANON] = "Plans for shooter available";
- stringsErr[INFO_RESEARCHTOWER] = "Plans for defense tower available";
- stringsErr[INFO_RESEARCHPHAZER] = "Plans for phazer shooter available";
- stringsErr[INFO_RESEARCHSHIELD] = "Plans for shielder available";
- stringsErr[INFO_RESEARCHATOMIC] = "Plans for nuclear power plant available";
- stringsErr[INFO_FACTORY] = "New bot available";
- stringsErr[INFO_LABO] = "Analysis performed";
- stringsErr[INFO_ENERGY] = "Power cell available";
- stringsErr[INFO_NUCLEAR] = "Nuclear power cell available";
- stringsErr[INFO_FINDING] = "You found a usable object";
- stringsErr[INFO_MARKPOWER] = "Found a site for power station";
- stringsErr[INFO_MARKURANIUM] = "Found a site for a derrick";
- stringsErr[INFO_MARKSTONE] = "Found a site for a derrick";
- stringsErr[INFO_MARKKEYa] = "Found a site for a derrick";
- stringsErr[INFO_MARKKEYb] = "Found a site for a derrick";
- stringsErr[INFO_MARKKEYc] = "Found a site for a derrick";
- stringsErr[INFO_MARKKEYd] = "Found a site for a derrick";
- stringsErr[INFO_WIN] = "<<< Well done; mission accomplished >>>";
- stringsErr[INFO_LOST] = "<<< Sorry; mission failed >>>";
- stringsErr[INFO_LOSTq] = "<<< Sorry; mission failed >>>";
- stringsErr[INFO_WRITEOK] = "Current mission saved";
- stringsErr[INFO_DELETEPATH] = "Checkpoint crossed";
- stringsErr[INFO_DELETEMOTHER] = "Alien Queen killed";
- stringsErr[INFO_DELETEANT] = "Ant fatally wounded";
- stringsErr[INFO_DELETEBEE] = "Wasp fatally wounded";
- stringsErr[INFO_DELETEWORM] = "Worm fatally wounded";
- stringsErr[INFO_DELETESPIDER] = "Spider fatally wounded";
- stringsErr[INFO_BEGINSATCOM] = "Press \\key help; to read instructions on your SatCom";
-
-
-
- stringsCbot[TX_OPENPAR] = "Opening bracket missing";
- stringsCbot[TX_CLOSEPAR] = "Closing bracket missing ";
- stringsCbot[TX_NOTBOOL] = "The expression must return a boolean value";
- stringsCbot[TX_UNDEFVAR] = "Variable not declared";
- stringsCbot[TX_BADLEFT] = "Assignment impossible";
- stringsCbot[TX_ENDOF] = "Semicolon terminator missing";
- stringsCbot[TX_OUTCASE] = "Instruction \"case\" outside a block \"switch\"";
- stringsCbot[TX_NOTERM] = "Instructions after the final closing brace";
- stringsCbot[TX_CLOSEBLK] = "End of block missing";
- stringsCbot[TX_ELSEWITHOUTIF] = "Instruction \"else\" without corresponding \"if\" ";
- stringsCbot[TX_OPENBLK] = "Opening brace missing ";
- stringsCbot[TX_BADTYPE] = "Wrong type for the assignment";
- stringsCbot[TX_REDEFVAR] = "A variable can not be declared twice";
- stringsCbot[TX_BAD2TYPE] = "The types of the two operands are incompatible ";
- stringsCbot[TX_UNDEFCALL] = "Unknown function";
- stringsCbot[TX_MISDOTS] = "Sign \" : \" missing";
- stringsCbot[TX_WHILE] = "Keyword \"while\" missing";
- stringsCbot[TX_BREAK] = "Instruction \"break\" outside a loop";
- stringsCbot[TX_LABEL] = "A label must be followed by \"for\"; \"while\"; \"do\" or \"switch\"";
- stringsCbot[TX_NOLABEL] = "This label does not exist";
- stringsCbot[TX_NOCASE] = "Instruction \"case\" missing";
- stringsCbot[TX_BADNUM] = "Number missing";
- stringsCbot[TX_VOID] = "Void parameter";
- stringsCbot[TX_NOTYP] = "Type declaration missing";
- stringsCbot[TX_NOVAR] = "Variable name missing";
- stringsCbot[TX_NOFONC] = "Function name missing";
- stringsCbot[TX_OVERPARAM] = "Too many parameters";
- stringsCbot[TX_REDEF] = "Function already exists";
- stringsCbot[TX_LOWPARAM] = "Parameters missing ";
- stringsCbot[TX_BADPARAM] = "No function with this name accepts this kind of parameter";
- stringsCbot[TX_NUMPARAM] = "No function with this name accepts this number of parameters";
- stringsCbot[TX_NOITEM] = "This is not a member of this class";
- stringsCbot[TX_DOT] = "This object is not a member of a class";
- stringsCbot[TX_NOCONST] = "Appropriate constructor missing";
- stringsCbot[TX_REDEFCLASS] = "This class already exists";
- stringsCbot[TX_CLBRK] = "\" ] \" missing";
- stringsCbot[TX_RESERVED] = "Reserved keyword of CBOT language";
- stringsCbot[TX_BADNEW] = "Bad argument for \"new\"";
- stringsCbot[TX_OPBRK] = "\" [ \" expected";
- stringsCbot[TX_BADSTRING] = "String missing";
- stringsCbot[TX_BADINDEX] = "Incorrect index type";
- stringsCbot[TX_PRIVATE] = "Private element";
- stringsCbot[TX_NOPUBLIC] = "Public required";
- stringsCbot[TX_DIVZERO] = "Dividing by zero";
- stringsCbot[TX_NOTINIT] = "Variable not initialized";
- stringsCbot[TX_BADTHROW] = "Negative value rejected by \"throw\"";
- stringsCbot[TX_NORETVAL] = "The function returned no value ";
- stringsCbot[TX_NORUN] = "No function running";
- stringsCbot[TX_NOCALL] = "Calling an unknown function";
- stringsCbot[TX_NOCLASS] = "This class does not exist";
- stringsCbot[TX_NULLPT] = "Unknown Object";
- stringsCbot[TX_OPNAN] = "Operation impossible with value \"nan\"";
- stringsCbot[TX_OUTARRAY] = "Access beyond array limit";
- stringsCbot[TX_STACKOVER] = "Stack overflow";
- stringsCbot[TX_DELETEDPT] = "Illegal object";
- stringsCbot[TX_FILEOPEN] = "Can't open file";
- stringsCbot[TX_NOTOPEN] = "File not open";
- stringsCbot[TX_ERRREAD] = "Read error";
- stringsCbot[TX_ERRWRITE] = "Write error";
+ stringsText[RT_DISINFO_TITLE] = TR("SatCom");
+ stringsText[RT_WINDOW_MAXIMIZED] = TR("Maximize");
+ stringsText[RT_WINDOW_MINIMIZED] = TR("Minimize");
+ stringsText[RT_WINDOW_STANDARD] = TR("Normal size");
+ stringsText[RT_WINDOW_CLOSE] = TR("Close");
+
+ stringsText[RT_STUDIO_TITLE] = TR("Program editor");
+ stringsText[RT_SCRIPT_NEW] = TR("New");
+ stringsText[RT_NAME_DEFAULT] = TR("Player");
+ stringsText[RT_IO_NEW] = TR("New ...");
+ stringsText[RT_KEY_OR] = TR(" or ");
+
+ stringsText[RT_TITLE_BASE] = TR("Colobot: Gold Edition");
+ stringsText[RT_TITLE_INIT] = TR("Colobot: Gold Edition");
+ stringsText[RT_TITLE_TRAINER] = TR("Programming exercises");
+ stringsText[RT_TITLE_DEFI] = TR("Challenges");
+ stringsText[RT_TITLE_MISSION] = TR("Missions");
+ stringsText[RT_TITLE_FREE] = TR("Free game");
+ stringsText[RT_TITLE_USER] = TR("User levels");
+ stringsText[RT_TITLE_SETUP] = TR("Options");
+ stringsText[RT_TITLE_NAME] = TR("Player's name");
+ stringsText[RT_TITLE_PERSO] = TR("Customize your appearance");
+ stringsText[RT_TITLE_WRITE] = TR("Save the current mission");
+ stringsText[RT_TITLE_READ] = TR("Load a saved mission");
+
+ stringsText[RT_PLAY_CHAPt] = TR(" Chapters:");
+ stringsText[RT_PLAY_CHAPd] = TR(" Chapters:");
+ stringsText[RT_PLAY_CHAPm] = TR(" Planets:");
+ stringsText[RT_PLAY_CHAPf] = TR(" Planets:");
+ stringsText[RT_PLAY_CHAPu] = TR(" User levels:");
+ stringsText[RT_PLAY_CHAPte] = TR(" Chapters:");
+ stringsText[RT_PLAY_LISTt] = TR(" Exercises in the chapter:");
+ stringsText[RT_PLAY_LISTd] = TR(" Challenges in the chapter:");
+ stringsText[RT_PLAY_LISTm] = TR(" Missions on this planet:");
+ stringsText[RT_PLAY_LISTf] = TR(" Free game on this planet:");
+ stringsText[RT_PLAY_LISTu] = TR(" Missions on this level:");
+ stringsText[RT_PLAY_RESUME] = TR(" Summary:");
+
+ stringsText[RT_SETUP_DEVICE] = TR(" Drivers:");
+ stringsText[RT_SETUP_MODE] = TR(" Resolution:");
+ stringsText[RT_SETUP_KEY1] = TR("1) First click on the key you want to redefine.");
+ stringsText[RT_SETUP_KEY2] = TR("2) Then press the key you want to use instead.");
+
+ stringsText[RT_PERSO_FACE] = TR("Face type:");
+ stringsText[RT_PERSO_GLASSES] = TR("Eyeglasses:");
+ stringsText[RT_PERSO_HAIR] = TR("Hair color:");
+ stringsText[RT_PERSO_COMBI] = TR("Suit color:");
+ stringsText[RT_PERSO_BAND] = TR("Strip color:");
+
+ stringsText[RT_DIALOG_QUIT] = TR("Do you want to quit Colobot: Gold Edition?");
+ stringsText[RT_DIALOG_TITLE] = TR("Colobot: Gold Edition");
+ stringsText[RT_DIALOG_YESQUIT] = TR("Quit\\Quit Colobot: Gold Edition");
+ stringsText[RT_DIALOG_ABORT] = TR("Quit the mission?");
+ stringsText[RT_DIALOG_YES] = TR("Abort\\Abort the current mission");
+ stringsText[RT_DIALOG_NO] = TR("Continue\\Continue the current mission");
+ stringsText[RT_DIALOG_NOQUIT] = TR("Continue\\Continue the game");
+ stringsText[RT_DIALOG_DELOBJ] = TR("Do you really want to destroy the selected building?");
+ stringsText[RT_DIALOG_DELGAME] = TR("Do you want to delete %s's saved games? ");
+ stringsText[RT_DIALOG_YESDEL] = TR("Delete");
+ stringsText[RT_DIALOG_NODEL] = TR("Cancel");
+ stringsText[RT_DIALOG_LOADING] = TR("LOADING");
+
+ stringsText[RT_STUDIO_LISTTT] = TR("Keyword help(\\key cbot;)");
+ stringsText[RT_STUDIO_COMPOK] = TR("Compilation ok (0 errors)");
+ stringsText[RT_STUDIO_PROGSTOP] = TR("Program finished");
+
+ stringsText[RT_SATCOM_LIST] = TR("\\b;List of objects\n");
+ stringsText[RT_SATCOM_BOT] = TR("\\b;Robots\n");
+ stringsText[RT_SATCOM_BUILDING] = TR("\\b;Buildings\n");
+ stringsText[RT_SATCOM_FRET] = TR("\\b;Moveable objects\n");
+ stringsText[RT_SATCOM_ALIEN] = TR("\\b;Aliens\n");
+ stringsText[RT_SATCOM_NULL] = TR("\\c; (none)\\n;\n");
+ stringsText[RT_SATCOM_ERROR1] = TR("\\b;Error\n");
+ stringsText[RT_SATCOM_ERROR2] = TR("The list is only available if a \\l;radar station\\u object\\radar; is working.\n");
+
+ stringsText[RT_IO_OPEN] = TR("Open");
+ stringsText[RT_IO_SAVE] = TR("Save");
+ stringsText[RT_IO_LIST] = TR("Folder: %s");
+ stringsText[RT_IO_NAME] = TR("Name:");
+ stringsText[RT_IO_DIR] = TR("Folder:");
+ stringsText[RT_IO_PRIVATE] = TR("Private\\Private folder");
+ stringsText[RT_IO_PUBLIC] = TR("Public\\Common folder");
+
+ stringsText[RT_GENERIC_DEV1] = TR("Developed by :");
+ stringsText[RT_GENERIC_DEV2] = TR("www.epsitec.com");
+ stringsText[RT_GENERIC_EDIT1] = TR(" ");
+ stringsText[RT_GENERIC_EDIT2] = TR(" ");
+
+ stringsText[RT_INTERFACE_REC] = TR("Recorder");
+
+
+
+ stringsEvent[EVENT_BUTTON_OK] = TR("OK");
+ stringsEvent[EVENT_BUTTON_CANCEL] = TR("Cancel");
+ stringsEvent[EVENT_BUTTON_NEXT] = TR("Next");
+ stringsEvent[EVENT_BUTTON_PREV] = TR("Previous");
+
+ stringsEvent[EVENT_DIALOG_OK] = TR("OK");
+ stringsEvent[EVENT_DIALOG_CANCEL] = TR("Cancel");
+
+ stringsEvent[EVENT_INTERFACE_TRAINER] = TR("Exercises\\Programming exercises");
+ stringsEvent[EVENT_INTERFACE_DEFI] = TR("Challenges\\Programming challenges");
+ stringsEvent[EVENT_INTERFACE_MISSION] = TR("Missions\\Select mission");
+ stringsEvent[EVENT_INTERFACE_FREE] = TR("Free game\\Free game without a specific goal");
+ stringsEvent[EVENT_INTERFACE_USER] = TR("User\\User levels");
+ stringsEvent[EVENT_INTERFACE_NAME] = TR("Change player\\Change player");
+ stringsEvent[EVENT_INTERFACE_SETUP] = TR("Options\\Preferences");
+ stringsEvent[EVENT_INTERFACE_AGAIN] = TR("Restart\\Restart the mission from the beginning");
+ stringsEvent[EVENT_INTERFACE_WRITE] = TR("Save\\Save the current mission ");
+ stringsEvent[EVENT_INTERFACE_READ] = TR("Load\\Load a saved mission");
+ stringsEvent[EVENT_INTERFACE_ABORT] = TR("\\Return to Colobot: Gold Edition");
+ stringsEvent[EVENT_INTERFACE_QUIT] = TR("Quit\\Quit Colobot: Gold Edition");
+ stringsEvent[EVENT_INTERFACE_BACK] = TR("<< Back \\Back to the previous screen");
+ stringsEvent[EVENT_INTERFACE_PLAY] = TR("Play\\Start mission!");
+ stringsEvent[EVENT_INTERFACE_SETUPd] = TR("Device\\Driver and resolution settings");
+ stringsEvent[EVENT_INTERFACE_SETUPg] = TR("Graphics\\Graphics settings");
+ stringsEvent[EVENT_INTERFACE_SETUPp] = TR("Game\\Game settings");
+ stringsEvent[EVENT_INTERFACE_SETUPc] = TR("Controls\\Keyboard, joystick and mouse settings");
+ stringsEvent[EVENT_INTERFACE_SETUPs] = TR("Sound\\Music and game sound volume");
+ stringsEvent[EVENT_INTERFACE_DEVICE] = TR("Unit");
+ stringsEvent[EVENT_INTERFACE_RESOL] = TR("Resolution");
+ stringsEvent[EVENT_INTERFACE_FULL] = TR("Full screen\\Full screen or window mode");
+ stringsEvent[EVENT_INTERFACE_APPLY] = TR("Apply changes\\Activates the changed settings");
+
+ stringsEvent[EVENT_INTERFACE_TOTO] = TR("Robbie\\Your assistant");
+ stringsEvent[EVENT_INTERFACE_SHADOW] = TR("Shadows\\Shadows on the ground");
+ stringsEvent[EVENT_INTERFACE_GROUND] = TR("Marks on the ground\\Marks on the ground");
+ stringsEvent[EVENT_INTERFACE_DIRTY] = TR("Dust\\Dust and dirt on bots and buildings");
+ stringsEvent[EVENT_INTERFACE_FOG] = TR("Fog\\Fog");
+ stringsEvent[EVENT_INTERFACE_LENS] = TR("Sunbeams\\Sunbeams in the sky");
+ stringsEvent[EVENT_INTERFACE_SKY] = TR("Sky\\Clouds and nebulae");
+ stringsEvent[EVENT_INTERFACE_PLANET] = TR("Planets and stars\\Astronomical objects in the sky");
+ stringsEvent[EVENT_INTERFACE_LIGHT] = TR("Dynamic lighting\\Mobile light sources");
+ stringsEvent[EVENT_INTERFACE_PARTI] = TR("Number of particles\\Explosions, dust, reflections, etc.");
+ stringsEvent[EVENT_INTERFACE_CLIP] = TR("Depth of field\\Maximum visibility");
+ stringsEvent[EVENT_INTERFACE_DETAIL] = TR("Details\\Visual quality of 3D objects");
+ stringsEvent[EVENT_INTERFACE_TEXTURE] = TR("Textures\\Quality of textures ");
+ stringsEvent[EVENT_INTERFACE_GADGET] = TR("Num of decorative objects\\Number of purely ornamental objects");
+ stringsEvent[EVENT_INTERFACE_RAIN] = TR("Particles in the interface\\Steam clouds and sparks in the interface");
+ stringsEvent[EVENT_INTERFACE_GLINT] = TR("Reflections on the buttons \\Shiny buttons");
+ stringsEvent[EVENT_INTERFACE_TOOLTIP] = TR("Help balloons\\Explain the function of the buttons");
+ stringsEvent[EVENT_INTERFACE_MOVIES] = TR("Film sequences\\Films before and after the missions");
+ stringsEvent[EVENT_INTERFACE_NICERST] = TR("Exit film\\Film at the exit of exercises");
+ stringsEvent[EVENT_INTERFACE_HIMSELF] = TR("Friendly fire\\Your shooting can damage your own objects ");
+ stringsEvent[EVENT_INTERFACE_SCROLL] = TR("Scrolling\\Scrolling when the mouse touches right or left border");
+ stringsEvent[EVENT_INTERFACE_INVERTX] = TR("Mouse inversion X\\Inversion of the scrolling direction on the X axis");
+ stringsEvent[EVENT_INTERFACE_INVERTY] = TR("Mouse inversion Y\\Inversion of the scrolling direction on the Y axis");
+ stringsEvent[EVENT_INTERFACE_EFFECT] = TR("Quake at explosions\\The screen shakes at explosions");
+ stringsEvent[EVENT_INTERFACE_MOUSE] = TR("Mouse shadow\\Gives the mouse a shadow");
+ stringsEvent[EVENT_INTERFACE_EDITMODE] = TR("Automatic indent\\When program editing");
+ stringsEvent[EVENT_INTERFACE_EDITVALUE] = TR("Big indent\\Indent 2 or 4 spaces per level defined by braces");
+ stringsEvent[EVENT_INTERFACE_SOLUCE4] = TR("Access to solutions\\Show program \"4: Solution\" in the exercises");
+ stringsEvent[EVENT_INTERFACE_BLOOD] = TR("Blood\\Display blood when the astronaut or the alien queen is hit");
+
+ stringsEvent[EVENT_INTERFACE_KDEF] = TR("Standard controls\\Standard key functions");
+ stringsEvent[EVENT_INTERFACE_KLEFT] = TR("Turn left\\turns the bot to the left");
+ stringsEvent[EVENT_INTERFACE_KRIGHT] = TR("Turn right\\turns the bot to the right");
+ stringsEvent[EVENT_INTERFACE_KUP] = TR("Forward\\Moves forward");
+ stringsEvent[EVENT_INTERFACE_KDOWN] = TR("Backward\\Moves backward");
+ stringsEvent[EVENT_INTERFACE_KGUP] = TR("Climb\\Increases the power of the jet");
+ stringsEvent[EVENT_INTERFACE_KGDOWN] = TR("Descend\\Reduces the power of the jet");
+ stringsEvent[EVENT_INTERFACE_KCAMERA] = TR("Change camera\\Switches between onboard camera and following camera");
+ stringsEvent[EVENT_INTERFACE_KDESEL] = TR("Previous object\\Selects the previous object");
+ stringsEvent[EVENT_INTERFACE_KACTION] = TR("Standard action\\Standard action of the bot (take/grab, shoot, sniff, etc)");
+ stringsEvent[EVENT_INTERFACE_KNEAR] = TR("Camera closer\\Moves the camera forward");
+ stringsEvent[EVENT_INTERFACE_KAWAY] = TR("Camera back\\Moves the camera backward");
+ stringsEvent[EVENT_INTERFACE_KNEXT] = TR("Next object\\Selects the next object");
+ stringsEvent[EVENT_INTERFACE_KHUMAN] = TR("Select the astronaut\\Selects the astronaut");
+ stringsEvent[EVENT_INTERFACE_KQUIT] = TR("Quit\\Quit the current mission or exercise");
+ stringsEvent[EVENT_INTERFACE_KHELP] = TR("Instructions\\Shows the instructions for the current mission");
+ stringsEvent[EVENT_INTERFACE_KPROG] = TR("Programming help\\Gives more detailed help with programming");
+ stringsEvent[EVENT_INTERFACE_KCBOT] = TR("Key word help\\More detailed help about key words");
+ stringsEvent[EVENT_INTERFACE_KVISIT] = TR("Origin of last message\\Shows where the last message was sent from");
+ stringsEvent[EVENT_INTERFACE_KSPEED10] = TR("Speed 1.0x\\Normal speed");
+ stringsEvent[EVENT_INTERFACE_KSPEED15] = TR("Speed 1.5x\\1.5 times faster");
+ stringsEvent[EVENT_INTERFACE_KSPEED20] = TR("Speed 2.0x\\Double speed");
+ stringsEvent[EVENT_INTERFACE_KSPEED30] = TR("Speed 3.0x\\Three times faster");
+
+ stringsEvent[EVENT_INTERFACE_VOLSOUND] = TR("Sound effects:\\Volume of engines, voice, shooting, etc.");
+ stringsEvent[EVENT_INTERFACE_VOLMUSIC] = TR("Background sound :\\Volume of audio tracks on the CD");
+ stringsEvent[EVENT_INTERFACE_SOUND3D] = TR("3D sound\\3D positioning of the sound");
+
+ stringsEvent[EVENT_INTERFACE_MIN] = TR("Lowest\\Minimum graphic quality (highest frame rate)");
+ stringsEvent[EVENT_INTERFACE_NORM] = TR("Normal\\Normal graphic quality");
+ stringsEvent[EVENT_INTERFACE_MAX] = TR("Highest\\Highest graphic quality (lowest frame rate)");
+
+ stringsEvent[EVENT_INTERFACE_SILENT] = TR("Mute\\No sound");
+ stringsEvent[EVENT_INTERFACE_NOISY] = TR("Normal\\Normal sound volume");
+
+ stringsEvent[EVENT_INTERFACE_JOYSTICK] = TR("Use a joystick\\Joystick or keyboard");
+ stringsEvent[EVENT_INTERFACE_SOLUCE] = TR("Access to solution\\Shows the solution (detailed instructions for missions)");
+
+ stringsEvent[EVENT_INTERFACE_NEDIT] = TR("\\New player name");
+ stringsEvent[EVENT_INTERFACE_NOK] = TR("OK\\Choose the selected player");
+ stringsEvent[EVENT_INTERFACE_NCANCEL] = TR("Cancel\\Keep current player name");
+ stringsEvent[EVENT_INTERFACE_NDELETE] = TR("Delete player\\Deletes the player from the list");
+ stringsEvent[EVENT_INTERFACE_NLABEL] = TR("Player name");
+
+ stringsEvent[EVENT_INTERFACE_IOWRITE] = TR("Save\\Saves the current mission");
+ stringsEvent[EVENT_INTERFACE_IOREAD] = TR("Load\\Loads the selected mission");
+ stringsEvent[EVENT_INTERFACE_IOLIST] = TR("List of saved missions");
+ stringsEvent[EVENT_INTERFACE_IOLABEL] = TR("Filename:");
+ stringsEvent[EVENT_INTERFACE_IONAME] = TR("Mission name");
+ stringsEvent[EVENT_INTERFACE_IOIMAGE] = TR("Photography");
+ stringsEvent[EVENT_INTERFACE_IODELETE] = TR("Delete\\Deletes the selected file");
+
+ stringsEvent[EVENT_INTERFACE_PERSO] = TR("Appearance\\Choose your appearance");
+ stringsEvent[EVENT_INTERFACE_POK] = TR("OK");
+ stringsEvent[EVENT_INTERFACE_PCANCEL] = TR("Cancel");
+ stringsEvent[EVENT_INTERFACE_PDEF] = TR("Standard\\Standard appearance settings");
+ stringsEvent[EVENT_INTERFACE_PHEAD] = TR("Head\\Face and hair");
+ stringsEvent[EVENT_INTERFACE_PBODY] = TR("Suit\\Astronaut suit");
+ stringsEvent[EVENT_INTERFACE_PLROT] = TR("\\Turn left");
+ stringsEvent[EVENT_INTERFACE_PRROT] = TR("\\Turn right");
+ stringsEvent[EVENT_INTERFACE_PCRa] = TR("Red");
+ stringsEvent[EVENT_INTERFACE_PCGa] = TR("Green");
+ stringsEvent[EVENT_INTERFACE_PCBa] = TR("Blue");
+ stringsEvent[EVENT_INTERFACE_PCRb] = TR("Red");
+ stringsEvent[EVENT_INTERFACE_PCGb] = TR("Green");
+ stringsEvent[EVENT_INTERFACE_PCBb] = TR("Blue");
+ stringsEvent[EVENT_INTERFACE_PFACE1] = TR("\\Face 1");
+ stringsEvent[EVENT_INTERFACE_PFACE2] = TR("\\Face 4");
+ stringsEvent[EVENT_INTERFACE_PFACE3] = TR("\\Face 3");
+ stringsEvent[EVENT_INTERFACE_PFACE4] = TR("\\Face 2");
+ stringsEvent[EVENT_INTERFACE_PGLASS0] = TR("\\No eyeglasses");
+ stringsEvent[EVENT_INTERFACE_PGLASS1] = TR("\\Eyeglasses 1");
+ stringsEvent[EVENT_INTERFACE_PGLASS2] = TR("\\Eyeglasses 2");
+ stringsEvent[EVENT_INTERFACE_PGLASS3] = TR("\\Eyeglasses 3");
+ stringsEvent[EVENT_INTERFACE_PGLASS4] = TR("\\Eyeglasses 4");
+ stringsEvent[EVENT_INTERFACE_PGLASS5] = TR("\\Eyeglasses 5");
+
+ stringsEvent[EVENT_OBJECT_DESELECT] = TR("Previous selection (\\key desel;)");
+ stringsEvent[EVENT_OBJECT_LEFT] = TR("Turn left (\\key left;)");
+ stringsEvent[EVENT_OBJECT_RIGHT] = TR("Turn right (\\key right;)");
+ stringsEvent[EVENT_OBJECT_UP] = TR("Forward (\\key up;)");
+ stringsEvent[EVENT_OBJECT_DOWN] = TR("Backward (\\key down;)");
+ stringsEvent[EVENT_OBJECT_GASUP] = TR("Up (\\key gup;)");
+ stringsEvent[EVENT_OBJECT_GASDOWN] = TR("Down (\\key gdown;)");
+ stringsEvent[EVENT_OBJECT_HTAKE] = TR("Grab or drop (\\key action;)");
+ stringsEvent[EVENT_OBJECT_MTAKE] = TR("Grab or drop (\\key action;)");
+ stringsEvent[EVENT_OBJECT_MFRONT] = TR("..in front");
+ stringsEvent[EVENT_OBJECT_MBACK] = TR("..behind");
+ stringsEvent[EVENT_OBJECT_MPOWER] = TR("..power cell");
+ stringsEvent[EVENT_OBJECT_BHELP] = TR("Instructions for the mission (\\key help;)");
+ stringsEvent[EVENT_OBJECT_BTAKEOFF] = TR("Take off to finish the mission");
+ stringsEvent[EVENT_OBJECT_BDESTROY] = TR("Destroy");
+ stringsEvent[EVENT_OBJECT_BDERRICK] = TR("Build a derrick");
+ stringsEvent[EVENT_OBJECT_BSTATION] = TR("Build a power station");
+ stringsEvent[EVENT_OBJECT_BFACTORY] = TR("Build a bot factory");
+ stringsEvent[EVENT_OBJECT_BREPAIR] = TR("Build a repair center");
+ stringsEvent[EVENT_OBJECT_BCONVERT] = TR("Build a converter");
+ stringsEvent[EVENT_OBJECT_BTOWER] = TR("Build a defense tower");
+ stringsEvent[EVENT_OBJECT_BRESEARCH] = TR("Build a research center");
+ stringsEvent[EVENT_OBJECT_BRADAR] = TR("Build a radar station");
+ stringsEvent[EVENT_OBJECT_BENERGY] = TR("Build a power cell factory");
+ stringsEvent[EVENT_OBJECT_BLABO] = TR("Build an autolab");
+ stringsEvent[EVENT_OBJECT_BNUCLEAR] = TR("Build a nuclear power plant");
+ stringsEvent[EVENT_OBJECT_BPARA] = TR("Build a lightning conductor");
+ stringsEvent[EVENT_OBJECT_BINFO] = TR("Build a exchange post");
+ stringsEvent[EVENT_OBJECT_BDESTROYER] = TR("Build a destroyer");
+ stringsEvent[EVENT_OBJECT_GFLAT] = TR("Show if the ground is flat");
+ stringsEvent[EVENT_OBJECT_FCREATE] = TR("Plant a flag");
+ stringsEvent[EVENT_OBJECT_FDELETE] = TR("Remove a flag");
+ stringsEvent[EVENT_OBJECT_FCOLORb] = TR("\\Blue flags");
+ stringsEvent[EVENT_OBJECT_FCOLORr] = TR("\\Red flags");
+ stringsEvent[EVENT_OBJECT_FCOLORg] = TR("\\Green flags");
+ stringsEvent[EVENT_OBJECT_FCOLORy] = TR("\\Yellow flags");
+ stringsEvent[EVENT_OBJECT_FCOLORv] = TR("\\Violet flags");
+ stringsEvent[EVENT_OBJECT_FACTORYfa] = TR("Build a winged grabber");
+ stringsEvent[EVENT_OBJECT_FACTORYta] = TR("Build a tracked grabber");
+ stringsEvent[EVENT_OBJECT_FACTORYwa] = TR("Build a wheeled grabber");
+ stringsEvent[EVENT_OBJECT_FACTORYia] = TR("Build a legged grabber");
+ stringsEvent[EVENT_OBJECT_FACTORYfc] = TR("Build a winged shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYtc] = TR("Build a tracked shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYwc] = TR("Build a wheeled shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYic] = TR("Build a legged shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYfi] = TR("Build a winged orga shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYti] = TR("Build a tracked orga shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYwi] = TR("Build a wheeled orga shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYii] = TR("Build a legged orga shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYfs] = TR("Build a winged sniffer");
+ stringsEvent[EVENT_OBJECT_FACTORYts] = TR("Build a tracked sniffer");
+ stringsEvent[EVENT_OBJECT_FACTORYws] = TR("Build a wheeled sniffer");
+ stringsEvent[EVENT_OBJECT_FACTORYis] = TR("Build a legged sniffer");
+ stringsEvent[EVENT_OBJECT_FACTORYrt] = TR("Build a thumper");
+ stringsEvent[EVENT_OBJECT_FACTORYrc] = TR("Build a phazer shooter");
+ stringsEvent[EVENT_OBJECT_FACTORYrr] = TR("Build a recycler");
+ stringsEvent[EVENT_OBJECT_FACTORYrs] = TR("Build a shielder");
+ stringsEvent[EVENT_OBJECT_FACTORYsa] = TR("Build a subber");
+ stringsEvent[EVENT_OBJECT_RTANK] = TR("Run research program for tracked bots");
+ stringsEvent[EVENT_OBJECT_RFLY] = TR("Run research program for winged bots");
+ stringsEvent[EVENT_OBJECT_RTHUMP] = TR("Run research program for thumper");
+ stringsEvent[EVENT_OBJECT_RCANON] = TR("Run research program for shooter");
+ stringsEvent[EVENT_OBJECT_RTOWER] = TR("Run research program for defense tower");
+ stringsEvent[EVENT_OBJECT_RPHAZER] = TR("Run research program for phazer shooter");
+ stringsEvent[EVENT_OBJECT_RSHIELD] = TR("Run research program for shielder");
+ stringsEvent[EVENT_OBJECT_RATOMIC] = TR("Run research program for nuclear power");
+ stringsEvent[EVENT_OBJECT_RiPAW] = TR("Run research program for legged bots");
+ stringsEvent[EVENT_OBJECT_RiGUN] = TR("Run research program for orga shooter");
+ stringsEvent[EVENT_OBJECT_RESET] = TR("Return to start");
+ stringsEvent[EVENT_OBJECT_SEARCH] = TR("Sniff (\\key action;)");
+ stringsEvent[EVENT_OBJECT_TERRAFORM] = TR("Thump (\\key action;)");
+ stringsEvent[EVENT_OBJECT_FIRE] = TR("Shoot (\\key action;)");
+ stringsEvent[EVENT_OBJECT_SPIDEREXPLO] = TR("Explode (\\key action;)");
+ stringsEvent[EVENT_OBJECT_RECOVER] = TR("Recycle (\\key action;)");
+ stringsEvent[EVENT_OBJECT_BEGSHIELD] = TR("Extend shield (\\key action;)");
+ stringsEvent[EVENT_OBJECT_ENDSHIELD] = TR("Withdraw shield (\\key action;)");
+ stringsEvent[EVENT_OBJECT_DIMSHIELD] = TR("Shield radius");
+ stringsEvent[EVENT_OBJECT_PROGRUN] = TR("Execute the selected program");
+ stringsEvent[EVENT_OBJECT_PROGEDIT] = TR("Edit the selected program");
+ stringsEvent[EVENT_OBJECT_INFOOK] = TR("\\SatCom on standby");
+ stringsEvent[EVENT_OBJECT_DELETE] = TR("Destroy the building");
+ stringsEvent[EVENT_OBJECT_GENERGY] = TR("Energy level");
+ stringsEvent[EVENT_OBJECT_GSHIELD] = TR("Shield level");
+ stringsEvent[EVENT_OBJECT_GRANGE] = TR("Jet temperature");
+ stringsEvent[EVENT_OBJECT_GPROGRESS] = TR("Still working ...");
+ stringsEvent[EVENT_OBJECT_GRADAR] = TR("Number of insects detected");
+ stringsEvent[EVENT_OBJECT_GINFO] = TR("Transmitted information");
+ stringsEvent[EVENT_OBJECT_COMPASS] = TR("Compass");
+ stringsEvent[EVENT_OBJECT_MAPZOOM] = TR("Zoom mini-map");
+ stringsEvent[EVENT_OBJECT_CAMERA] = TR("Camera (\\key camera;)");
+ stringsEvent[EVENT_OBJECT_CAMERAleft] = TR("Camera to left");
+ stringsEvent[EVENT_OBJECT_CAMERAright] = TR("Camera to right");
+ stringsEvent[EVENT_OBJECT_CAMERAnear] = TR("Camera nearest");
+ stringsEvent[EVENT_OBJECT_CAMERAaway] = TR("Camera awayest");
+ stringsEvent[EVENT_OBJECT_HELP] = TR("Help about selected object");
+ stringsEvent[EVENT_OBJECT_SOLUCE] = TR("Show the solution");
+ stringsEvent[EVENT_OBJECT_SHORTCUT00] = TR("Switch bots <-> buildings");
+ stringsEvent[EVENT_OBJECT_LIMIT] = TR("Show the range");
+ stringsEvent[EVENT_OBJECT_PEN0] = TR("\\Raise the pencil");
+ stringsEvent[EVENT_OBJECT_PEN1] = TR("\\Use the black pencil");
+ stringsEvent[EVENT_OBJECT_PEN2] = TR("\\Use the yellow pencil");
+ stringsEvent[EVENT_OBJECT_PEN3] = TR("\\Use the orange pencil");
+ stringsEvent[EVENT_OBJECT_PEN4] = TR("\\Use the red pencil");
+ stringsEvent[EVENT_OBJECT_PEN5] = TR("\\Use the purple pencil");
+ stringsEvent[EVENT_OBJECT_PEN6] = TR("\\Use the blue pencil");
+ stringsEvent[EVENT_OBJECT_PEN7] = TR("\\Use the green pencil");
+ stringsEvent[EVENT_OBJECT_PEN8] = TR("\\Use the brown pencil");
+ stringsEvent[EVENT_OBJECT_REC] = TR("\\Start recording");
+ stringsEvent[EVENT_OBJECT_STOP] = TR("\\Stop recording");
+ stringsEvent[EVENT_DT_VISIT0] = TR("Show the place");
+ stringsEvent[EVENT_DT_VISIT1] = TR("Show the place");
+ stringsEvent[EVENT_DT_VISIT2] = TR("Show the place");
+ stringsEvent[EVENT_DT_VISIT3] = TR("Show the place");
+ stringsEvent[EVENT_DT_VISIT4] = TR("Show the place");
+ stringsEvent[EVENT_DT_END] = TR("Continue");
+ stringsEvent[EVENT_CMD] = TR("Command line");
+ stringsEvent[EVENT_SPEED] = TR("Game speed");
+
+ stringsEvent[EVENT_HYPER_PREV] = TR("Back");
+ stringsEvent[EVENT_HYPER_NEXT] = TR("Forward");
+ stringsEvent[EVENT_HYPER_HOME] = TR("Home");
+ stringsEvent[EVENT_HYPER_COPY] = TR("Copy");
+ stringsEvent[EVENT_HYPER_SIZE1] = TR("Size 1");
+ stringsEvent[EVENT_HYPER_SIZE2] = TR("Size 2");
+ stringsEvent[EVENT_HYPER_SIZE3] = TR("Size 3");
+ stringsEvent[EVENT_HYPER_SIZE4] = TR("Size 4");
+ stringsEvent[EVENT_HYPER_SIZE5] = TR("Size 5");
+ stringsEvent[EVENT_SATCOM_HUSTON] = TR("Instructions from Houston");
+ stringsEvent[EVENT_SATCOM_SAT] = TR("Satellite report");
+ stringsEvent[EVENT_SATCOM_LOADING] = TR("Programs dispatched by Houston");
+ stringsEvent[EVENT_SATCOM_OBJECT] = TR("List of objects");
+ stringsEvent[EVENT_SATCOM_PROG] = TR("Programming help");
+ stringsEvent[EVENT_SATCOM_SOLUCE] = TR("Solution");
+
+ stringsEvent[EVENT_STUDIO_OK] = TR("OK\\Close program editor and return to game");
+ stringsEvent[EVENT_STUDIO_CANCEL] = TR("Cancel\\Cancel all changes");
+ stringsEvent[EVENT_STUDIO_NEW] = TR("New");
+ stringsEvent[EVENT_STUDIO_OPEN] = TR("Open (Ctrl+o)");
+ stringsEvent[EVENT_STUDIO_SAVE] = TR("Save (Ctrl+s)");
+ stringsEvent[EVENT_STUDIO_UNDO] = TR("Undo (Ctrl+z)");
+ stringsEvent[EVENT_STUDIO_CUT] = TR("Cut (Ctrl+x)");
+ stringsEvent[EVENT_STUDIO_COPY] = TR("Copy (Ctrl+c)");
+ stringsEvent[EVENT_STUDIO_PASTE] = TR("Paste (Ctrl+v)");
+ stringsEvent[EVENT_STUDIO_SIZE] = TR("Font size");
+ stringsEvent[EVENT_STUDIO_TOOL] = TR("Instructions (\\key help;)");
+ stringsEvent[EVENT_STUDIO_HELP] = TR("Programming help (\\key prog;)");
+ stringsEvent[EVENT_STUDIO_COMPILE] = TR("Compile");
+ stringsEvent[EVENT_STUDIO_RUN] = TR("Execute/stop");
+ stringsEvent[EVENT_STUDIO_REALTIME] = TR("Pause/continue");
+ stringsEvent[EVENT_STUDIO_STEP] = TR("One step");
+
+
+
+ stringsObject[OBJECT_PORTICO] = TR("Gantry crane");
+ stringsObject[OBJECT_BASE] = TR("Spaceship");
+ stringsObject[OBJECT_DERRICK] = TR("Derrick");
+ stringsObject[OBJECT_FACTORY] = TR("Bot factory");
+ stringsObject[OBJECT_REPAIR] = TR("Repair center");
+ stringsObject[OBJECT_DESTROYER] = TR("Destroyer");
+ stringsObject[OBJECT_STATION] = TR("Power station");
+ stringsObject[OBJECT_CONVERT] = TR("Converts ore to titanium");
+ stringsObject[OBJECT_TOWER] = TR("Defense tower");
+ stringsObject[OBJECT_NEST] = TR("Nest");
+ stringsObject[OBJECT_RESEARCH] = TR("Research center");
+ stringsObject[OBJECT_RADAR] = TR("Radar station");
+ stringsObject[OBJECT_INFO] = TR("Information exchange post");
+ stringsObject[OBJECT_ENERGY] = TR("Power cell factory");
+ stringsObject[OBJECT_LABO] = TR("Autolab");
+ stringsObject[OBJECT_NUCLEAR] = TR("Nuclear power station");
+ stringsObject[OBJECT_PARA] = TR("Lightning conductor");
+ stringsObject[OBJECT_SAFE] = TR("Vault");
+ stringsObject[OBJECT_HUSTON] = TR("Houston Mission Control");
+ stringsObject[OBJECT_TARGET1] = TR("Target");
+ stringsObject[OBJECT_TARGET2] = TR("Target");
+ stringsObject[OBJECT_START] = TR("Start");
+ stringsObject[OBJECT_END] = TR("Finish");
+ stringsObject[OBJECT_STONE] = TR("Titanium ore");
+ stringsObject[OBJECT_URANIUM] = TR("Uranium ore");
+ stringsObject[OBJECT_BULLET] = TR("Organic matter");
+ stringsObject[OBJECT_METAL] = TR("Titanium");
+ stringsObject[OBJECT_POWER] = TR("Power cell");
+ stringsObject[OBJECT_ATOMIC] = TR("Nuclear power cell");
+ stringsObject[OBJECT_BBOX] = TR("Black box");
+ stringsObject[OBJECT_KEYa] = TR("Key A");
+ stringsObject[OBJECT_KEYb] = TR("Key B");
+ stringsObject[OBJECT_KEYc] = TR("Key C");
+ stringsObject[OBJECT_KEYd] = TR("Key D");
+ stringsObject[OBJECT_TNT] = TR("Explosive");
+ stringsObject[OBJECT_BOMB] = TR("Fixed mine");
+ stringsObject[OBJECT_BAG] = TR("Survival kit");
+ stringsObject[OBJECT_WAYPOINT] = TR("Checkpoint");
+ stringsObject[OBJECT_FLAGb] = TR("Blue flag");
+ stringsObject[OBJECT_FLAGr] = TR("Red flag");
+ stringsObject[OBJECT_FLAGg] = TR("Green flag");
+ stringsObject[OBJECT_FLAGy] = TR("Yellow flag");
+ stringsObject[OBJECT_FLAGv] = TR("Violet flag");
+ stringsObject[OBJECT_MARKPOWER] = TR("Energy deposit (site for power station)");
+ stringsObject[OBJECT_MARKURANIUM] = TR("Uranium deposit (site for derrick)");
+ stringsObject[OBJECT_MARKKEYa] = TR("Found key A (site for derrick)");
+ stringsObject[OBJECT_MARKKEYb] = TR("Found key B (site for derrick)");
+ stringsObject[OBJECT_MARKKEYc] = TR("Found key C (site for derrick)");
+ stringsObject[OBJECT_MARKKEYd] = TR("Found key D (site for derrick)");
+ stringsObject[OBJECT_MARKSTONE] = TR("Titanium deposit (site for derrick)");
+ stringsObject[OBJECT_MOBILEft] = TR("Practice bot");
+ stringsObject[OBJECT_MOBILEtt] = TR("Practice bot");
+ stringsObject[OBJECT_MOBILEwt] = TR("Practice bot");
+ stringsObject[OBJECT_MOBILEit] = TR("Practice bot");
+ stringsObject[OBJECT_MOBILEfa] = TR("Winged grabber");
+ stringsObject[OBJECT_MOBILEta] = TR("Tracked grabber");
+ stringsObject[OBJECT_MOBILEwa] = TR("Wheeled grabber");
+ stringsObject[OBJECT_MOBILEia] = TR("Legged grabber");
+ stringsObject[OBJECT_MOBILEfc] = TR("Winged shooter");
+ stringsObject[OBJECT_MOBILEtc] = TR("Tracked shooter");
+ stringsObject[OBJECT_MOBILEwc] = TR("Wheeled shooter");
+ stringsObject[OBJECT_MOBILEic] = TR("Legged shooter");
+ stringsObject[OBJECT_MOBILEfi] = TR("Winged orga shooter");
+ stringsObject[OBJECT_MOBILEti] = TR("Tracked orga shooter");
+ stringsObject[OBJECT_MOBILEwi] = TR("Wheeled orga shooter");
+ stringsObject[OBJECT_MOBILEii] = TR("Legged orga shooter");
+ stringsObject[OBJECT_MOBILEfs] = TR("Winged sniffer");
+ stringsObject[OBJECT_MOBILEts] = TR("Tracked sniffer");
+ stringsObject[OBJECT_MOBILEws] = TR("Wheeled sniffer");
+ stringsObject[OBJECT_MOBILEis] = TR("Legged sniffer");
+ stringsObject[OBJECT_MOBILErt] = TR("Thumper");
+ stringsObject[OBJECT_MOBILErc] = TR("Phazer shooter");
+ stringsObject[OBJECT_MOBILErr] = TR("Recycler");
+ stringsObject[OBJECT_MOBILErs] = TR("Shielder");
+ stringsObject[OBJECT_MOBILEsa] = TR("Subber");
+ stringsObject[OBJECT_MOBILEtg] = TR("Target bot");
+ stringsObject[OBJECT_MOBILEdr] = TR("Drawer bot");
+ stringsObject[OBJECT_TECH] = TR("Engineer");
+ stringsObject[OBJECT_TOTO] = TR("Robbie");
+ stringsObject[OBJECT_MOTHER] = TR("Alien Queen");
+ stringsObject[OBJECT_ANT] = TR("Ant");
+ stringsObject[OBJECT_SPIDER] = TR("Spider");
+ stringsObject[OBJECT_BEE] = TR("Wasp");
+ stringsObject[OBJECT_WORM] = TR("Worm");
+ stringsObject[OBJECT_EGG] = TR("Egg");
+ stringsObject[OBJECT_RUINmobilew1] = TR("Wreckage");
+ stringsObject[OBJECT_RUINmobilew2] = TR("Wreckage");
+ stringsObject[OBJECT_RUINmobilet1] = TR("Wreckage");
+ stringsObject[OBJECT_RUINmobilet2] = TR("Wreckage");
+ stringsObject[OBJECT_RUINmobiler1] = TR("Wreckage");
+ stringsObject[OBJECT_RUINmobiler2] = TR("Wreckage");
+ stringsObject[OBJECT_RUINfactory] = TR("Ruin");
+ stringsObject[OBJECT_RUINdoor] = TR("Ruin");
+ stringsObject[OBJECT_RUINsupport] = TR("Waste");
+ stringsObject[OBJECT_RUINradar] = TR("Ruin");
+ stringsObject[OBJECT_RUINconvert] = TR("Ruin");
+ stringsObject[OBJECT_RUINbase] = TR("Spaceship ruin");
+ stringsObject[OBJECT_RUINhead] = TR("Spaceship ruin");
+ stringsObject[OBJECT_APOLLO1] = TR("Remains of Apollo mission");
+ stringsObject[OBJECT_APOLLO3] = TR("Remains of Apollo mission");
+ stringsObject[OBJECT_APOLLO4] = TR("Remains of Apollo mission");
+ stringsObject[OBJECT_APOLLO5] = TR("Remains of Apollo mission");
+ stringsObject[OBJECT_APOLLO2] = TR("Lunar Roving Vehicle");
+
+
+
+ stringsErr[ERR_GENERIC] = TR("Internal error - tell the developers");
+ stringsErr[ERR_CMD] = TR("Unknown command");
+ stringsErr[ERR_MANIP_VEH] = TR("Inappropriate bot");
+ stringsErr[ERR_MANIP_FLY] = TR("Impossible when flying");
+ stringsErr[ERR_MANIP_BUSY] = TR("Already carrying something");
+ stringsErr[ERR_MANIP_NIL] = TR("Nothing to grab");
+ stringsErr[ERR_MANIP_MOTOR] = TR("Impossible when moving");
+ stringsErr[ERR_MANIP_OCC] = TR("Place occupied");
+ stringsErr[ERR_MANIP_FRIEND] = TR("No other robot");
+ stringsErr[ERR_MANIP_RADIO] = TR("You can not carry a radioactive object");
+ stringsErr[ERR_MANIP_WATER] = TR("You can not carry an object under water");
+ stringsErr[ERR_MANIP_EMPTY] = TR("Nothing to drop");
+ stringsErr[ERR_BUILD_FLY] = TR("Impossible when flying");
+ stringsErr[ERR_BUILD_WATER] = TR("Impossible under water");
+ stringsErr[ERR_BUILD_ENERGY] = TR("Not enough energy");
+ stringsErr[ERR_BUILD_METALAWAY] = TR("Titanium too far away");
+ stringsErr[ERR_BUILD_METALNEAR] = TR("Titanium too close");
+ stringsErr[ERR_BUILD_METALINEX] = TR("No titanium around");
+ stringsErr[ERR_BUILD_FLAT] = TR("Ground not flat enough");
+ stringsErr[ERR_BUILD_FLATLIT] = TR("Flat ground not large enough");
+ stringsErr[ERR_BUILD_BUSY] = TR("Place occupied");
+ stringsErr[ERR_BUILD_BASE] = TR("Too close to space ship");
+ stringsErr[ERR_BUILD_NARROW] = TR("Too close to a building");
+ stringsErr[ERR_BUILD_MOTOR] = TR("Impossible when moving");
+ stringsErr[ERR_SEARCH_FLY] = TR("Impossible when flying");
+ stringsErr[ERR_BUILD_DISABLED] = TR("Can not produce this object in this mission");
+ stringsErr[ERR_BUILD_RESEARCH] = TR("Can not produce not researched object");
+ stringsErr[ERR_SEARCH_VEH] = TR("Inappropriate bot");
+ stringsErr[ERR_SEARCH_MOTOR] = TR("Impossible when moving");
+ stringsErr[ERR_TERRA_VEH] = TR("Inappropriate bot");
+ stringsErr[ERR_TERRA_ENERGY] = TR("Not enough energy");
+ stringsErr[ERR_TERRA_FLOOR] = TR("Ground inappropriate");
+ stringsErr[ERR_TERRA_BUILDING] = TR("Building too close");
+ stringsErr[ERR_TERRA_OBJECT] = TR("Object too close");
+ stringsErr[ERR_RECOVER_VEH] = TR("Inappropriate bot");
+ stringsErr[ERR_RECOVER_ENERGY] = TR("Not enough energy");
+ stringsErr[ERR_RECOVER_NULL] = TR("Nothing to recycle");
+ stringsErr[ERR_SHIELD_VEH] = TR("Inappropriate bot");
+ stringsErr[ERR_SHIELD_ENERGY] = TR("No more energy");
+ stringsErr[ERR_MOVE_IMPOSSIBLE] = TR("Error in instruction move");
+ stringsErr[ERR_FIND_IMPOSSIBLE] = TR("Object not found");
+ stringsErr[ERR_GOTO_IMPOSSIBLE] = TR("Goto: inaccessible destination");
+ stringsErr[ERR_GOTO_ITER] = TR("Goto: inaccessible destination");
+ stringsErr[ERR_GOTO_BUSY] = TR("Goto: destination occupied");
+ stringsErr[ERR_FIRE_VEH] = TR("Inappropriate bot");
+ stringsErr[ERR_FIRE_ENERGY] = TR("Not enough energy");
+ stringsErr[ERR_FIRE_FLY] = TR("Impossible when flying");
+ stringsErr[ERR_CONVERT_EMPTY] = TR("No titanium ore to convert");
+ stringsErr[ERR_DERRICK_NULL] = TR("No ore in the subsoil");
+ stringsErr[ERR_STATION_NULL] = TR("No energy in the subsoil");
+ stringsErr[ERR_TOWER_POWER] = TR("No power cell");
+ stringsErr[ERR_TOWER_ENERGY] = TR("No more energy");
+ stringsErr[ERR_RESEARCH_POWER] = TR("No power cell");
+ stringsErr[ERR_RESEARCH_ENERGY] = TR("Not enough energy");
+ stringsErr[ERR_RESEARCH_TYPE] = TR("Inappropriate cell type");
+ stringsErr[ERR_RESEARCH_ALREADY]= TR("Research program already performed");
+ stringsErr[ERR_ENERGY_NULL] = TR("No energy in the subsoil");
+ stringsErr[ERR_ENERGY_LOW] = TR("Not enough energy yet");
+ stringsErr[ERR_ENERGY_EMPTY] = TR("No titanium to transform");
+ stringsErr[ERR_ENERGY_BAD] = TR("Transforms only titanium");
+ stringsErr[ERR_BASE_DLOCK] = TR("Doors blocked by a robot or another object ");
+ stringsErr[ERR_BASE_DHUMAN] = TR("You must get on the spaceship to take off ");
+ stringsErr[ERR_LABO_NULL] = TR("Nothing to analyze");
+ stringsErr[ERR_LABO_BAD] = TR("Analyzes only organic matter");
+ stringsErr[ERR_LABO_ALREADY] = TR("Analysis already performed");
+ stringsErr[ERR_NUCLEAR_NULL] = TR("No energy in the subsoil");
+ stringsErr[ERR_NUCLEAR_LOW] = TR("Not yet enough energy");
+ stringsErr[ERR_NUCLEAR_EMPTY] = TR("No uranium to transform");
+ stringsErr[ERR_NUCLEAR_BAD] = TR("Transforms only uranium");
+ stringsErr[ERR_FACTORY_NULL] = TR("No titanium");
+ stringsErr[ERR_FACTORY_NEAR] = TR("Object too close");
+ stringsErr[ERR_RESET_NEAR] = TR("Place occupied");
+ stringsErr[ERR_INFO_NULL] = TR("No information exchange post within range");
+ stringsErr[ERR_VEH_VIRUS] = TR("Program infected by a virus");
+ stringsErr[ERR_BAT_VIRUS] = TR("Infected by a virus; temporarily out of order");
+ stringsErr[ERR_VEH_POWER] = TR("No power cell");
+ stringsErr[ERR_VEH_ENERGY] = TR("No more energy");
+ stringsErr[ERR_FLAG_FLY] = TR("Impossible when flying");
+ stringsErr[ERR_FLAG_WATER] = TR("Impossible when swimming");
+ stringsErr[ERR_FLAG_MOTOR] = TR("Impossible when moving");
+ stringsErr[ERR_FLAG_BUSY] = TR("Impossible when carrying an object");
+ stringsErr[ERR_FLAG_CREATE] = TR("Too many flags of this color (maximum 5)");
+ stringsErr[ERR_FLAG_PROXY] = TR("Too close to an existing flag");
+ stringsErr[ERR_FLAG_DELETE] = TR("No flag nearby");
+ stringsErr[ERR_DESTROY_NOTFOUND]= TR("Not found anything to destroy");
+ stringsErr[ERR_WRONG_OBJ] = TR("Inappropriate object");
+ stringsErr[ERR_MISSION_NOTERM] = TR("The mission is not accomplished yet (press \\key help; for more details)");
+ stringsErr[ERR_DELETEMOBILE] = TR("Bot destroyed");
+ stringsErr[ERR_DELETEBUILDING] = TR("Building destroyed");
+ stringsErr[ERR_TOOMANY] = TR("Can not create this; there are too many objects");
+ stringsErr[ERR_OBLIGATORYTOKEN] = TR("\"%s\" missing in this exercise");
+ stringsErr[ERR_PROHIBITEDTOKEN] = TR("Do not use in this exercise");
+
+ stringsErr[INFO_BUILD] = TR("Building completed");
+ stringsErr[INFO_CONVERT] = TR("Titanium available");
+ stringsErr[INFO_RESEARCH] = TR("Research program completed");
+ stringsErr[INFO_RESEARCHTANK] = TR("Plans for tracked robots available ");
+ stringsErr[INFO_RESEARCHFLY] = TR("You can fly with the keys (\\key gup;) and (\\key gdown;)");
+ stringsErr[INFO_RESEARCHTHUMP] = TR("Plans for thumper available");
+ stringsErr[INFO_RESEARCHCANON] = TR("Plans for shooter available");
+ stringsErr[INFO_RESEARCHTOWER] = TR("Plans for defense tower available");
+ stringsErr[INFO_RESEARCHPHAZER] = TR("Plans for phazer shooter available");
+ stringsErr[INFO_RESEARCHSHIELD] = TR("Plans for shielder available");
+ stringsErr[INFO_RESEARCHATOMIC] = TR("Plans for nuclear power plant available");
+ stringsErr[INFO_FACTORY] = TR("New bot available");
+ stringsErr[INFO_LABO] = TR("Analysis performed");
+ stringsErr[INFO_ENERGY] = TR("Power cell available");
+ stringsErr[INFO_NUCLEAR] = TR("Nuclear power cell available");
+ stringsErr[INFO_FINDING] = TR("You found a usable object");
+ stringsErr[INFO_MARKPOWER] = TR("Found a site for power station");
+ stringsErr[INFO_MARKURANIUM] = TR("Found a site for a derrick");
+ stringsErr[INFO_MARKSTONE] = TR("Found a site for a derrick");
+ stringsErr[INFO_MARKKEYa] = TR("Found a site for a derrick");
+ stringsErr[INFO_MARKKEYb] = TR("Found a site for a derrick");
+ stringsErr[INFO_MARKKEYc] = TR("Found a site for a derrick");
+ stringsErr[INFO_MARKKEYd] = TR("Found a site for a derrick");
+ stringsErr[INFO_WIN] = TR("<<< Well done; mission accomplished >>>");
+ stringsErr[INFO_LOST] = TR("<<< Sorry; mission failed >>>");
+ stringsErr[INFO_LOSTq] = TR("<<< Sorry; mission failed >>>");
+ stringsErr[INFO_WRITEOK] = TR("Current mission saved");
+ stringsErr[INFO_DELETEPATH] = TR("Checkpoint crossed");
+ stringsErr[INFO_DELETEMOTHER] = TR("Alien Queen killed");
+ stringsErr[INFO_DELETEANT] = TR("Ant fatally wounded");
+ stringsErr[INFO_DELETEBEE] = TR("Wasp fatally wounded");
+ stringsErr[INFO_DELETEWORM] = TR("Worm fatally wounded");
+ stringsErr[INFO_DELETESPIDER] = TR("Spider fatally wounded");
+ stringsErr[INFO_BEGINSATCOM] = TR("Press \\key help; to read instructions on your SatCom");
+
+
+
+ stringsCbot[TX_OPENPAR] = TR("Opening bracket missing");
+ stringsCbot[TX_CLOSEPAR] = TR("Closing bracket missing ");
+ stringsCbot[TX_NOTBOOL] = TR("The expression must return a boolean value");
+ stringsCbot[TX_UNDEFVAR] = TR("Variable not declared");
+ stringsCbot[TX_BADLEFT] = TR("Assignment impossible");
+ stringsCbot[TX_ENDOF] = TR("Semicolon terminator missing");
+ stringsCbot[TX_OUTCASE] = TR("Instruction \"case\" outside a block \"switch\"");
+ stringsCbot[TX_NOTERM] = TR("Instructions after the final closing brace");
+ stringsCbot[TX_CLOSEBLK] = TR("End of block missing");
+ stringsCbot[TX_ELSEWITHOUTIF] = TR("Instruction \"else\" without corresponding \"if\" ");
+ stringsCbot[TX_OPENBLK] = TR("Opening brace missing ");
+ stringsCbot[TX_BADTYPE] = TR("Wrong type for the assignment");
+ stringsCbot[TX_REDEFVAR] = TR("A variable can not be declared twice");
+ stringsCbot[TX_BAD2TYPE] = TR("The types of the two operands are incompatible ");
+ stringsCbot[TX_UNDEFCALL] = TR("Unknown function");
+ stringsCbot[TX_MISDOTS] = TR("Sign \" : \" missing");
+ stringsCbot[TX_WHILE] = TR("Keyword \"while\" missing");
+ stringsCbot[TX_BREAK] = TR("Instruction \"break\" outside a loop");
+ stringsCbot[TX_LABEL] = TR("A label must be followed by \"for\"; \"while\"; \"do\" or \"switch\"");
+ stringsCbot[TX_NOLABEL] = TR("This label does not exist");
+ stringsCbot[TX_NOCASE] = TR("Instruction \"case\" missing");
+ stringsCbot[TX_BADNUM] = TR("Number missing");
+ stringsCbot[TX_VOID] = TR("Void parameter");
+ stringsCbot[TX_NOTYP] = TR("Type declaration missing");
+ stringsCbot[TX_NOVAR] = TR("Variable name missing");
+ stringsCbot[TX_NOFONC] = TR("Function name missing");
+ stringsCbot[TX_OVERPARAM] = TR("Too many parameters");
+ stringsCbot[TX_REDEF] = TR("Function already exists");
+ stringsCbot[TX_LOWPARAM] = TR("Parameters missing ");
+ stringsCbot[TX_BADPARAM] = TR("No function with this name accepts this kind of parameter");
+ stringsCbot[TX_NUMPARAM] = TR("No function with this name accepts this number of parameters");
+ stringsCbot[TX_NOITEM] = TR("This is not a member of this class");
+ stringsCbot[TX_DOT] = TR("This object is not a member of a class");
+ stringsCbot[TX_NOCONST] = TR("Appropriate constructor missing");
+ stringsCbot[TX_REDEFCLASS] = TR("This class already exists");
+ stringsCbot[TX_CLBRK] = TR("\" ] \" missing");
+ stringsCbot[TX_RESERVED] = TR("Reserved keyword of CBOT language");
+ stringsCbot[TX_BADNEW] = TR("Bad argument for \"new\"");
+ stringsCbot[TX_OPBRK] = TR("\" [ \" expected");
+ stringsCbot[TX_BADSTRING] = TR("String missing");
+ stringsCbot[TX_BADINDEX] = TR("Incorrect index type");
+ stringsCbot[TX_PRIVATE] = TR("Private element");
+ stringsCbot[TX_NOPUBLIC] = TR("Public required");
+ stringsCbot[TX_DIVZERO] = TR("Dividing by zero");
+ stringsCbot[TX_NOTINIT] = TR("Variable not initialized");
+ stringsCbot[TX_BADTHROW] = TR("Negative value rejected by \"throw\"");
+ stringsCbot[TX_NORETVAL] = TR("The function returned no value ");
+ stringsCbot[TX_NORUN] = TR("No function running");
+ stringsCbot[TX_NOCALL] = TR("Calling an unknown function");
+ stringsCbot[TX_NOCLASS] = TR("This class does not exist");
+ stringsCbot[TX_NULLPT] = TR("Unknown Object");
+ stringsCbot[TX_OPNAN] = TR("Operation impossible with value \"nan\"");
+ stringsCbot[TX_OUTARRAY] = TR("Access beyond array limit");
+ stringsCbot[TX_STACKOVER] = TR("Stack overflow");
+ stringsCbot[TX_DELETEDPT] = TR("Illegal object");
+ stringsCbot[TX_FILEOPEN] = TR("Can't open file");
+ stringsCbot[TX_NOTOPEN] = TR("File not open");
+ stringsCbot[TX_ERRREAD] = TR("Read error");
+ stringsCbot[TX_ERRWRITE] = TR("Write error");
}
diff --git a/src/common/restext.h b/src/common/restext.h
index cde7203..8eb6bdb 100644
--- a/src/common/restext.h
+++ b/src/common/restext.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/restext.h
@@ -72,7 +75,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 +88,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/common/singleton.h b/src/common/singleton.h
index 841759d..eab7ec5 100644
--- a/src/common/singleton.h
+++ b/src/common/singleton.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/singleton.h
@@ -62,10 +65,7 @@ public:
static void ReplaceInstance(T* newInstance)
{
assert(newInstance != nullptr);
-
- if (m_instance != nullptr)
- delete m_instance;
-
+ delete m_instance;
m_instance = newInstance;
}
#endif
diff --git a/src/common/stringutils.cpp b/src/common/stringutils.cpp
index 03a0f0b..9edc82d 100644
--- a/src/common/stringutils.cpp
+++ b/src/common/stringutils.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/stringutils.h"
diff --git a/src/common/stringutils.h b/src/common/stringutils.h
index e80163a..46c1d2a 100644
--- a/src/common/stringutils.h
+++ b/src/common/stringutils.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file common/stringutils.h
diff --git a/src/graphics/core/color.cpp b/src/graphics/core/color.cpp
index f0b74f8..d51eb1a 100644
--- a/src/graphics/core/color.cpp
+++ b/src/graphics/core/color.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/core/color.h"
diff --git a/src/graphics/core/color.h b/src/graphics/core/color.h
index 87a50f4..d73b47e 100644
--- a/src/graphics/core/color.h
+++ b/src/graphics/core/color.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/color.h
diff --git a/src/graphics/core/device.h b/src/graphics/core/device.h
index a896104..f52e07f 100644
--- a/src/graphics/core/device.h
+++ b/src/graphics/core/device.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/device.h
@@ -258,26 +260,16 @@ public:
//! Sets the transform matrix of given type
virtual void SetTransform(TransformType type, const Math::Matrix &matrix) = 0;
- //! Returns the current transform matrix of given type
- virtual const Math::Matrix& GetTransform(TransformType type) = 0;
- //! Multiplies the current transform matrix of given type by given matrix
- virtual void MultiplyTransform(TransformType type, const Math::Matrix &matrix) = 0;
//! Sets the current material
virtual void SetMaterial(const Material &material) = 0;
- //! Returns the current material
- virtual const Material& GetMaterial() = 0;
//! Returns the maximum number of lights available
virtual int GetMaxLightCount() = 0;
//! Sets the light at given index
virtual void SetLight(int index, const Light &light) = 0;
- //! Returns the current light at given index
- virtual const Light& GetLight(int index) = 0;
//! Enables/disables the light at given index
virtual void SetLightEnabled(int index, bool enabled) = 0;
- //! Returns the current enable state of light at given index
- virtual bool GetLightEnabled(int index) = 0;
//! Creates a texture from image; the image can be safely removed after that
virtual Texture CreateTexture(CImage *image, const TextureCreateParams &params) = 0;
@@ -294,17 +286,11 @@ public:
virtual void SetTexture(int index, const Texture &texture) = 0;
//! Sets the texture image by ID at given texture stage
virtual void SetTexture(int index, unsigned int textureId) = 0;
- //! Returns the (multi)texture at given index
- virtual Texture GetTexture(int index) = 0;
//! Enables/disables the given texture stage
virtual void SetTextureEnabled(int index, bool enabled) = 0;
- //! Returns the current enable state of given texture stage
- virtual bool GetTextureEnabled(int index) = 0;
//! Sets the params for texture stage with given index
virtual void SetTextureStageParams(int index, const TextureStageParams &params) = 0;
- //! Returns the current params of texture stage with given index
- virtual TextureStageParams GetTextureStageParams(int index) = 0;
//! Sets only the texture wrap modes (for faster than thru stage params)
virtual void SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode wrapT) = 0;
@@ -348,61 +334,39 @@ public:
//! Enables/disables the given render state
virtual void SetRenderState(RenderState state, bool enabled) = 0;
- //! Returns the current setting of given render state
- virtual bool GetRenderState(RenderState state) = 0;
//! Sets the function of depth test
virtual void SetDepthTestFunc(CompFunc func) = 0;
- //! Returns the current function of depth test
- virtual CompFunc GetDepthTestFunc() = 0;
//! Sets the depth bias (constant value added to Z-coords)
virtual void SetDepthBias(float factor) = 0;
- //! Returns the current depth bias
- virtual float GetDepthBias() = 0;
//! Sets the alpha test function and reference value
virtual void SetAlphaTestFunc(CompFunc func, float refValue) = 0;
- //! Returns the current alpha test function and reference value
- virtual void GetAlphaTestFunc(CompFunc &func, float &refValue) = 0;
//! Sets the blending functions for source and destination operations
virtual void SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend) = 0;
- //! Returns the current blending functions for source and destination operations
- virtual void GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend) = 0;
//! Sets the clear color
virtual void SetClearColor(const Color &color) = 0;
- //! Returns the current clear color
- virtual Color GetClearColor() = 0;
//! Sets the global ambient color
virtual void SetGlobalAmbient(const Color &color) = 0;
- //! Returns the global ambient color
- virtual Color GetGlobalAmbient() = 0;
//! Sets the fog parameters: mode, color, start distance, end distance and density (for exp models)
virtual void SetFogParams(FogMode mode, const Color &color, float start, float end, float density) = 0;
- //! Returns the current fog parameters: mode, color, start distance, end distance and density (for exp models)
- virtual void GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density) = 0;
//! Sets the current cull mode
virtual void SetCullMode(CullMode mode) = 0;
- //! Returns the current cull mode
- virtual CullMode GetCullMode() = 0;
//! Sets the shade model
virtual void SetShadeModel(ShadeModel model) = 0;
- //! Returns the current shade model
- virtual ShadeModel GetShadeModel() = 0;
//! Sets the current fill mode
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;
+ virtual void* GetFrameBufferPixels() const = 0;
};
diff --git a/src/graphics/core/light.h b/src/graphics/core/light.h
index 923d0e9..e8eda7b 100644
--- a/src/graphics/core/light.h
+++ b/src/graphics/core/light.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/light.h
diff --git a/src/graphics/core/material.h b/src/graphics/core/material.h
index e0bfaff..1fde860 100644
--- a/src/graphics/core/material.h
+++ b/src/graphics/core/material.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/material.h
diff --git a/src/graphics/core/nulldevice.cpp b/src/graphics/core/nulldevice.cpp
new file mode 100644
index 0000000..f5e426d
--- /dev/null
+++ b/src/graphics/core/nulldevice.cpp
@@ -0,0 +1,343 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+
+#include "graphics/core/nulldevice.h"
+
+#include "common/config.h"
+#include "common/logger.h"
+
+#include "math/geometry.h"
+
+
+// Graphics module namespace
+namespace Gfx {
+
+CNullDevice::CNullDevice()
+{
+ m_matrix = Math::Matrix();
+ m_material = Material();
+ m_light = Light();
+}
+
+CNullDevice::~CNullDevice()
+{
+}
+
+void CNullDevice::DebugHook()
+{
+}
+
+void CNullDevice::DebugLights()
+{
+}
+
+bool CNullDevice::Create()
+{
+ return true;
+}
+
+void CNullDevice::Destroy()
+{
+}
+
+void CNullDevice::BeginScene()
+{
+}
+
+void CNullDevice::EndScene()
+{
+}
+
+void CNullDevice::Clear()
+{
+}
+
+void CNullDevice::SetTransform(TransformType type, const Math::Matrix &matrix)
+{
+}
+
+const Math::Matrix& CNullDevice::GetTransform(TransformType type)
+{
+ return m_matrix;
+}
+
+void CNullDevice::MultiplyTransform(TransformType type, const Math::Matrix &matrix)
+{
+}
+
+void CNullDevice::SetMaterial(const Material &material)
+{
+}
+
+const Material& CNullDevice::GetMaterial()
+{
+ return m_material;
+}
+
+int CNullDevice::GetMaxLightCount()
+{
+ return 99;
+}
+
+void CNullDevice::SetLight(int index, const Light &light)
+{
+}
+
+const Light& CNullDevice::GetLight(int index)
+{
+ return m_light;
+}
+
+void CNullDevice::SetLightEnabled(int index, bool enabled)
+{
+}
+
+bool CNullDevice::GetLightEnabled(int index)
+{
+ return false;
+}
+
+Texture CNullDevice::CreateTexture(CImage *image, const TextureCreateParams &params)
+{
+ Texture tex;
+ tex.id = 1; // tex.id = 0 => invalid texture
+ return tex;
+}
+
+Texture CNullDevice::CreateTexture(ImageData *data, const TextureCreateParams &params)
+{
+ Texture tex;
+ tex.id = 1; // tex.id = 0 => invalid texture
+ return tex;
+}
+
+void CNullDevice::DestroyTexture(const Texture &texture)
+{
+}
+
+void CNullDevice::DestroyAllTextures()
+{
+}
+
+int CNullDevice::GetMaxTextureStageCount()
+{
+ return 0;
+}
+
+void CNullDevice::SetTexture(int index, const Texture &texture)
+{
+}
+
+void CNullDevice::SetTexture(int index, unsigned int textureId)
+{
+}
+
+Texture CNullDevice::GetTexture(int index)
+{
+ return Texture();
+}
+
+void CNullDevice::SetTextureEnabled(int index, bool enabled)
+{
+}
+
+bool CNullDevice::GetTextureEnabled(int index)
+{
+ return false;
+}
+
+void CNullDevice::SetTextureStageParams(int index, const TextureStageParams &params)
+{
+}
+
+void CNullDevice::SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode wrapT)
+{
+}
+
+TextureStageParams CNullDevice::GetTextureStageParams(int index)
+{
+ return TextureStageParams();
+}
+
+void CNullDevice::DrawPrimitive(PrimitiveType type, const Vertex *vertices, int vertexCount,
+ Color color)
+{
+}
+
+void CNullDevice::DrawPrimitive(PrimitiveType type, const VertexTex2 *vertices, int vertexCount,
+ Color color)
+{
+}
+
+void CNullDevice::DrawPrimitive(PrimitiveType type, const VertexCol *vertices, int vertexCount)
+{
+}
+
+unsigned int CNullDevice::CreateStaticBuffer(PrimitiveType primitiveType, const Vertex* vertices, int vertexCount)
+{
+ return 0;
+}
+
+unsigned int CNullDevice::CreateStaticBuffer(PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount)
+{
+ return 0;
+}
+
+unsigned int CNullDevice::CreateStaticBuffer(PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount)
+{
+ return 0;
+}
+
+void CNullDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const Vertex* vertices, int vertexCount)
+{
+}
+
+void CNullDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount)
+{
+}
+
+void CNullDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount)
+{
+}
+
+void CNullDevice::DrawStaticBuffer(unsigned int bufferId)
+{
+}
+
+void CNullDevice::DestroyStaticBuffer(unsigned int bufferId)
+{
+}
+
+int CNullDevice::ComputeSphereVisibility(const Math::Vector &center, float radius)
+{
+ return 0;
+}
+
+void CNullDevice::SetRenderState(RenderState state, bool enabled)
+{
+}
+
+bool CNullDevice::GetRenderState(RenderState state)
+{
+ return false;
+}
+
+void CNullDevice::SetDepthTestFunc(CompFunc func)
+{
+}
+
+CompFunc CNullDevice::GetDepthTestFunc()
+{
+ return COMP_FUNC_NEVER;
+}
+
+void CNullDevice::SetDepthBias(float factor)
+{
+}
+
+float CNullDevice::GetDepthBias()
+{
+ return 0.0f;
+}
+
+void CNullDevice::SetAlphaTestFunc(CompFunc func, float refValue)
+{
+}
+
+void CNullDevice::GetAlphaTestFunc(CompFunc &func, float &refValue)
+{
+
+ func = COMP_FUNC_NEVER;
+ refValue = 0.0f;
+}
+
+void CNullDevice::SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend)
+{
+}
+
+void CNullDevice::GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend)
+{
+ srcBlend = BLEND_ZERO;
+ dstBlend = BLEND_ZERO;
+}
+
+void CNullDevice::SetClearColor(const Color &color)
+{
+}
+
+Color CNullDevice::GetClearColor()
+{
+ return Color(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void CNullDevice::SetGlobalAmbient(const Color &color)
+{
+}
+
+Color CNullDevice::GetGlobalAmbient()
+{
+ return Color(0.0f, 0.0f, 0.0f, 0.0f);
+}
+
+void CNullDevice::SetFogParams(FogMode mode, const Color &color, float start, float end, float density)
+{
+}
+
+void CNullDevice::GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density)
+{
+ //
+}
+
+void CNullDevice::SetCullMode(CullMode mode)
+{
+}
+
+CullMode CNullDevice::GetCullMode()
+{
+ return CULL_CW;
+}
+
+void CNullDevice::SetShadeModel(ShadeModel model)
+{
+}
+
+ShadeModel CNullDevice::GetShadeModel()
+{
+ return SHADE_FLAT;
+}
+
+void CNullDevice::SetFillMode(FillMode mode)
+{
+}
+
+FillMode CNullDevice::GetFillMode()
+{
+ return FILL_POINT;
+}
+
+void* CNullDevice::GetFrameBufferPixels() const
+{
+ return nullptr;
+}
+
+
+} // namespace Gfx
+
+
diff --git a/src/graphics/core/nulldevice.h b/src/graphics/core/nulldevice.h
new file mode 100644
index 0000000..c6065a6
--- /dev/null
+++ b/src/graphics/core/nulldevice.h
@@ -0,0 +1,145 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+/**
+ * \file graphics/core/device.h
+ * \brief Abstract graphics device - CDevice class and related structs/enums
+ */
+
+#pragma once
+
+
+#include "graphics/core/device.h"
+
+// Graphics module namespace
+namespace Gfx {
+
+/**
+ * \class CNullDevice
+ * \brief Device implementation that doesn't render anything
+ *
+ */
+class CNullDevice : public CDevice
+{
+public:
+ CNullDevice();
+ virtual ~CNullDevice();
+
+ virtual void DebugHook();
+ virtual void DebugLights();
+
+ virtual bool Create();
+ virtual void Destroy();
+
+ virtual void BeginScene();
+ virtual void EndScene();
+
+ virtual void Clear();
+
+ virtual void SetTransform(TransformType type, const Math::Matrix &matrix);
+ virtual const Math::Matrix& GetTransform(TransformType type);
+ virtual void MultiplyTransform(TransformType type, const Math::Matrix &matrix);
+
+ virtual void SetMaterial(const Material &material);
+ virtual const Material& GetMaterial();
+
+ virtual int GetMaxLightCount();
+ virtual void SetLight(int index, const Light &light);
+ virtual const Light& GetLight(int index);
+ virtual void SetLightEnabled(int index, bool enabled);
+ virtual bool GetLightEnabled(int index);
+
+ virtual Texture CreateTexture(CImage *image, const TextureCreateParams &params);
+ virtual Texture CreateTexture(ImageData *data, const TextureCreateParams &params);
+ virtual void DestroyTexture(const Texture &texture);
+ virtual void DestroyAllTextures();
+
+ virtual int GetMaxTextureStageCount();
+ virtual void SetTexture(int index, const Texture &texture);
+ virtual void SetTexture(int index, unsigned int textureId);
+ virtual Texture GetTexture(int index);
+ virtual void SetTextureEnabled(int index, bool enabled);
+ virtual bool GetTextureEnabled(int index);
+
+ virtual void SetTextureStageParams(int index, const TextureStageParams &params);
+ virtual TextureStageParams GetTextureStageParams(int index);
+
+ virtual void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT);
+
+ virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
+ Color color = Color(1.0f, 1.0f, 1.0f, 1.0f));
+ virtual void DrawPrimitive(PrimitiveType type, const VertexTex2 *vertices, int vertexCount,
+ Color color = Color(1.0f, 1.0f, 1.0f, 1.0f));
+ virtual void DrawPrimitive(PrimitiveType type, const VertexCol *vertices , int vertexCount);
+
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const Vertex* vertices, int vertexCount);
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount);
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount);
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const Vertex* vertices, int vertexCount);
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount);
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount);
+ virtual void DrawStaticBuffer(unsigned int bufferId);
+ virtual void DestroyStaticBuffer(unsigned int bufferId);
+
+ virtual int ComputeSphereVisibility(const Math::Vector &center, float radius);
+
+ virtual void SetRenderState(RenderState state, bool enabled);
+ virtual bool GetRenderState(RenderState state);
+
+ virtual void SetDepthTestFunc(CompFunc func);
+ virtual CompFunc GetDepthTestFunc();
+
+ virtual void SetDepthBias(float factor);
+ virtual float GetDepthBias();
+
+ virtual void SetAlphaTestFunc(CompFunc func, float refValue);
+ virtual void GetAlphaTestFunc(CompFunc &func, float &refValue);
+
+ virtual void SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend);
+ virtual void GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend);
+
+ virtual void SetClearColor(const Color &color);
+ virtual Color GetClearColor();
+
+ virtual void SetGlobalAmbient(const Color &color);
+ virtual Color GetGlobalAmbient();
+
+ virtual void SetFogParams(FogMode mode, const Color &color, float start, float end, float density);
+ virtual void GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density);
+
+ virtual void SetCullMode(CullMode mode);
+ virtual CullMode GetCullMode();
+
+ virtual void SetShadeModel(ShadeModel model);
+ virtual ShadeModel GetShadeModel();
+
+ virtual void SetFillMode(FillMode mode) ;
+ virtual FillMode GetFillMode();
+
+ virtual void* GetFrameBufferPixels() const;
+
+private:
+ Math::Matrix m_matrix;
+ Material m_material;
+ Light m_light;
+};
+
+
+} // namespace Gfx
+
diff --git a/src/graphics/core/texture.h b/src/graphics/core/texture.h
index 0702428..3ce06ee 100644
--- a/src/graphics/core/texture.h
+++ b/src/graphics/core/texture.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/texture.h
diff --git a/src/graphics/core/vertex.h b/src/graphics/core/vertex.h
index ca68352..7af7212 100644
--- a/src/graphics/core/vertex.h
+++ b/src/graphics/core/vertex.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/core/vertex.h
diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp
index fedc70a..6464b22 100644
--- a/src/graphics/engine/camera.cpp
+++ b/src/graphics/engine/camera.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/camera.h"
@@ -137,6 +139,7 @@ CCamera::CCamera()
m_scriptLookat = Math::Vector(0.0f, 0.0f, 0.0f);
m_effect = true;
+ m_blood = true;
m_cameraScroll = true;
m_cameraInvertX = false;
m_cameraInvertY = false;
@@ -151,6 +154,15 @@ void CCamera::SetEffect(bool enable)
m_effect = enable;
}
+void CCamera::SetBlood(bool enable)
+{
+ m_blood = enable;
+}
+
+bool CCamera::GetBlood() {
+ return m_blood;
+}
+
void CCamera::SetCameraScroll(bool scroll)
{
m_cameraScroll = scroll;
diff --git a/src/graphics/engine/camera.h b/src/graphics/engine/camera.h
index 6d94dad..4fe821f 100644
--- a/src/graphics/engine/camera.h
+++ b/src/graphics/engine/camera.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/camera.h
@@ -198,6 +200,8 @@ public:
void SetScriptLookat(Math::Vector lookat);
void SetEffect(bool enable);
+ void SetBlood(bool enable);
+ bool GetBlood();
void SetCameraScroll(bool scroll);
void SetCameraInvertX(bool invert);
void SetCameraInvertY(bool invert);
@@ -379,6 +383,8 @@ protected:
//! Shocks if explosion?
bool m_effect;
+ //! Blood?
+ bool m_blood;
//! Scroll in the edges?
bool m_cameraScroll;
//! X inversion in the edges?
diff --git a/src/graphics/engine/cloud.cpp b/src/graphics/engine/cloud.cpp
index 74083af..7ec0d9e 100644
--- a/src/graphics/engine/cloud.cpp
+++ b/src/graphics/engine/cloud.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/cloud.h"
@@ -125,8 +127,8 @@ void CCloud::Draw()
material.ambient = m_ambient;
m_engine->SetMaterial(material);
- m_engine->SetTexture(m_fileName, 0);
- m_engine->SetTexture(m_fileName, 1);
+ m_engine->SetTexture("textures/"+m_fileName, 0);
+ m_engine->SetTexture("textures/"+m_fileName, 1);
m_engine->SetState(ENG_RSTATE_TTEXTURE_BLACK | ENG_RSTATE_FOG | ENG_RSTATE_WRAP);
@@ -218,7 +220,7 @@ void CCloud::Create(const std::string& fileName,
m_fileName = fileName;
if (! m_fileName.empty())
- m_engine->LoadTexture(m_fileName);
+ m_engine->LoadTexture("textures/"+m_fileName);
if (m_terrain == nullptr)
m_terrain = CRobotMain::GetInstancePointer()->GetTerrain();
diff --git a/src/graphics/engine/cloud.h b/src/graphics/engine/cloud.h
index 8e820c7..decf1d6 100644
--- a/src/graphics/engine/cloud.h
+++ b/src/graphics/engine/cloud.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/cloud.h
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index e0861d2..3c642ae 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -1,25 +1,26 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/engine.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "common/image.h"
#include "common/key.h"
@@ -283,7 +284,7 @@ bool CEngine::Create()
params.minFilter = TEX_MIN_FILTER_NEAREST;
params.magFilter = TEX_MAG_FILTER_NEAREST;
params.mipmap = false;
- m_miceTexture = LoadTexture("mouse.png", params);
+ m_miceTexture = LoadTexture("textures/interface/mouse.png", params);
GetSystemUtils()->GetCurrentTimeStamp(m_currentFrameTime);
GetSystemUtils()->GetCurrentTimeStamp(m_lastFrameTime);
@@ -294,6 +295,9 @@ bool CEngine::Create()
void CEngine::Destroy()
{
m_text->Destroy();
+
+ delete m_pause;
+ m_pause = nullptr;
delete m_lightMan;
m_lightMan = nullptr;
@@ -319,11 +323,13 @@ void CEngine::Destroy()
void CEngine::ResetAfterDeviceChanged()
{
- m_size = m_app->GetVideoConfig().size;;
+ m_size = m_app->GetVideoConfig().size;
m_text->FlushCache();
FlushTextureCache();
+
+ LoadAllTextures();
}
bool CEngine::ProcessEvent(const Event &event)
@@ -509,6 +515,16 @@ int CEngine::GetStatisticTriangle()
return m_statisticTriangle;
}
+void CEngine::SetStatisticPos(Math::Vector pos)
+{
+ m_statisticPos = pos;
+}
+
+void CEngine::SetTimerDisplay(const std::string& text)
+{
+ m_timerText = text;
+}
+
/*******************************************************
@@ -1124,10 +1140,10 @@ void CEngine::ChangeSecondTexture(int objRank, const std::string& tex2Name)
p1.next[l2].next.clear();
if (!newP2.tex1.Valid())
- newP2.tex1 = LoadTexture(newP2.tex1Name);
+ newP2.tex1 = LoadTexture("textures/"+newP2.tex1Name);
if (!newP2.tex2.Valid())
- newP2.tex2 = LoadTexture(newP2.tex2Name);
+ newP2.tex2 = LoadTexture("textures/"+newP2.tex2Name);
}
}
@@ -1965,10 +1981,10 @@ bool CEngine::IsWithinLODLimit(float distance, LODLevel lodLevel)
}
min *= m_size.x / 640.0f;
- min *= m_objectDetail*2.0f;
+ min *= 1.0f+m_objectDetail*2.0f;
max *= m_size.x / 640.0f;
- max *= m_objectDetail*2.0f;
+ max *= 1.0f+m_objectDetail*2.0f;
}
return distance >= min && distance < max;
@@ -2258,7 +2274,7 @@ Texture CEngine::CreateTexture(const std::string& texName, const TextureCreatePa
if (image == nullptr)
{
- if (! img.Load(CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, texName)))
+ if (!img.Load(texName))
{
std::string error = img.GetError();
GetLogger()->Error("Couldn't load texture '%s': %s, blacklisting\n", texName.c_str(), error.c_str());
@@ -2309,27 +2325,27 @@ Texture CEngine::LoadTexture(const std::string& name, const TextureCreateParams&
bool CEngine::LoadAllTextures()
{
- LoadTexture("text.png");
- m_miceTexture = LoadTexture("mouse.png");
- LoadTexture("button1.png");
- LoadTexture("button2.png");
- LoadTexture("button3.png");
- LoadTexture("effect00.png");
- LoadTexture("effect01.png");
- LoadTexture("effect02.png");
- LoadTexture("map.png");
+ LoadTexture("textures/interface/text.png");
+ m_miceTexture = LoadTexture("textures/interface/mouse.png");
+ LoadTexture("textures/interface/button1.png");
+ LoadTexture("textures/interface/button2.png");
+ LoadTexture("textures/interface/button3.png");
+ LoadTexture("textures/effect00.png");
+ LoadTexture("textures/effect01.png");
+ LoadTexture("textures/effect02.png");
+ LoadTexture("textures/interface/map.png");
if (! m_backgroundName.empty())
{
TextureCreateParams params = m_defaultTexParams;
params.padToNearestPowerOfTwo = true;
- m_backgroundTex = LoadTexture(m_backgroundName, params);
+ m_backgroundTex = LoadTexture("textures/"+m_backgroundName, params);
}
else
m_backgroundTex.SetInvalid();
if (! m_foregroundName.empty())
- m_foregroundTex = LoadTexture(m_foregroundName);
+ m_foregroundTex = LoadTexture("textures/"+m_foregroundName);
else
m_foregroundTex.SetInvalid();
@@ -2363,9 +2379,9 @@ bool CEngine::LoadAllTextures()
if (! p2.tex1Name.empty())
{
if (terrain)
- p2.tex1 = LoadTexture(p2.tex1Name, m_terrainTexParams);
+ p2.tex1 = LoadTexture("textures/"+p2.tex1Name, m_terrainTexParams);
else
- p2.tex1 = LoadTexture(p2.tex1Name);
+ p2.tex1 = LoadTexture("textures/"+p2.tex1Name);
if (! p2.tex1.Valid())
ok = false;
@@ -2374,9 +2390,9 @@ bool CEngine::LoadAllTextures()
if (! p2.tex2Name.empty())
{
if (terrain)
- p2.tex2 = LoadTexture(p2.tex2Name, m_terrainTexParams);
+ p2.tex2 = LoadTexture("textures/"+p2.tex2Name, m_terrainTexParams);
else
- p2.tex2 = LoadTexture(p2.tex2Name);
+ p2.tex2 = LoadTexture("textures/"+p2.tex2Name);
if (! p2.tex2.Valid())
ok = false;
@@ -2426,7 +2442,7 @@ bool CEngine::ChangeTextureColor(const std::string& texName,
CImage img;
- if (! img.Load(CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, texName)))
+ if (!img.Load(texName))
{
std::string error = img.GetError();
GetLogger()->Error("Couldn't load texture '%s': %s, blacklisting\n", texName.c_str(), error.c_str());
@@ -2771,7 +2787,7 @@ void CEngine::SetBackground(const std::string& name, Color up, Color down,
{
TextureCreateParams params = m_defaultTexParams;
params.padToNearestPowerOfTwo = true;
- m_backgroundTex = LoadTexture(m_backgroundName, params);
+ m_backgroundTex = LoadTexture("textures/"+m_backgroundName, params);
}
}
@@ -2797,7 +2813,7 @@ void CEngine::SetForegroundName(const std::string& name)
m_foregroundName = name;
if (! m_foregroundName.empty())
- m_foregroundTex = LoadTexture(m_foregroundName);
+ m_foregroundTex = LoadTexture("textures/"+m_foregroundName);
}
void CEngine::SetOverFront(bool front)
@@ -3124,67 +3140,67 @@ void CEngine::Draw3DScene()
m_app->StartPerformanceCounter(PCNT_RENDER_TERRAIN);
- // Draw terrain with shadows, if shadows enabled
- if (m_shadowVisible)
+ // Draw terrain
+
+ m_lightMan->UpdateDeviceLights(ENG_OBJTYPE_TERRAIN);
+
+ for (int objRank = 0; objRank < static_cast<int>(m_objects.size()); objRank++)
{
- m_lightMan->UpdateDeviceLights(ENG_OBJTYPE_TERRAIN);
+ if (! m_objects[objRank].used)
+ continue;
- for (int objRank = 0; objRank < static_cast<int>(m_objects.size()); objRank++)
- {
- if (! m_objects[objRank].used)
- continue;
+ if (m_objects[objRank].type != ENG_OBJTYPE_TERRAIN)
+ continue;
- if (m_objects[objRank].type != ENG_OBJTYPE_TERRAIN)
- continue;
+ if (! m_objects[objRank].drawWorld)
+ continue;
- if (! m_objects[objRank].drawWorld)
- continue;
+ m_device->SetTransform(TRANSFORM_WORLD, m_objects[objRank].transform);
- m_device->SetTransform(TRANSFORM_WORLD, m_objects[objRank].transform);
+ if (! IsVisible(objRank))
+ continue;
- if (! IsVisible(objRank))
- continue;
+ int baseObjRank = m_objects[objRank].baseObjRank;
+ if (baseObjRank == -1)
+ continue;
- int baseObjRank = m_objects[objRank].baseObjRank;
- if (baseObjRank == -1)
- continue;
+ assert(baseObjRank >= 0 && baseObjRank < static_cast<int>( m_baseObjects.size() ));
- assert(baseObjRank >= 0 && baseObjRank < static_cast<int>( m_baseObjects.size() ));
+ EngineBaseObject& p1 = m_baseObjects[baseObjRank];
+ if (! p1.used)
+ continue;
- EngineBaseObject& p1 = m_baseObjects[baseObjRank];
- if (! p1.used)
- continue;
+ for (int l2 = 0; l2 < static_cast<int>( p1.next.size() ); l2++)
+ {
+ EngineBaseObjTexTier& p2 = p1.next[l2];
- for (int l2 = 0; l2 < static_cast<int>( p1.next.size() ); l2++)
+ SetTexture(p2.tex1, 0);
+ SetTexture(p2.tex2, 1);
+
+ for (int l3 = 0; l3 < static_cast<int>( p2.next.size() ); l3++)
{
- EngineBaseObjTexTier& p2 = p1.next[l2];
+ EngineBaseObjLODTier& p3 = p2.next[l3];
- SetTexture(p2.tex1, 0);
- SetTexture(p2.tex2, 1);
+ if (! IsWithinLODLimit(m_objects[objRank].distance, p3.lodLevel))
+ continue;
- for (int l3 = 0; l3 < static_cast<int>( p2.next.size() ); l3++)
+ for (int l4 = 0; l4 < static_cast<int>( p3.next.size() ); l4++)
{
- EngineBaseObjLODTier& p3 = p2.next[l3];
-
- if (! IsWithinLODLimit(m_objects[objRank].distance, p3.lodLevel))
- continue;
-
- for (int l4 = 0; l4 < static_cast<int>( p3.next.size() ); l4++)
- {
- EngineBaseObjDataTier& p4 = p3.next[l4];
+ EngineBaseObjDataTier& p4 = p3.next[l4];
- SetMaterial(p4.material);
- SetState(p4.state);
+ SetMaterial(p4.material);
+ SetState(p4.state);
- DrawObject(p4);
- }
+ DrawObject(p4);
}
}
}
+ }
- // Draws the shadows
+ // Draws the shadows , if shadows enabled
+ if (m_shadowVisible)
DrawShadow();
- }
+
m_app->StopPerformanceCounter(PCNT_RENDER_TERRAIN);
@@ -3499,6 +3515,7 @@ void CEngine::DrawInterface()
DrawMouse();
DrawHighlight();
DrawStats();
+ DrawTimer();
}
void CEngine::UpdateGroundSpotTextures()
@@ -3736,7 +3753,7 @@ void CEngine::UpdateGroundSpotTextures()
}
std::stringstream str;
- str << "shadow" << std::setfill('0') << std::setw(2) << s << ".png";
+ str << "textures/shadow" << std::setfill('0') << std::setw(2) << s << ".png";
std::string texName = str.str();
DeleteTexture(texName);
@@ -3785,7 +3802,7 @@ void CEngine::DrawShadow()
SetMaterial(material);
// TODO: create a separate texture
- SetTexture("text.png");
+ SetTexture("textures/interface/text.png");
Math::Point ts, ti;
@@ -4329,7 +4346,7 @@ void CEngine::DrawStats()
float height = m_text->GetAscent(FONT_COLOBOT, 12.0f);
float width = 0.2f;
- Math::Point pos(0.04f, 0.04f + 17 * height);
+ Math::Point pos(0.04f, 0.04f + 20 * height);
SetState(ENG_RSTATE_OPAQUE_COLOR);
@@ -4337,9 +4354,9 @@ void CEngine::DrawStats()
VertexCol vertex[4] =
{
- VertexCol(Math::Vector(pos.x , pos.y - 17 * height, 0.0f), black),
+ VertexCol(Math::Vector(pos.x , pos.y - 20 * height, 0.0f), black),
VertexCol(Math::Vector(pos.x , pos.y + height, 0.0f), black),
- VertexCol(Math::Vector(pos.x + width, pos.y - 17 * height, 0.0f), black),
+ VertexCol(Math::Vector(pos.x + width, pos.y - 20 * height, 0.0f), black),
VertexCol(Math::Vector(pos.x + width, pos.y + height, 0.0f), black)
};
@@ -4452,6 +4469,28 @@ void CEngine::DrawStats()
pos.y -= height;
m_text->DrawText(m_fpsText, FONT_COLOBOT, 12.0f, pos, 1.0f, TEXT_ALIGN_LEFT, 0, Color(1.0f, 1.0f, 1.0f, 1.0f));
+
+
+ pos.y -= height;
+ pos.y -= height;
+
+ str.str("");
+ str << "Position x: " << std::fixed << std::setprecision(2) << m_statisticPos.x/g_unit;
+ m_text->DrawText(str.str(), FONT_COLOBOT, 12.0f, pos, 1.0f, TEXT_ALIGN_LEFT, 0, Color(1.0f, 1.0f, 1.0f, 1.0f));
+
+ pos.y -= height;
+
+ str.str("");
+ str << "Position y: " << std::fixed << std::setprecision(2) << m_statisticPos.z/g_unit;
+ m_text->DrawText(str.str(), FONT_COLOBOT, 12.0f, pos, 1.0f, TEXT_ALIGN_LEFT, 0, Color(1.0f, 1.0f, 1.0f, 1.0f));
+}
+
+void CEngine::DrawTimer()
+{
+ SetState(ENG_RSTATE_TEXT);
+
+ Math::Point pos(0.98f, 0.98f-m_text->GetAscent(FONT_COLOBOT, 15.0f));
+ m_text->DrawText(m_timerText, FONT_COLOBOT, 15.0f, pos, 1.0f, TEXT_ALIGN_RIGHT, 0, Color(1.0f, 1.0f, 1.0f, 1.0f));
}
diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h
index d56bf38..6ca7d1b 100644
--- a/src/graphics/engine/engine.h
+++ b/src/graphics/engine/engine.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX& EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/engine.h
@@ -775,6 +777,12 @@ public:
void AddStatisticTriangle(int nb);
//! Returns the number of triangles in current frame
int GetStatisticTriangle();
+
+ //! Sets the coordinates to display in stats window
+ void SetStatisticPos(Math::Vector pos);
+
+ //! Sets text to display as mission timer
+ void SetTimerDisplay(const std::string& text);
/* *************** Object management *************** */
@@ -1231,6 +1239,8 @@ protected:
void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon);
//! Draw statistic texts
void DrawStats();
+ //! Draw mission timer
+ void DrawTimer();
//! Creates a new tier 2 object (texture)
EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name);
@@ -1346,6 +1356,7 @@ protected:
float m_fogStart[2];
Color m_waterAddColor;
int m_statisticTriangle;
+ Math::Vector m_statisticPos;
bool m_updateGeometry;
bool m_updateStaticBuffers;
int m_alphaMode;
@@ -1436,6 +1447,8 @@ protected:
bool m_debugLights;
bool m_debugDumpLights;
+
+ std::string m_timerText;
};
diff --git a/src/graphics/engine/lightman.cpp b/src/graphics/engine/lightman.cpp
index 564cced..bb67ad0 100644
--- a/src/graphics/engine/lightman.cpp
+++ b/src/graphics/engine/lightman.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/lightman.h"
diff --git a/src/graphics/engine/lightman.h b/src/graphics/engine/lightman.h
index 5df466d..d8f32bb 100644
--- a/src/graphics/engine/lightman.h
+++ b/src/graphics/engine/lightman.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/lightman.h
diff --git a/src/graphics/engine/lightning.cpp b/src/graphics/engine/lightning.cpp
index 4395eec..be76b2f 100644
--- a/src/graphics/engine/lightning.cpp
+++ b/src/graphics/engine/lightning.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/lightning.h"
@@ -235,7 +237,7 @@ void CLightning::Draw()
mat.LoadIdentity();
device->SetTransform(TRANSFORM_WORLD, mat);
- m_engine->SetTexture("effect00.png");
+ m_engine->SetTexture("textures/effect00.png");
m_engine->SetState(ENG_RSTATE_TTEXTURE_BLACK);
Math::Point texInf;
diff --git a/src/graphics/engine/lightning.h b/src/graphics/engine/lightning.h
index 1b1d339..3426515 100644
--- a/src/graphics/engine/lightning.h
+++ b/src/graphics/engine/lightning.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/lightning.h
diff --git a/src/graphics/engine/modelfile.cpp b/src/graphics/engine/modelfile.cpp
index 99496aa..c422f18 100644
--- a/src/graphics/engine/modelfile.cpp
+++ b/src/graphics/engine/modelfile.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/modelfile.h"
@@ -22,6 +24,10 @@
#include "common/logger.h"
#include "common/stringutils.h"
+#ifndef MODELFILE_NO_ENGINE
+#include "common/resources/inputstream.h"
+#endif
+
#include "graphics/engine/engine.h"
#include "math/geometry.h"
@@ -432,13 +438,23 @@ bool CModelFile::ReadModel(const std::string& fileName)
{
m_triangles.clear();
+ #ifndef MODELFILE_NO_ENGINE
+ CInputStream stream;
+ stream.open(fileName);
+ if (!stream.is_open())
+ {
+ GetLogger()->Error("Could not open file '%s'\n", fileName.c_str());
+ return false;
+ }
+ #else
std::ifstream stream;
- stream.open(fileName.c_str(), std::ios_base::in | std::ios_base::binary);
+ stream.open(fileName);
if (!stream.good())
{
GetLogger()->Error("Could not open file '%s'\n", fileName.c_str());
return false;
}
+ #endif
return ReadModel(stream);
}
@@ -823,13 +839,23 @@ struct NewModelTriangle1
bool CModelFile::ReadTextModel(const std::string& fileName)
{
+ #ifndef MODELFILE_NO_ENGINE
+ CInputStream stream;
+ stream.open(fileName);
+ if (!stream.is_open())
+ {
+ GetLogger()->Error("Could not open file '%s'\n", fileName.c_str());
+ return false;
+ }
+ #else
std::ifstream stream;
- stream.open(fileName.c_str(), std::ios_base::in);
+ stream.open(fileName);
if (!stream.good())
{
GetLogger()->Error("Could not open file '%s'\n", fileName.c_str());
return false;
}
+ #endif
return ReadTextModel(stream);
}
@@ -1020,13 +1046,23 @@ bool CModelFile::WriteTextModel(std::ostream& stream)
bool CModelFile::ReadBinaryModel(const std::string& fileName)
{
+ #ifndef MODELFILE_NO_ENGINE
+ CInputStream stream;
+ stream.open(fileName);
+ if (!stream.is_open())
+ {
+ GetLogger()->Error("Could not open file '%s'\n", fileName.c_str());
+ return false;
+ }
+ #else
std::ifstream stream;
- stream.open(fileName.c_str(), std::ios_base::in | std::ios_base::binary);
+ stream.open(fileName);
if (!stream.good())
{
GetLogger()->Error("Could not open file '%s'\n", fileName.c_str());
return false;
}
+ #endif
return ReadBinaryModel(stream);
}
diff --git a/src/graphics/engine/modelfile.h b/src/graphics/engine/modelfile.h
index 3b4019b..f6ac229 100644
--- a/src/graphics/engine/modelfile.h
+++ b/src/graphics/engine/modelfile.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/modelfile.h
diff --git a/src/graphics/engine/modelmanager.cpp b/src/graphics/engine/modelmanager.cpp
index 0c0fb98..ec104d0 100644
--- a/src/graphics/engine/modelmanager.cpp
+++ b/src/graphics/engine/modelmanager.cpp
@@ -1,24 +1,25 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012-2014, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/modelmanager.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "common/logger.h"
@@ -48,11 +49,9 @@ bool CModelManager::LoadModel(const std::string& fileName, bool mirrored)
if (CApplication::GetInstance().IsDebugModeActive(DEBUG_MODELS))
modelFile.SetPrintDebugInfo(true);
- std::string filePath = CGameData::GetInstancePointer()->GetFilePath(DIR_MODEL, fileName);
-
- if (!modelFile.ReadModel(filePath))
+ if (!modelFile.ReadModel("models/" + fileName))
{
- GetLogger()->Error("Loading model '%s' failed\n", filePath.c_str());
+ GetLogger()->Error("Loading model '%s' failed\n", fileName.c_str());
return false;
}
diff --git a/src/graphics/engine/modelmanager.h b/src/graphics/engine/modelmanager.h
index ee5fc27..3805631 100644
--- a/src/graphics/engine/modelmanager.h
+++ b/src/graphics/engine/modelmanager.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012-2014, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#pragma once
diff --git a/src/graphics/engine/particle.cpp b/src/graphics/engine/particle.cpp
index abee2e2..f5a16e9 100644
--- a/src/graphics/engine/particle.cpp
+++ b/src/graphics/engine/particle.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/particle.h"
@@ -114,7 +116,7 @@ bool IsAlien(ObjectType type)
//! Returns the damping factor for friendly fire
float GetDecay(ObjectType type)
{
- if (IsSoft(type)) return 0.2f;
+ if (IsSoft(type)) return 0.004f;
return 1.0f;
}
@@ -201,7 +203,7 @@ void NameParticle(std::string &name, int num)
if (num == 1) name = "effect00.png";
else if (num == 2) name = "effect01.png";
else if (num == 3) name = "effect02.png";
- else if (num == 4) name = "text.png";
+ else if (num == 4) name = "interface/text.png";
else name = "";
}
@@ -3532,7 +3534,7 @@ void CParticle::DrawParticle(int sheet)
if (m_particle[i].sheet != sheet) continue;
if (m_particle[i].type == PARTIPART) continue;
- m_engine->SetTexture(m_triangle[i].tex1Name);
+ m_engine->SetTexture("textures/"+m_triangle[i].tex1Name);
m_engine->SetMaterial(m_triangle[i].material);
m_engine->SetState(m_triangle[i].state);
DrawParticleTriangle(i);
@@ -3551,7 +3553,7 @@ void CParticle::DrawParticle(int sheet)
// Draw tire marks.
if (m_wheelTraceTotal > 0 && sheet == SH_WORLD)
{
- m_engine->SetTexture("text.png");
+ m_engine->SetTexture("textures/interface/text.png");
m_engine->SetState(ENG_RSTATE_TTEXTURE_WHITE);
Math::Matrix matrix;
matrix.LoadIdentity();
@@ -3582,7 +3584,7 @@ void CParticle::DrawParticle(int sheet)
{
std::string name;
NameParticle(name, t);
- m_engine->SetTexture(name);
+ m_engine->SetTexture("textures/"+name);
loadTexture = true;
}
diff --git a/src/graphics/engine/particle.h b/src/graphics/engine/particle.h
index 7fb24a1..c7c7cef 100644
--- a/src/graphics/engine/particle.h
+++ b/src/graphics/engine/particle.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/particle.h
diff --git a/src/graphics/engine/planet.cpp b/src/graphics/engine/planet.cpp
index 0c96f63..df34fbc 100644
--- a/src/graphics/engine/planet.cpp
+++ b/src/graphics/engine/planet.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/planet.h"
@@ -86,7 +88,7 @@ void CPlanet::LoadTexture()
{
for (int i = 0; i < static_cast<int>( m_planet[j].size() ); i++)
{
- m_engine->LoadTexture(m_planet[j][i].name);
+ m_engine->LoadTexture("textures/"+m_planet[j][i].name);
}
}
}
@@ -102,7 +104,7 @@ void CPlanet::Draw()
for (int i = 0; i < static_cast<int>( m_planet[m_mode].size() ); i++)
{
- m_engine->SetTexture(m_planet[m_mode][i].name);
+ m_engine->SetTexture("textures/"+m_planet[m_mode][i].name);
if (m_planet[m_mode][i].transparent)
m_engine->SetState(ENG_RSTATE_WRAP | ENG_RSTATE_ALPHA);
diff --git a/src/graphics/engine/planet.h b/src/graphics/engine/planet.h
index 58d3aeb..52ffd24 100644
--- a/src/graphics/engine/planet.h
+++ b/src/graphics/engine/planet.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/planet.h
diff --git a/src/graphics/engine/pyro.cpp b/src/graphics/engine/pyro.cpp
index d3e0405..8d5d323 100644
--- a/src/graphics/engine/pyro.cpp
+++ b/src/graphics/engine/pyro.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/pyro.h"
@@ -312,7 +314,7 @@ bool CPyro::Create(PyroType type, CObject* obj, float force)
}
if ( m_type == PT_SHOTH )
{
- if ( m_object->GetSelect() )
+ if ( m_camera->GetBlood() && m_object->GetSelect() )
{
m_camera->StartOver(CAM_OVER_EFFECT_BLOOD, m_pos, force);
}
@@ -672,7 +674,7 @@ bool CPyro::EventProcess(const Event &event)
}
}
- if ( m_type == PT_SHOTH &&
+ if ( m_camera->GetBlood() && m_type == PT_SHOTH &&
m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time )
{
m_lastParticle = m_time;
@@ -694,7 +696,7 @@ bool CPyro::EventProcess(const Event &event)
}
}
- if ( m_type == PT_SHOTM &&
+ if ( m_camera->GetBlood() && m_type == PT_SHOTM &&
m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time )
{
m_lastParticle = m_time;
@@ -1594,7 +1596,7 @@ void CPyro::ExploStart()
if (channel != -1)
m_object->SetMasterParticle(i, channel);
}
- m_engine->LoadTexture("dirty04.png");
+ m_engine->LoadTexture("textures/dirty04.png");
DeleteObject(false, true); // destroys the object transported + the battery
}
@@ -1637,7 +1639,7 @@ void CPyro::BurnStart()
m_engine->ChangeSecondTexture(objRank, "dirty04.png");
}
}
- m_engine->LoadTexture("dirty04.png");
+ m_engine->LoadTexture("textures/dirty04.png");
m_burnPartTotal = 0;
diff --git a/src/graphics/engine/pyro.h b/src/graphics/engine/pyro.h
index 60724b4..9646988 100644
--- a/src/graphics/engine/pyro.h
+++ b/src/graphics/engine/pyro.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/pyro.h
diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp
index 5f37cd8..b58685b 100644
--- a/src/graphics/engine/terrain.cpp
+++ b/src/graphics/engine/terrain.cpp
@@ -1,25 +1,26 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/terrain.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "common/image.h"
#include "common/logger.h"
@@ -122,7 +123,8 @@ bool CTerrain::InitTextures(const std::string& baseName, int* table, int dx, int
m_useMaterials = false;
m_texBaseName = baseName;
- size_t pos = baseName.find('.');
+ size_t pos = baseName.rfind('.');
+ if(pos < baseName.find_last_of('/')) pos = std::string::npos; // If last . is not a part of filename (some directory, possibly . or ..)
if (pos == std::string::npos)
{
@@ -190,10 +192,10 @@ void CTerrain::AddMaterial(int id, const std::string& texName, const Math::Point
bool CTerrain::LoadResources(const std::string& fileName)
{
CImage img;
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, fileName);
- if (! img.Load(path))
+
+ if (! img.Load(fileName))
{
- GetLogger()->Error("Cannot load resource file: '%s'\n", path.c_str());
+ GetLogger()->Error("Cannot load resource file: '%s'\n", fileName.c_str());
return false;
}
@@ -287,10 +289,10 @@ bool CTerrain::LoadRelief(const std::string &fileName, float scaleRelief,
m_scaleRelief = scaleRelief;
CImage img;
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_TEXTURE, fileName);
- if (! img.Load(path))
+
+ if (! img.Load(fileName))
{
- GetLogger()->Error("Could not load relief file: '%s'!\n", path.c_str());
+ GetLogger()->Error("Could not load relief file: '%s'!\n", fileName.c_str());
return false;
}
@@ -366,17 +368,11 @@ bool CTerrain::RandomizeRelief()
double xi, yi, a, b;
a = modf(x * (rozmiar_oktawy-1), &xi);
b = modf(y * (rozmiar_oktawy-1), &yi);
- /*int xi = floor(x * (rozmiar_oktawy-1));
- int yi = floor(y * (rozmiar_oktawy-1));
- float a = (x * (rozmiar_oktawy-1)) - xi;
- float b = (y * (rozmiar_oktawy-1)) - yi;*/
- //CLogger::GetInstancePointer()->Error("%f %f %f %f\n", xi, yi, a, b);
float lg = oktawy[i][static_cast<int>(yi * rozmiar_oktawy + xi)];
float pg = oktawy[i][static_cast<int>(yi * rozmiar_oktawy + xi + 1)];
float ld = oktawy[i][static_cast<int>((yi+1) * rozmiar_oktawy + xi)];
float pd = oktawy[i][static_cast<int>((yi+1) * rozmiar_oktawy + xi + 1)];
- //CLogger::GetInstancePointer()->Error("%f %f %f %f\n", lg, pg, ld, pd);
float g = pg * a + lg * (1-a);
float d = pd * a + ld * (1-a);
diff --git a/src/graphics/engine/terrain.h b/src/graphics/engine/terrain.h
index 75a8975..a2bb36a 100644
--- a/src/graphics/engine/terrain.h
+++ b/src/graphics/engine/terrain.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/terrain.h
diff --git a/src/graphics/engine/text.cpp b/src/graphics/engine/text.cpp
index 8fd01b7..bebf30c 100644
--- a/src/graphics/engine/text.cpp
+++ b/src/graphics/engine/text.cpp
@@ -1,29 +1,31 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/text.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "common/image.h"
#include "common/logger.h"
#include "common/stringutils.h"
+#include "common/resources/resourcemanager.h"
#include "math/func.h"
@@ -78,12 +80,12 @@ bool CText::Create()
return false;
}
- m_fonts[FONT_COLOBOT] = new MultisizeFont("dvu_sans.ttf");
- m_fonts[FONT_COLOBOT_BOLD] = new MultisizeFont("dvu_sans_bold.ttf");
- m_fonts[FONT_COLOBOT_ITALIC] = new MultisizeFont("dvu_sans_italic.ttf");
+ m_fonts[FONT_COLOBOT] = new MultisizeFont("fonts/dvu_sans.ttf");
+ m_fonts[FONT_COLOBOT_BOLD] = new MultisizeFont("fonts/dvu_sans_bold.ttf");
+ m_fonts[FONT_COLOBOT_ITALIC] = new MultisizeFont("fonts/dvu_sans_italic.ttf");
- m_fonts[FONT_COURIER] = new MultisizeFont("dvu_sans_mono.ttf");
- m_fonts[FONT_COURIER_BOLD] = new MultisizeFont("dvu_sans_mono_bold.ttf");
+ m_fonts[FONT_COURIER] = new MultisizeFont("fonts/dvu_sans_mono.ttf");
+ m_fonts[FONT_COURIER_BOLD] = new MultisizeFont("fonts/dvu_sans_mono_bold.ttf");
for (auto it = m_fonts.begin(); it != m_fonts.end(); ++it)
{
@@ -866,10 +868,14 @@ CachedFont* CText::GetOrOpenFont(FontType font, float size)
return m_lastCachedFont;
}
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_FONT, mf->fileName);
-
m_lastCachedFont = new CachedFont();
- m_lastCachedFont->font = TTF_OpenFont(path.c_str(), pointSize);
+ SDL_RWops* file = CResourceManager::GetSDLFileHandler(mf->fileName);
+ if(file == nullptr)
+ {
+ m_error = std::string("Unable to open file");
+ return nullptr;
+ }
+ m_lastCachedFont->font = TTF_OpenFontRW(file, 1, pointSize);
if (m_lastCachedFont->font == nullptr)
m_error = std::string("TTF_OpenFont error ") + std::string(TTF_GetError());
diff --git a/src/graphics/engine/text.h b/src/graphics/engine/text.h
index 3abb8b7..0551dcd 100644
--- a/src/graphics/engine/text.h
+++ b/src/graphics/engine/text.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/text.h
diff --git a/src/graphics/engine/water.cpp b/src/graphics/engine/water.cpp
index d1f8d29..8a396a8 100644
--- a/src/graphics/engine/water.cpp
+++ b/src/graphics/engine/water.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/water.h"
@@ -348,8 +350,8 @@ void CWater::DrawSurf()
material.ambient = m_ambient;
m_engine->SetMaterial(material);
- m_engine->SetTexture(m_fileName, 0);
- m_engine->SetTexture(m_fileName, 1);
+ m_engine->SetTexture("textures/"+m_fileName, 0);
+ m_engine->SetTexture("textures/"+m_fileName, 1);
if (m_type[rankview] == WATER_TT)
m_engine->SetState(ENG_RSTATE_TTEXTURE_BLACK | ENG_RSTATE_DUAL_WHITE | ENG_RSTATE_WRAP, m_color);
@@ -492,7 +494,7 @@ void CWater::Create(WaterType type1, WaterType type2, const std::string& fileNam
VaporFlush();
if (! m_fileName.empty())
- m_engine->LoadTexture(m_fileName);
+ m_engine->LoadTexture("textures/"+m_fileName);
if (m_terrain == nullptr)
m_terrain = CRobotMain::GetInstancePointer()->GetTerrain();
diff --git a/src/graphics/engine/water.h b/src/graphics/engine/water.h
index 5e9f4b2..5e488d5 100644
--- a/src/graphics/engine/water.h
+++ b/src/graphics/engine/water.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/engine/water.h
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index b42f29d..a197b18 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/opengl/gldevice.h"
@@ -65,6 +68,7 @@ CGLDevice::CGLDevice(const GLDeviceConfig &config)
m_lastVboId = 0;
m_multitextureAvailable = false;
m_vboAvailable = false;
+ m_vertexBufferType = VBT_DISPLAY_LIST;
}
@@ -183,7 +187,7 @@ bool CGLDevice::Create()
{
GetLogger()->Info("Creating CDevice\n");
- static bool glewInited = false;
+ /*static*/ bool glewInited = false;
if (!glewInited)
{
@@ -204,22 +208,43 @@ bool CGLDevice::Create()
if (m_config.vboMode == VBO_MODE_ENABLE)
{
GetLogger()->Info("VBO enabled by override - using VBOs\n");
- m_vboAvailable = true;
+ SetVertexBufferType(VBT_VBO_CORE);
}
else if (m_config.vboMode == VBO_MODE_DISABLE)
{
GetLogger()->Info("VBO disabled by override - using display lists\n");
- m_vboAvailable = false;
+ SetVertexBufferType(VBT_DISPLAY_LIST);
}
else
{
GetLogger()->Info("Auto-detecting VBO support\n");
- m_vboAvailable = glewIsSupported("GL_ARB_vertex_buffer_object");
-
- if (m_vboAvailable)
- GetLogger()->Info("Detected ARB_vertex_buffer_object extension - using VBOs\n");
- else
- GetLogger()->Info("No ARB_vertex_buffer_object extension present - using display lists\n");
+
+ // extracting OpenGL version
+ const char *version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
+ int major = 0, minor = 0;
+
+ sscanf(version, "%d.%d", &major, &minor);
+
+ // detecting VBO ARB extension
+ bool vboARB = glewIsSupported("GL_ARB_vertex_buffer_object");
+
+ // VBO is core OpenGL feature since 1.5
+ // everything below 1.5 means no VBO support
+ if(major > 1 || minor > 4)
+ {
+ GetLogger()->Info("OpenGL %d.%d, VBO supported\n", major, minor);
+ SetVertexBufferType(VBT_VBO_CORE);
+ }
+ else if(vboARB) // VBO ARB extension available
+ {
+ GetLogger()->Info("OpenGL %d.%d with GL_ARB_vertex_buffer_object, VBO supported\n", major, minor);
+ SetVertexBufferType(VBT_VBO_ARB);
+ }
+ else // no VBO support
+ {
+ GetLogger()->Info("OpenGL %d.%d without GL_ARB_vertex_buffer_object, VBO not supported\n", major, minor);
+ SetVertexBufferType(VBT_DISPLAY_LIST);
+ }
}
}
@@ -288,11 +313,13 @@ void CGLDevice::ConfigChanged(const GLDeviceConfig& newConfig)
void CGLDevice::SetUseVbo(bool vboAvailable)
{
m_vboAvailable = vboAvailable;
+ m_vertexBufferType = vboAvailable ? VBT_VBO_CORE : VBT_DISPLAY_LIST;
}
-bool CGLDevice::GetUseVbo()
+void CGLDevice::SetVertexBufferType(VertexBufferType type)
{
- return m_vboAvailable;
+ m_vertexBufferType = type;
+ m_vboAvailable = (type != VBT_DISPLAY_LIST);
}
void CGLDevice::BeginScene()
@@ -339,44 +366,6 @@ void CGLDevice::SetTransform(TransformType type, const Math::Matrix &matrix)
}
}
-const Math::Matrix& CGLDevice::GetTransform(TransformType type)
-{
- if (type == TRANSFORM_WORLD)
- return m_worldMat;
- else if (type == TRANSFORM_VIEW)
- return m_viewMat;
- else if (type == TRANSFORM_PROJECTION)
- return m_projectionMat;
- else
- assert(false);
-
- return m_worldMat; // to avoid warning
-}
-
-void CGLDevice::MultiplyTransform(TransformType type, const Math::Matrix &matrix)
-{
- if (type == TRANSFORM_WORLD)
- {
- m_worldMat = Math::MultiplyMatrices(m_worldMat, matrix);
- UpdateModelviewMatrix();
- }
- else if (type == TRANSFORM_VIEW)
- {
- m_viewMat = Math::MultiplyMatrices(m_viewMat, matrix);
- UpdateModelviewMatrix();
- }
- else if (type == TRANSFORM_PROJECTION)
- {
- m_projectionMat = Math::MultiplyMatrices(m_projectionMat, matrix);
- glMatrixMode(GL_PROJECTION);
- glLoadMatrixf(m_projectionMat.Array());
- }
- else
- {
- assert(false);
- }
-}
-
void CGLDevice::UpdateModelviewMatrix()
{
m_modelviewMat = Math::MultiplyMatrices(m_viewMat, m_worldMat);
@@ -402,11 +391,6 @@ void CGLDevice::SetMaterial(const Material &material)
glMaterialfv(GL_FRONT, GL_SPECULAR, m_material.specular.Array());
}
-const Material& CGLDevice::GetMaterial()
-{
- return m_material;
-}
-
int CGLDevice::GetMaxLightCount()
{
return m_lights.size();
@@ -482,14 +466,6 @@ void CGLDevice::UpdateLightPosition(int index)
glPopMatrix();
}
-const Light& CGLDevice::GetLight(int index)
-{
- assert(index >= 0);
- assert(index < static_cast<int>( m_lights.size() ));
-
- return m_lights[index];
-}
-
void CGLDevice::SetLightEnabled(int index, bool enabled)
{
assert(index >= 0);
@@ -503,14 +479,6 @@ void CGLDevice::SetLightEnabled(int index, bool enabled)
glDisable(GL_LIGHT0 + index);
}
-bool CGLDevice::GetLightEnabled(int index)
-{
- assert(index >= 0);
- assert(index < static_cast<int>( m_lights.size() ));
-
- return m_lightsEnabled[index];
-}
-
/** If image is invalid, returns invalid texture.
Otherwise, returns pointer to new Texture struct.
This struct must not be deleted in other way than through DeleteTexture() */
@@ -781,15 +749,6 @@ void CGLDevice::SetTexture(int index, unsigned int textureId)
UpdateTextureParams(index);
}
-/**
- Returns the previously assigned texture or invalid texture if the given stage is not enabled. */
-Texture CGLDevice::GetTexture(int index)
-{
- assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
-
- return m_currentTextures[index];
-}
-
void CGLDevice::SetTextureEnabled(int index, bool enabled)
{
assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
@@ -813,13 +772,6 @@ void CGLDevice::SetTextureEnabled(int index, bool enabled)
glDisable(GL_TEXTURE_2D);
}
-bool CGLDevice::GetTextureEnabled(int index)
-{
- assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
-
- return m_texturesEnabled[index];
-}
-
/**
Sets the texture parameters for the given texture stage.
If the given texture was not set (bound) yet, nothing happens.
@@ -851,13 +803,13 @@ void CGLDevice::UpdateTextureParams(int index)
glActiveTexture(GL_TEXTURE0 + index);
if (params.wrapS == TEX_WRAP_CLAMP)
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
else if (params.wrapS == TEX_WRAP_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
else assert(false);
if (params.wrapT == TEX_WRAP_CLAMP)
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
else if (params.wrapT == TEX_WRAP_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
else assert(false);
@@ -990,25 +942,18 @@ void CGLDevice::SetTextureStageWrap(int index, TexWrapMode wrapS, TexWrapMode wr
glActiveTexture(GL_TEXTURE0 + index);
if (wrapS == TEX_WRAP_CLAMP)
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
else if (wrapS == TEX_WRAP_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
else assert(false);
if (wrapT == TEX_WRAP_CLAMP)
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
else if (wrapT == TEX_WRAP_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
else assert(false);
}
-TextureStageParams CGLDevice::GetTextureStageParams(int index)
-{
- assert(index >= 0 && index < static_cast<int>( m_currentTextures.size() ));
-
- return m_textureStageParams[index];
-}
-
GLenum TranslateGfxPrimitive(PrimitiveType type)
{
GLenum flag = 0;
@@ -1117,10 +1062,20 @@ unsigned int CGLDevice::CreateStaticBuffer(PrimitiveType primitiveType, const Ve
info.vertexCount = vertexCount;
info.bufferId = 0;
- glGenBuffers(1, &info.bufferId);
- glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
- glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(Vertex), vertices, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ {
+ glGenBuffers(1, &info.bufferId);
+ glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
+ glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(Vertex), vertices, GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ }
+ else
+ {
+ glGenBuffersARB(1, &info.bufferId);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, info.bufferId);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, vertexCount * sizeof(Vertex), vertices, GL_STATIC_DRAW_ARB);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ }
m_vboObjects[id] = info;
}
@@ -1151,10 +1106,20 @@ unsigned int CGLDevice::CreateStaticBuffer(PrimitiveType primitiveType, const Ve
info.vertexCount = vertexCount;
info.bufferId = 0;
- glGenBuffers(1, &info.bufferId);
- glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
- glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexTex2), vertices, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ {
+ glGenBuffers(1, &info.bufferId);
+ glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
+ glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexTex2), vertices, GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ }
+ else
+ {
+ glGenBuffersARB(1, &info.bufferId);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, info.bufferId);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, vertexCount * sizeof(VertexTex2), vertices, GL_STATIC_DRAW_ARB);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ }
m_vboObjects[id] = info;
}
@@ -1184,11 +1149,21 @@ unsigned int CGLDevice::CreateStaticBuffer(PrimitiveType primitiveType, const Ve
info.vertexType = VERTEX_TYPE_COL;
info.vertexCount = vertexCount;
info.bufferId = 0;
-
- glGenBuffers(1, &info.bufferId);
- glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
- glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexCol), vertices, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ {
+ glGenBuffers(1, &info.bufferId);
+ glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
+ glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexCol), vertices, GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ }
+ else
+ {
+ glGenBuffersARB(1, &info.bufferId);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, info.bufferId);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, vertexCount * sizeof(VertexCol), vertices, GL_STATIC_DRAW_ARB);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ }
m_vboObjects[id] = info;
}
@@ -1219,9 +1194,18 @@ void CGLDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiv
info.vertexType = VERTEX_TYPE_NORMAL;
info.vertexCount = vertexCount;
- glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
- glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(Vertex), vertices, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ {
+ glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
+ glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(Vertex), vertices, GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ }
+ else
+ {
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, info.bufferId);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, vertexCount * sizeof(Vertex), vertices, GL_STATIC_DRAW_ARB);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ }
}
else
{
@@ -1246,9 +1230,18 @@ void CGLDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiv
info.vertexType = VERTEX_TYPE_TEX2;
info.vertexCount = vertexCount;
- glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
- glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexTex2), vertices, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ {
+ glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
+ glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexTex2), vertices, GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ }
+ else
+ {
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, info.bufferId);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, vertexCount * sizeof(VertexTex2), vertices, GL_STATIC_DRAW_ARB);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ }
}
else
{
@@ -1273,9 +1266,18 @@ void CGLDevice::UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiv
info.vertexType = VERTEX_TYPE_COL;
info.vertexCount = vertexCount;
- glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
- glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexCol), vertices, GL_STATIC_DRAW);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ {
+ glBindBuffer(GL_ARRAY_BUFFER, info.bufferId);
+ glBufferData(GL_ARRAY_BUFFER, vertexCount * sizeof(VertexCol), vertices, GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ }
+ else
+ {
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, info.bufferId);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, vertexCount * sizeof(VertexCol), vertices, GL_STATIC_DRAW_ARB);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+ }
}
else
{
@@ -1296,7 +1298,11 @@ void CGLDevice::DrawStaticBuffer(unsigned int bufferId)
return;
glEnable(GL_VERTEX_ARRAY);
- glBindBuffer(GL_ARRAY_BUFFER, (*it).second.bufferId);
+
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ glBindBuffer(GL_ARRAY_BUFFER, (*it).second.bufferId);
+ else
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, (*it).second.bufferId);
if ((*it).second.vertexType == VERTEX_TYPE_NORMAL)
{
@@ -1368,7 +1374,11 @@ void CGLDevice::DrawStaticBuffer(unsigned int bufferId)
glDisableClientState(GL_COLOR_ARRAY);
}
- glBindBuffer(GL_ARRAY_BUFFER, 0);
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ else
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
+
glDisable(GL_VERTEX_ARRAY);
}
else
@@ -1385,7 +1395,10 @@ void CGLDevice::DestroyStaticBuffer(unsigned int bufferId)
if (it == m_vboObjects.end())
return;
- glDeleteBuffers(1, &(*it).second.bufferId);
+ if(m_vertexBufferType == VBT_VBO_CORE)
+ glDeleteBuffers(1, &(*it).second.bufferId);
+ else
+ glDeleteBuffersARB(1, &(*it).second.bufferId);
m_vboObjects.erase(it);
}
@@ -1529,30 +1542,6 @@ void CGLDevice::SetRenderState(RenderState state, bool enabled)
glDisable(flag);
}
-bool CGLDevice::GetRenderState(RenderState state)
-{
- if (state == RENDER_STATE_LIGHTING)
- return m_lighting;
-
- GLenum flag = 0;
-
- switch (state)
- {
- case RENDER_STATE_DEPTH_WRITE: flag = GL_DEPTH_WRITEMASK; break;
- case RENDER_STATE_BLENDING: flag = GL_BLEND; break;
- case RENDER_STATE_FOG: flag = GL_FOG; break;
- case RENDER_STATE_DEPTH_TEST: flag = GL_DEPTH_TEST; break;
- case RENDER_STATE_ALPHA_TEST: flag = GL_ALPHA_TEST; break;
- case RENDER_STATE_CULLING: flag = GL_CULL_FACE; break;
- default: assert(false); break;
- }
-
- GLboolean result = GL_FALSE;
- glGetBooleanv(flag, &result);
-
- return result == GL_TRUE;
-}
-
CompFunc TranslateGLCompFunc(GLenum flag)
{
switch (flag)
@@ -1592,39 +1581,16 @@ void CGLDevice::SetDepthTestFunc(CompFunc func)
glDepthFunc(TranslateGfxCompFunc(func));
}
-CompFunc CGLDevice::GetDepthTestFunc()
-{
- GLint flag = 0;
- glGetIntegerv(GL_DEPTH_FUNC, &flag);
- return TranslateGLCompFunc(static_cast<GLenum>(flag));
-}
-
void CGLDevice::SetDepthBias(float factor)
{
glPolygonOffset(factor, 0.0f);
}
-float CGLDevice::GetDepthBias()
-{
- GLfloat result = 0.0f;
- glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &result);
- return result;
-}
-
void CGLDevice::SetAlphaTestFunc(CompFunc func, float refValue)
{
glAlphaFunc(TranslateGfxCompFunc(func), refValue);
}
-void CGLDevice::GetAlphaTestFunc(CompFunc &func, float &refValue)
-{
- GLint flag = 0;
- glGetIntegerv(GL_ALPHA_TEST_FUNC, &flag);
- func = TranslateGLCompFunc(static_cast<GLenum>(flag));
-
- glGetFloatv(GL_ALPHA_TEST_REF, static_cast<GLfloat*>(&refValue));
-}
-
BlendFunc TranslateGLBlendFunc(GLenum flag)
{
switch (flag)
@@ -1671,41 +1637,16 @@ void CGLDevice::SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend)
glBlendFunc(TranslateGfxBlendFunc(srcBlend), TranslateGfxBlendFunc(dstBlend));
}
-void CGLDevice::GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend)
-{
- GLint srcFlag = 0;
- glGetIntegerv(GL_ALPHA_TEST_FUNC, &srcFlag);
- srcBlend = TranslateGLBlendFunc(static_cast<GLenum>(srcFlag));
-
- GLint dstFlag = 0;
- glGetIntegerv(GL_ALPHA_TEST_FUNC, &dstFlag);
- dstBlend = TranslateGLBlendFunc(static_cast<GLenum>(dstFlag));
-}
-
void CGLDevice::SetClearColor(const Color &color)
{
glClearColor(color.r, color.g, color.b, color.a);
}
-Color CGLDevice::GetClearColor()
-{
- GLfloat color[4] = { 0.0f };
- glGetFloatv(GL_COLOR_CLEAR_VALUE, color);
- return Color(color[0], color[1], color[2], color[3]);
-}
-
void CGLDevice::SetGlobalAmbient(const Color &color)
{
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, color.Array());
}
-Color CGLDevice::GetGlobalAmbient()
-{
- GLfloat color[4] = { 0.0f };
- glGetFloatv(GL_LIGHT_MODEL_AMBIENT, color);
- return Color(color[0], color[1], color[2], color[3]);
-}
-
void CGLDevice::SetFogParams(FogMode mode, const Color &color, float start, float end, float density)
{
if (mode == FOG_LINEAR) glFogi(GL_FOG_MODE, GL_LINEAR);
@@ -1719,23 +1660,6 @@ void CGLDevice::SetFogParams(FogMode mode, const Color &color, float start, floa
glFogfv(GL_FOG_COLOR, color.Array());
}
-void CGLDevice::GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density)
-{
- GLint flag = 0;
- glGetIntegerv(GL_FOG_MODE, &flag);
- if (flag == GL_LINEAR) mode = FOG_LINEAR;
- else if (flag == GL_EXP) mode = FOG_EXP;
- else if (flag == GL_EXP2) mode = FOG_EXP2;
- else assert(false);
-
- glGetFloatv(GL_FOG_START, static_cast<GLfloat*>(&start));
- glGetFloatv(GL_FOG_END, static_cast<GLfloat*>(&end));
- glGetFloatv(GL_FOG_DENSITY, static_cast<GLfloat*>(&density));
- GLfloat col[4] = { 0.0f };
- glGetFloatv(GL_FOG_COLOR, col);
- color = Color(col[0], col[1], col[2], col[3]);
-}
-
void CGLDevice::SetCullMode(CullMode mode)
{
// Cull clockwise back faces, so front face is the opposite
@@ -1745,16 +1669,6 @@ void CGLDevice::SetCullMode(CullMode mode)
else assert(false);
}
-CullMode CGLDevice::GetCullMode()
-{
- GLint flag = 0;
- glGetIntegerv(GL_FRONT_FACE, &flag);
- if (flag == GL_CW) return CULL_CCW;
- else if (flag == GL_CCW) return CULL_CW;
- else assert(false);
- return CULL_CW;
-}
-
void CGLDevice::SetShadeModel(ShadeModel model)
{
if (model == SHADE_FLAT) glShadeModel(GL_FLAT);
@@ -1762,16 +1676,6 @@ void CGLDevice::SetShadeModel(ShadeModel model)
else assert(false);
}
-ShadeModel CGLDevice::GetShadeModel()
-{
- GLint flag = 0;
- glGetIntegerv(GL_SHADE_MODEL, &flag);
- if (flag == GL_FLAT) return SHADE_FLAT;
- else if (flag == GL_SMOOTH) return SHADE_SMOOTH;
- else assert(false);
- return SHADE_FLAT;
-}
-
void CGLDevice::SetFillMode(FillMode mode)
{
if (mode == FILL_POINT) glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
@@ -1780,21 +1684,10 @@ void CGLDevice::SetFillMode(FillMode mode)
else assert(false);
}
-FillMode CGLDevice::GetFillMode()
-{
- GLint flag = 0;
- glGetIntegerv(GL_POLYGON_MODE, &flag);
- if (flag == GL_POINT) return FILL_POINT;
- else if (flag == GL_LINE) return FILL_LINES;
- else if (flag == GL_FILL) return FILL_POLY;
- else assert(false);
- return FILL_POINT;
-}
-
void* CGLDevice::GetFrameBufferPixels()const{
- GLubyte* pixels = new GLubyte [4 * m_config.size.x * m_config.size.y];
-
+ 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) );
diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h
index 267ee73..1174367 100644
--- a/src/graphics/opengl/gldevice.h
+++ b/src/graphics/opengl/gldevice.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file graphics/opengl/gldevice.h
@@ -45,6 +48,17 @@ enum VBOMode
};
/**
+ \enum VertexBufferType
+ \brief Specifies type of vertex buffer to use
+ */
+enum VertexBufferType
+{
+ VBT_DISPLAY_LIST, //! use display lists
+ VBT_VBO_CORE, //! use core OpenGL 1.5 VBOs
+ VBT_VBO_ARB //! use ARB extension VBOs
+};
+
+/**
\struct GLDeviceConfig
\brief Additional config with OpenGL-specific settings */
struct GLDeviceConfig : public DeviceConfig
@@ -92,103 +106,84 @@ public:
CGLDevice(const GLDeviceConfig &config);
virtual ~CGLDevice();
- virtual void DebugHook();
- virtual void DebugLights();
+ virtual void DebugHook() override;
+ virtual void DebugLights() override;
- virtual bool Create();
- virtual void Destroy();
+ virtual bool Create() override;
+ virtual void Destroy() override;
void ConfigChanged(const GLDeviceConfig &newConfig);
void SetUseVbo(bool useVbo);
- bool GetUseVbo();
+ void SetVertexBufferType(VertexBufferType type);
- virtual void BeginScene();
- virtual void EndScene();
+ virtual void BeginScene() override;
+ virtual void EndScene() override;
- virtual void Clear();
+ virtual void Clear() override;
- virtual void SetTransform(TransformType type, const Math::Matrix &matrix);
- virtual const Math::Matrix& GetTransform(TransformType type);
- virtual void MultiplyTransform(TransformType type, const Math::Matrix &matrix);
+ virtual void SetTransform(TransformType type, const Math::Matrix &matrix) override;
- virtual void SetMaterial(const Material &material);
- virtual const Material& GetMaterial();
+ virtual void SetMaterial(const Material &material) override;
- virtual int GetMaxLightCount();
- virtual void SetLight(int index, const Light &light);
- virtual const Light& GetLight(int index);
- virtual void SetLightEnabled(int index, bool enabled);
- virtual bool GetLightEnabled(int index);
+ virtual int GetMaxLightCount() override;
+ virtual void SetLight(int index, const Light &light) override;
+ virtual void SetLightEnabled(int index, bool enabled) override;
- virtual Texture CreateTexture(CImage *image, const TextureCreateParams &params);
- virtual Texture CreateTexture(ImageData *data, const TextureCreateParams &params);
- virtual void DestroyTexture(const Texture &texture);
- virtual void DestroyAllTextures();
+ virtual Texture CreateTexture(CImage *image, const TextureCreateParams &params) override;
+ virtual Texture CreateTexture(ImageData *data, const TextureCreateParams &params) override;
+ virtual void DestroyTexture(const Texture &texture) override;
+ virtual void DestroyAllTextures() override;
- virtual int GetMaxTextureStageCount();
- virtual void SetTexture(int index, const Texture &texture);
- virtual void SetTexture(int index, unsigned int textureId);
- virtual Texture GetTexture(int index);
- virtual void SetTextureEnabled(int index, bool enabled);
- virtual bool GetTextureEnabled(int index);
+ virtual int GetMaxTextureStageCount() override;
+ virtual void SetTexture(int index, const Texture &texture) override;
+ virtual void SetTexture(int index, unsigned int textureId) override;
+ virtual void SetTextureEnabled(int index, bool enabled) override;
- virtual void SetTextureStageParams(int index, const TextureStageParams &params);
- virtual TextureStageParams GetTextureStageParams(int index);
+ virtual void SetTextureStageParams(int index, const TextureStageParams &params) override;
- virtual void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT);
+ virtual void SetTextureStageWrap(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT) override;
virtual void DrawPrimitive(PrimitiveType type, const Vertex *vertices , int vertexCount,
- Color color = Color(1.0f, 1.0f, 1.0f, 1.0f));
+ Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
virtual void DrawPrimitive(PrimitiveType type, const VertexTex2 *vertices, int vertexCount,
- Color color = Color(1.0f, 1.0f, 1.0f, 1.0f));
- virtual void DrawPrimitive(PrimitiveType type, const VertexCol *vertices , int vertexCount);
+ Color color = Color(1.0f, 1.0f, 1.0f, 1.0f)) override;
+ virtual void DrawPrimitive(PrimitiveType type, const VertexCol *vertices , int vertexCount) override;
- virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const Vertex* vertices, int vertexCount);
- virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount);
- virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount);
- virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const Vertex* vertices, int vertexCount);
- virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount);
- virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount);
- virtual void DrawStaticBuffer(unsigned int bufferId);
- virtual void DestroyStaticBuffer(unsigned int bufferId);
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const Vertex* vertices, int vertexCount) override;
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount) override;
+ virtual unsigned int CreateStaticBuffer(PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount) override;
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const Vertex* vertices, int vertexCount) override;
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexTex2* vertices, int vertexCount) override;
+ virtual void UpdateStaticBuffer(unsigned int bufferId, PrimitiveType primitiveType, const VertexCol* vertices, int vertexCount) override;
+ virtual void DrawStaticBuffer(unsigned int bufferId) override;
+ virtual void DestroyStaticBuffer(unsigned int bufferId) override;
- virtual int ComputeSphereVisibility(const Math::Vector &center, float radius);
+ virtual int ComputeSphereVisibility(const Math::Vector &center, float radius) override;
- virtual void SetRenderState(RenderState state, bool enabled);
- virtual bool GetRenderState(RenderState state);
+ virtual void SetRenderState(RenderState state, bool enabled) override;
- virtual void SetDepthTestFunc(CompFunc func);
- virtual CompFunc GetDepthTestFunc();
+ virtual void SetDepthTestFunc(CompFunc func) override;
- virtual void SetDepthBias(float factor);
- virtual float GetDepthBias();
+ virtual void SetDepthBias(float factor) override;
- virtual void SetAlphaTestFunc(CompFunc func, float refValue);
- virtual void GetAlphaTestFunc(CompFunc &func, float &refValue);
+ virtual void SetAlphaTestFunc(CompFunc func, float refValue) override;
- virtual void SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend);
- virtual void GetBlendFunc(BlendFunc &srcBlend, BlendFunc &dstBlend);
+ virtual void SetBlendFunc(BlendFunc srcBlend, BlendFunc dstBlend) override;
- virtual void SetClearColor(const Color &color);
- virtual Color GetClearColor();
+ virtual void SetClearColor(const Color &color) override;
- virtual void SetGlobalAmbient(const Color &color);
- virtual Color GetGlobalAmbient();
+ virtual void SetGlobalAmbient(const Color &color) override;
- virtual void SetFogParams(FogMode mode, const Color &color, float start, float end, float density);
- virtual void GetFogParams(FogMode &mode, Color &color, float &start, float &end, float &density);
+ virtual void SetFogParams(FogMode mode, const Color &color, float start, float end, float density) override;
- virtual void SetCullMode(CullMode mode);
- virtual CullMode GetCullMode();
+ virtual void SetCullMode(CullMode mode) override;
- virtual void SetShadeModel(ShadeModel model);
- virtual ShadeModel GetShadeModel();
+ virtual void SetShadeModel(ShadeModel model) override;
- virtual void SetFillMode(FillMode mode) ;
- virtual FillMode GetFillMode();
+ virtual void SetFillMode(FillMode mode) override;
- virtual void* GetFrameBufferPixels()const;
+ virtual void* GetFrameBufferPixels() const override;
private:
//! Updates internal modelview matrix
@@ -252,6 +247,8 @@ private:
bool m_multitextureAvailable;
//! Whether to use VBOs or display lists
bool m_vboAvailable;
+ //! Which vertex buffer type to use
+ VertexBufferType m_vertexBufferType;
//! Map of saved VBO objects
std::map<unsigned int, VboObjectInfo> m_vboObjects;
//! Last ID of VBO object
diff --git a/src/math/all.h b/src/math/all.h
index 7d716c8..fc289ee 100644
--- a/src/math/all.h
+++ b/src/math/all.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/all.h
diff --git a/src/math/const.h b/src/math/const.h
index fee635e..1e2cddf 100644
--- a/src/math/const.h
+++ b/src/math/const.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/const.h
diff --git a/src/math/func.h b/src/math/func.h
index 98111c5..78bfeb4 100644
--- a/src/math/func.h
+++ b/src/math/func.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/func.h
diff --git a/src/math/geometry.h b/src/math/geometry.h
index 9dcb447..595046e 100644
--- a/src/math/geometry.h
+++ b/src/math/geometry.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/geometry.h
diff --git a/src/math/intpoint.h b/src/math/intpoint.h
index 872e614..7d27b33 100644
--- a/src/math/intpoint.h
+++ b/src/math/intpoint.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/intpoint.h
diff --git a/src/math/matrix.h b/src/math/matrix.h
index f139517..75e515c 100644
--- a/src/math/matrix.h
+++ b/src/math/matrix.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/matrix.h
diff --git a/src/math/point.h b/src/math/point.h
index edb902b..e8ae4d6 100644
--- a/src/math/point.h
+++ b/src/math/point.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/point.h
diff --git a/src/math/vector.h b/src/math/vector.h
index 6827785..31a6162 100644
--- a/src/math/vector.h
+++ b/src/math/vector.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file math/vector.h
diff --git a/src/object/auto/auto.cpp b/src/object/auto/auto.cpp
index 9e593a9..fb6698b 100644
--- a/src/object/auto/auto.cpp
+++ b/src/object/auto/auto.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/auto.h"
diff --git a/src/object/auto/auto.h b/src/object/auto/auto.h
index fd25e70..af7766c 100644
--- a/src/object/auto/auto.h
+++ b/src/object/auto/auto.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// auto.h
diff --git a/src/object/auto/autobase.cpp b/src/object/auto/autobase.cpp
index af6c6e0..611730d 100644
--- a/src/object/auto/autobase.cpp
+++ b/src/object/auto/autobase.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include <stdio.h>
@@ -1371,7 +1374,7 @@ void CAutoBase::BeginTransit()
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));
- m_engine->LoadTexture(m_bgBack);
+ m_engine->LoadTexture("textures/"+m_bgBack);
m_cloud->SetEnabled(false); // cache clouds
m_planet->SetMode(1);
@@ -1388,7 +1391,7 @@ void CAutoBase::EndTransit()
m_engine->DeleteTexture(m_bgBack);
m_engine->SetBackground(m_bgName, m_bgUp, m_bgDown, m_bgCloudUp, m_bgCloudDown);
- m_engine->LoadTexture(m_bgName);
+ m_engine->LoadTexture("textures/"+m_bgName);
m_cloud->SetEnabled(true); // gives the clouds
m_planet->SetMode(0);
diff --git a/src/object/auto/autobase.h b/src/object/auto/autobase.h
index 967e43d..c0b2b88 100644
--- a/src/object/auto/autobase.h
+++ b/src/object/auto/autobase.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autobase.h
diff --git a/src/object/auto/autoconvert.cpp b/src/object/auto/autoconvert.cpp
index ee1e83b..5dc80e9 100644
--- a/src/object/auto/autoconvert.cpp
+++ b/src/object/auto/autoconvert.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoconvert.h"
diff --git a/src/object/auto/autoconvert.h b/src/object/auto/autoconvert.h
index 56591f7..54cdb98 100644
--- a/src/object/auto/autoconvert.h
+++ b/src/object/auto/autoconvert.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoconvert.h
diff --git a/src/object/auto/autoderrick.cpp b/src/object/auto/autoderrick.cpp
index 5b6cea4..f797ed9 100644
--- a/src/object/auto/autoderrick.cpp
+++ b/src/object/auto/autoderrick.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoderrick.h"
diff --git a/src/object/auto/autoderrick.h b/src/object/auto/autoderrick.h
index 81ed8b4..dd2f4d9 100644
--- a/src/object/auto/autoderrick.h
+++ b/src/object/auto/autoderrick.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoderrick.h
diff --git a/src/object/auto/autodestroyer.cpp b/src/object/auto/autodestroyer.cpp
index dfe8e78..bc392f5 100644
--- a/src/object/auto/autodestroyer.cpp
+++ b/src/object/auto/autodestroyer.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autodestroyer.h"
diff --git a/src/object/auto/autodestroyer.h b/src/object/auto/autodestroyer.h
index ef3d5ae..14949e2 100644
--- a/src/object/auto/autodestroyer.h
+++ b/src/object/auto/autodestroyer.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autodestroyer.h
diff --git a/src/object/auto/autoegg.cpp b/src/object/auto/autoegg.cpp
index e510ca6..828821a 100644
--- a/src/object/auto/autoegg.cpp
+++ b/src/object/auto/autoegg.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoegg.h"
diff --git a/src/object/auto/autoegg.h b/src/object/auto/autoegg.h
index 00725db..54c6e34 100644
--- a/src/object/auto/autoegg.h
+++ b/src/object/auto/autoegg.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoegg.h
diff --git a/src/object/auto/autoenergy.cpp b/src/object/auto/autoenergy.cpp
index a38caf2..ea97cc8 100644
--- a/src/object/auto/autoenergy.cpp
+++ b/src/object/auto/autoenergy.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoenergy.h"
diff --git a/src/object/auto/autoenergy.h b/src/object/auto/autoenergy.h
index d3ed5fe..fc6f470 100644
--- a/src/object/auto/autoenergy.h
+++ b/src/object/auto/autoenergy.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoenergy.h
diff --git a/src/object/auto/autofactory.cpp b/src/object/auto/autofactory.cpp
index 49abad4..825ea53 100644
--- a/src/object/auto/autofactory.cpp
+++ b/src/object/auto/autofactory.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autofactory.h"
diff --git a/src/object/auto/autofactory.h b/src/object/auto/autofactory.h
index d9350e6..60a44fb 100644
--- a/src/object/auto/autofactory.h
+++ b/src/object/auto/autofactory.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autofactory.h
diff --git a/src/object/auto/autoflag.cpp b/src/object/auto/autoflag.cpp
index cc00db0..402c87a 100644
--- a/src/object/auto/autoflag.cpp
+++ b/src/object/auto/autoflag.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoflag.h"
diff --git a/src/object/auto/autoflag.h b/src/object/auto/autoflag.h
index c3fd35a..59c7b71 100644
--- a/src/object/auto/autoflag.h
+++ b/src/object/auto/autoflag.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoflag.h
diff --git a/src/object/auto/autohuston.cpp b/src/object/auto/autohuston.cpp
index 80f9185..864919e 100644
--- a/src/object/auto/autohuston.cpp
+++ b/src/object/auto/autohuston.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autohuston.h"
diff --git a/src/object/auto/autohuston.h b/src/object/auto/autohuston.h
index f99876a..d3f561c 100644
--- a/src/object/auto/autohuston.h
+++ b/src/object/auto/autohuston.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autohuston.h
diff --git a/src/object/auto/autoinfo.cpp b/src/object/auto/autoinfo.cpp
index 6d4a484..7b8622f 100644
--- a/src/object/auto/autoinfo.cpp
+++ b/src/object/auto/autoinfo.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoinfo.h"
diff --git a/src/object/auto/autoinfo.h b/src/object/auto/autoinfo.h
index 41b74d3..632edf8 100644
--- a/src/object/auto/autoinfo.h
+++ b/src/object/auto/autoinfo.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoinfo.h
diff --git a/src/object/auto/autojostle.cpp b/src/object/auto/autojostle.cpp
index 5ce01c2..4ff49e5 100644
--- a/src/object/auto/autojostle.cpp
+++ b/src/object/auto/autojostle.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autojostle.h"
diff --git a/src/object/auto/autojostle.h b/src/object/auto/autojostle.h
index 3822421..faaea23 100644
--- a/src/object/auto/autojostle.h
+++ b/src/object/auto/autojostle.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autojostle.h
diff --git a/src/object/auto/autokid.cpp b/src/object/auto/autokid.cpp
index 7d61d64..b291280 100644
--- a/src/object/auto/autokid.cpp
+++ b/src/object/auto/autokid.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autokid.h"
diff --git a/src/object/auto/autokid.h b/src/object/auto/autokid.h
index 19836a7..3fb5ca9 100644
--- a/src/object/auto/autokid.h
+++ b/src/object/auto/autokid.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autokid.h
diff --git a/src/object/auto/autolabo.cpp b/src/object/auto/autolabo.cpp
index 07112b7..3a0be92 100644
--- a/src/object/auto/autolabo.cpp
+++ b/src/object/auto/autolabo.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autolabo.h"
diff --git a/src/object/auto/autolabo.h b/src/object/auto/autolabo.h
index b3b08bb..b62668e 100644
--- a/src/object/auto/autolabo.h
+++ b/src/object/auto/autolabo.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autolabo.h
diff --git a/src/object/auto/automush.cpp b/src/object/auto/automush.cpp
index 1e4796d..c05878d 100644
--- a/src/object/auto/automush.cpp
+++ b/src/object/auto/automush.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/automush.h"
diff --git a/src/object/auto/automush.h b/src/object/auto/automush.h
index 1697c5a..2d70eaa 100644
--- a/src/object/auto/automush.h
+++ b/src/object/auto/automush.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// automush.h
diff --git a/src/object/auto/autonest.cpp b/src/object/auto/autonest.cpp
index 8a2d644..1c3b834 100644
--- a/src/object/auto/autonest.cpp
+++ b/src/object/auto/autonest.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autonest.h"
diff --git a/src/object/auto/autonest.h b/src/object/auto/autonest.h
index 4d734a8..df16367 100644
--- a/src/object/auto/autonest.h
+++ b/src/object/auto/autonest.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autonest.h
diff --git a/src/object/auto/autonuclear.cpp b/src/object/auto/autonuclear.cpp
index edab5eb..8fc7461 100644
--- a/src/object/auto/autonuclear.cpp
+++ b/src/object/auto/autonuclear.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autonuclear.h"
diff --git a/src/object/auto/autonuclear.h b/src/object/auto/autonuclear.h
index 5b01bba..83d8a91 100644
--- a/src/object/auto/autonuclear.h
+++ b/src/object/auto/autonuclear.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autonuclear.h
diff --git a/src/object/auto/autopara.cpp b/src/object/auto/autopara.cpp
index 24bc119..4a8e608 100644
--- a/src/object/auto/autopara.cpp
+++ b/src/object/auto/autopara.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autopara.h"
diff --git a/src/object/auto/autopara.h b/src/object/auto/autopara.h
index 1f0b805..059d813 100644
--- a/src/object/auto/autopara.h
+++ b/src/object/auto/autopara.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autopara.h
diff --git a/src/object/auto/autoportico.cpp b/src/object/auto/autoportico.cpp
index 1646874..c0c4988 100644
--- a/src/object/auto/autoportico.cpp
+++ b/src/object/auto/autoportico.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoportico.h"
diff --git a/src/object/auto/autoportico.h b/src/object/auto/autoportico.h
index 0aa580f..f055448 100644
--- a/src/object/auto/autoportico.h
+++ b/src/object/auto/autoportico.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoportico.h
diff --git a/src/object/auto/autoradar.cpp b/src/object/auto/autoradar.cpp
index 4afd3fe..1a1b209 100644
--- a/src/object/auto/autoradar.cpp
+++ b/src/object/auto/autoradar.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoradar.h"
diff --git a/src/object/auto/autoradar.h b/src/object/auto/autoradar.h
index 86833f9..6cdb21a 100644
--- a/src/object/auto/autoradar.h
+++ b/src/object/auto/autoradar.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoradar.h
diff --git a/src/object/auto/autorepair.cpp b/src/object/auto/autorepair.cpp
index 2f813f8..f118ab5 100644
--- a/src/object/auto/autorepair.cpp
+++ b/src/object/auto/autorepair.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autorepair.h"
diff --git a/src/object/auto/autorepair.h b/src/object/auto/autorepair.h
index f522a55..e377279 100644
--- a/src/object/auto/autorepair.h
+++ b/src/object/auto/autorepair.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autorepair.h
diff --git a/src/object/auto/autoresearch.cpp b/src/object/auto/autoresearch.cpp
index 834a48c..ed6ce9d 100644
--- a/src/object/auto/autoresearch.cpp
+++ b/src/object/auto/autoresearch.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoresearch.h"
diff --git a/src/object/auto/autoresearch.h b/src/object/auto/autoresearch.h
index dcb9f7b..6b76b3d 100644
--- a/src/object/auto/autoresearch.h
+++ b/src/object/auto/autoresearch.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoresearch.h
diff --git a/src/object/auto/autoroot.cpp b/src/object/auto/autoroot.cpp
index 7e5c5e7..429f1c6 100644
--- a/src/object/auto/autoroot.cpp
+++ b/src/object/auto/autoroot.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autoroot.h"
diff --git a/src/object/auto/autoroot.h b/src/object/auto/autoroot.h
index 3eb906c..88c85d5 100644
--- a/src/object/auto/autoroot.h
+++ b/src/object/auto/autoroot.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autoroot.h
diff --git a/src/object/auto/autosafe.cpp b/src/object/auto/autosafe.cpp
index 2871a70..7337c1b 100644
--- a/src/object/auto/autosafe.cpp
+++ b/src/object/auto/autosafe.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autosafe.h"
diff --git a/src/object/auto/autosafe.h b/src/object/auto/autosafe.h
index b575b4e..60219dd 100644
--- a/src/object/auto/autosafe.h
+++ b/src/object/auto/autosafe.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autosafe.h
diff --git a/src/object/auto/autostation.cpp b/src/object/auto/autostation.cpp
index 2c0aa02..d5aa347 100644
--- a/src/object/auto/autostation.cpp
+++ b/src/object/auto/autostation.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autostation.h"
diff --git a/src/object/auto/autostation.h b/src/object/auto/autostation.h
index d8a37b4..0c17948 100644
--- a/src/object/auto/autostation.h
+++ b/src/object/auto/autostation.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autostation.h
diff --git a/src/object/auto/autotower.cpp b/src/object/auto/autotower.cpp
index 329cab0..c06fa55 100644
--- a/src/object/auto/autotower.cpp
+++ b/src/object/auto/autotower.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/auto/autotower.h"
diff --git a/src/object/auto/autotower.h b/src/object/auto/autotower.h
index d219fb5..0158b22 100644
--- a/src/object/auto/autotower.h
+++ b/src/object/auto/autotower.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// autotower.h
diff --git a/src/object/brain.cpp b/src/object/brain.cpp
index 4bd8742..f10faac 100644
--- a/src/object/brain.cpp
+++ b/src/object/brain.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/brain.h"
@@ -812,11 +815,23 @@ void CBrain::StopProgram()
void CBrain::StopTask()
{
- if ( m_primaryTask != 0 )
+ if (m_primaryTask != nullptr)
{
m_primaryTask->Abort();
delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
+ m_primaryTask = nullptr;
+ }
+}
+
+// Stops the current secondary task.
+
+void CBrain::StopSecondaryTask()
+{
+ if (m_secondaryTask != nullptr)
+ {
+ m_secondaryTask->Abort();
+ delete m_secondaryTask; // stops the current secondary task
+ m_secondaryTask = nullptr;
}
}
@@ -900,16 +915,10 @@ void CBrain::StopEditScript(bool bCancel)
Error CBrain::StartTaskTake()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskTake();
+ Error err = m_primaryTask->StartTaskTake();
UpdateInterface();
return err;
}
@@ -918,16 +927,10 @@ Error CBrain::StartTaskTake()
Error CBrain::StartTaskManip(TaskManipOrder order, TaskManipArm arm)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskManip(order, arm);
+ Error err = m_primaryTask->StartTaskManip(order, arm);
UpdateInterface();
return err;
}
@@ -936,16 +939,10 @@ Error CBrain::StartTaskManip(TaskManipOrder order, TaskManipArm arm)
Error CBrain::StartTaskFlag(TaskFlagOrder order, int rank)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskFlag(order, rank);
+ Error err = m_primaryTask->StartTaskFlag(order, rank);
UpdateInterface();
return err;
}
@@ -954,16 +951,10 @@ Error CBrain::StartTaskFlag(TaskFlagOrder order, int rank)
Error CBrain::StartTaskBuild(ObjectType type)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskBuild(type);
+ Error err = m_primaryTask->StartTaskBuild(type);
UpdateInterface();
return err;
}
@@ -972,16 +963,10 @@ Error CBrain::StartTaskBuild(ObjectType type)
Error CBrain::StartTaskSearch()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskSearch();
+ Error err = m_primaryTask->StartTaskSearch();
UpdateInterface();
return err;
}
@@ -990,38 +975,26 @@ Error CBrain::StartTaskSearch()
Error CBrain::StartTaskTerraform()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskTerraform();
+ Error err = m_primaryTask->StartTaskTerraform();
UpdateInterface();
return err;
}
// Change pencil.
-Error CBrain::StartTaskPen(bool bDown, int color)
+Error CBrain::StartTaskPen(bool down, int color)
{
- Error err;
-
m_physics->SetMotorSpeedX(0.0f);
m_physics->SetMotorSpeedY(0.0f);
m_physics->SetMotorSpeedZ(0.0f);
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskPen(bDown, color);
+ Error err = m_primaryTask->StartTaskPen(down, color);
UpdateInterface();
return err;
}
@@ -1030,16 +1003,10 @@ Error CBrain::StartTaskPen(bool bDown, int color)
Error CBrain::StartTaskRecover()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskRecover();
+ Error err = m_primaryTask->StartTaskRecover();
UpdateInterface();
return err;
}
@@ -1048,16 +1015,10 @@ Error CBrain::StartTaskRecover()
Error CBrain::StartTaskShield(TaskShieldMode mode)
{
- Error err;
-
- if ( m_secondaryTask != 0 )
- {
- delete m_secondaryTask; // stops the current task
- m_secondaryTask = 0;
- }
+ StopSecondaryTask();
m_secondaryTask = new CTaskManager(m_object);
- err = m_secondaryTask->StartTaskShield(mode, 1000.0f);
+ Error err = m_secondaryTask->StartTaskShield(mode, 1000.0f);
UpdateInterface();
return err;
}
@@ -1066,16 +1027,10 @@ Error CBrain::StartTaskShield(TaskShieldMode mode)
Error CBrain::StartTaskFire(float delay)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskFire(delay);
+ Error err = m_primaryTask->StartTaskFire(delay);
UpdateInterface();
return err;
}
@@ -1084,16 +1039,10 @@ Error CBrain::StartTaskFire(float delay)
Error CBrain::StartTaskSpiderExplo()
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskSpiderExplo();
+ Error err = m_primaryTask->StartTaskSpiderExplo();
UpdateInterface();
return err;
}
@@ -1102,16 +1051,10 @@ Error CBrain::StartTaskSpiderExplo()
Error CBrain::StartTaskFireAnt(Math::Vector impact)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskFireAnt(impact);
+ Error err = m_primaryTask->StartTaskFireAnt(impact);
UpdateInterface();
return err;
}
@@ -1120,16 +1063,10 @@ Error CBrain::StartTaskFireAnt(Math::Vector impact)
Error CBrain::StartTaskGunGoal(float dirV, float dirH)
{
- Error err;
-
- if ( m_secondaryTask != 0 )
- {
- delete m_secondaryTask; // stops the current task
- m_secondaryTask = 0;
- }
+ StopSecondaryTask();
m_secondaryTask = new CTaskManager(m_object);
- err = m_secondaryTask->StartTaskGunGoal(dirV, dirH);
+ Error err = m_secondaryTask->StartTaskGunGoal(dirV, dirH);
UpdateInterface();
return err;
}
@@ -1138,16 +1075,10 @@ Error CBrain::StartTaskGunGoal(float dirV, float dirH)
Error CBrain::StartTaskReset(Math::Vector goal, Math::Vector angle)
{
- Error err;
-
- if ( m_primaryTask != 0 )
- {
- delete m_primaryTask; // stops the current task
- m_primaryTask = 0;
- }
+ StopTask();
m_primaryTask = new CTaskManager(m_object);
- err = m_primaryTask->StartTaskReset(goal, angle);
+ Error err = m_primaryTask->StartTaskReset(goal, angle);
UpdateInterface();
return err;
}
@@ -1156,30 +1087,29 @@ Error CBrain::StartTaskReset(Math::Vector goal, Math::Vector angle)
Error CBrain::EndedTask()
{
- Error err;
-
- if ( m_secondaryTask != 0 ) // current task?
+ if (m_secondaryTask != nullptr) // current task?
{
- err = m_secondaryTask->IsEnded();
+ Error err = m_secondaryTask->IsEnded();
if ( err != ERR_CONTINUE ) // job ended?
{
delete m_secondaryTask;
- m_secondaryTask = 0;
+ m_secondaryTask = nullptr;
UpdateInterface();
}
}
- if ( m_primaryTask != 0 ) // current task?
+ if (m_primaryTask != nullptr) // current task?
{
- err = m_primaryTask->IsEnded();
+ Error err = m_primaryTask->IsEnded();
if ( err != ERR_CONTINUE ) // job ended?
{
delete m_primaryTask;
- m_primaryTask = 0;
+ m_primaryTask = nullptr;
UpdateInterface();
}
return err;
}
+
return ERR_STOP;
}
@@ -2616,6 +2546,8 @@ void CBrain::RunProgram(int rank)
BlinkScript(true); // blink
m_object->CreateSelectParticle();
m_main->UpdateShortcuts();
+ if(m_object->GetTrainer())
+ m_main->StartMissionTimer();
}
}
diff --git a/src/object/brain.h b/src/object/brain.h
index a1f5da7..a0d1869 100644
--- a/src/object/brain.h
+++ b/src/object/brain.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file object/brain.h
@@ -102,6 +105,7 @@ public:
int GetProgram();
void StopProgram();
void StopTask();
+ void StopSecondaryTask();
bool IntroduceVirus();
void SetActiveVirus(bool bActive);
@@ -128,7 +132,7 @@ public:
Error StartTaskBuild(ObjectType type);
Error StartTaskSearch();
Error StartTaskTerraform();
- Error StartTaskPen(bool bDown, int color);
+ Error StartTaskPen(bool down, int color);
Error StartTaskRecover();
Error StartTaskShield(TaskShieldMode mode);
Error StartTaskFire(float delay);
diff --git a/src/object/level/parser.cpp b/src/object/level/parser.cpp
new file mode 100644
index 0000000..3a0449a
--- /dev/null
+++ b/src/object/level/parser.cpp
@@ -0,0 +1,250 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "object/level/parser.h"
+
+
+#include "app/app.h"
+
+#include "common/resources/resourcemanager.h"
+#include "common/resources/inputstream.h"
+
+#include "object/level/parserexceptions.h"
+
+#include "object/robotmain.h"
+
+#include <string>
+#include <exception>
+#include <sstream>
+#include <iomanip>
+
+#include <boost/algorithm/string/trim.hpp>
+#include <boost/algorithm/string/replace.hpp>
+#include <boost/lexical_cast.hpp>
+
+CLevelParser::CLevelParser()
+{
+ m_filename = "";
+}
+
+CLevelParser::CLevelParser(std::string filename)
+{
+ m_filename = filename;
+}
+
+CLevelParser::CLevelParser(std::string category, int chapter, int rank)
+{
+ m_filename = BuildSceneName(category, chapter, rank);
+}
+
+CLevelParser::~CLevelParser()
+{
+ for(auto line : m_lines)
+ {
+ delete line;
+ }
+}
+
+std::string CLevelParser::BuildSceneName(std::string category, int chapter, int rank, bool sceneFile)
+{
+ std::ostringstream outstream;
+ if(category == "custom")
+ {
+ outstream << "levels/custom/";
+ outstream << CRobotMain::GetInstancePointer()->GetUserLevelName(chapter);
+ if(rank == 000)
+ {
+ if(sceneFile)
+ {
+ outstream << "/chaptertitle.txt";
+ }
+ }
+ else
+ {
+ outstream << "/level" << std::setfill('0') << std::setw(3) << rank;
+ if(sceneFile)
+ {
+ outstream << "/scene.txt";
+ }
+ }
+ }
+ else if(category == "perso")
+ {
+ outstream << "levels/other/perso.txt";
+ }
+ else if(category == "win" || category == "lost")
+ {
+ outstream << "levels/other/";
+ outstream << category << std::setfill('0') << std::setw(3) << chapter*100+rank << ".txt";
+ }
+ else
+ {
+ outstream << "levels/" << category << "/";
+ outstream << "chapter" << std::setfill('0') << std::setw(3) << chapter;
+ if(rank == 000)
+ {
+ if(sceneFile)
+ {
+ outstream << "/chaptertitle.txt";
+ }
+ }
+ else
+ {
+ outstream << "/level" << std::setfill('0') << std::setw(3) << rank;
+ if(sceneFile)
+ {
+ outstream << "/scene.txt";
+ }
+ }
+ }
+ return outstream.str();
+}
+
+bool CLevelParser::Exists()
+{
+ return CResourceManager::Exists(m_filename);
+}
+
+void CLevelParser::Load()
+{
+ CInputStream file;
+ file.open(m_filename);
+ if(!file.is_open())
+ throw CLevelParserException("Failed to open file: "+m_filename);
+
+ char lang = CApplication::GetInstancePointer()->GetLanguageChar();
+
+ std::string line;
+ int lineNumber = 0;
+ std::map<std::string, CLevelParserLine*> translatableLines;
+ while(getline(file,line))
+ {
+ lineNumber++;
+
+ boost::replace_all(line, "\t", " "); // replace tab by space
+
+ // ignore comments
+ std::size_t comment = line.find("//");
+ if(comment != std::string::npos)
+ line = line.substr(0, comment);
+
+ boost::algorithm::trim(line);
+
+ std::size_t pos = line.find_first_of(" \t\n");
+ std::string command = line.substr(0, pos);
+ if(pos != std::string::npos) {
+ line = line.substr(pos+1);
+ boost::algorithm::trim(line);
+ } else {
+ line = "";
+ }
+ if(command.empty()) continue;
+
+ CLevelParserLine* parserLine = new CLevelParserLine(lineNumber, command);
+
+ std::string baseCommand = command;
+ if(command[command.length()-2] == '.') {
+ baseCommand = command.substr(0, command.length()-2);
+ if(command[command.length()-1] == 'E' && translatableLines[baseCommand] == nullptr) {
+ parserLine->SetCommand(baseCommand);
+ translatableLines[baseCommand] = parserLine;
+ } else if(command[command.length()-1] == lang) {
+ if(translatableLines[baseCommand] != nullptr) {
+ m_lines.erase(std::remove(m_lines.begin(), m_lines.end(), translatableLines[baseCommand]), m_lines.end());
+ delete translatableLines[baseCommand];
+ }
+ parserLine->SetCommand(baseCommand);
+ translatableLines[baseCommand] = parserLine;
+ } else {
+ delete parserLine;
+ continue;
+ }
+ }
+
+ while(!line.empty()) {
+ pos = line.find_first_of("=");
+ std::string paramName = line.substr(0, pos);
+ boost::algorithm::trim(paramName);
+ line = line.substr(pos+1);
+ boost::algorithm::trim(line);
+
+ if(line[0] == '\"') {
+ pos = line.find_first_of("\"", 1);
+ if(pos == std::string::npos)
+ throw CLevelParserException("Unclosed \" in "+m_filename+":"+boost::lexical_cast<std::string>(lineNumber));
+ } else if(line[0] == '\'') {
+ pos = line.find_first_of("'", 1);
+ if(pos == std::string::npos)
+ throw CLevelParserException("Unclosed ' in "+m_filename+":"+boost::lexical_cast<std::string>(lineNumber));
+ } else {
+ pos = line.find_first_of("=");
+ if(pos != std::string::npos) {
+ std::size_t pos2 = line.find_last_of(" \t\n", line.find_last_not_of(" \t\n", pos-1));
+ if(pos2 != std::string::npos)
+ pos = pos2;
+ } else {
+ pos = line.length()-1;
+ }
+ }
+ std::string paramValue = line.substr(0, pos+1);
+ boost::algorithm::trim(paramValue);
+
+ parserLine->AddParam(paramName, new CLevelParserParam(paramName, paramValue));
+
+ if(pos == std::string::npos)
+ break;
+ line = line.substr(pos+1);
+ boost::algorithm::trim(line);
+ }
+
+ AddLine(parserLine);
+ }
+
+ file.close();
+}
+
+void CLevelParser::Save(std::string filename)
+{
+ assert(false); //TODO
+}
+
+const std::string& CLevelParser::GetFilename()
+{
+ return m_filename;
+}
+
+std::vector<CLevelParserLine*> CLevelParser::GetLines()
+{
+ return m_lines;
+}
+
+void CLevelParser::AddLine(CLevelParserLine* line)
+{
+ line->SetLevel(this);
+ m_lines.push_back(line);
+}
+
+CLevelParserLine* CLevelParser::Get(std::string command)
+{
+ for(auto& line : m_lines) {
+ if(line->GetCommand() == command)
+ return line;
+ }
+ throw CLevelParserException("Command not found: "+command);
+}
diff --git a/src/object/level/parser.h b/src/object/level/parser.h
new file mode 100644
index 0000000..ca2bf6f
--- /dev/null
+++ b/src/object/level/parser.h
@@ -0,0 +1,71 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+/**
+ * \file object/level/parser.h
+ * \brief Parser for level files
+ */
+
+#pragma once
+
+#include "object/level/parserline.h"
+#include "object/level/parserparam.h"
+#include "object/level/parserexceptions.h"
+
+#include <string>
+#include <vector>
+
+class CLevelParser
+{
+public:
+ //! Create an empty level file
+ CLevelParser();
+ //! Load level from file
+ CLevelParser(std::string filename);
+ //! Load given level
+ CLevelParser(std::string category, int chapter, int rank);
+
+ ~CLevelParser();
+
+ //! Build level filename
+ static std::string BuildSceneName(std::string category, int chapter, int rank, bool sceneFile = true);
+
+ //! Check if level file exists
+ bool Exists();
+ //! Load file
+ void Load();
+ //! Save file
+ void Save(std::string filename);
+
+ //! Get filename
+ const std::string& GetFilename();
+
+ //! Get all lines from file
+ std::vector<CLevelParserLine*> GetLines();
+ //! Insert new line to file
+ void AddLine(CLevelParserLine* line);
+
+ //! Find first line with given command
+ CLevelParserLine* Get(std::string command);
+
+private:
+
+ std::string m_filename;
+ std::vector<CLevelParserLine*> m_lines;
+}; \ No newline at end of file
diff --git a/src/object/level/parserexceptions.cpp b/src/object/level/parserexceptions.cpp
new file mode 100644
index 0000000..8f74078
--- /dev/null
+++ b/src/object/level/parserexceptions.cpp
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "object/level/parserexceptions.h"
+
+
+#include "object/level/parser.h"
+
+#include <boost/lexical_cast.hpp>
+
+CLevelParserException::CLevelParserException(std::string message) noexcept
+{
+ m_message = message;
+}
+
+const char* CLevelParserException::what() const noexcept
+{
+ return m_message.c_str();
+}
+
+CLevelParserExceptionMissingParam::CLevelParserExceptionMissingParam(CLevelParserParam* thisParam) noexcept
+: CLevelParserException("Missing required param "+thisParam->GetName()+" (in "+thisParam->GetLine()->GetLevel()->GetFilename()+":"+boost::lexical_cast<std::string>(thisParam->GetLine()->GetLineNumber())+")")
+{
+}
+
+CLevelParserExceptionBadParam::CLevelParserExceptionBadParam(CLevelParserParam* thisParam, std::string requestedType) noexcept
+: CLevelParserException("Unable to parse '"+thisParam->GetValue()+"' as "+requestedType+" (param '"+thisParam->GetName()+"' in "+thisParam->GetLine()->GetLevel()->GetFilename()+":"+boost::lexical_cast<std::string>(thisParam->GetLine()->GetLineNumber())+")")
+{
+}
diff --git a/src/object/level/parserexceptions.h b/src/object/level/parserexceptions.h
new file mode 100644
index 0000000..7265d8b
--- /dev/null
+++ b/src/object/level/parserexceptions.h
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+/**
+ * \file object/level/parserexceptions.h
+ * \brief Exceptions that could be thrown in level parser
+ */
+
+#pragma once
+
+#include <exception>
+#include <string>
+
+class CLevelParserParam;
+
+class CLevelParserException : public std::exception
+{
+public:
+ CLevelParserException(std::string message) noexcept;
+ virtual ~CLevelParserException() noexcept {}
+ const char* what() const noexcept;
+
+protected:
+ std::string m_message;
+};
+
+class CLevelParserExceptionMissingParam : public CLevelParserException
+{
+public:
+ CLevelParserExceptionMissingParam(CLevelParserParam* thisParam) noexcept;
+ virtual ~CLevelParserExceptionMissingParam() noexcept {}
+};
+
+class CLevelParserExceptionBadParam : public CLevelParserException
+{
+public:
+ CLevelParserExceptionBadParam(CLevelParserParam* thisParam, std::string requestedType) noexcept;
+ virtual ~CLevelParserExceptionBadParam() noexcept {}
+}; \ No newline at end of file
diff --git a/src/object/level/parserline.cpp b/src/object/level/parserline.cpp
new file mode 100644
index 0000000..e0e8097
--- /dev/null
+++ b/src/object/level/parserline.cpp
@@ -0,0 +1,90 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "object/level/parserline.h"
+
+
+#include "object/level/parser.h"
+#include "common/logger.h"
+
+CLevelParserLine::CLevelParserLine(std::string command)
+{
+ m_command = command;
+ m_lineNumber = 0;
+}
+
+CLevelParserLine::CLevelParserLine(int lineNumber, std::string command)
+{
+ m_command = command;
+ m_lineNumber = lineNumber;
+}
+
+CLevelParserLine::~CLevelParserLine()
+{
+ for(auto param : m_params)
+ {
+ delete param.second;
+ }
+}
+
+std::string CLevelParserLine::GetLine()
+{
+ assert(false); //TODO
+}
+
+int CLevelParserLine::GetLineNumber()
+{
+ return m_lineNumber;
+}
+
+CLevelParser* CLevelParserLine::GetLevel()
+{
+ return m_level;
+}
+
+void CLevelParserLine::SetLevel(CLevelParser* level)
+{
+ m_level = level;
+}
+
+std::string CLevelParserLine::GetCommand()
+{
+ return m_command;
+}
+
+void CLevelParserLine::SetCommand(std::string command)
+{
+ m_command = command;
+}
+
+CLevelParserParam* CLevelParserLine::GetParam(std::string name)
+{
+ if(m_params[name] == nullptr) {
+ CLevelParserParam* param = new CLevelParserParam(name, true);
+ param->SetLine(this);
+ m_params[name] = param;
+ }
+ return m_params[name];
+}
+
+void CLevelParserLine::AddParam(std::string name, CLevelParserParam* value)
+{
+ value->SetLine(this);
+ m_params[name] = value;
+} \ No newline at end of file
diff --git a/src/object/level/parserline.h b/src/object/level/parserline.h
new file mode 100644
index 0000000..9881ac7
--- /dev/null
+++ b/src/object/level/parserline.h
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+/**
+ * \file object/level/parserline.h
+ * \brief Class for one line from level file
+ */
+
+#pragma once
+
+#include <string>
+#include <map>
+
+class CLevelParser;
+class CLevelParserParam;
+
+class CLevelParserLine
+{
+public:
+ CLevelParserLine(int lineNumber, std::string command);
+ CLevelParserLine(std::string command);
+ ~CLevelParserLine();
+
+ //! Get line to be saved in level file
+ std::string GetLine();
+
+ //! Get line number
+ int GetLineNumber();
+
+ //! Get CLevelParser this line is part of
+ CLevelParser* GetLevel();
+ //! Set CLevelParser this line is part of
+ void SetLevel(CLevelParser* level);
+
+ std::string GetCommand();
+ void SetCommand(std::string command);
+
+ CLevelParserParam* GetParam(std::string name);
+ void AddParam(std::string name, CLevelParserParam* value);
+
+private:
+ CLevelParser* m_level;
+ int m_lineNumber;
+ std::string m_command;
+ std::map<std::string, CLevelParserParam*> m_params;
+}; \ No newline at end of file
diff --git a/src/object/level/parserparam.cpp b/src/object/level/parserparam.cpp
new file mode 100644
index 0000000..1f81f0e
--- /dev/null
+++ b/src/object/level/parserparam.cpp
@@ -0,0 +1,950 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+#include "object/level/parserline.h"
+
+
+#include "app/app.h"
+#include "common/logger.h"
+#include "common/resources/resourcemanager.h"
+#include "object/level/parser.h"
+#include "object/robotmain.h"
+
+#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string.hpp>
+
+CLevelParserParam::CLevelParserParam(std::string name, std::string value)
+{
+ m_name = name;
+ m_value = value;
+ m_empty = false;
+}
+
+CLevelParserParam::CLevelParserParam(std::string name, bool empty)
+{
+ assert(empty == true); // we need a second argument because we don't want to create param with value "name"
+ m_name = name;
+ m_value = "";
+ m_empty = true;
+}
+
+CLevelParserParam::~CLevelParserParam()
+{
+ for(auto& a : m_array)
+ delete a;
+}
+
+void CLevelParserParam::SetLine(CLevelParserLine* line)
+{
+ m_line = line;
+}
+
+CLevelParserLine* CLevelParserParam::GetLine()
+{
+ return m_line;
+}
+
+std::string CLevelParserParam::GetName()
+{
+ return m_name;
+}
+
+std::string CLevelParserParam::GetValue()
+{
+ return m_value;
+}
+
+bool CLevelParserParam::IsDefined()
+{
+ return !m_empty;
+}
+
+template<typename T>
+T CLevelParserParam::Cast(std::string value, std::string requestedType)
+{
+ try {
+ return boost::lexical_cast<T>(value);
+ }
+ catch(...)
+ {
+ throw CLevelParserExceptionBadParam(this, requestedType);
+ }
+}
+
+template<typename T>
+T CLevelParserParam::Cast(std::string requestedType)
+{
+ return Cast<T>(m_value, requestedType);
+}
+
+
+int CLevelParserParam::AsInt()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return Cast<int>("int");
+}
+
+
+int CLevelParserParam::AsInt(int def)
+{
+ if(m_empty)
+ return def;
+ return AsInt();
+}
+
+
+float CLevelParserParam::AsFloat()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return Cast<float>("float");
+}
+
+float CLevelParserParam::AsFloat(float def)
+{
+ if(m_empty)
+ return def;
+ return AsFloat();
+}
+
+
+std::string CLevelParserParam::AsString()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ if((m_value[0] == '\"' && m_value[m_value.length()-1] == '\"') || (m_value[0] == '\'' && m_value[m_value.length()-1] == '\''))
+ {
+ return m_value.substr(1, m_value.length()-2);
+ } else {
+ throw CLevelParserExceptionBadParam(this, "string");
+ }
+}
+
+std::string CLevelParserParam::AsString(std::string def)
+{
+ if(m_empty)
+ return def;
+ return AsString();
+}
+
+
+bool CLevelParserParam::AsBool()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ std::string value = m_value;
+ boost::to_lower(value);
+ if(value == "true") return true;
+ if(value == "false") return false;
+ return Cast<bool>("bool");
+}
+
+bool CLevelParserParam::AsBool(bool def)
+{
+ if(m_empty)
+ return def;
+ return AsBool();
+}
+
+
+std::string CLevelParserParam::InjectLevelDir(std::string path, const std::string defaultDir)
+{
+ std::string newPath = path;
+ std::string lvlDir = CLevelParser::BuildSceneName(CRobotMain::GetInstancePointer()->GetSceneName(), CRobotMain::GetInstancePointer()->GetSceneRank()/100, CRobotMain::GetInstancePointer()->GetSceneRank()%100, false);
+ boost::replace_all(newPath, "%lvl%", lvlDir);
+ std::string chapDir = CLevelParser::BuildSceneName(CRobotMain::GetInstancePointer()->GetSceneName(), CRobotMain::GetInstancePointer()->GetSceneRank()/100, 0, false);
+ boost::replace_all(newPath, "%chap%", chapDir);
+ if(newPath == path && !path.empty())
+ {
+ newPath = defaultDir + (!defaultDir.empty() ? "/" : "") + newPath;
+ }
+
+ std::string langPath = newPath;
+ std::string langStr(1, CApplication::GetInstancePointer()->GetLanguageChar());
+ boost::replace_all(langPath, "%lng%", langStr);
+ if(CResourceManager::Exists(langPath))
+ return langPath;
+
+ // Fallback to English if file doesn't exist
+ boost::replace_all(newPath, "%lng%", "E");
+ if(CResourceManager::Exists(newPath))
+ return newPath;
+
+ return langPath; // Return current language file if none of the files exist
+}
+
+std::string CLevelParserParam::ToPath(std::string path, const std::string defaultDir)
+{
+ if(defaultDir == "" && path.find("%lvl%") != std::string::npos)
+ throw CLevelParserException("TODO: Param "+m_name+" does not yet support %lvl%! :(");
+
+ return InjectLevelDir(path, defaultDir);
+}
+
+std::string CLevelParserParam::AsPath(const std::string defaultDir)
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+
+ return ToPath(AsString(), defaultDir);
+}
+
+std::string CLevelParserParam::AsPath(const std::string defaultDir, std::string def)
+{
+ if(m_empty)
+ return InjectLevelDir(def, defaultDir);
+
+ return ToPath(AsString(def), defaultDir);
+}
+
+
+Gfx::Color CLevelParserParam::AsColor()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+
+ ParseArray();
+
+ if(m_array.size() == 3) { //RGB
+ return Gfx::Color(m_array[0]->AsFloat(), m_array[1]->AsFloat(), m_array[2]->AsFloat());
+ } else if(m_array.size() == 4) { //RGBA
+ return Gfx::Color(m_array[0]->AsFloat(), m_array[1]->AsFloat(), m_array[2]->AsFloat(), m_array[3]->AsFloat());
+ } else {
+ throw CLevelParserExceptionBadParam(this, "color");
+ }
+}
+
+Gfx::Color CLevelParserParam::AsColor(Gfx::Color def)
+{
+ if(m_empty)
+ return def;
+ return AsColor();
+}
+
+
+Math::Vector CLevelParserParam::AsPoint()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+
+ ParseArray();
+
+ if(m_array.size() == 2) { //XZ
+ return Math::Vector(m_array[0]->AsFloat(), 0.0f, m_array[1]->AsFloat());
+ } else if(m_array.size() == 3) { //XYZ
+ return Math::Vector(m_array[0]->AsFloat(), m_array[1]->AsFloat(), m_array[2]->AsFloat());
+ } else {
+ throw CLevelParserExceptionBadParam(this, "point");
+ }
+}
+
+Math::Vector CLevelParserParam::AsPoint(Math::Vector def)
+{
+ if(m_empty)
+ return def;
+ return AsPoint();
+}
+
+
+ObjectType CLevelParserParam::ToObjectType(std::string value)
+{
+ if(value == "All" ) return OBJECT_NULL;
+ if(value == "Portico" ) return OBJECT_PORTICO;
+ if(value == "SpaceShip" ) return OBJECT_BASE;
+ if(value == "PracticeBot" ) return OBJECT_MOBILEwt;
+ if(value == "WingedGrabber" ) return OBJECT_MOBILEfa;
+ if(value == "TrackedGrabber" ) return OBJECT_MOBILEta;
+ if(value == "WheeledGrabber" ) return OBJECT_MOBILEwa;
+ if(value == "LeggedGrabber" ) return OBJECT_MOBILEia;
+ if(value == "WingedShooter" ) return OBJECT_MOBILEfc;
+ if(value == "TrackedShooter" ) return OBJECT_MOBILEtc;
+ if(value == "WheeledShooter" ) return OBJECT_MOBILEwc;
+ if(value == "LeggedShooter" ) return OBJECT_MOBILEic;
+ if(value == "WingedOrgaShooter" ) return OBJECT_MOBILEfi;
+ if(value == "TrackedOrgaShooter") return OBJECT_MOBILEti;
+ if(value == "WheeledOrgaShooter") return OBJECT_MOBILEwi;
+ if(value == "LeggedOrgaShooter" ) return OBJECT_MOBILEii;
+ if(value == "WingedSniffer" ) return OBJECT_MOBILEfs;
+ if(value == "TrackedSniffer" ) return OBJECT_MOBILEts;
+ if(value == "WheeledSniffer" ) return OBJECT_MOBILEws;
+ if(value == "LeggedSniffer" ) return OBJECT_MOBILEis;
+ if(value == "Thumper" ) return OBJECT_MOBILErt;
+ if(value == "PhazerShooter" ) return OBJECT_MOBILErc;
+ if(value == "Recycler" ) return OBJECT_MOBILErr;
+ if(value == "Shielder" ) return OBJECT_MOBILErs;
+ if(value == "Subber" ) return OBJECT_MOBILEsa;
+ if(value == "TargetBot" ) return OBJECT_MOBILEtg;
+ if(value == "Scribbler" ) return OBJECT_MOBILEdr;
+ if(value == "PowerSpot" ) return OBJECT_MARKPOWER;
+ if(value == "TitaniumSpot" ) return OBJECT_MARKSTONE;
+ if(value == "UraniumSpot" ) return OBJECT_MARKURANIUM;
+ if(value == "PlatinumSpot" ) return OBJECT_MARKURANIUM;
+ if(value == "KeyASpot" ) return OBJECT_MARKKEYa;
+ if(value == "KeyBSpot" ) return OBJECT_MARKKEYb;
+ if(value == "KeyCSpot" ) return OBJECT_MARKKEYc;
+ if(value == "KeyDSpot" ) return OBJECT_MARKKEYd;
+ if(value == "WayPoint" ) return OBJECT_WAYPOINT;
+ if(value == "BlueFlag" ) return OBJECT_FLAGb;
+ if(value == "RedFlag" ) return OBJECT_FLAGr;
+ if(value == "GreenFlag" ) return OBJECT_FLAGg;
+ if(value == "YellowFlag" ) return OBJECT_FLAGy;
+ if(value == "VioletFlag" ) return OBJECT_FLAGv;
+ if(value == "PowerCell" ) return OBJECT_POWER;
+ if(value == "FuelCellPlant" ) return OBJECT_NUCLEAR;
+ if(value == "FuelCell" ) return OBJECT_ATOMIC;
+ if(value == "NuclearCell" ) return OBJECT_ATOMIC;
+ if(value == "TitaniumOre" ) return OBJECT_STONE;
+ if(value == "UraniumOre" ) return OBJECT_URANIUM;
+ if(value == "PlatinumOre" ) return OBJECT_URANIUM;
+ if(value == "Titanium" ) return OBJECT_METAL;
+ if(value == "OrgaMatter" ) return OBJECT_BULLET;
+ if(value == "BlackBox" ) return OBJECT_BBOX;
+ if(value == "KeyA" ) return OBJECT_KEYa;
+ if(value == "KeyB" ) return OBJECT_KEYb;
+ if(value == "KeyC" ) return OBJECT_KEYc;
+ if(value == "KeyD" ) return OBJECT_KEYd;
+ if(value == "TNT" ) return OBJECT_TNT;
+ if(value == "Scrap1" ) return OBJECT_SCRAP1;
+ if(value == "Scrap2" ) return OBJECT_SCRAP2;
+ if(value == "Scrap3" ) return OBJECT_SCRAP3;
+ if(value == "Scrap4" ) return OBJECT_SCRAP4;
+ if(value == "Scrap5" ) return OBJECT_SCRAP5;
+ if(value == "Mine" ) return OBJECT_BOMB;
+ if(value == "Firework" ) return OBJECT_WINFIRE;
+ if(value == "Bag" ) return OBJECT_BAG;
+ if(value == "Greenery0" ) return OBJECT_PLANT0;
+ if(value == "Greenery1" ) return OBJECT_PLANT1;
+ if(value == "Greenery2" ) return OBJECT_PLANT2;
+ if(value == "Greenery3" ) return OBJECT_PLANT3;
+ if(value == "Greenery4" ) return OBJECT_PLANT4;
+ if(value == "Greenery5" ) return OBJECT_PLANT5;
+ if(value == "Greenery6" ) return OBJECT_PLANT6;
+ if(value == "Greenery7" ) return OBJECT_PLANT7;
+ if(value == "Greenery8" ) return OBJECT_PLANT8;
+ if(value == "Greenery9" ) return OBJECT_PLANT9;
+ if(value == "Greenery10" ) return OBJECT_PLANT10;
+ if(value == "Greenery11" ) return OBJECT_PLANT11;
+ if(value == "Greenery12" ) return OBJECT_PLANT12;
+ if(value == "Greenery13" ) return OBJECT_PLANT13;
+ if(value == "Greenery14" ) return OBJECT_PLANT14;
+ if(value == "Greenery15" ) return OBJECT_PLANT15;
+ if(value == "Greenery16" ) return OBJECT_PLANT16;
+ if(value == "Greenery17" ) return OBJECT_PLANT17;
+ if(value == "Greenery18" ) return OBJECT_PLANT18;
+ if(value == "Greenery19" ) return OBJECT_PLANT19;
+ if(value == "Tree0" ) return OBJECT_TREE0;
+ if(value == "Tree1" ) return OBJECT_TREE1;
+ if(value == "Tree2" ) return OBJECT_TREE2;
+ if(value == "Tree3" ) return OBJECT_TREE3;
+ if(value == "Tree4" ) return OBJECT_TREE4;
+ if(value == "Tree5" ) return OBJECT_TREE5;
+ if(value == "Mushroom1" ) return OBJECT_MUSHROOM1;
+ if(value == "Mushroom2" ) return OBJECT_MUSHROOM2;
+ if(value == "Home" ) return OBJECT_HOME1;
+ if(value == "Derrick" ) return OBJECT_DERRICK;
+ if(value == "BotFactory" ) return OBJECT_FACTORY;
+ if(value == "PowerStation" ) return OBJECT_STATION;
+ if(value == "Converter" ) return OBJECT_CONVERT;
+ if(value == "RepairCenter" ) return OBJECT_REPAIR;
+ if(value == "Destroyer" ) return OBJECT_DESTROYER;
+ if(value == "DefenseTower" ) return OBJECT_TOWER;
+ if(value == "AlienNest" ) return OBJECT_NEST;
+ if(value == "ResearchCenter" ) return OBJECT_RESEARCH;
+ if(value == "RadarStation" ) return OBJECT_RADAR;
+ if(value == "ExchangePost" ) return OBJECT_INFO;
+ if(value == "PowerPlant" ) return OBJECT_ENERGY;
+ if(value == "AutoLab" ) return OBJECT_LABO;
+ if(value == "NuclearPlant" ) return OBJECT_NUCLEAR;
+ if(value == "PowerCaptor" ) return OBJECT_PARA;
+ if(value == "Vault" ) return OBJECT_SAFE;
+ if(value == "Houston" ) return OBJECT_HUSTON;
+ if(value == "Target1" ) return OBJECT_TARGET1;
+ if(value == "Target2" ) return OBJECT_TARGET2;
+ if(value == "StartArea" ) return OBJECT_START;
+ if(value == "GoalArea" ) return OBJECT_END;
+ if(value == "AlienQueen" ) return OBJECT_MOTHER;
+ if(value == "AlienEgg" ) return OBJECT_EGG;
+ if(value == "AlienAnt" ) return OBJECT_ANT;
+ if(value == "AlienSpider" ) return OBJECT_SPIDER;
+ if(value == "AlienWasp" ) return OBJECT_BEE;
+ if(value == "AlienWorm" ) return OBJECT_WORM;
+ if(value == "WreckBotw1" ) return OBJECT_RUINmobilew1;
+ if(value == "WreckBotw2" ) return OBJECT_RUINmobilew2;
+ if(value == "WreckBott1" ) return OBJECT_RUINmobilet1;
+ if(value == "WreckBott2" ) return OBJECT_RUINmobilet2;
+ if(value == "WreckBotr1" ) return OBJECT_RUINmobiler1;
+ if(value == "WreckBotr2" ) return OBJECT_RUINmobiler2;
+ if(value == "RuinBotFactory" ) return OBJECT_RUINfactory;
+ if(value == "RuinDoor" ) return OBJECT_RUINdoor;
+ if(value == "RuinSupport" ) return OBJECT_RUINsupport;
+ if(value == "RuinRadar" ) return OBJECT_RUINradar;
+ if(value == "RuinConvert" ) return OBJECT_RUINconvert;
+ if(value == "RuinBaseCamp" ) return OBJECT_RUINbase;
+ if(value == "RuinHeadCamp" ) return OBJECT_RUINhead;
+ if(value == "Barrier0" ) return OBJECT_BARRIER0;
+ if(value == "Barrier1" ) return OBJECT_BARRIER1;
+ if(value == "Barrier2" ) return OBJECT_BARRIER2;
+ if(value == "Barrier3" ) return OBJECT_BARRIER3;
+ if(value == "Teen0" ) return OBJECT_TEEN0;
+ if(value == "Teen1" ) return OBJECT_TEEN1;
+ if(value == "Teen2" ) return OBJECT_TEEN2;
+ if(value == "Teen3" ) return OBJECT_TEEN3;
+ if(value == "Teen4" ) return OBJECT_TEEN4;
+ if(value == "Teen5" ) return OBJECT_TEEN5;
+ if(value == "Teen6" ) return OBJECT_TEEN6;
+ if(value == "Teen7" ) return OBJECT_TEEN7;
+ if(value == "Teen8" ) return OBJECT_TEEN8;
+ if(value == "Teen9" ) return OBJECT_TEEN9;
+ if(value == "Teen10" ) return OBJECT_TEEN10;
+ if(value == "Teen11" ) return OBJECT_TEEN11;
+ if(value == "Teen12" ) return OBJECT_TEEN12;
+ if(value == "Teen13" ) return OBJECT_TEEN13;
+ if(value == "Teen14" ) return OBJECT_TEEN14;
+ if(value == "Teen15" ) return OBJECT_TEEN15;
+ if(value == "Teen16" ) return OBJECT_TEEN16;
+ if(value == "Teen17" ) return OBJECT_TEEN17;
+ if(value == "Teen18" ) return OBJECT_TEEN18;
+ if(value == "Teen19" ) return OBJECT_TEEN19;
+ if(value == "Teen20" ) return OBJECT_TEEN20;
+ if(value == "Teen21" ) return OBJECT_TEEN21;
+ if(value == "Teen22" ) return OBJECT_TEEN22;
+ if(value == "Teen23" ) return OBJECT_TEEN23;
+ if(value == "Teen24" ) return OBJECT_TEEN24;
+ if(value == "Teen25" ) return OBJECT_TEEN25;
+ if(value == "Teen26" ) return OBJECT_TEEN26;
+ if(value == "Teen27" ) return OBJECT_TEEN27;
+ if(value == "Teen28" ) return OBJECT_TEEN28;
+ if(value == "Teen29" ) return OBJECT_TEEN29;
+ if(value == "Teen30" ) return OBJECT_TEEN30;
+ if(value == "Teen31" ) return OBJECT_TEEN31;
+ if(value == "Teen32" ) return OBJECT_TEEN32;
+ if(value == "Teen33" ) return OBJECT_TEEN33;
+ if(value == "Stone" ) return OBJECT_TEEN34;
+ if(value == "Teen35" ) return OBJECT_TEEN35;
+ if(value == "Teen36" ) return OBJECT_TEEN36;
+ if(value == "Teen37" ) return OBJECT_TEEN37;
+ if(value == "Teen38" ) return OBJECT_TEEN38;
+ if(value == "Teen39" ) return OBJECT_TEEN39;
+ if(value == "Teen40" ) return OBJECT_TEEN40;
+ if(value == "Teen41" ) return OBJECT_TEEN41;
+ if(value == "Teen42" ) return OBJECT_TEEN42;
+ if(value == "Teen43" ) return OBJECT_TEEN43;
+ if(value == "Teen44" ) return OBJECT_TEEN44;
+ if(value == "Quartz0" ) return OBJECT_QUARTZ0;
+ if(value == "Quartz1" ) return OBJECT_QUARTZ1;
+ if(value == "Quartz2" ) return OBJECT_QUARTZ2;
+ if(value == "Quartz3" ) return OBJECT_QUARTZ3;
+ if(value == "MegaStalk0" ) return OBJECT_ROOT0;
+ if(value == "MegaStalk1" ) return OBJECT_ROOT1;
+ if(value == "MegaStalk2" ) return OBJECT_ROOT2;
+ if(value == "MegaStalk3" ) return OBJECT_ROOT3;
+ if(value == "MegaStalk4" ) return OBJECT_ROOT4;
+ if(value == "MegaStalk5" ) return OBJECT_ROOT5;
+ if(value == "ApolloLEM" ) return OBJECT_APOLLO1;
+ if(value == "ApolloJeep" ) return OBJECT_APOLLO2;
+ if(value == "ApolloFlag" ) return OBJECT_APOLLO3;
+ if(value == "ApolloModule" ) return OBJECT_APOLLO4;
+ if(value == "ApolloAntenna" ) return OBJECT_APOLLO5;
+ if(value == "Me" ) return OBJECT_HUMAN;
+ if(value == "Tech" ) return OBJECT_TECH;
+ if(value == "MissionController" ) return OBJECT_CONTROLLER;
+ return static_cast<ObjectType>(Cast<int>(value, "object"));
+}
+
+const std::string CLevelParserParam::FromObjectType(ObjectType value)
+{
+ if(value == OBJECT_PORTICO ) return "Portico";
+ if(value == OBJECT_BASE ) return "SpaceShip";
+ if(value == OBJECT_MOBILEwt ) return "PracticeBot";
+ if(value == OBJECT_MOBILEfa ) return "WingedGrabber";
+ if(value == OBJECT_MOBILEta ) return "TrackedGrabber";
+ if(value == OBJECT_MOBILEwa ) return "WheeledGrabber";
+ if(value == OBJECT_MOBILEia ) return "LeggedGrabber";
+ if(value == OBJECT_MOBILEfc ) return "WingedShooter";
+ if(value == OBJECT_MOBILEtc ) return "TrackedShooter";
+ if(value == OBJECT_MOBILEwc ) return "WheeledShooter";
+ if(value == OBJECT_MOBILEic ) return "LeggedShooter";
+ if(value == OBJECT_MOBILEfi ) return "WingedOrgaShooter";
+ if(value == OBJECT_MOBILEti ) return "TrackedOrgaShooter";
+ if(value == OBJECT_MOBILEwi ) return "WheeledOrgaShooter";
+ if(value == OBJECT_MOBILEii ) return "LeggedOrgaShooter";
+ if(value == OBJECT_MOBILEfs ) return "WingedSniffer";
+ if(value == OBJECT_MOBILEts ) return "TrackedSniffer";
+ if(value == OBJECT_MOBILEws ) return "WheeledSniffer";
+ if(value == OBJECT_MOBILEis ) return "LeggedSniffer";
+ if(value == OBJECT_MOBILErt ) return "Thumper";
+ if(value == OBJECT_MOBILErc ) return "PhazerShooter";
+ if(value == OBJECT_MOBILErr ) return "Recycler";
+ if(value == OBJECT_MOBILErs ) return "Shielder";
+ if(value == OBJECT_MOBILEsa ) return "Subber";
+ if(value == OBJECT_MOBILEtg ) return "TargetBot";
+ if(value == OBJECT_MOBILEdr ) return "Scribbler";
+ if(value == OBJECT_MARKPOWER ) return "PowerSpot";
+ if(value == OBJECT_MARKSTONE ) return "TitaniumSpot";
+ if(value == OBJECT_MARKURANIUM ) return "UraniumSpot";
+ if(value == OBJECT_MARKKEYa ) return "KeyASpot";
+ if(value == OBJECT_MARKKEYb ) return "KeyBSpot";
+ if(value == OBJECT_MARKKEYc ) return "KeyCSpot";
+ if(value == OBJECT_MARKKEYd ) return "KeyDSpot";
+ if(value == OBJECT_WAYPOINT ) return "WayPoint";
+ if(value == OBJECT_FLAGb ) return "BlueFlag";
+ if(value == OBJECT_FLAGr ) return "RedFlag";
+ if(value == OBJECT_FLAGg ) return "GreenFlag";
+ if(value == OBJECT_FLAGy ) return "YellowFlag";
+ if(value == OBJECT_FLAGv ) return "VioletFlag";
+ if(value == OBJECT_POWER ) return "PowerCell";
+ if(value == OBJECT_ATOMIC ) return "NuclearCell";
+ if(value == OBJECT_STONE ) return "TitaniumOre";
+ if(value == OBJECT_URANIUM ) return "UraniumOre";
+ if(value == OBJECT_METAL ) return "Titanium";
+ if(value == OBJECT_BULLET ) return "OrgaMatter";
+ if(value == OBJECT_BBOX ) return "BlackBox";
+ if(value == OBJECT_KEYa ) return "KeyA";
+ if(value == OBJECT_KEYb ) return "KeyB";
+ if(value == OBJECT_KEYc ) return "KeyC";
+ if(value == OBJECT_KEYd ) return "KeyD";
+ if(value == OBJECT_TNT ) return "TNT";
+ if(value == OBJECT_SCRAP1 ) return "Scrap1";
+ if(value == OBJECT_SCRAP2 ) return "Scrap2";
+ if(value == OBJECT_SCRAP3 ) return "Scrap3";
+ if(value == OBJECT_SCRAP4 ) return "Scrap4";
+ if(value == OBJECT_SCRAP5 ) return "Scrap5";
+ if(value == OBJECT_BOMB ) return "Mine";
+ if(value == OBJECT_WINFIRE ) return "Firework";
+ if(value == OBJECT_BAG ) return "Bag";
+ if(value == OBJECT_PLANT0 ) return "Greenery0";
+ if(value == OBJECT_PLANT1 ) return "Greenery1";
+ if(value == OBJECT_PLANT2 ) return "Greenery2";
+ if(value == OBJECT_PLANT3 ) return "Greenery3";
+ if(value == OBJECT_PLANT4 ) return "Greenery4";
+ if(value == OBJECT_PLANT5 ) return "Greenery5";
+ if(value == OBJECT_PLANT6 ) return "Greenery6";
+ if(value == OBJECT_PLANT7 ) return "Greenery7";
+ if(value == OBJECT_PLANT8 ) return "Greenery8";
+ if(value == OBJECT_PLANT9 ) return "Greenery9";
+ if(value == OBJECT_PLANT10 ) return "Greenery10";
+ if(value == OBJECT_PLANT11 ) return "Greenery11";
+ if(value == OBJECT_PLANT12 ) return "Greenery12";
+ if(value == OBJECT_PLANT13 ) return "Greenery13";
+ if(value == OBJECT_PLANT14 ) return "Greenery14";
+ if(value == OBJECT_PLANT15 ) return "Greenery15";
+ if(value == OBJECT_PLANT16 ) return "Greenery16";
+ if(value == OBJECT_PLANT17 ) return "Greenery17";
+ if(value == OBJECT_PLANT18 ) return "Greenery18";
+ if(value == OBJECT_PLANT19 ) return "Greenery19";
+ if(value == OBJECT_TREE0 ) return "Tree0";
+ if(value == OBJECT_TREE1 ) return "Tree1";
+ if(value == OBJECT_TREE2 ) return "Tree2";
+ if(value == OBJECT_TREE3 ) return "Tree3";
+ if(value == OBJECT_TREE4 ) return "Tree4";
+ if(value == OBJECT_TREE5 ) return "Tree5";
+ if(value == OBJECT_MUSHROOM1 ) return "Mushroom1";
+ if(value == OBJECT_MUSHROOM2 ) return "Mushroom2";
+ if(value == OBJECT_HOME1 ) return "Home";
+ if(value == OBJECT_DERRICK ) return "Derrick";
+ if(value == OBJECT_FACTORY ) return "BotFactory";
+ if(value == OBJECT_STATION ) return "PowerStation";
+ if(value == OBJECT_CONVERT ) return "Converter";
+ if(value == OBJECT_REPAIR ) return "RepairCenter";
+ if(value == OBJECT_DESTROYER ) return "Destroyer";
+ if(value == OBJECT_TOWER ) return "DefenseTower";
+ if(value == OBJECT_NEST ) return "AlienNest";
+ if(value == OBJECT_RESEARCH ) return "ResearchCenter";
+ if(value == OBJECT_RADAR ) return "RadarStation";
+ if(value == OBJECT_INFO ) return "ExchangePost";
+ if(value == OBJECT_ENERGY ) return "PowerPlant";
+ if(value == OBJECT_LABO ) return "AutoLab";
+ if(value == OBJECT_NUCLEAR ) return "NuclearPlant";
+ if(value == OBJECT_PARA ) return "PowerCaptor";
+ if(value == OBJECT_SAFE ) return "Vault";
+ if(value == OBJECT_HUSTON ) return "Houston";
+ if(value == OBJECT_TARGET1 ) return "Target1";
+ if(value == OBJECT_TARGET2 ) return "Target2";
+ if(value == OBJECT_START ) return "StartArea";
+ if(value == OBJECT_END ) return "GoalArea";
+ if(value == OBJECT_MOTHER ) return "AlienQueen";
+ if(value == OBJECT_EGG ) return "AlienEgg";
+ if(value == OBJECT_ANT ) return "AlienAnt";
+ if(value == OBJECT_SPIDER ) return "AlienSpider";
+ if(value == OBJECT_BEE ) return "AlienWasp";
+ if(value == OBJECT_WORM ) return "AlienWorm";
+ if(value == OBJECT_RUINmobilew1) return "WreckBotw1";
+ if(value == OBJECT_RUINmobilew2) return "WreckBotw2";
+ if(value == OBJECT_RUINmobilet1) return "WreckBott1";
+ if(value == OBJECT_RUINmobilet2) return "WreckBott2";
+ if(value == OBJECT_RUINmobiler1) return "WreckBotr1";
+ if(value == OBJECT_RUINmobiler2) return "WreckBotr2";
+ if(value == OBJECT_RUINfactory ) return "RuinBotFactory";
+ if(value == OBJECT_RUINdoor ) return "RuinDoor";
+ if(value == OBJECT_RUINsupport ) return "RuinSupport";
+ if(value == OBJECT_RUINradar ) return "RuinRadar";
+ if(value == OBJECT_RUINconvert ) return "RuinConvert";
+ if(value == OBJECT_RUINbase ) return "RuinBaseCamp";
+ if(value == OBJECT_RUINhead ) return "RuinHeadCamp";
+ if(value == OBJECT_BARRIER0 ) return "Barrier0";
+ if(value == OBJECT_BARRIER1 ) return "Barrier1";
+ if(value == OBJECT_BARRIER2 ) return "Barrier2";
+ if(value == OBJECT_BARRIER3 ) return "Barrier3";
+ if(value == OBJECT_TEEN0 ) return "Teen0";
+ if(value == OBJECT_TEEN1 ) return "Teen1";
+ if(value == OBJECT_TEEN2 ) return "Teen2";
+ if(value == OBJECT_TEEN3 ) return "Teen3";
+ if(value == OBJECT_TEEN4 ) return "Teen4";
+ if(value == OBJECT_TEEN5 ) return "Teen5";
+ if(value == OBJECT_TEEN6 ) return "Teen6";
+ if(value == OBJECT_TEEN7 ) return "Teen7";
+ if(value == OBJECT_TEEN8 ) return "Teen8";
+ if(value == OBJECT_TEEN9 ) return "Teen9";
+ if(value == OBJECT_TEEN10 ) return "Teen10";
+ if(value == OBJECT_TEEN11 ) return "Teen11";
+ if(value == OBJECT_TEEN12 ) return "Teen12";
+ if(value == OBJECT_TEEN13 ) return "Teen13";
+ if(value == OBJECT_TEEN14 ) return "Teen14";
+ if(value == OBJECT_TEEN15 ) return "Teen15";
+ if(value == OBJECT_TEEN16 ) return "Teen16";
+ if(value == OBJECT_TEEN17 ) return "Teen17";
+ if(value == OBJECT_TEEN18 ) return "Teen18";
+ if(value == OBJECT_TEEN19 ) return "Teen19";
+ if(value == OBJECT_TEEN20 ) return "Teen20";
+ if(value == OBJECT_TEEN21 ) return "Teen21";
+ if(value == OBJECT_TEEN22 ) return "Teen22";
+ if(value == OBJECT_TEEN23 ) return "Teen23";
+ if(value == OBJECT_TEEN24 ) return "Teen24";
+ if(value == OBJECT_TEEN25 ) return "Teen25";
+ if(value == OBJECT_TEEN26 ) return "Teen26";
+ if(value == OBJECT_TEEN27 ) return "Teen27";
+ if(value == OBJECT_TEEN28 ) return "Teen28";
+ if(value == OBJECT_TEEN29 ) return "Teen29";
+ if(value == OBJECT_TEEN30 ) return "Teen30";
+ if(value == OBJECT_TEEN31 ) return "Teen31";
+ if(value == OBJECT_TEEN32 ) return "Teen32";
+ if(value == OBJECT_TEEN33 ) return "Teen33";
+ if(value == OBJECT_TEEN34 ) return "Stone";
+ if(value == OBJECT_TEEN35 ) return "Teen35";
+ if(value == OBJECT_TEEN36 ) return "Teen36";
+ if(value == OBJECT_TEEN37 ) return "Teen37";
+ if(value == OBJECT_TEEN38 ) return "Teen38";
+ if(value == OBJECT_TEEN39 ) return "Teen39";
+ if(value == OBJECT_TEEN40 ) return "Teen40";
+ if(value == OBJECT_TEEN41 ) return "Teen41";
+ if(value == OBJECT_TEEN42 ) return "Teen42";
+ if(value == OBJECT_TEEN43 ) return "Teen43";
+ if(value == OBJECT_TEEN44 ) return "Teen44";
+ if(value == OBJECT_QUARTZ0 ) return "Quartz0";
+ if(value == OBJECT_QUARTZ1 ) return "Quartz1";
+ if(value == OBJECT_QUARTZ2 ) return "Quartz2";
+ if(value == OBJECT_QUARTZ3 ) return "Quartz3";
+ if(value == OBJECT_ROOT0 ) return "MegaStalk0";
+ if(value == OBJECT_ROOT1 ) return "MegaStalk1";
+ if(value == OBJECT_ROOT2 ) return "MegaStalk2";
+ if(value == OBJECT_ROOT3 ) return "MegaStalk3";
+ if(value == OBJECT_ROOT4 ) return "MegaStalk4";
+ if(value == OBJECT_ROOT5 ) return "MegaStalk5";
+ if(value == OBJECT_APOLLO1 ) return "ApolloLEM";
+ if(value == OBJECT_APOLLO2 ) return "ApolloJeep";
+ if(value == OBJECT_APOLLO3 ) return "ApolloFlag";
+ if(value == OBJECT_APOLLO4 ) return "ApolloModule";
+ if(value == OBJECT_APOLLO5 ) return "ApolloAntenna";
+ if(value == OBJECT_HUMAN ) return "Me";
+ if(value == OBJECT_TECH ) return "Tech";
+ if(value == OBJECT_CONTROLLER ) return "MissionController";
+ return boost::lexical_cast<std::string>(static_cast<int>(value));
+}
+
+ObjectType CLevelParserParam::AsObjectType()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToObjectType(m_value);
+}
+
+ObjectType CLevelParserParam::AsObjectType(ObjectType def)
+{
+ if(m_empty)
+ return def;
+ return AsObjectType();
+}
+
+
+DriveType CLevelParserParam::ToDriveType(std::string value)
+{
+ if(value == "Wheeled") return DRIVE_WHEELED;
+ if(value == "Tracked") return DRIVE_TRACKED;
+ if(value == "Winged" ) return DRIVE_WINGED;
+ if(value == "Legged" ) return DRIVE_LEGGED;
+ if(value == "Other" ) return DRIVE_OTHER;
+ return static_cast<DriveType>(Cast<int>(value, "drive"));
+}
+
+DriveType CLevelParserParam::AsDriveType()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToDriveType(m_value);
+}
+
+DriveType CLevelParserParam::AsDriveType(DriveType def)
+{
+ if(m_empty)
+ return def;
+ return AsDriveType();
+}
+
+
+ToolType CLevelParserParam::ToToolType(std::string value)
+{
+ if(value == "Grabber" ) return TOOL_GRABBER;
+ if(value == "Shiffer" ) return TOOL_SNIFFER;
+ if(value == "Shooter" ) return TOOL_SHOOTER;
+ if(value == "OrgaShooter") return TOOL_ORGASHOOTER;
+ if(value == "Other" ) return TOOL_OTHER;
+ return static_cast<ToolType>(Cast<int>(value, "tool"));
+}
+
+ToolType CLevelParserParam::AsToolType()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToToolType(m_value);
+}
+
+ToolType CLevelParserParam::AsToolType(ToolType def)
+{
+ if(m_empty)
+ return def;
+ return AsToolType();
+}
+
+
+Gfx::WaterType CLevelParserParam::ToWaterType(std::string value)
+{
+ if(value == "NULL") return Gfx::WATER_NULL;
+ if(value == "TT" ) return Gfx::WATER_TT;
+ if(value == "TO" ) return Gfx::WATER_TO;
+ if(value == "CT" ) return Gfx::WATER_CT;
+ if(value == "CO" ) return Gfx::WATER_CO;
+ return static_cast<Gfx::WaterType>(Cast<int>(value, "watertype"));
+}
+
+Gfx::WaterType CLevelParserParam::AsWaterType()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToWaterType(m_value);
+}
+
+Gfx::WaterType CLevelParserParam::AsWaterType(Gfx::WaterType def)
+{
+ if(m_empty)
+ return def;
+ return AsWaterType();
+}
+
+
+Gfx::EngineObjectType CLevelParserParam::ToTerrainType(std::string value)
+{
+ if(value == "Terrain") return Gfx::ENG_OBJTYPE_TERRAIN;
+ if(value == "Object" ) return Gfx::ENG_OBJTYPE_FIX;
+ if(value == "Quartz" ) return Gfx::ENG_OBJTYPE_QUARTZ;
+ if(value == "Metal" ) return Gfx::ENG_OBJTYPE_METAL;
+ return static_cast<Gfx::EngineObjectType>(Cast<int>(value, "terraintype"));
+}
+
+Gfx::EngineObjectType CLevelParserParam::AsTerrainType()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToTerrainType(m_value);
+}
+
+Gfx::EngineObjectType CLevelParserParam::AsTerrainType(Gfx::EngineObjectType def)
+{
+ if(m_empty)
+ return def;
+ return AsTerrainType();
+}
+
+
+int CLevelParserParam::ToBuildFlag(std::string value)
+{
+ if(value == "BotFactory" ) return BUILD_FACTORY;
+ if(value == "Derrick" ) return BUILD_DERRICK;
+ if(value == "Converter" ) return BUILD_CONVERT;
+ if(value == "RadarStation" ) return BUILD_RADAR;
+ if(value == "PowerPlant" ) return BUILD_ENERGY;
+ if(value == "NuclearPlant" ) return BUILD_NUCLEAR;
+ if(value == "FuelCellPlant" ) return BUILD_NUCLEAR;
+ if(value == "PowerStation" ) return BUILD_STATION;
+ if(value == "RepairCenter" ) return BUILD_REPAIR;
+ if(value == "DefenseTower" ) return BUILD_TOWER;
+ if(value == "ResearchCenter") return BUILD_RESEARCH;
+ if(value == "AutoLab" ) return BUILD_LABO;
+ if(value == "PowerCaptor" ) return BUILD_PARA;
+ if(value == "ExchangePost" ) return BUILD_INFO;
+ if(value == "Destroyer" ) return BUILD_DESTROYER;
+ if(value == "FlatGround" ) return BUILD_GFLAT;
+ if(value == "Flag" ) return BUILD_FLAG;
+ return Cast<int>(value, "buildflag");
+}
+
+int CLevelParserParam::AsBuildFlag()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToBuildFlag(m_value);
+}
+
+int CLevelParserParam::AsBuildFlag(int def)
+{
+ if(m_empty)
+ return def;
+ return AsBuildFlag();
+}
+
+
+int CLevelParserParam::ToResearchFlag(std::string value)
+{
+ if(value == "TRACKER" ) return RESEARCH_TANK;
+ if(value == "WINGER" ) return RESEARCH_FLY;
+ if(value == "THUMPER" ) return RESEARCH_THUMP;
+ if(value == "SHOOTER" ) return RESEARCH_CANON;
+ if(value == "TOWER" ) return RESEARCH_TOWER;
+ if(value == "PHAZER" ) return RESEARCH_PHAZER;
+ if(value == "SHIELDER") return RESEARCH_SHIELD;
+ if(value == "ATOMIC" ) return RESEARCH_ATOMIC;
+ if(value == "iPAW" ) return RESEARCH_iPAW;
+ if(value == "iGUN" ) return RESEARCH_iGUN;
+ if(value == "RECYCLER") return RESEARCH_RECYCLER;
+ if(value == "SUBBER" ) return RESEARCH_SUBM;
+ if(value == "SNIFFER" ) return RESEARCH_SNIFFER;
+ return Cast<int>(value, "researchflag");
+}
+
+int CLevelParserParam::AsResearchFlag()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToResearchFlag(m_value);
+}
+
+int CLevelParserParam::AsResearchFlag(int def)
+{
+ if(m_empty)
+ return def;
+ return AsResearchFlag();
+}
+
+
+Gfx::PyroType CLevelParserParam::ToPyroType(std::string value)
+{
+ if(value == "FRAGt" ) return Gfx::PT_FRAGT;
+ if(value == "FRAGo" ) return Gfx::PT_FRAGO;
+ if(value == "FRAGw" ) return Gfx::PT_FRAGW;
+ if(value == "EXPLOt") return Gfx::PT_EXPLOT;
+ if(value == "EXPLOo") return Gfx::PT_EXPLOO;
+ if(value == "EXPLOw") return Gfx::PT_EXPLOW;
+ if(value == "SHOTt" ) return Gfx::PT_SHOTT;
+ if(value == "SHOTh" ) return Gfx::PT_SHOTH;
+ if(value == "SHOTm" ) return Gfx::PT_SHOTM;
+ if(value == "SHOTw" ) return Gfx::PT_SHOTW;
+ if(value == "EGG" ) return Gfx::PT_EGG;
+ if(value == "BURNt" ) return Gfx::PT_BURNT;
+ if(value == "BURNo" ) return Gfx::PT_BURNO;
+ if(value == "SPIDER") return Gfx::PT_SPIDER;
+ if(value == "FALL" ) return Gfx::PT_FALL;
+ if(value == "RESET" ) return Gfx::PT_RESET;
+ if(value == "WIN" ) return Gfx::PT_WIN;
+ if(value == "LOST" ) return Gfx::PT_LOST;
+ return static_cast<Gfx::PyroType>(Cast<int>(value, "pyrotype"));
+}
+
+Gfx::PyroType CLevelParserParam::AsPyroType()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToPyroType(m_value);
+}
+
+Gfx::PyroType CLevelParserParam::AsPyroType(Gfx::PyroType def)
+{
+ if(m_empty)
+ return def;
+ return AsPyroType();
+}
+
+
+Gfx::CameraType CLevelParserParam::ToCameraType(std::string value)
+{
+ if(value == "BACK" ) return Gfx::CAM_TYPE_BACK;
+ if(value == "PLANE" ) return Gfx::CAM_TYPE_PLANE;
+ if(value == "ONBOARD") return Gfx::CAM_TYPE_ONBOARD;
+ if(value == "FIX" ) return Gfx::CAM_TYPE_FIX;
+ return static_cast<Gfx::CameraType>(Cast<int>(value, "camera"));
+}
+
+const std::string CLevelParserParam::FromCameraType(Gfx::CameraType value)
+{
+ if(value == Gfx::CAM_TYPE_ONBOARD) return "ONBOARD";
+ if(value == Gfx::CAM_TYPE_FIX ) return "FIX";
+ return boost::lexical_cast<std::string>(static_cast<int>(value));
+}
+
+Gfx::CameraType CLevelParserParam::AsCameraType()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+ return ToCameraType(m_value);
+}
+
+Gfx::CameraType CLevelParserParam::AsCameraType(Gfx::CameraType def)
+{
+ if(m_empty)
+ return def;
+ return AsCameraType();
+}
+
+
+void CLevelParserParam::ParseArray()
+{
+ if(m_array.size() != 0)
+ return;
+
+ std::vector<std::string> values;
+ boost::split(values, m_value, boost::is_any_of(";"));
+ int i = 0;
+ for(auto& value : values) {
+ boost::algorithm::trim(value);
+ if(value.empty()) continue;
+ CLevelParserParam* param = new CLevelParserParam(m_name+"["+boost::lexical_cast<std::string>(i)+"]", value);
+ param->SetLine(m_line);
+ m_array.push_back(param);
+ i++;
+ }
+}
+
+const std::vector<CLevelParserParam*>& CLevelParserParam::AsArray()
+{
+ if(m_empty)
+ throw CLevelParserExceptionMissingParam(this);
+
+ ParseArray();
+
+ return m_array;
+} \ No newline at end of file
diff --git a/src/object/level/parserparam.h b/src/object/level/parserparam.h
new file mode 100644
index 0000000..f59b40f
--- /dev/null
+++ b/src/object/level/parserparam.h
@@ -0,0 +1,137 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+
+/**
+ * \file object/level/parserparam.h
+ * \brief Value of command argument in level file
+ */
+
+#pragma once
+
+#include <object/object.h>
+#include <graphics/core/color.h>
+#include <graphics/engine/water.h>
+#include <graphics/engine/pyro.h>
+#include <math/point.h>
+
+#include <string>
+
+class CLevelParserLine;
+
+class CLevelParserParam
+{
+public:
+ //! Create param with given value
+ //@{
+ CLevelParserParam(int value);
+ CLevelParserParam(float value);
+ CLevelParserParam(std::string value);
+ CLevelParserParam(bool value);
+ CLevelParserParam(Gfx::Color value);
+ CLevelParserParam(Math::Point value);
+ CLevelParserParam(ObjectType value);
+ CLevelParserParam(Gfx::CameraType value);
+ CLevelParserParam(const std::vector<CLevelParserParam*>& value);
+ //@}
+ //! Create param from string
+ CLevelParserParam(std::string name, std::string value);
+ //! Create empty parser param
+ CLevelParserParam(std::string name, bool empty);
+
+ ~CLevelParserParam();
+
+ //! Get value (throws exception if not found or unable to process)
+ //@{
+ int AsInt();
+ float AsFloat();
+ std::string AsString();
+ bool AsBool();
+ std::string AsPath(const std::string defaultDir);
+ Gfx::Color AsColor();
+ Math::Vector AsPoint();
+ ObjectType AsObjectType();
+ DriveType AsDriveType();
+ ToolType AsToolType();
+ Gfx::WaterType AsWaterType();
+ Gfx::EngineObjectType AsTerrainType();
+ int AsBuildFlag();
+ int AsResearchFlag();
+ Gfx::PyroType AsPyroType();
+ Gfx::CameraType AsCameraType();
+ const std::vector<CLevelParserParam*>& AsArray();
+ //@}
+
+ //! Get value (returns default if not found, throws exception if unable to process)
+ //@{
+ int AsInt(int def);
+ float AsFloat(float def);
+ std::string AsString(std::string def);
+ bool AsBool(bool def);
+ std::string AsPath(const std::string defaultDir, std::string def);
+ Gfx::Color AsColor(Gfx::Color def);
+ Math::Vector AsPoint(Math::Vector def);
+ ObjectType AsObjectType(ObjectType def);
+ DriveType AsDriveType(DriveType def);
+ ToolType AsToolType(ToolType def);
+ Gfx::WaterType AsWaterType(Gfx::WaterType def);
+ Gfx::EngineObjectType AsTerrainType(Gfx::EngineObjectType def);
+ int AsBuildFlag(int def);
+ int AsResearchFlag(int def);
+ Gfx::PyroType AsPyroType(Gfx::PyroType def);
+ Gfx::CameraType AsCameraType(Gfx::CameraType def);
+ //@}
+
+ //! Set line this param is part of
+ void SetLine(CLevelParserLine* line);
+ //! Get line this param is part of
+ CLevelParserLine* GetLine();
+
+ std::string GetName();
+ std::string GetValue();
+ bool IsDefined();
+
+ static std::string InjectLevelDir(std::string path, const std::string defaultDir);
+
+private:
+ void ParseArray();
+
+ template<typename T> T Cast(std::string value, std::string requestedType);
+ template<typename T> T Cast(std::string requestedType);
+
+ std::string ToPath(std::string path, const std::string defaultDir);
+ ObjectType ToObjectType(std::string value);
+ DriveType ToDriveType(std::string value);
+ ToolType ToToolType(std::string value);
+ Gfx::WaterType ToWaterType(std::string value);
+ Gfx::EngineObjectType ToTerrainType(std::string value);
+ int ToBuildFlag(std::string value);
+ int ToResearchFlag(std::string value);
+ Gfx::PyroType ToPyroType(std::string value);
+ Gfx::CameraType ToCameraType(std::string value);
+
+ const std::string FromObjectType(ObjectType value);
+ const std::string FromCameraType(Gfx::CameraType value);
+
+private:
+ CLevelParserLine* m_line;
+ bool m_empty;
+ std::string m_name;
+ std::string m_value;
+ std::vector<CLevelParserParam*> m_array;
+}; \ No newline at end of file
diff --git a/src/object/mainmovie.cpp b/src/object/mainmovie.cpp
index 85abee2..1459cf4 100644
--- a/src/object/mainmovie.cpp
+++ b/src/object/mainmovie.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/mainmovie.h"
diff --git a/src/object/mainmovie.h b/src/object/mainmovie.h
index 4554431..c4fc79a 100644
--- a/src/object/mainmovie.h
+++ b/src/object/mainmovie.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file object/mainmovie.h
diff --git a/src/object/motion/motion.cpp b/src/object/motion/motion.cpp
index 00b3073..6693317 100644
--- a/src/object/motion/motion.cpp
+++ b/src/object/motion/motion.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motion.h"
diff --git a/src/object/motion/motion.h b/src/object/motion/motion.h
index d35ee67..81350b7 100644
--- a/src/object/motion/motion.h
+++ b/src/object/motion/motion.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motion.h
diff --git a/src/object/motion/motionant.cpp b/src/object/motion/motionant.cpp
index 16e53aa..6ca0707 100644
--- a/src/object/motion/motionant.cpp
+++ b/src/object/motion/motionant.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motionant.h"
diff --git a/src/object/motion/motionant.h b/src/object/motion/motionant.h
index 45d02b3..660418a 100644
--- a/src/object/motion/motionant.h
+++ b/src/object/motion/motionant.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motionant.h
diff --git a/src/object/motion/motionbee.cpp b/src/object/motion/motionbee.cpp
index 2a052b2..07e295a 100644
--- a/src/object/motion/motionbee.cpp
+++ b/src/object/motion/motionbee.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motionbee.h"
diff --git a/src/object/motion/motionbee.h b/src/object/motion/motionbee.h
index c0347a0..a09ef3a 100644
--- a/src/object/motion/motionbee.h
+++ b/src/object/motion/motionbee.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motionbee.h
diff --git a/src/object/motion/motiondummy.cpp b/src/object/motion/motiondummy.cpp
index 86e389e..a3ba540 100644
--- a/src/object/motion/motiondummy.cpp
+++ b/src/object/motion/motiondummy.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2013 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motiondummy.h"
diff --git a/src/object/motion/motiondummy.h b/src/object/motion/motiondummy.h
index 2cb3a88..a2c8460 100644
--- a/src/object/motion/motiondummy.h
+++ b/src/object/motion/motiondummy.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2013 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motiondummy.h
diff --git a/src/object/motion/motionhuman.cpp b/src/object/motion/motionhuman.cpp
index edee260..2c6005b 100644
--- a/src/object/motion/motionhuman.cpp
+++ b/src/object/motion/motionhuman.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motionhuman.h"
diff --git a/src/object/motion/motionhuman.h b/src/object/motion/motionhuman.h
index ddb0843..4eac403 100644
--- a/src/object/motion/motionhuman.h
+++ b/src/object/motion/motionhuman.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motionhuman.h
diff --git a/src/object/motion/motionmother.cpp b/src/object/motion/motionmother.cpp
index 03e7c21..161187e 100644
--- a/src/object/motion/motionmother.cpp
+++ b/src/object/motion/motionmother.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motionmother.h"
diff --git a/src/object/motion/motionmother.h b/src/object/motion/motionmother.h
index a6c7e93..13fe466 100644
--- a/src/object/motion/motionmother.h
+++ b/src/object/motion/motionmother.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motionmother.h
diff --git a/src/object/motion/motionspider.cpp b/src/object/motion/motionspider.cpp
index 8d339b6..082ab51 100644
--- a/src/object/motion/motionspider.cpp
+++ b/src/object/motion/motionspider.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motionspider.h"
diff --git a/src/object/motion/motionspider.h b/src/object/motion/motionspider.h
index 89745c4..1a99bfd 100644
--- a/src/object/motion/motionspider.h
+++ b/src/object/motion/motionspider.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motionspider.h
diff --git a/src/object/motion/motiontoto.cpp b/src/object/motion/motiontoto.cpp
index b4ed89d..ef3fb68 100644
--- a/src/object/motion/motiontoto.cpp
+++ b/src/object/motion/motiontoto.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motiontoto.h"
diff --git a/src/object/motion/motiontoto.h b/src/object/motion/motiontoto.h
index 47baa28..a071781 100644
--- a/src/object/motion/motiontoto.h
+++ b/src/object/motion/motiontoto.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motiontoto.h
diff --git a/src/object/motion/motionvehicle.cpp b/src/object/motion/motionvehicle.cpp
index a67ae24..2197d6f 100644
--- a/src/object/motion/motionvehicle.cpp
+++ b/src/object/motion/motionvehicle.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motionvehicle.h"
diff --git a/src/object/motion/motionvehicle.h b/src/object/motion/motionvehicle.h
index ffb25ef..9342886 100644
--- a/src/object/motion/motionvehicle.h
+++ b/src/object/motion/motionvehicle.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motionvehicle.h
diff --git a/src/object/motion/motionworm.cpp b/src/object/motion/motionworm.cpp
index 80bf7fc..073a962 100644
--- a/src/object/motion/motionworm.cpp
+++ b/src/object/motion/motionworm.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/motion/motionworm.h"
diff --git a/src/object/motion/motionworm.h b/src/object/motion/motionworm.h
index 7684faf..5353bf2 100644
--- a/src/object/motion/motionworm.h
+++ b/src/object/motion/motionworm.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// motionworm.h
diff --git a/src/object/object.cpp b/src/object/object.cpp
index 3c225d0..a64bcb5 100644
--- a/src/object/object.cpp
+++ b/src/object/object.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/object.h"
diff --git a/src/object/object.h b/src/object/object.h
index 0e469f2..9283c9b 100644
--- a/src/object/object.h
+++ b/src/object/object.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file object/object.h
diff --git a/src/object/objman.cpp b/src/object/objman.cpp
index b0bac1a..25f907a 100644
--- a/src/object/objman.cpp
+++ b/src/object/objman.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/object.h"
diff --git a/src/object/objman.h b/src/object/objman.h
index 390587b..137cbc8 100644
--- a/src/object/objman.h
+++ b/src/object/objman.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file object/objman.h
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 76c234d..2c9384c 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/robotmain.h"
@@ -20,7 +23,6 @@
#include "CBot/CBotDll.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "common/event.h"
#include "common/global.h"
@@ -30,6 +32,9 @@
#include "common/profile.h"
#include "common/restext.h"
+#include "common/resources/resourcemanager.h"
+#include "common/resources/inputstream.h"
+
#include "graphics/engine/camera.h"
#include "graphics/engine/cloud.h"
#include "graphics/engine/engine.h"
@@ -57,6 +62,7 @@
#include "object/task/task.h"
#include "object/task/taskbuild.h"
#include "object/task/taskmanip.h"
+#include "object/level/parser.h"
#include "physics/physics.h"
@@ -82,7 +88,7 @@
#include <iomanip>
-#include <boost/regex.hpp>
+#include <boost/lexical_cast.hpp>
template<> CRobotMain* CSingleton<CRobotMain>::m_instance = nullptr;
@@ -640,6 +646,10 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
m_time = 0.0f;
m_gameTime = 0.0f;
m_checkEndTime = 0.0f;
+
+ m_missionTimerEnabled = false;
+ m_missionTimerStarted = false;
+ m_missionTimer = 0.0f;
m_phase = PHASE_NAME;
m_cameraRank = -1;
@@ -656,12 +666,6 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
m_selectObject = 0;
m_infoUsed = 0;
- m_beginObject = false;
- m_terrainGenerate = false;
- m_terrainInit = false;
- m_terrainInitTextures = false;
- m_terrainCreate = false;
-
m_version = 1;
m_controller = nullptr;
m_retroStyle = false;
@@ -674,7 +678,6 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
m_editFull = false;
m_hilite = false;
m_freePhoto = false;
- m_showPos = false;
m_selectInsect = false;
m_showSoluce = false;
@@ -712,7 +715,7 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
FlushDisplayInfo();
- m_fontSize = 9.0f;
+ m_fontSize = 19.0f;
m_windowPos = Math::Point(0.15f, 0.17f);
m_windowDim = Math::Point(0.70f, 0.66f);
@@ -721,11 +724,11 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
if (loadProfile)
{
- if (GetProfile().GetLocalProfileFloat("Edit", "FontSize", fValue)) m_fontSize = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowPosX", fValue)) m_windowPos.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowPosY", fValue)) m_windowPos.y = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowDimX", fValue)) m_windowDim.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "WindowDimY", fValue)) m_windowDim.y = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "FontSize", fValue)) m_fontSize = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowPosX", fValue)) m_windowPos.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowPosY", fValue)) m_windowPos.y = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowDimX", fValue)) m_windowDim.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "WindowDimY", fValue)) m_windowDim.y = fValue;
}
m_IOPublic = false;
@@ -735,11 +738,11 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
if (loadProfile)
{
- if (GetProfile().GetLocalProfileInt ("Edit", "IOPublic", iValue)) m_IOPublic = iValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IOPosX", fValue)) m_IOPos.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IOPosY", fValue)) m_IOPos.y = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IODimX", fValue)) m_IODim.x = fValue;
- if (GetProfile().GetLocalProfileFloat("Edit", "IODimY", fValue)) m_IODim.y = fValue;
+ if (GetProfile().GetIntProperty ("Edit", "IOPublic", iValue)) m_IOPublic = iValue;
+ if (GetProfile().GetFloatProperty("Edit", "IOPosX", fValue)) m_IOPos.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "IOPosY", fValue)) m_IOPos.y = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "IODimX", fValue)) m_IODim.x = fValue;
+ if (GetProfile().GetFloatProperty("Edit", "IODimY", fValue)) m_IODim.y = fValue;
}
m_short->FlushShortcuts();
@@ -757,7 +760,7 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
g_unit = UNIT;
m_gamerName = "";
- if (loadProfile) GetProfile().GetLocalProfileString("Gamer", "LastName", m_gamerName);
+ if (loadProfile) GetProfile().GetStringProperty("Gamer", "LastName", m_gamerName);
SetGlobalGamerName(m_gamerName);
ReadFreeParam();
if (loadProfile) m_dialog->SetupRecall();
@@ -859,8 +862,6 @@ CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
CBotProgram::DefineNum("ResearchSubber", RESEARCH_SUBM);
CBotProgram::DefineNum("ResearchSniffer", RESEARCH_SNIFFER);
-//? CBotProgram::
-
CBotProgram::DefineNum("PolskiPortalColobota", 1337);
CBotClass* bc;
@@ -957,29 +958,44 @@ void CRobotMain::LoadSceneOnStart(const std::string& name, int rank)
{
m_exitAfterMission = true;
// TODO: fix this ugly dependency :(
+ ChangePhase(PHASE_USER); // To load userlevel list
m_dialog->SetSceneName(name.c_str());
m_dialog->SetSceneRank(rank);
ChangePhase(PHASE_LOADING);
}
+void CRobotMain::ResetAfterDeviceChanged()
+{
+ if(m_phase == PHASE_SETUPds ||
+ m_phase == PHASE_SETUPgs ||
+ m_phase == PHASE_SETUPps ||
+ m_phase == PHASE_SETUPcs ||
+ m_phase == PHASE_SETUPss ||
+ m_phase == PHASE_SIMUL ||
+ m_phase == PHASE_WIN ||
+ m_phase == PHASE_LOST)
+ ChangeColor();
+ UpdateMap();
+}
+
//! Creates the file colobot.ini at the first time
void CRobotMain::CreateIni()
{
m_dialog->SetupMemorize();
- GetProfile().SetLocalProfileFloat("Edit", "FontSize", m_fontSize);
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosX", m_windowPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosY", m_windowPos.y);
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimX", m_windowDim.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimY", m_windowDim.y);
- GetProfile().SetLocalProfileInt("Edit", "IOPublic", m_IOPublic);
- GetProfile().SetLocalProfileFloat("Edit", "IOPosX", m_IOPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "IOPosY", m_IOPos.y);
- GetProfile().SetLocalProfileFloat("Edit", "IODimX", m_IODim.x);
- GetProfile().SetLocalProfileFloat("Edit", "IODimY", m_IODim.y);
+ GetProfile().SetFloatProperty("Edit", "FontSize", m_fontSize);
+ GetProfile().SetFloatProperty("Edit", "WindowPosX", m_windowPos.x);
+ GetProfile().SetFloatProperty("Edit", "WindowPosY", m_windowPos.y);
+ GetProfile().SetFloatProperty("Edit", "WindowDimX", m_windowDim.x);
+ GetProfile().SetFloatProperty("Edit", "WindowDimY", m_windowDim.y);
+ GetProfile().SetIntProperty("Edit", "IOPublic", m_IOPublic);
+ GetProfile().SetFloatProperty("Edit", "IOPosX", m_IOPos.x);
+ GetProfile().SetFloatProperty("Edit", "IOPosY", m_IOPos.y);
+ GetProfile().SetFloatProperty("Edit", "IODimX", m_IODim.x);
+ GetProfile().SetFloatProperty("Edit", "IODimY", m_IODim.y);
- GetProfile().SaveCurrentDirectory();
+ GetProfile().Save();
}
void CRobotMain::SetDefaultInputBindings()
@@ -1077,6 +1093,9 @@ void CRobotMain::ResetKeyStates()
//! Changes phase
void CRobotMain::ChangePhase(Phase phase)
{
+ m_missionTimerEnabled = m_missionTimerStarted = false;
+ m_missionTimer = 0.0f;
+
if (m_phase == PHASE_SIMUL) // ends a simulation?
{
SaveAllScript();
@@ -1209,26 +1228,27 @@ void CRobotMain::ChangePhase(Phase phase)
bool loading = (m_dialog->GetSceneRead()[0] != 0);
m_map->CreateMap();
- CreateScene(m_dialog->GetSceneSoluce(), false, false); // interactive scene
- if (m_mapImage)
- m_map->SetFixImage(m_mapFilename);
-
- m_app->ResetTimeAfterLoading();
-
- /*Math::Point ddim;
+
+ try {
+ CreateScene(m_dialog->GetSceneSoluce(), false, false); // interactive scene
+ if (m_mapImage)
+ m_map->SetFixImage(m_mapFilename);
- 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);*/
+ m_app->ResetTimeAfterLoading();
- if (m_immediatSatCom && !loading &&
- m_infoFilename[SATCOM_HUSTON][0] != 0)
- StartDisplayInfo(SATCOM_HUSTON, false); // shows the instructions
+ if (m_immediatSatCom && !loading &&
+ m_infoFilename[SATCOM_HUSTON][0] != 0)
+ StartDisplayInfo(SATCOM_HUSTON, false); // shows the instructions
- m_sound->StopMusic(0.0f);
- if (!m_base || loading) StartMusic();
+ m_sound->StopMusic(0.0f);
+ if (!m_base || loading) StartMusic();
+ }
+ catch(const CLevelParserException& e)
+ {
+ CLogger::GetInstancePointer()->Error("An error occured while trying to load a level\n");
+ CLogger::GetInstancePointer()->Error("%s\n", e.what());
+ ChangePhase(PHASE_INIT);
+ }
}
if (m_phase == PHASE_WIN)
@@ -1244,29 +1264,37 @@ void CRobotMain::ChangePhase(Phase phase)
m_dialog->SetSceneName("win");
m_dialog->SetSceneRank(m_endingWinRank);
- CreateScene(false, true, false); // sets scene
+ try {
+ CreateScene(false, true, false); // sets scene
- pos.x = ox+sx*1; pos.y = oy+sy*1;
- Math::Point ddim;
- ddim.x = dim.x*2; ddim.y = dim.y*2;
- m_interface->CreateButton(pos, ddim, 16, EVENT_BUTTON_OK);
+ pos.x = ox+sx*1; pos.y = oy+sy*1;
+ Math::Point ddim;
+ ddim.x = dim.x*2; ddim.y = dim.y*2;
+ m_interface->CreateButton(pos, ddim, 16, EVENT_BUTTON_OK);
- if (m_winTerminate)
- {
- 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);
- pe->SetGenericMode(true);
- pe->SetFontType(Gfx::FONT_COLOBOT);
- pe->SetEditCap(false);
- pe->SetHighlightCap(false);
- pe->ReadText(std::string("help/") + m_app->GetLanguageChar() + std::string("/win.txt"));
+ if (m_winTerminate)
+ {
+ 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);
+ pe->SetGenericMode(true);
+ pe->SetFontType(Gfx::FONT_COLOBOT);
+ pe->SetEditCap(false);
+ pe->SetHighlightCap(false);
+ pe->ReadText(std::string("help/") + m_app->GetLanguageChar() + std::string("/win.txt"));
+ }
+ else
+ {
+ m_displayText->DisplayError(INFO_WIN, Math::Vector(0.0f,0.0f,0.0f), 15.0f, 60.0f, 1000.0f);
+ }
+ StartMusic();
}
- else
+ catch(const CLevelParserException& e)
{
- m_displayText->DisplayError(INFO_WIN, Math::Vector(0.0f,0.0f,0.0f), 15.0f, 60.0f, 1000.0f);
+ CLogger::GetInstancePointer()->Error("An error occured while trying to load win scene\n");
+ CLogger::GetInstancePointer()->Error("%s\n", e.what());
+ ChangePhase(PHASE_TERM);
}
- StartMusic();
}
}
@@ -1282,15 +1310,23 @@ void CRobotMain::ChangePhase(Phase phase)
m_winTerminate = false;
m_dialog->SetSceneName("lost");
m_dialog->SetSceneRank(m_endingLostRank);
- CreateScene(false, true, false); // sets scene
+ try {
+ CreateScene(false, true, false); // sets scene
- pos.x = ox+sx*1; pos.y = oy+sy*1;
- Math::Point ddim;
- ddim.x = dim.x*2; ddim.y = dim.y*2;
- m_interface->CreateButton(pos, ddim, 16, EVENT_BUTTON_OK);
- m_displayText->DisplayError(INFO_LOST, Math::Vector(0.0f,0.0f,0.0f), 15.0f, 60.0f, 1000.0f);
+ pos.x = ox+sx*1; pos.y = oy+sy*1;
+ Math::Point ddim;
+ ddim.x = dim.x*2; ddim.y = dim.y*2;
+ m_interface->CreateButton(pos, ddim, 16, EVENT_BUTTON_OK);
+ m_displayText->DisplayError(INFO_LOST, Math::Vector(0.0f,0.0f,0.0f), 15.0f, 60.0f, 1000.0f);
- StartMusic();
+ StartMusic();
+ }
+ catch(const CLevelParserException& e)
+ {
+ CLogger::GetInstancePointer()->Error("An error occured while trying to load lost scene\n");
+ CLogger::GetInstancePointer()->Error("%s\n", e.what());
+ ChangePhase(PHASE_TERM);
+ }
}
}
@@ -1389,6 +1425,8 @@ bool CRobotMain::ProcessEvent(Event &event)
m_interface->EventProcess(event);
if (m_displayInfo != nullptr) // current edition?
m_displayInfo->EventProcess(event);
+
+ UpdateInfoText();
return EventFrame(event);
}
@@ -1473,8 +1511,6 @@ bool CRobotMain::ProcessEvent(Event &event)
// Simulation phase of the game
if (m_phase == PHASE_SIMUL)
{
- UpdateInfoText();
-
if (!m_editFull)
m_camera->EventProcess(event);
@@ -1638,18 +1674,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;
@@ -1736,15 +1760,13 @@ bool CRobotMain::ProcessEvent(Event &event)
break;
case EVENT_WIN:
+ m_missionTimerEnabled = m_missionTimerStarted = false;
ChangePhase(PHASE_WIN);
- if(m_exitAfterMission)
- m_eventQueue->AddEvent(Event(EVENT_QUIT));
break;
case EVENT_LOST:
+ m_missionTimerEnabled = m_missionTimerStarted = false;
ChangePhase(PHASE_LOST);
- if(m_exitAfterMission)
- m_eventQueue->AddEvent(Event(EVENT_QUIT));
break;
default:
@@ -2064,12 +2086,6 @@ void CRobotMain::ExecuteCmd(char *cmd)
return;
}
- if (strcmp(cmd, "showpos") == 0)
- {
- m_showPos = !m_showPos;
- return;
- }
-
if (strcmp(cmd, "selectinsect") == 0)
{
m_selectInsect = !m_selectInsect;
@@ -2189,12 +2205,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();
@@ -2223,10 +2233,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);
@@ -2264,20 +2270,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);
@@ -2298,7 +2296,7 @@ float CRobotMain::GetGameTime()
void CRobotMain::SetFontSize(float size)
{
m_fontSize = size;
- GetProfile().SetLocalProfileFloat("Edit", "FontSize", m_fontSize);
+ GetProfile().SetFloatProperty("Edit", "FontSize", m_fontSize);
}
float CRobotMain::GetFontSize()
@@ -2310,8 +2308,8 @@ float CRobotMain::GetFontSize()
void CRobotMain::SetWindowPos(Math::Point pos)
{
m_windowPos = pos;
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosX", m_windowPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowPosY", m_windowPos.y);
+ GetProfile().SetFloatProperty("Edit", "WindowPosX", m_windowPos.x);
+ GetProfile().SetFloatProperty("Edit", "WindowPosY", m_windowPos.y);
}
Math::Point CRobotMain::GetWindowPos()
@@ -2322,8 +2320,8 @@ Math::Point CRobotMain::GetWindowPos()
void CRobotMain::SetWindowDim(Math::Point dim)
{
m_windowDim = dim;
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimX", m_windowDim.x);
- GetProfile().SetLocalProfileFloat("Edit", "WindowDimY", m_windowDim.y);
+ GetProfile().SetFloatProperty("Edit", "WindowDimX", m_windowDim.x);
+ GetProfile().SetFloatProperty("Edit", "WindowDimY", m_windowDim.y);
}
Math::Point CRobotMain::GetWindowDim()
@@ -2336,7 +2334,7 @@ Math::Point CRobotMain::GetWindowDim()
void CRobotMain::SetIOPublic(bool mode)
{
m_IOPublic = mode;
- GetProfile().SetLocalProfileInt("Edit", "IOPublic", m_IOPublic);
+ GetProfile().SetIntProperty("Edit", "IOPublic", m_IOPublic);
}
bool CRobotMain::GetIOPublic()
@@ -2347,8 +2345,8 @@ bool CRobotMain::GetIOPublic()
void CRobotMain::SetIOPos(Math::Point pos)
{
m_IOPos = pos;
- GetProfile().SetLocalProfileFloat("Edit", "IOPosX", m_IOPos.x);
- GetProfile().SetLocalProfileFloat("Edit", "IOPosY", m_IOPos.y);
+ GetProfile().SetFloatProperty("Edit", "IOPosX", m_IOPos.x);
+ GetProfile().SetFloatProperty("Edit", "IOPosY", m_IOPos.y);
}
Math::Point CRobotMain::GetIOPos()
@@ -2359,8 +2357,8 @@ Math::Point CRobotMain::GetIOPos()
void CRobotMain::SetIODim(Math::Point dim)
{
m_IODim = dim;
- GetProfile().SetLocalProfileFloat("Edit", "IODimX", m_IODim.x);
- GetProfile().SetLocalProfileFloat("Edit", "IODimY", m_IODim.y);
+ GetProfile().SetFloatProperty("Edit", "IODimX", m_IODim.x);
+ GetProfile().SetFloatProperty("Edit", "IODimY", m_IODim.y);
}
Math::Point CRobotMain::GetIODim()
@@ -3371,17 +3369,16 @@ void CRobotMain::AbortMovie()
//! Updates the text information
void CRobotMain::UpdateInfoText()
{
- if (m_showPos)
+ if (m_phase == PHASE_SIMUL)
{
CObject* obj = GetSelect();
if (obj != nullptr)
{
Math::Vector pos = obj->GetPosition(0);
- char info[100];
- sprintf(info, "Pos = %.2f ; %.2f", pos.x/g_unit, pos.z/g_unit);
- //TODO: m_engine->SetInfoText(4, info);
+ m_engine->SetStatisticPos(pos);
}
}
+ m_engine->SetTimerDisplay(m_missionTimerEnabled && m_missionTimerStarted ? TimeFormat(m_missionTimer) : "");
}
@@ -3405,6 +3402,9 @@ bool CRobotMain::EventFrame(const Event &event)
m_displayText->DisplayError(INFO_BEGINSATCOM, Math::Vector(0.0f,0.0f,0.0f));
m_beginSatCom = true; // message appears
}
+
+ if(!m_movieLock && m_pause->GetPause() == PAUSE_NONE && m_missionTimerStarted)
+ m_missionTimer += event.rTime;
m_water->EventProcess(event);
m_cloud->EventProcess(event);
@@ -3553,7 +3553,7 @@ bool CRobotMain::EventFrame(const Event &event)
if (m_phase == PHASE_SIMUL)
{
- if (!m_editLock && m_checkEndTime+1.0f < m_time)
+ if (!m_editLock /*&& m_checkEndTime+1.0f < m_time*/)
{
m_checkEndTime = m_time;
CheckEndMission(true);
@@ -3643,199 +3643,6 @@ char* SkipNum(char *p)
return p;
}
-//! Conversion of units
-void CRobotMain::Convert()
-{
- char* base = m_dialog->GetSceneName();
- int rank = m_dialog->GetSceneRank();
-
- //TODO change line to string
- char line[500];
- std::string tempLine;
-
- m_dialog->BuildSceneName(tempLine, base, rank);
- strcpy(line, tempLine.c_str());
- FILE* file = fopen(line, "r");
- if (file == NULL) return;
-
- strcpy(line+strlen(line)-4, ".new");
- FILE* fileNew = fopen(line, "w");
- if (fileNew == NULL) return;
-
- char lineNew[500];
- char s[200];
-
- while (fgets(line, 500, file) != NULL)
- {
- strcpy(lineNew, line);
-
- if (Cmd(line, "DeepView"))
- {
- char* p = strstr(line, "air=");
- if (p != 0)
- {
- float value = OpFloat(line, "air", 500.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- strcpy(lineNew, line);
- strcat(lineNew, "air=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
-
- p = strstr(line, "water=");
- if (p != 0)
- {
- float value = OpFloat(line, "water", 100.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+6);
- strcpy(lineNew, line);
- strcat(lineNew, "water=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
- }
-
- if (Cmd(line, "TerrainGenerate"))
- {
- char* p = strstr(line, "vision=");
- if (p != 0)
- {
- float value = OpFloat(line, "vision", 500.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+7);
- strcpy(lineNew, line);
- strcat(lineNew, "vision=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- }
-
- if (Cmd(line, "CreateObject") ||
- Cmd(line, "CreateSpot"))
- {
- char* p = strstr(line, "pos=");
- if (p != 0)
- {
- Math::Vector pos = OpPos(line, "pos");
- pos.x /= g_unit;
- pos.y /= g_unit;
- pos.z /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- p = SkipNum(p+1);
- strcpy(lineNew, line);
- strcat(lineNew, "pos=");
- sprintf(s, "%.2f", pos.x);
- strcat(lineNew, s);
- strcat(lineNew, ";");
- sprintf(s, "%.2f", pos.z);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- }
-
- if (Cmd(line, "EndMissionTake") || Cmd(line, "AudioChange"))
- {
- char* p = strstr(line, "pos=");
- if (p != 0)
- {
- Math::Vector pos = OpPos(line, "pos");
- pos.x /= g_unit;
- pos.y /= g_unit;
- pos.z /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- p = SkipNum(p+1);
- strcpy(lineNew, line);
- strcat(lineNew, "pos=");
- sprintf(s, "%.2f", pos.x);
- strcat(lineNew, s);
- strcat(lineNew, ";");
- sprintf(s, "%.2f", pos.z);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
-
- p = strstr(line, "dist=");
- if (p != 0)
- {
- float value = OpFloat(line, "dist", 32.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+5);
- strcpy(lineNew, line);
- strcat(lineNew, "dist=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
- }
-
- if (Cmd(line, "Camera"))
- {
- char* p = strstr(line, "pos=");
- if (p != 0)
- {
- Math::Vector pos = OpPos(line, "pos");
- pos.x /= g_unit;
- pos.y /= g_unit;
- pos.z /= g_unit;
- p[0] = 0;
- p = SkipNum(p+4);
- p = SkipNum(p+1);
- strcpy(lineNew, line);
- strcat(lineNew, "pos=");
- sprintf(s, "%.2f", pos.x);
- strcat(lineNew, s);
- strcat(lineNew, ";");
- sprintf(s, "%.2f", pos.z);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
-
- p = strstr(line, "h=");
- if (p != 0)
- {
- float value = OpFloat(line, "h", 32.0f);
- value /= g_unit;
- p[0] = 0;
- p = SkipNum(p+2);
- strcpy(lineNew, line);
- strcat(lineNew, "h=");
- sprintf(s, "%.2f", value);
- strcat(lineNew, s);
- strcat(lineNew, " ");
- strcat(lineNew, p);
- }
- strcpy(line, lineNew);
- }
-
- fputs(lineNew, fileNew);
- }
-
- fclose(fileNew);
- fclose(file);
-}
-
//! Load the scene for the character
void CRobotMain::ScenePerso()
{
@@ -3858,7 +3665,14 @@ void CRobotMain::ScenePerso()
m_dialog->SetSceneName("perso");
m_dialog->SetSceneRank(0);
- CreateScene(false, true, false); // sets scene
+ try {
+ CreateScene(false, true, false); // sets scene
+ }
+ catch(const CLevelParserException& e)
+ {
+ CLogger::GetInstancePointer()->Error("An error occured while trying to load apperance scene\n");
+ CLogger::GetInstancePointer()->Error("%s\n", e.what());
+ }
m_engine->SetDrawWorld(false); // does not draw anything on the interface
m_engine->SetDrawFront(true); // draws on the human interface
@@ -3880,12 +3694,6 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
int rank = m_dialog->GetSceneRank();
const char* read = m_dialog->GetSceneRead().c_str();
const char* stack = m_dialog->GetStackRead().c_str();
- m_dialog->SetUserDir(base, rank);
-
- /*
- * TODO: original code relying on UserDir() was removed.
- * A new way of providing custom data file paths will need to be devised.
- */
m_fixScene = fixScene;
@@ -3957,35 +3765,19 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
strcpy(m_scriptName, scriptNameStr.c_str());
m_scriptFile[0] = 0;
- m_beginObject = false;
- m_terrainGenerate = false;
- m_terrainInit = false;
- m_terrainInitTextures = false;
- m_terrainCreate = false;
-
m_version = 1;
m_retroStyle = false;
m_missionResult = ERR_MISSION_NOTERM;
}
-
- char line[500];
- char name[200];
- char dir[100];
- char op[100];
- char filename[500];
- int lineNum = 0;
-
- memset(line, 0, 500);
- memset(name, 0, 200);
- memset(dir, 0, 100);
- memset(op, 0, 100);
- memset(filename, 0, 500);
- std::string tempLine;
- m_dialog->BuildSceneName(tempLine, base, rank);
- strcpy(filename, tempLine.c_str());
- FILE* file = fopen(filename, "r");
- if (file == NULL) return;
+
+ //NOTE: Reset timer always, even when only resetting object positions
+ m_missionTimerEnabled = false;
+ m_missionTimerStarted = false;
+ m_missionTimer = 0.0f;
+
+ CLevelParser* level = new CLevelParser(base, rank/100, rank%100);
+ level->Load();
int rankObj = 0;
int rankGadget = 0;
@@ -3998,579 +3790,462 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
* may speed up loading
*/
- while (fgets(line, 500, file) != NULL)
+ for(auto& line : level->GetLines())
{
- lineNum++;
- for (int i = 0; i < 500; i++)
+ if (line->GetCommand() == "MissionFile" && !resetObject)
{
- if (line[i] == '\t' ) line[i] = ' '; // replace tab by space
- if (line[i] == '/' && line[i+1] == '/')
- {
- line[i] = 0;
- break;
- }
- }
-
- if (Cmd(line, "MissionFile") && !resetObject) {
- m_version = OpInt(line, "version", 1);
- continue;
+ m_version = line->GetParam("version")->AsInt(1);
+ continue;
}
-
- // TODO: Fallback to an non-localized entry
- sprintf(op, "Title.%c", m_app->GetLanguageChar());
- if (Cmd(line, op) && !resetObject)
+
+ if(line->GetCommand() == "Title" && !resetObject)
{
- OpString(line, "text", m_title);
+ strcpy(m_title, line->GetParam("text")->AsString().c_str());
continue;
}
-
- sprintf(op, "Resume.%c", m_app->GetLanguageChar());
- if (Cmd(line, op) && !resetObject)
+
+ if(line->GetCommand() == "Resume" && !resetObject)
{
- OpString(line, "text", m_resume);
+ strcpy(m_resume, line->GetParam("text")->AsString().c_str());
continue;
}
-
- sprintf(op, "ScriptName.%c", m_app->GetLanguageChar());
- if (Cmd(line, op) && !resetObject)
+
+ if(line->GetCommand() == "ScriptName" && !resetObject)
{
- OpString(line, "text", m_scriptName);
+ strcpy(m_scriptName, line->GetParam("text")->AsString().c_str());
continue;
}
-
- static const boost::regex titleCmdRe("Title\\.[A-Z]");
- static const boost::regex resumeCmdRe("Resume\\.[A-Z]");
- static const boost::regex scriptNameCmdRe("ScriptName\\.[A-Z]");
-
- if (boost::regex_match(GetCmd(line), titleCmdRe)) continue; // Ignore
- if (boost::regex_match(GetCmd(line), resumeCmdRe)) continue; // Ignore
- if (boost::regex_match(GetCmd(line), scriptNameCmdRe)) continue; // Ignore
-
-
- if (Cmd(line, "ScriptFile") && !resetObject)
+
+ if (line->GetCommand() == "ScriptFile" && !resetObject)
{
- OpString(line, "name", m_scriptFile);
+ strcpy(m_scriptFile, line->GetParam("name")->AsString().c_str());
continue;
}
-
- if (Cmd(line, "Instructions") && !resetObject)
+
+ if (line->GetCommand() == "Instructions" && !resetObject)
{
- OpString(line, "name", name);
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name);
- strcpy(m_infoFilename[SATCOM_HUSTON], path.c_str());
-
- m_immediatSatCom = OpInt(line, "immediat", 0);
- if (m_version >= 2) m_beginSatCom = m_lockedSatCom = OpInt(line, "lock", 0);
+ strcpy(m_infoFilename[SATCOM_HUSTON], line->GetParam("name")->AsPath("help/%lng%").c_str());
+
+ m_immediatSatCom = line->GetParam("immediat")->AsBool(false);
+ if (m_version >= 2) m_beginSatCom = m_lockedSatCom = line->GetParam("lock")->AsBool(false);
if (m_app->GetSceneTestMode()) m_immediatSatCom = false;
continue;
}
-
- if (Cmd(line, "Satellite") && !resetObject)
+
+ if (line->GetCommand() == "Satellite" && !resetObject)
{
- OpString(line, "name", name);
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name);
- strcpy(m_infoFilename[SATCOM_SAT], path.c_str());
+ strcpy(m_infoFilename[SATCOM_SAT], line->GetParam("name")->AsPath("help/%lng%").c_str());
continue;
}
-
- if (Cmd(line, "Loading") && !resetObject)
+
+ if (line->GetCommand() == "Loading" && !resetObject)
{
- OpString(line, "name", name);
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name);
- strcpy(m_infoFilename[SATCOM_LOADING], path.c_str());
+ strcpy(m_infoFilename[SATCOM_LOADING], line->GetParam("name")->AsPath("help/%lng%").c_str());
continue;
}
-
- if (Cmd(line, "HelpFile") && !resetObject)
+
+ if (line->GetCommand() == "HelpFile" && !resetObject)
{
- OpString(line, "name", name);
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name);
- strcpy(m_infoFilename[SATCOM_PROG], path.c_str());
+ strcpy(m_infoFilename[SATCOM_PROG], line->GetParam("name")->AsPath("help/%lng%").c_str());
continue;
}
- if (Cmd(line, "SoluceFile") && !resetObject)
+ if (line->GetCommand() == "SoluceFile" && !resetObject)
{
- OpString(line, "name", name);
- std::string path = CGameData::GetInstancePointer()->GetFilePath(DIR_HELP, name);
- strcpy(m_infoFilename[SATCOM_SOLUCE], path.c_str());
+ strcpy(m_infoFilename[SATCOM_SOLUCE], line->GetParam("name")->AsPath("help/%lng%").c_str());
continue;
}
-
- if (Cmd(line, "EndingFile") && !resetObject)
+
+ if (line->GetCommand() == "EndingFile" && !resetObject)
{
- m_endingWinRank = OpInt(line, "win", 0);
- m_endingLostRank = OpInt(line, "lost", 0);
+ // NOTE: The old default was 0, but I think -1 is more correct - 0 means "ending file 000", while -1 means "no ending file"
+ m_endingWinRank = line->GetParam("win")->AsInt(-1);
+ m_endingLostRank = line->GetParam("lost")->AsInt(-1);
continue;
}
-
- if (Cmd(line, "MessageDelay") && !resetObject)
+
+ if (line->GetCommand() == "MessageDelay" && !resetObject)
{
- m_displayText->SetDelay(OpFloat(line, "factor", 1.0f));
+ m_displayText->SetDelay(line->GetParam("factor")->AsFloat());
continue;
}
-
- if (Cmd(line, "CacheAudio") && !resetObject && m_version >= 2)
+
+ if (line->GetCommand() == "MissionTimer")
{
- OpString(line, "filename", name);
- m_sound->CacheMusic(name);
+ m_missionTimerEnabled = line->GetParam("enabled")->AsBool();
+ if(!line->GetParam("program")->AsBool(false)) {
+ m_missionTimerStarted = true;
+ }
continue;
}
-
- if (Cmd(line, "AudioChange") && !resetObject && m_version >= 2 && m_controller == nullptr)
+
+ if (line->GetCommand() == "CacheAudio" && !resetObject && m_version >= 2)
+ {
+ m_sound->CacheMusic(std::string("../")+line->GetParam("filename")->AsPath("music"));
+ continue;
+ }
+
+ if (line->GetCommand() == "AudioChange" && !resetObject && m_version >= 2 && m_controller == nullptr)
{
int i = m_audioChangeTotal;
if (i < 10)
{
- m_audioChange[i].pos = OpPos(line, "pos")*g_unit;
- m_audioChange[i].dist = OpFloat(line, "dist", 1000.0f)*g_unit;
- m_audioChange[i].type = OpTypeObject(line, "type", OBJECT_NULL);
- m_audioChange[i].min = OpInt(line, "min", 1);
- m_audioChange[i].max = OpInt(line, "max", 9999);
- m_audioChange[i].powermin = OpFloat(line, "powermin", -1);
- m_audioChange[i].powermax = OpFloat(line, "powermax", 100);
- m_audioChange[i].tool = OpTool(line, "tool");
- m_audioChange[i].drive = OpDrive(line, "drive");
- OpString(line, "filename", m_audioChange[i].music);
- m_audioChange[i].repeat = OpInt(line, "repeat", 1);
+ m_audioChange[i].pos = line->GetParam("pos")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f))*g_unit;
+ m_audioChange[i].dist = line->GetParam("dist")->AsFloat(1000.0f)*g_unit;
+ m_audioChange[i].type = line->GetParam("type")->AsObjectType(OBJECT_NULL);
+ m_audioChange[i].min = line->GetParam("min")->AsInt(1);
+ m_audioChange[i].max = line->GetParam("max")->AsInt(9999);
+ m_audioChange[i].powermin = line->GetParam("powermin")->AsFloat(-1);
+ m_audioChange[i].powermax = line->GetParam("powermax")->AsFloat(100);
+ m_audioChange[i].tool = line->GetParam("tool")->AsToolType(TOOL_OTHER);
+ m_audioChange[i].drive = line->GetParam("drive")->AsDriveType(DRIVE_OTHER);
+ strcpy(m_audioChange[i].music, (std::string("../")+line->GetParam("filename")->AsPath("music")).c_str());
+ m_audioChange[i].repeat = line->GetParam("repeat")->AsBool(true);
m_audioChange[i].changed = false;
m_sound->CacheMusic(m_audioChange[i].music);
m_audioChangeTotal ++;
}
continue;
}
-
- if (Cmd(line, "Audio") && !resetObject && m_controller == nullptr)
+
+ if (line->GetCommand() == "Audio" && !resetObject && m_controller == nullptr)
{
if (m_version < 2)
{
- int trackid = OpInt(line, "track", 0);
+ int trackid = line->GetParam("track")->AsInt();
if (trackid != 0)
{
std::stringstream filenameStr;
filenameStr << "music" << std::setfill('0') << std::setw(3) << trackid << ".ogg";
m_audioTrack = filenameStr.str();
}
- m_audioRepeat = OpInt(line, "repeat", 1);
+ m_audioRepeat = line->GetParam("repeat")->AsBool(true);
}
else
{
- char trackname[100];
-
- OpString(line, "main", trackname);
- m_audioTrack = trackname;
- m_audioRepeat = OpInt(line, "mainRepeat", 1);
+ if(line->GetParam("main")->IsDefined()) {
+ m_audioTrack = std::string("../")+line->GetParam("main")->AsPath("music");
+ m_audioRepeat = line->GetParam("mainRepeat")->AsBool(true);
+ } else {
+ m_audioTrack = "";
+ }
- OpString(line, "satcom", trackname);
- m_satcomTrack = trackname;
- m_satcomRepeat = OpInt(line, "satcomRepeat", 1);
+ if(line->GetParam("satcom")->IsDefined()) {
+ m_satcomTrack = std::string("../")+line->GetParam("satcom")->AsPath("music");
+ m_satcomRepeat = line->GetParam("satcomRepeat")->AsBool(true);
+ } else {
+ m_satcomTrack = "";
+ }
- OpString(line, "editor", trackname);
- m_editorTrack = trackname;
- m_editorRepeat = OpInt(line, "editorRepeat", 1);
+ if(line->GetParam("editor")->IsDefined()) {
+ m_editorTrack = std::string("../")+line->GetParam("editor")->AsPath("music");
+ m_editorRepeat = line->GetParam("editorRepeat")->AsBool(true);
+ } else {
+ m_editorTrack = "";
+ }
}
if (m_audioTrack != "") m_sound->CacheMusic(m_audioTrack);
if (m_satcomTrack != "") m_sound->CacheMusic(m_satcomTrack);
if (m_editorTrack != "") m_sound->CacheMusic(m_editorTrack);
continue;
}
-
- if (Cmd(line, "AmbientColor") && !resetObject)
+
+ if (line->GetCommand() == "AmbientColor" && !resetObject)
{
- m_engine->SetAmbientColor(OpColor(line, "air", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 0);
- m_engine->SetAmbientColor(OpColor(line, "water", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 1);
+ m_engine->SetAmbientColor(line->GetParam("air")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 0);
+ m_engine->SetAmbientColor(line->GetParam("water")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 1);
continue;
}
-
- if (Cmd(line, "FogColor") && !resetObject)
+
+ if (line->GetCommand() == "FogColor" && !resetObject)
{
- m_engine->SetFogColor(OpColor(line, "air", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 0);
- m_engine->SetFogColor(OpColor(line, "water", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 1);
+ m_engine->SetFogColor(line->GetParam("air")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 0);
+ m_engine->SetFogColor(line->GetParam("water")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)), 1);
continue;
}
-
- if (Cmd(line, "VehicleColor") && !resetObject)
+
+ if (line->GetCommand() == "VehicleColor" && !resetObject)
{
- m_colorNewBot = OpColor(line, "color", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f));
+ m_colorNewBot = line->GetParam("color")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f));
continue;
}
-
- if (Cmd(line, "InsectColor") && !resetObject)
+
+ if (line->GetCommand() == "InsectColor" && !resetObject)
{
- m_colorNewAlien = OpColor(line, "color", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f));
+ m_colorNewAlien = line->GetParam("color")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f));
continue;
}
-
- if (Cmd(line, "GreeneryColor") && !resetObject)
+
+ if (line->GetCommand() == "GreeneryColor" && !resetObject)
{
- m_colorNewGreen = OpColor(line, "color", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f));
+ m_colorNewGreen = line->GetParam("color")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f));
continue;
}
-
- if (Cmd(line, "DeepView") && !resetObject)
+
+ if (line->GetCommand() == "DeepView" && !resetObject)
{
- m_engine->SetDeepView(OpFloat(line, "air", 500.0f)*g_unit, 0, true);
- m_engine->SetDeepView(OpFloat(line, "water", 100.0f)*g_unit, 1, true);
+ m_engine->SetDeepView(line->GetParam("air")->AsFloat(500.0f)*g_unit, 0, true);
+ m_engine->SetDeepView(line->GetParam("water")->AsFloat(100.0f)*g_unit, 1, true);
continue;
}
-
- if (Cmd(line, "FogStart") && !resetObject)
+
+ if (line->GetCommand() == "FogStart" && !resetObject)
{
- m_engine->SetFogStart(OpFloat(line, "air", 0.5f), 0);
- m_engine->SetFogStart(OpFloat(line, "water", 0.5f), 1);
+ m_engine->SetFogStart(line->GetParam("air")->AsFloat(0.5f), 0);
+ m_engine->SetFogStart(line->GetParam("water")->AsFloat(0.5f), 1);
continue;
}
-
- if (Cmd(line, "SecondTexture") && !resetObject)
+
+ if (line->GetCommand() == "SecondTexture" && !resetObject)
{
- m_engine->SetSecondTexture(OpInt(line, "rank", 1));
+ m_engine->SetSecondTexture(line->GetParam("rank")->AsInt());
continue;
}
-
- if (Cmd(line, "Background") && !resetObject)
- {
- OpString(line, "image", name);
- m_engine->SetBackground(name,
- OpColor(line, "up", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
- OpColor(line, "down", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
- OpColor(line, "cloudUp", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
- OpColor(line, "cloudDown", Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
- OpInt(line, "full", 0));
+
+ if (line->GetCommand() == "Background" && !resetObject)
+ {
+ std::string path = "";
+ if(line->GetParam("image")->IsDefined())
+ path = "../"+line->GetParam("image")->AsPath("textures");
+ m_engine->SetBackground(path.c_str(),
+ line->GetParam("up")->AsColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
+ line->GetParam("down")->AsColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
+ line->GetParam("cloudUp")->AsColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
+ line->GetParam("cloudDown")->AsColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)),
+ line->GetParam("full")->AsBool(false));
continue;
}
-
- if (Cmd(line, "Planet") && !resetObject)
+
+ if (line->GetCommand() == "Planet" && !resetObject)
{
Math::Vector ppos, uv1, uv2;
-
- ppos = OpPos(line, "pos");
- uv1 = OpPos(line, "uv1");
- uv2 = OpPos(line, "uv2");
- OpString(line, "image", name);
- m_planet->Create(OpInt(line, "mode", 0),
+
+ ppos = line->GetParam("pos")->AsPoint();
+ uv1 = line->GetParam("uv1")->AsPoint();
+ uv2 = line->GetParam("uv2")->AsPoint();
+ m_planet->Create(line->GetParam("mode")->AsInt(0),
Math::Point(ppos.x, ppos.z),
- OpFloat(line, "dim", 0.2f),
- OpFloat(line, "speed", 0.0f),
- OpFloat(line, "dir", 0.0f),
- name,
+ line->GetParam("dim")->AsFloat(0.2f),
+ line->GetParam("speed")->AsFloat(0.0f),
+ line->GetParam("dir")->AsFloat(0.0f),
+ "../"+line->GetParam("image")->AsPath("textures"),
Math::Point(uv1.x, uv1.z),
Math::Point(uv2.x, uv2.z),
- strstr(name, "planet") != nullptr // TODO: add transparent op or modify textures
- );
+ line->GetParam("image")->AsPath("textures").find("planet") != std::string::npos // TODO: add transparent op or modify textures
+ );
continue;
}
-
- if (Cmd(line, "ForegroundName") && !resetObject)
+
+ if (line->GetCommand() == "ForegroundName" && !resetObject)
{
- OpString(line, "image", name);
- m_engine->SetForegroundName(name);
+ m_engine->SetForegroundName("../"+line->GetParam("image")->AsPath("textures"));
continue;
}
-
- if (((m_version == 1 && Cmd(line, "Global")) || (m_version >= 2 && Cmd(line, "Mission"))) && !resetObject)
+
+ if (((line->GetCommand() == "Global") || (m_version >= 2 && line->GetCommand() == "Mission")) && !resetObject)
{
- g_unit = OpFloat(line, "unitScale", 4.0f);
- m_engine->SetTracePrecision(OpFloat(line, "traceQuality", 1.0f));
- m_shortCut = OpInt(line, "shortcut", 1);
+ g_unit = line->GetParam("unitScale")->AsFloat(4.0f);
+ m_engine->SetTracePrecision(line->GetParam("traceQuality")->AsFloat(1.0f));
+ m_shortCut = line->GetParam("shortcut")->AsBool(true);
if (m_version >= 2)
{
- m_retroStyle = OpInt(line, "retro", 0);
+ m_retroStyle = line->GetParam("retro")->AsBool(false);
if (m_retroStyle) GetLogger()->Info("Retro mode enabled.\n");
}
continue;
}
-
- if (Cmd(line, "TerrainGenerate") && !resetObject)
- {
- if (m_terrainCreate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainGenerate after TerrainCreate\n", filename, lineNum);
- continue;
- }
-
- if (m_terrainInit)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainGenerate after TerrainInit\n", filename, lineNum);
- continue;
- }
-
- m_terrain->Generate(OpInt(line, "mosaic", 20),
- OpInt(line, "brick", 3),
- OpFloat(line, "size", 20.0f),
- OpFloat(line, "vision", 500.0f)*g_unit,
- OpInt(line, "depth", 2),
- OpFloat(line, "hard", 0.5f));
-
- m_terrainGenerate = true;
+
+ if (line->GetCommand() == "TerrainGenerate" && !resetObject)
+ {
+ m_terrain->Generate(line->GetParam("mosaic")->AsInt(20),
+ line->GetParam("brick")->AsInt(3),
+ line->GetParam("size")->AsFloat(20.0f),
+ line->GetParam("vision")->AsFloat(500.0f)*g_unit,
+ line->GetParam("depth")->AsInt(2),
+ line->GetParam("hard")->AsFloat(0.5f));
continue;
}
-
- if (Cmd(line, "TerrainWind") && !resetObject)
+
+ if (line->GetCommand() == "TerrainWind" && !resetObject)
{
- if (m_terrainCreate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainWind after TerrainCreate\n", filename, lineNum);
- continue;
- }
-
- if (m_terrainInit)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainWind after TerrainInit\n", filename, lineNum);
- continue;
- }
-
- if (!m_terrainGenerate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainWind before TerrainGenerate\n", filename, lineNum);
- continue;
- }
-
- m_terrain->SetWind(OpPos(line, "speed"));
+ m_terrain->SetWind(line->GetParam("speed")->AsPoint());
continue;
}
-
- if (Cmd(line, "TerrainRelief") && !resetObject)
+
+ if (line->GetCommand() == "TerrainRelief" && !resetObject)
{
- if (m_terrainCreate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainRelief after TerrainCreate\n", filename, lineNum);
- continue;
- }
-
- if (m_terrainInit)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainRelief after TerrainInit\n", filename, lineNum);
- continue;
- }
-
- if (!m_terrainGenerate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainRelief before TerrainGenerate\n", filename, lineNum);
- continue;
- }
-
- OpString(line, "image", name);
- m_terrain->LoadRelief(name, OpFloat(line, "factor", 1.0f), OpInt(line, "border", 1));
+ m_terrain->LoadRelief(
+ line->GetParam("image")->AsPath("textures"),
+ line->GetParam("factor")->AsFloat(1.0f),
+ line->GetParam("border")->AsBool(true));
continue;
}
- if (Cmd(line, "TerrainRandomRelief") && !resetObject)
+ if (line->GetCommand() == "TerrainRandomRelief" && !resetObject)
{
m_terrain->RandomizeRelief();
continue;
}
-
- if (Cmd(line, "TerrainResource") && !resetObject)
+
+ if (line->GetCommand() == "TerrainResource" && !resetObject)
{
- if (m_terrainCreate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainResource after TerrainCreate\n", filename, lineNum);
- continue;
- }
-
- if (m_terrainInit)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainResource after TerrainInit\n", filename, lineNum);
- continue;
- }
-
- if (!m_terrainGenerate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainResource before TerrainGenerate\n", filename, lineNum);
- continue;
- }
-
- OpString(line, "image", name);
- m_terrain->LoadResources(name);
+ m_terrain->LoadResources(line->GetParam("image")->AsPath("textures"));
continue;
}
-
- if (Cmd(line, "TerrainWater") && !resetObject)
+
+ if (line->GetCommand() == "TerrainWater" && !resetObject)
{
- OpString(line, "image", name);
Math::Vector pos;
- pos.x = OpFloat(line, "moveX", 0.0f);
- pos.y = OpFloat(line, "moveY", 0.0f);
+ pos.x = line->GetParam("moxeX")->AsFloat(0.0f);
+ pos.y = line->GetParam("moxeY")->AsFloat(0.0f);
pos.z = pos.x;
- m_water->Create(OpTypeWater(line, "air", Gfx::WATER_TT),
- OpTypeWater(line, "water", Gfx::WATER_TT),
- name,
- OpColor(line, "diffuse", Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
- OpColor(line, "ambient", Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
- OpFloat(line, "level", 100.0f)*g_unit,
- OpFloat(line, "glint", 1.0f),
+ m_water->Create(line->GetParam("air")->AsWaterType(Gfx::WATER_TT),
+ line->GetParam("water")->AsWaterType(Gfx::WATER_TT),
+ "../"+line->GetParam("image")->AsPath("textures"),
+ line->GetParam("diffuse")->AsColor(Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
+ line->GetParam("ambient")->AsColor(Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
+ line->GetParam("level")->AsFloat(100.0f)*g_unit,
+ line->GetParam("glint")->AsFloat(1.0f),
pos);
- m_colorNewWater = OpColor(line, "color", m_colorRefWater);
- m_colorShiftWater = OpFloat(line, "brightness", 0.0f);
+ m_colorNewWater = line->GetParam("color")->AsColor(m_colorRefWater);
+ m_colorShiftWater = line->GetParam("brightness")->AsFloat(0.0f);
continue;
}
-
- if (Cmd(line, "TerrainLava") && !resetObject)
+
+ if (line->GetCommand() == "TerrainLava" && !resetObject)
{
- m_water->SetLava(OpInt(line, "mode", 0));
+ m_water->SetLava(line->GetParam("mode")->AsBool());
continue;
}
-
- if (Cmd(line, "TerrainCloud") && !resetObject)
- {
- OpString(line, "image", name);
- m_cloud->Create(name,
- OpColor(line, "diffuse", Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
- OpColor(line, "ambient", Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
- OpFloat(line, "level", 500.0f) * g_unit);
+
+ if (line->GetCommand() == "TerrainCloud" && !resetObject)
+ {
+ std::string path = "";
+ if(line->GetParam("image")->IsDefined())
+ path = "../"+line->GetParam("image")->AsPath("textures");
+ m_cloud->Create(path,
+ line->GetParam("diffuse")->AsColor(Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
+ line->GetParam("ambient")->AsColor(Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f)),
+ line->GetParam("level")->AsFloat(500.0f)*g_unit);
continue;
}
-
- if (Cmd(line, "TerrainBlitz") && !resetObject)
+
+ if (line->GetCommand() == "TerrainBlitz" && !resetObject)
{
- m_lightning->Create(OpFloat(line, "sleep", 0.0f),
- OpFloat(line, "delay", 3.0f),
- OpFloat(line, "magnetic", 50.0f) * g_unit);
+ m_lightning->Create(line->GetParam("sleep")->AsFloat(0.0f),
+ line->GetParam("delay")->AsFloat(3.0f),
+ line->GetParam("magnetic")->AsFloat(50.0f)*g_unit);
continue;
}
-
- if (Cmd(line, "TerrainInitTextures") && !resetObject)
+
+ if (line->GetCommand() == "TerrainInitTextures" && !resetObject)
{
- if (m_terrainInit)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainInitTextures and TerrainInit at same time\n", filename, lineNum);
- continue;
+ std::string name = "../"+line->GetParam("image")->AsPath("textures");
+ if(name.find(".") == std::string::npos)
+ name += ".png";
+ unsigned int dx = line->GetParam("dx")->AsInt(1);
+ unsigned int dy = line->GetParam("dy")->AsInt(1);
+
+ int tt[100]; //TODO: I have no idea how TerrainInitTextures works, but maybe we shuld remove the limit to 100?
+ if(dx*dy > 100)
+ throw CLevelParserException("In TerrainInitTextures: dx*dy must be <100");
+ if(line->GetParam("table")->IsDefined()) {
+ const std::vector<CLevelParserParam*>& table = line->GetParam("table")->AsArray();
+
+ if(table.size() > dx*dy)
+ throw CLevelParserException("In TerrainInitTextures: table size must be dx*dy");
+
+ for (unsigned int i = 0; i < dx*dy; i++)
+ {
+ if(i >= table.size())
+ {
+ tt[i] = 0;
+ } else {
+ tt[i] = table[i]->AsInt();
+ }
+ }
+ } else {
+ for (unsigned int i = 0; i < dx*dy; i++)
+ {
+ tt[i] = 0;
+ }
}
-
- OpString(line, "image", name);
- AddExt(name, ".png");
- int dx = OpInt(line, "dx", 1);
- int dy = OpInt(line, "dy", 1);
- char* opTable = SearchOp(line, "table");
- int tt[100];
- for (int i = 0; i < dx*dy; i++)
- tt[i] = GetInt(opTable, i, 0);
-
- if (strstr(name, "%user%") != 0)
- CopyFileListToTemp(name, tt, dx*dy);
-
- m_terrain->InitTextures(name, tt, dx, dy);
-
- m_terrainInitTextures = true;
+
+ m_terrain->InitTextures(name.c_str(), tt, dx, dy);
continue;
}
-
- if (Cmd(line, "TerrainInit") && !resetObject)
+
+ if (line->GetCommand() == "TerrainInit" && !resetObject)
{
- if (m_terrainInitTextures)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainInit and TerrainInitTextures at same time\n", filename, lineNum);
- continue;
- }
-
- m_terrain->InitMaterials(OpInt(line, "id", 1));
- m_terrainInit = true;
+ m_terrain->InitMaterials(line->GetParam("id")->AsInt(1));
continue;
}
-
- if (Cmd(line, "TerrainMaterial") && !resetObject)
+
+ if (line->GetCommand() == "TerrainMaterial" && !resetObject)
{
- if (m_terrainCreate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainMaterial after TerrainCreate\n", filename, lineNum);
- continue;
- }
-
- if (m_terrainInit)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainMaterial after TerrainInit\n", filename, lineNum);
- continue;
- }
-
- if (m_terrainInitTextures)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainMaterial and TerrainInitTextures at same time\n", filename, lineNum);
- continue;
- }
-
- OpString(line, "image", name);
- AddExt(name, ".png");
- if (strstr(name, "%user%") != 0)
- {
- GetProfile().CopyFileToTemp(std::string(name));
- }
-
- m_terrain->AddMaterial(OpInt(line, "id", 0),
- name,
- Math::Point(OpFloat(line, "u", 0.0f),
- OpFloat(line, "v", 0.0f)),
- OpInt(line, "up", 1),
- OpInt(line, "right", 1),
- OpInt(line, "down", 1),
- OpInt(line, "left", 1),
- OpFloat(line, "hard", 0.5f));
+ std::string name = line->GetParam("image")->AsPath("textures");
+ if(name.find(".") == std::string::npos)
+ name += ".png";
+ name = "../"+name;
+
+ m_terrain->AddMaterial(line->GetParam("id")->AsInt(0),
+ name.c_str(),
+ Math::Point(line->GetParam("u")->AsFloat(),
+ line->GetParam("v")->AsFloat()),
+ line->GetParam("up")->AsInt(),
+ line->GetParam("right")->AsInt(),
+ line->GetParam("down")->AsInt(),
+ line->GetParam("left")->AsInt(),
+ line->GetParam("hard")->AsFloat(0.5f));
continue;
}
-
- if (Cmd(line, "TerrainLevel") && !resetObject)
+
+ if (line->GetCommand() == "TerrainLevel" && !resetObject)
{
- if (m_terrainCreate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainLevel after TerrainCreate\n", filename, lineNum);
- continue;
- }
-
- if (!m_terrainInit)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainLevel before TerrainInit\n", filename, lineNum);
- continue;
- }
-
- if (m_terrainInitTextures)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainLevel and TerrainInitTextures at same time\n", filename, lineNum);
- continue;
- }
-
- if (!m_terrainGenerate)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): TerrainLevel before TerrainGenerate\n", filename, lineNum);
- continue;
- }
-
- char* opId = SearchOp(line, "id");
- int id[50];
- int i = 0;
- while (i < 50)
- {
- id[i] = GetInt(opId, i, 0);
- if (id[i++] == 0) break;
+ int id[50]; //TODO: I have no idea how TerrainLevel works, but maybe we should remove the limit to 50?
+ if(line->GetParam("id")->IsDefined()) {
+ const std::vector<CLevelParserParam*>& id_array = line->GetParam("id")->AsArray();
+
+ if(id_array.size() > 50)
+ throw CLevelParserException("In TerrainLevel: id array size must be < 50");
+
+ unsigned int i = 0;
+ while (i < 50)
+ {
+ id[i] = id_array[i]->AsInt();
+ i++;
+ if(i >= id_array.size()) break;
+ }
+ id[i] = 0;
}
-
+
m_terrain->GenerateMaterials(id,
- OpFloat(line, "min", 0.0f)*g_unit,
- OpFloat(line, "max", 100.0f)*g_unit,
- OpFloat(line, "slope", 5.0f),
- OpFloat(line, "freq", 100.0f),
- OpPos(line, "center")*g_unit,
- OpFloat(line, "radius", 0.0f)*g_unit);
+ line->GetParam("min")->AsFloat(0.0f)*g_unit,
+ line->GetParam("max")->AsFloat(100.0f)*g_unit,
+ line->GetParam("slope")->AsFloat(5.0f),
+ line->GetParam("freq")->AsFloat(100.0f),
+ line->GetParam("center")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f))*g_unit,
+ line->GetParam("radius")->AsFloat(0.0f)*g_unit);
continue;
}
-
- if (Cmd(line, "TerrainCreate") && !resetObject)
+
+ if (line->GetCommand() == "TerrainCreate" && !resetObject)
{
m_terrain->CreateObjects();
- m_terrainCreate = true;
continue;
}
-
- if (Cmd(line, "BeginObject"))
+
+ if (line->GetCommand() == "BeginObject")
{
InitEye();
SetMovieLock(false);
-
+
if (read[0] != 0) // loading file ?
sel = IOReadScene(read, stack);
-
- m_beginObject = true;
+
continue;
}
-
- if (Cmd(line, "MissionController") && read[0] == 0 && m_version >= 2)
+
+ if (line->GetCommand() == "MissionController" && read[0] == 0 && m_version >= 2)
{
m_controller = CObjectManager::GetInstancePointer()->CreateObject(Math::Vector(0.0f, 0.0f, 0.0f), 0.0f, OBJECT_CONTROLLER, 100.0f);
m_controller->SetMagnifyDamage(100.0f);
@@ -4578,48 +4253,42 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
CBrain* brain = m_controller->GetBrain();
if (brain != nullptr)
{
- OpString(line, "script", name);
- if (name[0] != 0)
- brain->SetScriptName(0, name);
+ std::string name = "../"+line->GetParam("script")->AsPath("ai");
+ if (!name.empty())
+ brain->SetScriptName(0, const_cast<char*>(name.c_str()));
brain->SetScriptRun(0);
}
continue;
}
-
- if (Cmd(line, "CreateObject") && read[0] == 0)
+
+ if (line->GetCommand() == "CreateObject" && read[0] == 0)
{
- if (!m_beginObject)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): CreateObject before BeginObject\n", filename, lineNum);
- continue;
- }
-
- ObjectType type = OpTypeObject(line, "type", OBJECT_NULL);
-
- int gadget = OpInt(line, "gadget", -1);
+ ObjectType type = line->GetParam("type")->AsObjectType();
+
+ int gadget = line->GetParam("gadget")->AsInt(-1);
if ( gadget == -1 )
{
gadget = 0;
if ( type == OBJECT_TECH ||
- (type >= OBJECT_PLANT0 &&
- type <= OBJECT_PLANT19 ) ||
- (type >= OBJECT_TREE0 &&
- type <= OBJECT_TREE5 ) ||
- (type >= OBJECT_TEEN0 &&
- type <= OBJECT_TEEN44 ) ||
- (type >= OBJECT_QUARTZ0 &&
- type <= OBJECT_QUARTZ3 ) ||
- (type >= OBJECT_ROOT0 &&
- type <= OBJECT_ROOT4 ) ) // not ROOT5!
+ (type >= OBJECT_PLANT0 &&
+ type <= OBJECT_PLANT19 ) ||
+ (type >= OBJECT_TREE0 &&
+ type <= OBJECT_TREE5 ) ||
+ (type >= OBJECT_TEEN0 &&
+ type <= OBJECT_TEEN44 ) ||
+ (type >= OBJECT_QUARTZ0 &&
+ type <= OBJECT_QUARTZ3 ) ||
+ (type >= OBJECT_ROOT0 &&
+ type <= OBJECT_ROOT4 ) ) // not ROOT5!
{
if ( type != OBJECT_TEEN11 && // lamp?
- type != OBJECT_TEEN12 && // coke?
- type != OBJECT_TEEN20 && // wall?
- type != OBJECT_TEEN21 && // wall?
- type != OBJECT_TEEN22 && // wall?
- type != OBJECT_TEEN26 && // lamp?
- type != OBJECT_TEEN28 && // bottle?
- type != OBJECT_TEEN34 ) // stone?
+ type != OBJECT_TEEN12 && // coke?
+ type != OBJECT_TEEN20 && // wall?
+ type != OBJECT_TEEN21 && // wall?
+ type != OBJECT_TEEN22 && // wall?
+ type != OBJECT_TEEN26 && // lamp?
+ type != OBJECT_TEEN28 && // bottle?
+ type != OBJECT_TEEN34 ) // stone?
{
gadget = 1;
}
@@ -4629,19 +4298,20 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
{
if (!TestGadgetQuantity(rankGadget++)) continue;
}
-
- Math::Vector pos = OpPos(line, "pos")*g_unit;
- float dirAngle = OpFloat(line, "dir", 0.0f)*Math::PI;
+
+ Math::Vector pos = line->GetParam("pos")->AsPoint()*g_unit;
+ float dirAngle = line->GetParam("dir")->AsFloat(0.0f)*Math::PI;
bool trainer;
CObject* obj = CObjectManager::GetInstancePointer()->CreateObject(
- pos, dirAngle,
- type,
- OpFloat(line, "power", 1.0f),
- OpFloat(line, "z", 1.0f),
- OpFloat(line, "h", 0.0f),
- trainer = OpInt(line, "trainer", 0),
- OpInt(line, "toy", 0),
- OpInt(line, "option", 0));
+ pos, dirAngle,
+ type,
+ line->GetParam("power")->AsFloat(1.0f),
+ line->GetParam("z")->AsFloat(1.0f),
+ line->GetParam("h")->AsFloat(0.0f),
+ trainer = line->GetParam("trainer")->AsBool(false),
+ line->GetParam("toy")->AsBool(false),
+ line->GetParam("option")->AsInt(0)
+ );
if (m_fixScene && type == OBJECT_HUMAN)
{
@@ -4649,108 +4319,111 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (m_phase == PHASE_WIN ) motion->SetAction(MHS_WIN, 0.4f);
if (m_phase == PHASE_LOST) motion->SetAction(MHS_LOST, 0.5f);
}
-
+
if (obj != nullptr)
{
obj->SetDefRank(rankObj);
-
+
if (type == OBJECT_BASE) m_base = true;
-
- Gfx::CameraType cType = OpCamera(line, "camera");
+
+ Gfx::CameraType cType = line->GetParam("camera")->AsCameraType(Gfx::CAM_TYPE_NULL);
if (cType != Gfx::CAM_TYPE_NULL)
obj->SetCameraType(cType);
-
- obj->SetCameraDist(OpFloat(line, "cameraDist", 50.0f));
- obj->SetCameraLock(OpInt(line, "cameraLock", 0));
-
- Gfx::PyroType pType = OpPyro(line, "pyro");
+
+ obj->SetCameraDist(line->GetParam("cameraDist")->AsFloat(50.0f));
+ obj->SetCameraLock(line->GetParam("cameraLock")->AsBool(false));
+
+ Gfx::PyroType pType = line->GetParam("pyro")->AsPyroType(Gfx::PT_NULL);
if (pType != Gfx::PT_NULL)
{
Gfx::CPyro* pyro = new Gfx::CPyro();
pyro->Create(pType, obj);
}
-
+
// Puts information in terminal (OBJECT_INFO).
for (int i = 0; i < OBJECTMAXINFO; i++)
{
- sprintf(op, "info%d", i+1);
- char text[100];
- OpString(line, op, text);
- if (text[0] == 0) break;
- char* p = strchr(text, '=');
- if (p == 0) break;
- *p = 0;
+ std::string op = "info"+boost::lexical_cast<std::string>(i+1);
+ if(!line->GetParam(op)->IsDefined()) break;
+ std::string text = line->GetParam(op)->AsString();
+ std::size_t p = text.find_first_of("=");
+ if(p == std::string::npos)
+ throw CLevelParserExceptionBadParam(line->GetParam(op), "info");
Info info;
- strcpy(info.name, text);
- sscanf(p+1, "%f", &info.value);
+ strcpy(info.name, text.substr(0, p).c_str());
+ try {
+ info.value = boost::lexical_cast<float>(text.substr(p+1).c_str());
+ }
+ catch(...)
+ {
+ throw CLevelParserExceptionBadParam(line->GetParam(op), "info.value (float)");
+ }
obj->SetInfo(i, info);
}
-
+
// Sets the parameters of the command line.
- char* p = SearchOp(line, "cmdline");
- for (int i = 0; i < OBJECTMAXCMDLINE; i++)
- {
- float value = GetFloat(p, i, NAN);
- if (value == NAN) break;
- obj->SetCmdLine(i, value);
+ if(line->GetParam("cmdline")->IsDefined()) {
+ const std::vector<CLevelParserParam*>& cmdline = line->GetParam("cmdline")->AsArray();
+ for (unsigned int i = 0; i < OBJECTMAXCMDLINE && i < cmdline.size(); i++) //TODO: get rid of the limit
+ {
+ obj->SetCmdLine(i, cmdline[i]->AsFloat());
+ }
}
-
- if (OpInt(line, "select", 0) == 1)
+
+ if (line->GetParam("select")->AsBool(false))
{
sel = obj;
}
-
- bool selectable = OpInt(line, "selectable", 1);
+
+ bool selectable = line->GetParam("selectable")->AsBool(true);
obj->SetSelectable(selectable);
- obj->SetIgnoreBuildCheck(OpInt(line, "ignoreBuildCheck", 0));
- obj->SetEnable(OpInt(line, "enable", 1));
- obj->SetProxyActivate(OpInt(line, "proxyActivate", 0));
- obj->SetProxyDistance(OpFloat(line, "proxyDistance", 15.0f)*g_unit);
- obj->SetRange(OpFloat(line, "range", 30.0f));
- obj->SetShield(OpFloat(line, "shield", 1.0f));
- obj->SetMagnifyDamage(OpFloat(line, "magnifyDamage", 1.0f));
- obj->SetClip(OpInt(line, "clip", 1));
- obj->SetCheckToken(m_version >= 2 ? trainer || !selectable : OpInt(line, "checkToken", 1));
+ obj->SetIgnoreBuildCheck(line->GetParam("ignoreBuildCheck")->AsBool(false));
+ obj->SetEnable(line->GetParam("enable")->AsBool(true));
+ obj->SetProxyActivate(line->GetParam("proxyActivate")->AsBool(false));
+ obj->SetProxyDistance(line->GetParam("proxyDistance")->AsFloat(15.0f)*g_unit);
+ obj->SetRange(line->GetParam("range")->AsFloat(30.0f));
+ obj->SetShield(line->GetParam("shield")->AsFloat(1.0f));
+ obj->SetMagnifyDamage(line->GetParam("magnifyDamage")->AsFloat(1.0f));
+ obj->SetClip(line->GetParam("clip")->AsBool(true));
+ obj->SetCheckToken(m_version >= 2 ? trainer || !selectable : line->GetParam("checkToken")->AsBool(true));
// SetManual will affect bot speed
if (type == OBJECT_MOBILEdr)
{
- obj->SetManual(m_version >= 2 ? !trainer : OpInt(line, "manual", 0));
+ obj->SetManual(m_version >= 2 ? !trainer : line->GetParam("manual")->AsBool(false));
}
-
+
if (m_version >= 2)
{
- Math::Vector zoom = OpDir(line, "zoom");
+ Math::Vector zoom = line->GetParam("zoom")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f));
if (zoom.x != 0.0f || zoom.y != 0.0f || zoom.z != 0.0f)
obj->SetZoom(0, zoom);
}
-
+
+ //TODO: I don't remember what this is used for
CMotion* motion = obj->GetMotion();
- if (motion != nullptr)
+ if (motion != nullptr && line->GetParam("param")->IsDefined())
{
- p = SearchOp(line, "param");
- for (int i = 0; i < 10; i++)
+ const std::vector<CLevelParserParam*>& p = line->GetParam("param")->AsArray();
+ for (unsigned int i = 0; i < 10 && i < p.size(); i++)
{
- float value;
- value = GetFloat(p, i, NAN);
- if (value == NAN) break;
- motion->SetParam(i, value);
+ motion->SetParam(i, p[i]->AsFloat());
}
}
-
+
int run = -1;
CBrain* brain = obj->GetBrain();
if (brain != nullptr)
{
for (int i = 0; i < 10; i++)
{
- sprintf(op, "script%d", i+1); // script1..script10
- OpString(line, op, name);
- if (name[0] != 0)
- brain->SetScriptName(i, name);
-
+ std::string op = "script"+boost::lexical_cast<std::string>(i+1); // script1..script10
+ if(line->GetParam(op)->IsDefined()) {
+ brain->SetScriptName(i, const_cast<char*>(("../"+line->GetParam(op)->AsPath("ai")).c_str()));
+ }
+
}
-
- int i = OpInt(line, "run", 0);
+
+ int i = line->GetParam("run")->AsInt(0);
if (i != 0)
{
run = i-1;
@@ -4760,17 +4433,16 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
CAuto* automat = obj->GetAuto();
if (automat != nullptr)
{
- type = OpTypeObject(line, "autoType", OBJECT_NULL);
+ type = line->GetParam("autoType")->AsObjectType(OBJECT_NULL);
automat->SetType(type);
for (int i = 0; i < 5; i++)
{
- sprintf(op, "autoValue%d", i+1); // autoValue1..autoValue5
- automat->SetValue(i, OpFloat(line, op, 0.0f));
+ std::string op = "autoValue"+boost::lexical_cast<std::string>(i+1); // autoValue1..autoValue5
+ automat->SetValue(i, line->GetParam(op)->AsFloat(0.0f));
}
- OpString(line, "autoString", name);
- automat->SetString(name);
-
- int i = OpInt(line, "run", -1);
+ automat->SetString(const_cast<char*>(line->GetParam("autoString")->AsPath("ai", "").c_str()));
+
+ int i = line->GetParam("run")->AsInt(-1);
if (i != -1)
{
if (i != PARAM_FIXSCENE &&
@@ -4778,30 +4450,29 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
automat->Start(i); // starts the film
}
}
-
- OpString(line, "soluce", name);
- if (soluce && brain != 0 && name[0] != 0)
- brain->SetSoluceName(name);
-
+
+ if (soluce && brain != nullptr && line->GetParam("soluce")->IsDefined())
+ brain->SetSoluceName(const_cast<char*>(line->GetParam("soluce")->AsString().c_str()));
+
obj->SetResetPosition(obj->GetPosition(0));
obj->SetResetAngle(obj->GetAngle(0));
obj->SetResetRun(run);
-
- if (OpInt(line, "reset", 0) == 1)
+
+ if (line->GetParam("reset")->AsBool(false))
obj->SetResetCap(RESET_MOVE);
}
-
+
rankObj ++;
continue;
}
-
- if (Cmd(line, "CreateFog") && !resetObject)
+
+ if (line->GetCommand() == "CreateFog" && !resetObject)
{
- Gfx::ParticleType type = static_cast<Gfx::ParticleType>((Gfx::PARTIFOG0+OpInt(line, "type", 0)));
- Math::Vector pos = OpPos(line, "pos")*g_unit;
- float height = OpFloat(line, "height", 1.0f)*g_unit;
- float ddim = OpFloat(line, "dim", 50.0f)*g_unit;
- float delay = OpFloat(line, "delay", 2.0f);
+ Gfx::ParticleType type = static_cast<Gfx::ParticleType>(Gfx::PARTIFOG0+(line->GetParam("type")->AsInt()));
+ Math::Vector pos = line->GetParam("pos")->AsPoint()*g_unit;
+ float height = line->GetParam("height")->AsFloat(1.0f)*g_unit;
+ float ddim = line->GetParam("dim")->AsFloat(50.0f)*g_unit;
+ float delay = line->GetParam("delay")->AsFloat(2.0f);
m_terrain->AdjustToFloor(pos);
pos.y += height;
Math::Point dim;
@@ -4810,149 +4481,150 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
m_particle->CreateParticle(pos, Math::Vector(0.0f, 0.0f, 0.0f), dim, type, delay, 0.0f, 0.0f);
continue;
}
-
- if (Cmd(line, "CreateLight") && !resetObject)
+
+ if (line->GetCommand() == "CreateLight" && !resetObject)
{
Gfx::EngineObjectType type;
-
- int lightRank = CreateLight(OpDir(line, "dir"),
- OpColor(line, "color", Gfx::Color(0.5f, 0.5f, 0.5f, 1.0f)));
-
- type = OpTypeTerrain(line, "type", Gfx::ENG_OBJTYPE_NULL);
+
+ int lightRank = CreateLight(line->GetParam("dir")->AsPoint(),
+ line->GetParam("color")->AsColor(Gfx::Color(0.5f, 0.5f, 0.5f, 1.0f)));
+
+ type = line->GetParam("type")->AsTerrainType(Gfx::ENG_OBJTYPE_NULL);
+
if (type == Gfx::ENG_OBJTYPE_TERRAIN)
{
m_lightMan->SetLightPriority(lightRank, Gfx::LIGHT_PRI_HIGHEST);
m_lightMan->SetLightIncludeType(lightRank, Gfx::ENG_OBJTYPE_TERRAIN);
}
-
+
if (type == Gfx::ENG_OBJTYPE_QUARTZ)
m_lightMan->SetLightIncludeType(lightRank, Gfx::ENG_OBJTYPE_QUARTZ);
-
+
if (type == Gfx::ENG_OBJTYPE_METAL)
m_lightMan->SetLightIncludeType(lightRank, Gfx::ENG_OBJTYPE_METAL);
-
+
if (type == Gfx::ENG_OBJTYPE_FIX)
m_lightMan->SetLightExcludeType(lightRank, Gfx::ENG_OBJTYPE_TERRAIN);
-
+
continue;
}
- if (Cmd(line, "CreateSpot") && !resetObject)
+ if (line->GetCommand() == "CreateSpot" && !resetObject)
{
Gfx::EngineObjectType type;
-
- int rankLight = CreateSpot(OpDir(line, "pos")*g_unit,
- OpColor(line, "color", Gfx::Color(0.5f, 0.5f, 0.5f, 1.0f)));
-
- type = OpTypeTerrain(line, "type", Gfx::ENG_OBJTYPE_NULL);
+
+ int rankLight = CreateSpot(line->GetParam("pos")->AsPoint()*g_unit,
+ line->GetParam("color")->AsColor(Gfx::Color(0.5f, 0.5f, 0.5f, 1.0f)));
+
+ type = line->GetParam("type")->AsTerrainType(Gfx::ENG_OBJTYPE_NULL);
if (type == Gfx::ENG_OBJTYPE_TERRAIN)
m_lightMan->SetLightIncludeType(rankLight, Gfx::ENG_OBJTYPE_TERRAIN);
-
+
if (type == Gfx::ENG_OBJTYPE_QUARTZ)
m_lightMan->SetLightIncludeType(rankLight, Gfx::ENG_OBJTYPE_QUARTZ);
-
+
if (type == Gfx::ENG_OBJTYPE_METAL)
m_lightMan->SetLightIncludeType(rankLight, Gfx::ENG_OBJTYPE_METAL);
-
+
if (type == Gfx::ENG_OBJTYPE_FIX)
m_lightMan->SetLightExcludeType(rankLight, Gfx::ENG_OBJTYPE_TERRAIN);
-
+
continue;
}
-
- if (Cmd(line, "GroundSpot") && !resetObject)
+
+ if (line->GetCommand() == "GroundSpot" && !resetObject)
{
rank = m_engine->CreateGroundSpot();
if (rank != -1)
{
- m_engine->SetObjectGroundSpotPos(rank, OpPos(line, "pos")*g_unit);
- m_engine->SetObjectGroundSpotRadius(rank, OpFloat(line, "radius", 10.0f)*g_unit);
- m_engine->SetObjectGroundSpotColor(rank, OpColor(line, "color", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)));
- m_engine->SetObjectGroundSpotSmooth(rank, OpFloat(line, "smooth", 1.0f));
- m_engine->SetObjectGroundSpotMinMax(rank, OpFloat(line, "min", 0.0f)*g_unit,
- OpFloat(line, "max", 0.0f)*g_unit);
+ m_engine->SetObjectGroundSpotPos(rank, line->GetParam("pos")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f))*g_unit);
+ m_engine->SetObjectGroundSpotRadius(rank, line->GetParam("radius")->AsFloat(10.0f)*g_unit);
+ m_engine->SetObjectGroundSpotColor(rank, line->GetParam("color")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)));
+ m_engine->SetObjectGroundSpotSmooth(rank, line->GetParam("smooth")->AsFloat(1.0f));
+ m_engine->SetObjectGroundSpotMinMax(rank, line->GetParam("min")->AsFloat(0.0f)*g_unit,
+ line->GetParam("max")->AsFloat(0.0f)*g_unit);
}
continue;
}
-
- if (Cmd(line, "WaterColor") && !resetObject)
+
+ if (line->GetCommand() == "WaterColor" && !resetObject)
{
- m_engine->SetWaterAddColor(OpColor(line, "color", Gfx::Color(0.0f, 0.0f, 0.0f, 1.0f)));
+ m_engine->SetWaterAddColor(line->GetParam("color")->AsColor());
continue;
}
-
- if (Cmd(line, "MapColor") && !resetObject)
+
+ if (line->GetCommand() == "MapColor" && !resetObject)
{
- m_map->FloorColorMap(OpColor(line, "floor", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)),
- OpColor(line, "water", Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)));
- m_mapShow = OpInt(line, "show", 1);
+ m_map->FloorColorMap(line->GetParam("floor")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)),
+ line->GetParam("water")->AsColor(Gfx::Color(0.533f, 0.533f, 0.533f, 0.533f)));
+ m_mapShow = line->GetParam("show")->AsBool(true);
m_map->ShowMap(m_mapShow);
- m_map->SetToy(OpInt(line, "toyIcon", 0));
- m_mapImage = OpInt(line, "image", 0);
+ m_map->SetToy(line->GetParam("toyIcon")->AsBool(false));
+ m_mapImage = line->GetParam("image")->AsBool(false);
if (m_mapImage)
{
- Math::Vector offset;
- OpString(line, "filename", m_mapFilename);
- offset = OpPos(line, "offset");
- m_map->SetFixParam(OpFloat(line, "zoom", 1.0f),
+ Math::Vector offset;
+ strcpy(m_mapFilename, ("../"+line->GetParam("filename")->AsPath("textures")).c_str());
+ offset = line->GetParam("offset")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f));
+ m_map->SetFixParam(line->GetParam("zoom")->AsFloat(1.0f),
offset.x, offset.z,
- OpFloat(line, "angle", 0.0f)*Math::PI/180.0f,
- OpInt(line, "mode", 0),
- OpInt(line, "debug", 0));
+ line->GetParam("angle")->AsFloat(0.0f)*Math::PI/180.0f,
+ line->GetParam("mode")->AsInt(0),
+ line->GetParam("debug")->AsBool(false));
}
continue;
}
-
- if (Cmd(line, "MapZoom") && !resetObject)
+
+ if (line->GetCommand() == "MapZoom" && !resetObject)
{
- m_map->ZoomMap(OpFloat(line, "factor", 2.0f));
- m_map->MapEnable(OpInt(line, "enable", 1));
+ m_map->ZoomMap(line->GetParam("factor")->AsFloat(2.0f));
+ m_map->MapEnable(line->GetParam("enable")->AsBool(true));
continue;
}
-
- if (Cmd(line, "MaxFlyingHeight") && !resetObject)
+
+ if (line->GetCommand() == "MaxFlyingHeight" && !resetObject)
{
- m_terrain->SetFlyingMaxHeight(OpFloat(line, "max", 280.0f)*g_unit);
+ m_terrain->SetFlyingMaxHeight(line->GetParam("max")->AsFloat(280.0f)*g_unit);
continue;
}
-
- if (Cmd(line, "AddFlyingHeight") && !resetObject)
+
+ if (line->GetCommand() == "AddFlyingHeight" && !resetObject)
{
- m_terrain->AddFlyingLimit(OpPos(line, "center")*g_unit,
- OpFloat(line, "extRadius", 20.0f)*g_unit,
- OpFloat(line, "intRadius", 10.0f)*g_unit,
- OpFloat(line, "maxHeight", 200.0f));
+ m_terrain->AddFlyingLimit(line->GetParam("center")->AsPoint()*g_unit,
+ line->GetParam("extRadius")->AsFloat(20.0f)*g_unit,
+ line->GetParam("intRadius")->AsFloat(10.0f)*g_unit,
+ line->GetParam("maxHeight")->AsFloat(200.0f));
continue;
}
-
- if (Cmd(line, "Camera"))
+
+ if (line->GetCommand() == "Camera")
{
- m_camera->Init(OpDir(line, "eye")*g_unit,
- OpDir(line, "lookat")*g_unit,
- resetObject?0.0f:OpFloat(line, "delay", 0.0f));
-
- if (OpInt(line, "fadeIn", 0) == 1)
+ m_camera->Init(line->GetParam("eye")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f))*g_unit,
+ line->GetParam("lookat")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f))*g_unit,
+ resetObject ? 0.0f : line->GetParam("delay")->AsFloat(0.0f));
+
+ if (line->GetParam("fadeIn")->AsBool(false))
m_camera->StartOver(Gfx::CAM_OVER_EFFECT_FADEIN_WHITE, Math::Vector(0.0f, 0.0f, 0.0f), 1.0f);
-
- m_camera->SetFixDirection(OpFloat(line, "fixDirection", 0.25f)*Math::PI);
+
+ m_camera->SetFixDirection(line->GetParam("fixDirection")->AsFloat(0.25f)*Math::PI);
continue;
}
-
- if (Cmd(line, "EndMissionTake") && !resetObject && m_controller == nullptr)
+
+ if (line->GetCommand() == "EndMissionTake" && !resetObject && m_controller == nullptr)
{
int i = m_endTakeTotal;
if (i < 10)
{
- m_endTake[i].pos = OpPos(line, "pos")*g_unit;
- m_endTake[i].dist = OpFloat(line, "dist", (m_version < 2 ? 8.0f : 100.0f))*g_unit;
- m_endTake[i].type = OpTypeObject(line, "type", OBJECT_NULL);
- m_endTake[i].min = OpInt(line, "min", 1);
- m_endTake[i].max = OpInt(line, "max", 9999);
+ m_endTake[i].pos = line->GetParam("pos")->AsPoint(Math::Vector(0.0f, 0.0f, 0.0f))*g_unit;
+ m_endTake[i].dist = line->GetParam("dist")->AsFloat(m_version < 2 ? 8.0f : 100.0f)*g_unit;
+ m_endTake[i].type = line->GetParam("type")->AsObjectType(OBJECT_NULL);
+ m_endTake[i].min = line->GetParam("min")->AsInt(1);
+ m_endTake[i].max = line->GetParam("max")->AsInt(9999);
if (m_version >= 2)
{
- m_endTake[i].powermin = OpFloat(line, "powermin", -1);
- m_endTake[i].powermax = OpFloat(line, "powermax", 100);
- m_endTake[i].tool = OpTool(line, "tool");
- m_endTake[i].drive = OpDrive(line, "drive");
+ m_endTake[i].powermin = line->GetParam("powermin")->AsFloat(-1);
+ m_endTake[i].powermax = line->GetParam("powermax")->AsFloat(100);
+ m_endTake[i].tool = line->GetParam("tool")->AsToolType(TOOL_OTHER);
+ m_endTake[i].drive = line->GetParam("drive")->AsDriveType(DRIVE_OTHER);
}
else
{
@@ -4961,93 +4633,89 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
m_endTake[i].tool = TOOL_OTHER;
m_endTake[i].drive = DRIVE_OTHER;
}
- m_endTake[i].lost = OpInt(line, "lost", -1);
- m_endTake[i].immediat = OpInt(line, "immediat", 0);
- OpString(line, "message", m_endTake[i].message);
+ m_endTake[i].lost = line->GetParam("lost")->AsInt(-1);
+ m_endTake[i].immediat = line->GetParam("immediat")->AsBool(false);
+ strcpy(m_endTake[i].message, line->GetParam("message")->AsString("").c_str()); //TODO: Really, ending mission on message()? Is this used anywhere? Do we need that?
m_endTakeTotal ++;
}
continue;
}
- if (Cmd(line, "EndMissionDelay") && !resetObject && m_controller == nullptr)
+ if (line->GetCommand() == "EndMissionDelay" && !resetObject && m_controller == nullptr)
{
- m_endTakeWinDelay = OpFloat(line, "win", 2.0f);
- m_endTakeLostDelay = OpFloat(line, "lost", 2.0f);
+ m_endTakeWinDelay = line->GetParam("win")->AsFloat(2.0f);
+ m_endTakeLostDelay = line->GetParam("lost")->AsFloat(2.0f);
continue;
}
- if (Cmd(line, "EndMissionResearch") && !resetObject && m_controller == nullptr)
+ if (line->GetCommand() == "EndMissionResearch" && !resetObject && m_controller == nullptr) //TODO: Is this used anywhere?
{
- m_endTakeResearch |= OpResearch(line, "type");
+ m_endTakeResearch |= line->GetParam("type")->AsResearchFlag();
continue;
}
- if (Cmd(line, "EndMissionNever") && !resetObject && m_controller == nullptr)
+ if (line->GetCommand() == "EndMissionNever" && !resetObject && m_controller == nullptr)
{
m_endTakeNever = true;
continue;
}
-
- if (Cmd(line, "ObligatoryToken") && !resetObject)
+
+ if (line->GetCommand() == "ObligatoryToken" && !resetObject) //NOTE: This was used only in CeeBot, maybe we should add this to some Colobot exercises?
{
int i = m_obligatoryTotal;
- if (i < 100)
+ if (i < 100) //TODO: remove the limit
{
- OpString(line, "text", m_obligatoryToken[i]);
+ strcpy(m_obligatoryToken[i], line->GetParam("text")->AsString().c_str());
m_obligatoryTotal ++;
}
continue;
}
-
- if (Cmd(line, "ProhibitedToken") && !resetObject)
+
+ if (line->GetCommand() == "ProhibitedToken" && !resetObject) //NOTE: This was used only in CeeBot, maybe we should add this to some Colobot exercises?
{
int i = m_prohibitedTotal;
- if (i < 100)
+ if (i < 100) //TODO: remove the limit
{
- OpString(line, "text", m_prohibitedToken[i]);
+ strcpy(m_prohibitedToken[i], line->GetParam("text")->AsString().c_str());
m_prohibitedTotal ++;
}
continue;
}
-
- if (Cmd(line, "EnableBuild") && !resetObject)
+
+ if (line->GetCommand() == "EnableBuild" && !resetObject)
{
- g_build |= OpBuild(line, "type");
+ g_build |= line->GetParam("type")->AsBuildFlag();
continue;
}
-
- if (Cmd(line, "EnableResearch") && !resetObject)
+
+ if (line->GetCommand() == "EnableResearch" && !resetObject)
{
- g_researchEnable |= OpResearch(line, "type");
+ g_researchEnable |= line->GetParam("type")->AsResearchFlag();
continue;
}
-
- if (Cmd(line, "DoneResearch") && read[0] == 0 && !resetObject) // not loading file?
+
+ if (line->GetCommand() == "DoneResearch" && read[0] == 0 && !resetObject) // not loading file?
{
- g_researchDone |= OpResearch(line, "type");
+ g_researchDone |= line->GetParam("type")->AsResearchFlag();
continue;
}
-
- if (Cmd(line, "NewScript") && !resetObject)
+
+ if (line->GetCommand() == "NewScript" && !resetObject)
{
- OpString(line, "name", name);
- AddNewScriptName(OpTypeObject(line, "type", OBJECT_NULL), name);
+ AddNewScriptName(line->GetParam("type")->AsObjectType(OBJECT_NULL), const_cast<char*>(line->GetParam("name")->AsPath("ai").c_str()));
continue;
}
-
- if (line[0] == '\n') continue; // Ignore empty lines
- if (line[0] == '\0') continue; // Ignore empty lines
- if (read[0] != 0) continue; // Ignore when loading saved game
-
- GetLogger()->Error("Syntax error in file '%s' (line %d): Unknown command: %s", filename, lineNum, line); // Don't add \n at the end of log message - it's included in line variable
+
+ if(read[0] != 0) continue; // ignore errors when loading saved game (TODO: don't report ones that are just not loaded when loading saved game)
+ if(resetObject) continue; // ignore when reseting just objects (TODO: see above)
+
+ throw CLevelParserException("Unknown command: '"+line->GetCommand()+"' in "+line->GetLevel()->GetFilename()+":"+boost::lexical_cast<std::string>(line->GetLineNumber()));
}
- fclose(file);
-
if (read[0] == 0)
CompileScript(soluce); // compiles all scripts
- if (strcmp(base, "scene") == 0 && !resetObject) // mission?
+ if (strcmp(base, "missions") == 0 && !resetObject) // mission?
WriteFreeParam();
- if (strcmp(base, "free") == 0 && !resetObject) // free play?
+ if (strcmp(base, "freemissions") == 0 && !resetObject) // free play?
{
g_researchDone = m_freeResearch;
@@ -5189,7 +4857,7 @@ void CRobotMain::ChangeColor()
exclu[3] = Math::Point(256.0f/256.0f, 256.0f/256.0f); // SatCom screen
exclu[4] = Math::Point(0.0f, 0.0f);
exclu[5] = Math::Point(0.0f, 0.0f); // terminator
- m_engine->ChangeTextureColor("human.png", colorRef1, colorNew1, colorRef2, colorNew2, 0.30f, 0.01f, ts, ti, exclu);
+ m_engine->ChangeTextureColor("textures/human.png", colorRef1, colorNew1, colorRef2, colorNew2, 0.30f, 0.01f, ts, ti, exclu);
float tolerance;
@@ -5231,7 +4899,7 @@ void CRobotMain::ChangeColor()
colorNew2.b = 0.0f;
char name[100];
- sprintf(name, "face%.2d.png", face+1);
+ sprintf(name, "textures/face%.2d.png", face+1);
exclu[0] = Math::Point(105.0f/256.0f, 47.0f/166.0f);
exclu[1] = Math::Point(153.0f/256.0f, 79.0f/166.0f); // blue canister
exclu[2] = Math::Point(0.0f, 0.0f);
@@ -5245,19 +4913,19 @@ void CRobotMain::ChangeColor()
colorNew2.g = 0.0f;
colorNew2.b = 0.0f;
- m_engine->ChangeTextureColor("base1.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
- m_engine->ChangeTextureColor("convert.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
- m_engine->ChangeTextureColor("derrick.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
- m_engine->ChangeTextureColor("factory.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
- m_engine->ChangeTextureColor("lemt.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
- m_engine->ChangeTextureColor("roller.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
- m_engine->ChangeTextureColor("search.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeTextureColor("textures/base1.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeTextureColor("textures/convert.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeTextureColor("textures/derrick.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeTextureColor("textures/factory.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeTextureColor("textures/lemt.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeTextureColor("textures/roller.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
+ m_engine->ChangeTextureColor("textures/search.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, 0, 0, true);
exclu[0] = Math::Point( 0.0f/256.0f, 160.0f/256.0f);
exclu[1] = Math::Point(256.0f/256.0f, 256.0f/256.0f); // pencils
exclu[2] = Math::Point(0.0f, 0.0f);
exclu[3] = Math::Point(0.0f, 0.0f); // terminator
- m_engine->ChangeTextureColor("drawer.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, true);
+ m_engine->ChangeTextureColor("textures/drawer.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, true);
exclu[0] = Math::Point(237.0f/256.0f, 176.0f/256.0f);
exclu[1] = Math::Point(256.0f/256.0f, 220.0f/256.0f); // blue canister
@@ -5265,26 +4933,26 @@ void CRobotMain::ChangeColor()
exclu[3] = Math::Point(130.0f/256.0f, 214.0f/256.0f); // safe location
exclu[4] = Math::Point(0.0f, 0.0f);
exclu[5] = Math::Point(0.0f, 0.0f); // terminator
- m_engine->ChangeTextureColor("subm.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, true);
+ m_engine->ChangeTextureColor("textures/subm.png", m_colorRefBot, m_colorNewBot, colorRef2, colorNew2, 0.10f, -1.0f, ts, ti, exclu, 0, true);
exclu[0] = Math::Point(128.0f/256.0f, 160.0f/256.0f);
exclu[1] = Math::Point(256.0f/256.0f, 256.0f/256.0f); // SatCom
exclu[2] = Math::Point(0.0f, 0.0f);
exclu[3] = Math::Point(0.0f, 0.0f); // terminator
- m_engine->ChangeTextureColor("ant.png", m_colorRefAlien, m_colorNewAlien, colorRef2, colorNew2, 0.50f, -1.0f, ts, ti, exclu);
- m_engine->ChangeTextureColor("mother.png", m_colorRefAlien, m_colorNewAlien, colorRef2, colorNew2, 0.50f, -1.0f, ts, ti);
+ m_engine->ChangeTextureColor("textures/ant.png", m_colorRefAlien, m_colorNewAlien, colorRef2, colorNew2, 0.50f, -1.0f, ts, ti, exclu);
+ m_engine->ChangeTextureColor("textures/mother.png", m_colorRefAlien, m_colorNewAlien, colorRef2, colorNew2, 0.50f, -1.0f, ts, ti);
- m_engine->ChangeTextureColor("plant.png", m_colorRefGreen, m_colorNewGreen, colorRef2, colorNew2, 0.50f, -1.0f, ts, ti);
+ m_engine->ChangeTextureColor("textures/plant.png", m_colorRefGreen, m_colorNewGreen, colorRef2, colorNew2, 0.50f, -1.0f, ts, ti);
// PARTIPLOUF0 and PARTIDROP :
ts = Math::Point(0.500f, 0.500f);
ti = Math::Point(0.875f, 0.750f);
- m_engine->ChangeTextureColor("effect00.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
+ m_engine->ChangeTextureColor("textures/effect00.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
// PARTIFLIC :
ts = Math::Point(0.00f, 0.75f);
ti = Math::Point(0.25f, 1.00f);
- m_engine->ChangeTextureColor("effect02.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
+ m_engine->ChangeTextureColor("textures/effect02.png", m_colorRefWater, m_colorNewWater, colorRef2, colorNew2, 0.20f, -1.0f, ts, ti, 0, m_colorShiftWater, true);
}
//! Updates the number of unnecessary objects
@@ -5718,11 +5386,12 @@ void CRobotMain::CompileScript(bool soluce)
{
if (brain->GetCompile(j)) continue;
- char* name = brain->GetScriptName(j);
+ std::string name = brain->GetScriptName(j);
if (name[0] != 0)
{
- if(! brain->ReadProgram(j, name)) {
- CLogger::GetInstancePointer()->Error("Unable to read script from file \"%s\"\n", name);
+ name = "ai/"+name;
+ if(! brain->ReadProgram(j, const_cast<char*>(name.c_str()))) {
+ CLogger::GetInstancePointer()->Error("Unable to read script from file \"%s\"\n", name.c_str());
}
if (!brain->GetCompile(j)) nbError++;
}
@@ -5794,7 +5463,7 @@ void CRobotMain::LoadOneScript(CObject *obj, int &nbError)
char filename[MAX_FNAME];
sprintf(filename, "%s/%s/%c%.3d%.3d%.1d.txt",
- GetSavegameDir(), m_gamerName.c_str(), name[0], rank, objRank, i);
+ GetPHYSFSSavegameDir(), m_gamerName.c_str(), name[0], rank, objRank, i);
brain->ReadProgram(i, filename);
if (!brain->GetCompile(i)) nbError++;
}
@@ -5812,9 +5481,15 @@ void CRobotMain::LoadFileScript(CObject *obj, const char* filename, int objRank,
ObjectType type = obj->GetType();
if (type == OBJECT_HUMAN) return;
-
+
+ std::string fnstr = filename;
+ std::string savedir = CResourceManager::GetSaveLocation()+"/";
+ boost::replace_all(fnstr, "\\", "/");
+ boost::replace_all(savedir, "\\", "/");
+ boost::replace_all(fnstr, savedir, ""); //TODO: Refactor to get physfs path here
+ //TODO: Refactor to std::string
char fn[MAX_FNAME];
- strcpy(fn, filename);
+ strcpy(fn, fnstr.c_str());
char* ldir = SearchLastDir(fn);
if (ldir == 0) return;
@@ -5864,7 +5539,7 @@ void CRobotMain::SaveOneScript(CObject *obj)
{
char filename[MAX_FNAME];
sprintf(filename, "%s/%s/%c%.3d%.3d%.1d.txt",
- GetSavegameDir(), m_gamerName.c_str(), name[0], rank, objRank, i);
+ GetPHYSFSSavegameDir(), m_gamerName.c_str(), name[0], rank, objRank, i);
brain->WriteProgram(i, filename);
}
}
@@ -5881,8 +5556,14 @@ void CRobotMain::SaveFileScript(CObject *obj, const char* filename, int objRank)
ObjectType type = obj->GetType();
if (type == OBJECT_HUMAN) return;
+ std::string fnstr = filename;
+ std::string savedir = CResourceManager::GetSaveLocation()+"/";
+ boost::replace_all(fnstr, "\\", "/");
+ boost::replace_all(savedir, "\\", "/");
+ boost::replace_all(fnstr, savedir, ""); //TODO: Refactor to get physfs path here
+ //TODO: Refactor to std::string
char fn[MAX_FNAME];
- strcpy(fn, filename);
+ strcpy(fn, fnstr.c_str());
char* ldir = SearchLastDir(fn);
if (ldir == 0) return;
@@ -6576,20 +6257,28 @@ void CRobotMain::ResetCreate()
m_camera->SetType(Gfx::CAM_TYPE_DIALOG);
- CreateScene(m_dialog->GetSceneSoluce(), false, true);
+ try {
+ CreateScene(m_dialog->GetSceneSoluce(), false, true);
- if (!GetNiceReset()) return;
+ if (!GetNiceReset()) return;
- for (int i = 0; i < 1000000; i++)
- {
- CObject* obj = static_cast<CObject*>(iMan->SearchInstance(CLASS_OBJECT, i));
- if (obj == nullptr) break;
+ for (int i = 0; i < 1000000; i++)
+ {
+ CObject* obj = static_cast<CObject*>(iMan->SearchInstance(CLASS_OBJECT, i));
+ if (obj == nullptr) break;
- ResetCap cap = obj->GetResetCap();
- if (cap == RESET_NONE) continue;
+ ResetCap cap = obj->GetResetCap();
+ if (cap == RESET_NONE) continue;
- Gfx::CPyro* pyro = new Gfx::CPyro();
- pyro->Create(Gfx::PT_RESET, obj);
+ Gfx::CPyro* pyro = new Gfx::CPyro();
+ pyro->Create(Gfx::PT_RESET, obj);
+ }
+ }
+ catch(const CLevelParserException& e)
+ {
+ CLogger::GetInstancePointer()->Error("An error occured while trying to reset scene\n");
+ CLogger::GetInstancePointer()->Error("%s\n", e.what());
+ ChangePhase(PHASE_TERM);
}
}
@@ -6684,22 +6373,35 @@ Error CRobotMain::CheckEndMission(bool frame)
if (m_missionResult == INFO_LOST) //mission lost?
{
m_displayText->DisplayError(INFO_LOST, Math::Vector(0.0f,0.0f,0.0f));
+ m_missionTimerEnabled = m_missionTimerStarted = false;
m_winDelay = 0.0f;
if (m_lostDelay == 0) m_lostDelay = m_endTakeLostDelay;
m_displayText->SetEnable(false);
+ if(m_exitAfterMission)
+ m_eventQueue->AddEvent(Event(EVENT_QUIT));
}
if (m_missionResult == INFO_LOSTq) //mission lost?
{
+ m_missionTimerEnabled = m_missionTimerStarted = false;
m_winDelay = 0.0f;
if (m_lostDelay == 0) m_lostDelay = 0.1f;
m_displayText->SetEnable(false);
+ if(m_exitAfterMission)
+ m_eventQueue->AddEvent(Event(EVENT_QUIT));
}
if (frame && m_base) return ERR_MISSION_NOTERM;
if (m_missionResult == ERR_OK) { //mission win?
m_displayText->DisplayError(INFO_WIN, Math::Vector(0.0f,0.0f,0.0f));
+ if(m_missionTimerEnabled && m_missionTimerStarted) {
+ CLogger::GetInstancePointer()->Info("Mission time: %s\n", TimeFormat(m_missionTimer).c_str());
+ m_displayText->DisplayText(("Time: "+TimeFormat(m_missionTimer)).c_str(), Math::Vector(0.0f,0.0f,0.0f));
+ }
+ m_missionTimerEnabled = m_missionTimerStarted = false;
if (m_winDelay == 0) m_winDelay = m_endTakeWinDelay;
m_lostDelay = 0.0f;
m_displayText->SetEnable(false);
+ if(m_exitAfterMission)
+ m_eventQueue->AddEvent(Event(EVENT_QUIT));
}
if (m_missionResult == ERR_MISSION_NOTERM) m_displayText->SetEnable(true);
return m_missionResult;
@@ -6773,6 +6475,7 @@ Error CRobotMain::CheckEndMission(bool frame)
m_lostDelay = 0.1f; // lost immediately
m_winDelay = 0.0f;
}
+ m_missionTimerEnabled = m_missionTimerStarted = false;
m_displayText->SetEnable(false);
return INFO_LOSTq;
}
@@ -6784,6 +6487,7 @@ Error CRobotMain::CheckEndMission(bool frame)
m_lostDelay = m_endTakeLostDelay; // lost in 6 seconds
m_winDelay = 0.0f;
}
+ m_missionTimerEnabled = m_missionTimerStarted = false;
m_displayText->SetEnable(false);
return INFO_LOST;
}
@@ -6802,6 +6506,7 @@ Error CRobotMain::CheckEndMission(bool frame)
m_winDelay = m_endTakeWinDelay; // wins in x seconds
m_lostDelay = 0.0f;
}
+ m_missionTimerEnabled = m_missionTimerStarted = false;
m_displayText->SetEnable(false);
return ERR_OK; // mission ended
}
@@ -6820,7 +6525,10 @@ Error CRobotMain::CheckEndMission(bool frame)
{
m_winDelay = 1.0f; // wins in one second
m_lostDelay = 0.0f;
+ m_missionTimerEnabled = m_missionTimerStarted = false;
m_displayText->SetEnable(false);
+ if(m_exitAfterMission)
+ m_eventQueue->AddEvent(Event(EVENT_QUIT));
return ERR_OK; // mission ended
}
@@ -6829,8 +6537,15 @@ Error CRobotMain::CheckEndMission(bool frame)
if (m_winDelay == 0.0f)
{
m_displayText->DisplayError(INFO_WIN, Math::Vector(0.0f,0.0f,0.0f));
+ if(m_missionTimerEnabled && m_missionTimerStarted) {
+ CLogger::GetInstancePointer()->Info("Mission time: %s\n", TimeFormat(m_missionTimer).c_str());
+ m_displayText->DisplayText(("Time: "+TimeFormat(m_missionTimer)).c_str(), Math::Vector(0.0f,0.0f,0.0f));
+ }
+ m_missionTimerEnabled = m_missionTimerStarted = false;
m_winDelay = m_endTakeWinDelay; // wins in two seconds
m_lostDelay = 0.0f;
+ if(m_exitAfterMission)
+ m_eventQueue->AddEvent(Event(EVENT_QUIT));
}
m_displayText->SetEnable(false);
return ERR_OK; // mission ended
@@ -6982,6 +6697,12 @@ bool CRobotMain::GetRadar()
return false;
}
+//TODO: Use PHYSFS everywhere
+const char* CRobotMain::GetPHYSFSSavegameDir()
+{
+ return m_dialog->GetPHYSFSSavegameDir().c_str();
+}
+
const char* CRobotMain::GetSavegameDir()
{
return m_dialog->GetSavegameDir().c_str();
@@ -7041,6 +6762,21 @@ float CRobotMain::GetPersoAngle()
return m_dialog->GetPersoAngle();
}
+char* CRobotMain::GetSceneName()
+{
+ return m_dialog->GetSceneName();
+}
+
+int CRobotMain::GetSceneRank()
+{
+ return m_dialog->GetSceneRank();
+}
+
+void CRobotMain::BuildSceneName(std::string &filename, char *base, int rank, bool sceneFile)
+{
+ m_dialog->BuildSceneName(filename, base, rank, sceneFile);
+}
+
//! Changes on the pause mode
void CRobotMain::ChangePause(PauseType pause)
@@ -7276,3 +7012,16 @@ void CRobotMain::DisplayError(Error err, Math::Vector goal, float height, float
{
m_displayText->DisplayError(err, goal, height, dist, time);
}
+
+std::string& CRobotMain::GetUserLevelName(int id)
+{
+ return m_dialog->GetUserLevelName(id);
+}
+
+void CRobotMain::StartMissionTimer()
+{
+ if(m_missionTimerEnabled && !m_missionTimerStarted) {
+ CLogger::GetInstancePointer()->Info("Starting mission timer...\n");
+ m_missionTimerStarted = true;
+ }
+}
diff --git a/src/object/robotmain.h b/src/object/robotmain.h
index 71ad455..0b89975 100644
--- a/src/object/robotmain.h
+++ b/src/object/robotmain.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file object/robotmain.h
@@ -44,7 +47,6 @@ enum Phase
PHASE_DEFI,
PHASE_MISSION,
PHASE_FREE,
- PHASE_TEEN,
PHASE_USER,
PHASE_LOADING,
PHASE_SIMUL,
@@ -208,6 +210,8 @@ public:
void LoadSceneOnStart(const std::string& name, int rank);
void CreateIni();
+
+ void ResetAfterDeviceChanged();
//! Sets the default input bindings (key and axes)
void SetDefaultInputBindings();
@@ -327,6 +331,7 @@ public:
bool GetSceneSoluce();
bool GetShowAll();
bool GetRadar();
+ const char* GetPHYSFSSavegameDir();
const char* GetSavegameDir();
const char* GetPublicDir();
const char* GetFilesDir();
@@ -338,6 +343,9 @@ public:
int GetGamerGlasses();
bool GetGamerOnlyHead();
float GetPersoAngle();
+ char* GetSceneName();
+ int GetSceneRank();
+ void BuildSceneName(std::string &filename, char *base, int rank, bool sceneFile = true);
void StartMusic();
void StartPauseMusic(PauseType pause);
@@ -387,13 +395,16 @@ public:
void DisplayError(Error err, CObject* pObj, float time=10.0f);
void DisplayError(Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f);
+
+ std::string& GetUserLevelName(int id);
+
+ void StartMissionTimer();
protected:
bool EventFrame(const Event &event);
bool EventObject(const Event &event);
void InitEye();
- void Convert();
void CreateScene(bool soluce, bool fixScene, bool resetObject);
Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length);
@@ -470,7 +481,6 @@ protected:
Gfx::Color m_color;
bool m_freePhoto;
bool m_cmdEdit;
- bool m_showPos;
bool m_selectInsect;
bool m_showSoluce;
bool m_showAll;
@@ -487,13 +497,6 @@ protected:
CObject* m_controller;
- // Level Checker flags
- bool m_beginObject;
- bool m_terrainGenerate;
- bool m_terrainInitTextures;
- bool m_terrainInit;
- bool m_terrainCreate;
-
int m_version; // Mission file version
bool m_retroStyle; // Retro
bool m_immediatSatCom; // SatCom immediately?
@@ -588,5 +591,9 @@ protected:
float m_colorShiftWater;
std::string m_oldLocale;
+
+ bool m_missionTimerEnabled;
+ bool m_missionTimerStarted;
+ float m_missionTimer;
};
diff --git a/src/object/task/task.cpp b/src/object/task/task.cpp
index 3624816..1459125 100644
--- a/src/object/task/task.cpp
+++ b/src/object/task/task.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/task.h"
diff --git a/src/object/task/task.h b/src/object/task/task.h
index 800b880..366bcfe 100644
--- a/src/object/task/task.h
+++ b/src/object/task/task.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// task.h
diff --git a/src/object/task/taskadvance.cpp b/src/object/task/taskadvance.cpp
index 885e100..0b1bf85 100644
--- a/src/object/task/taskadvance.cpp
+++ b/src/object/task/taskadvance.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskadvance.h"
diff --git a/src/object/task/taskadvance.h b/src/object/task/taskadvance.h
index f8c672d..bb966b4 100644
--- a/src/object/task/taskadvance.h
+++ b/src/object/task/taskadvance.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskadvance.h
diff --git a/src/object/task/taskbuild.cpp b/src/object/task/taskbuild.cpp
index 4dfd6fb..67661b6 100644
--- a/src/object/task/taskbuild.cpp
+++ b/src/object/task/taskbuild.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskbuild.h"
diff --git a/src/object/task/taskbuild.h b/src/object/task/taskbuild.h
index b3193a0..38b7193 100644
--- a/src/object/task/taskbuild.h
+++ b/src/object/task/taskbuild.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskbuild.h
diff --git a/src/object/task/taskfire.cpp b/src/object/task/taskfire.cpp
index beb4944..010151f 100644
--- a/src/object/task/taskfire.cpp
+++ b/src/object/task/taskfire.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskfire.h"
diff --git a/src/object/task/taskfire.h b/src/object/task/taskfire.h
index 81058df..bf3a775 100644
--- a/src/object/task/taskfire.h
+++ b/src/object/task/taskfire.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskfire.h
diff --git a/src/object/task/taskfireant.cpp b/src/object/task/taskfireant.cpp
index c0acf64..b0ef429 100644
--- a/src/object/task/taskfireant.cpp
+++ b/src/object/task/taskfireant.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskfireant.h"
diff --git a/src/object/task/taskfireant.h b/src/object/task/taskfireant.h
index 2a0ead8..9875480 100644
--- a/src/object/task/taskfireant.h
+++ b/src/object/task/taskfireant.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskfireant.h
diff --git a/src/object/task/taskflag.cpp b/src/object/task/taskflag.cpp
index dd5e11d..598e019 100644
--- a/src/object/task/taskflag.cpp
+++ b/src/object/task/taskflag.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskflag.h"
diff --git a/src/object/task/taskflag.h b/src/object/task/taskflag.h
index 7e3e4ef..a1d61b1 100644
--- a/src/object/task/taskflag.h
+++ b/src/object/task/taskflag.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskflag.h
#pragma once
diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp
index 8070d13..46629e0 100644
--- a/src/object/task/taskgoto.cpp
+++ b/src/object/task/taskgoto.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include <stdio.h>
@@ -34,7 +37,12 @@
const float FLY_DIST_GROUND = 80.0f; // minimum distance to remain on the ground
const float FLY_DEF_HEIGHT = 50.0f; // default flying height
-const float BM_DIM_STEP = 5.0f;
+
+// Settings that define goto() accuracy:
+const float BM_DIM_STEP = 5.0f; // Size of one pixel on the bitmap. Setting 5 means that 5x5 square (in game units) will be represented by 1 px on the bitmap. Decreasing this value will make a bigger bitmap, and may increase accuracy. TODO: Check how it actually impacts goto() accuracy
+const float BEAM_ACCURACY = 5.0f; // higher value = more accurate, but slower
+const float SAFETY_MARGIN = 0.5f; // Smallest distance between two objects. Smaller = less "no route to destination", but higher probability of collisions between objects.
+// Changing SAFETY_MARGIN (old value was 4.0f) seems to have fixed many issues with goto(). TODO: maybe we could make it even smaller? Did changing it introduce any new bugs?
@@ -1736,7 +1744,7 @@ Error CTaskGoto::BeamSearch(const Math::Vector &start, const Math::Vector &goal,
m_bmStep ++;
len = Math::DistanceProjected(start, goal);
- step = len/5.0f;
+ step = len/BEAM_ACCURACY;
if ( step < BM_DIM_STEP*2.1f ) step = BM_DIM_STEP*2.1f;
if ( step > 20.0f ) step = 20.0f;
nbIter = 200; // in order not to lower the framerate
@@ -1966,7 +1974,7 @@ void CTaskGoto::BitmapObject()
}
if ( type == OBJECT_PARA ) oRadius -= 2.0f;
- BitmapSetCircle(oPos, oRadius+iRadius+4.0f);
+ BitmapSetCircle(oPos, oRadius+iRadius+SAFETY_MARGIN);
}
}
}
diff --git a/src/object/task/taskgoto.h b/src/object/task/taskgoto.h
index d2b2d7e..383338e 100644
--- a/src/object/task/taskgoto.h
+++ b/src/object/task/taskgoto.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskgoto.h
diff --git a/src/object/task/taskgungoal.cpp b/src/object/task/taskgungoal.cpp
index c9c8d30..f4e4aa6 100644
--- a/src/object/task/taskgungoal.cpp
+++ b/src/object/task/taskgungoal.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskgungoal.h"
diff --git a/src/object/task/taskgungoal.h b/src/object/task/taskgungoal.h
index 9fc509d..59b7d3f 100644
--- a/src/object/task/taskgungoal.h
+++ b/src/object/task/taskgungoal.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskgungoal.h
diff --git a/src/object/task/taskinfo.cpp b/src/object/task/taskinfo.cpp
index 32ac342..50c5e4f 100644
--- a/src/object/task/taskinfo.cpp
+++ b/src/object/task/taskinfo.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskinfo.h"
diff --git a/src/object/task/taskinfo.h b/src/object/task/taskinfo.h
index 1ce3dca..5fdb974 100644
--- a/src/object/task/taskinfo.h
+++ b/src/object/task/taskinfo.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskinfo.h
diff --git a/src/object/task/taskmanager.cpp b/src/object/task/taskmanager.cpp
index 11fba6c..f34b464 100644
--- a/src/object/task/taskmanager.cpp
+++ b/src/object/task/taskmanager.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include <stdio.h>
diff --git a/src/object/task/taskmanager.h b/src/object/task/taskmanager.h
index 80a78fd..908a37a 100644
--- a/src/object/task/taskmanager.h
+++ b/src/object/task/taskmanager.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskmanager.h
diff --git a/src/object/task/taskmanip.cpp b/src/object/task/taskmanip.cpp
index 0608b6e..f12bde4 100644
--- a/src/object/task/taskmanip.cpp
+++ b/src/object/task/taskmanip.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskmanip.h"
diff --git a/src/object/task/taskmanip.h b/src/object/task/taskmanip.h
index e80602c..ed20b7a 100644
--- a/src/object/task/taskmanip.h
+++ b/src/object/task/taskmanip.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskmanip.h
diff --git a/src/object/task/taskpen.cpp b/src/object/task/taskpen.cpp
index 03c2322..b8d2c70 100644
--- a/src/object/task/taskpen.cpp
+++ b/src/object/task/taskpen.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskpen.h"
diff --git a/src/object/task/taskpen.h b/src/object/task/taskpen.h
index adaba6c..ad2658a 100644
--- a/src/object/task/taskpen.h
+++ b/src/object/task/taskpen.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskpen.h
diff --git a/src/object/task/taskrecover.cpp b/src/object/task/taskrecover.cpp
index d8bbafd..62f675a 100644
--- a/src/object/task/taskrecover.cpp
+++ b/src/object/task/taskrecover.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include <stdio.h>
diff --git a/src/object/task/taskrecover.h b/src/object/task/taskrecover.h
index 817ed5f..685cbd4 100644
--- a/src/object/task/taskrecover.h
+++ b/src/object/task/taskrecover.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskrecover.h
diff --git a/src/object/task/taskreset.cpp b/src/object/task/taskreset.cpp
index 98d9730..75b02b0 100644
--- a/src/object/task/taskreset.cpp
+++ b/src/object/task/taskreset.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskreset.h"
diff --git a/src/object/task/taskreset.h b/src/object/task/taskreset.h
index 5f1bb34..2ba08b5 100644
--- a/src/object/task/taskreset.h
+++ b/src/object/task/taskreset.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskreset.h
diff --git a/src/object/task/tasksearch.cpp b/src/object/task/tasksearch.cpp
index aa731a0..ce6e4b9 100644
--- a/src/object/task/tasksearch.cpp
+++ b/src/object/task/tasksearch.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/tasksearch.h"
diff --git a/src/object/task/tasksearch.h b/src/object/task/tasksearch.h
index 582d45a..7f6939b 100644
--- a/src/object/task/tasksearch.h
+++ b/src/object/task/tasksearch.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// tasksearch.h
diff --git a/src/object/task/taskshield.cpp b/src/object/task/taskshield.cpp
index e9ab157..bd74a4a 100644
--- a/src/object/task/taskshield.cpp
+++ b/src/object/task/taskshield.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskshield.h"
diff --git a/src/object/task/taskshield.h b/src/object/task/taskshield.h
index 36d3819..beb7b56 100644
--- a/src/object/task/taskshield.h
+++ b/src/object/task/taskshield.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskshield.h
diff --git a/src/object/task/taskspiderexplo.cpp b/src/object/task/taskspiderexplo.cpp
index f629714..2dd798f 100644
--- a/src/object/task/taskspiderexplo.cpp
+++ b/src/object/task/taskspiderexplo.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskspiderexplo.h"
diff --git a/src/object/task/taskspiderexplo.h b/src/object/task/taskspiderexplo.h
index 0984020..1b0dba0 100644
--- a/src/object/task/taskspiderexplo.h
+++ b/src/object/task/taskspiderexplo.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskspiderexplo.h
diff --git a/src/object/task/tasktake.cpp b/src/object/task/tasktake.cpp
index c7f0530..14688f3 100644
--- a/src/object/task/tasktake.cpp
+++ b/src/object/task/tasktake.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/tasktake.h"
diff --git a/src/object/task/tasktake.h b/src/object/task/tasktake.h
index 7f3f831..a128e94 100644
--- a/src/object/task/tasktake.h
+++ b/src/object/task/tasktake.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// tasktake.h
diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp
index 61ff045..58148fa 100644
--- a/src/object/task/taskterraform.cpp
+++ b/src/object/task/taskterraform.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include <stdio.h>
diff --git a/src/object/task/taskterraform.h b/src/object/task/taskterraform.h
index 8ae0d64..952b875 100644
--- a/src/object/task/taskterraform.h
+++ b/src/object/task/taskterraform.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskterraform.h
diff --git a/src/object/task/taskturn.cpp b/src/object/task/taskturn.cpp
index 9c099d2..661fb21 100644
--- a/src/object/task/taskturn.cpp
+++ b/src/object/task/taskturn.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskturn.h"
diff --git a/src/object/task/taskturn.h b/src/object/task/taskturn.h
index 11de476..23cf83c 100644
--- a/src/object/task/taskturn.h
+++ b/src/object/task/taskturn.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskturn.h
diff --git a/src/object/task/taskwait.cpp b/src/object/task/taskwait.cpp
index 5b9fdb3..6ad21f4 100644
--- a/src/object/task/taskwait.cpp
+++ b/src/object/task/taskwait.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "object/task/taskwait.h"
diff --git a/src/object/task/taskwait.h b/src/object/task/taskwait.h
index 3225c9a..4270e27 100644
--- a/src/object/task/taskwait.h
+++ b/src/object/task/taskwait.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// taskwait.h
diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp
index a3aaa28..6dd9d32 100644
--- a/src/physics/physics.cpp
+++ b/src/physics/physics.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "physics/physics.h"
diff --git a/src/physics/physics.h b/src/physics/physics.h
index fea5601..ace5b58 100644
--- a/src/physics/physics.h
+++ b/src/physics/physics.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file physics/physics.h
diff --git a/src/script/cbottoken.cpp b/src/script/cbottoken.cpp
index 81219df..5a23c3e 100644
--- a/src/script/cbottoken.cpp
+++ b/src/script/cbottoken.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "script/cbottoken.h"
diff --git a/src/script/cbottoken.h b/src/script/cbottoken.h
index 976d856..c897726 100644
--- a/src/script/cbottoken.h
+++ b/src/script/cbottoken.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file script/cbottoken.h
diff --git a/src/script/cmdtoken.cpp b/src/script/cmdtoken.cpp
index 6393505..317e881 100644
--- a/src/script/cmdtoken.cpp
+++ b/src/script/cmdtoken.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "script/cmdtoken.h"
@@ -23,6 +26,8 @@
#include <cstdio>
+// TODO: Remove these functions
+
// Skips spaces.
diff --git a/src/script/cmdtoken.h b/src/script/cmdtoken.h
index 8a423c5..de99e41 100644
--- a/src/script/cmdtoken.h
+++ b/src/script/cmdtoken.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file script/cmdtoken.h
diff --git a/src/script/dd.cpp b/src/script/dd.cpp
index a7f5eb9..6c6eab2 100644
--- a/src/script/dd.cpp
+++ b/src/script/dd.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// Compilation of a procedure with a "dot".
diff --git a/src/script/script.cpp b/src/script/script.cpp
index 2299fbf..abb2a8b 100644
--- a/src/script/script.cpp
+++ b/src/script/script.cpp
@@ -1,30 +1,35 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "script/script.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "common/global.h"
#include "common/iman.h"
#include "common/restext.h"
#include "common/stringutils.h"
+#include "common/resources/inputstream.h"
+#include "common/resources/resourcemanager.h"
+
#include "graphics/engine/terrain.h"
#include "graphics/engine/water.h"
#include "graphics/engine/text.h"
@@ -4366,7 +4371,6 @@ void CScript::GetError(std::string& error)
void CScript::New(Ui::CEdit* edit, const char* name)
{
- FILE *file = NULL;
char res[100];
char text[100];
char script[500];
@@ -4409,18 +4413,18 @@ void CScript::New(Ui::CEdit* edit, const char* name)
sf = m_main->GetScriptFile();
if ( sf[0] != 0 ) // Load an empty program specific?
{
- std::string filename = CGameData::GetInstancePointer()->GetFilePath(DIR_AI, sf);
- file = fopen(filename.c_str(), "rb");
- if ( file != NULL )
+ std::string filename = sf;
+ CInputStream stream;
+ stream.open(filename);
+
+ if (stream.is_open())
{
- fseek(file, 0, SEEK_END);
- len = ftell(file);
- fseek(file, 0, SEEK_SET);
+ len = stream.size();
if ( len > 500-1 ) len = 500-1;
- fread(buffer, 1, len, file);
+ stream.read(buffer, len);
buffer[len] = 0;
- fclose(file);
+ stream.close();
cursor1 = 0;
i = 0;
@@ -4497,24 +4501,9 @@ bool CScript::SendScript(const char* text)
bool CScript::ReadScript(const char* filename)
{
- FILE* file;
Ui::CEdit* edit;
- std::string name;
-
- if ( strchr(filename, '/') == 0 ) //we're reading non user script
- {
- name = CGameData::GetInstancePointer()->GetFilePath(DIR_AI, filename);
- }
- else
- {
- name = filename;
- //TODO: is this needed?
- // UserDir(name, filename, "");
- }
- file = fopen(name.c_str(), "rb");
- if ( file == NULL ) return false;
- fclose(file);
+ if (!CResourceManager::Exists(filename)) return false;
delete[] m_script;
m_script = nullptr;
@@ -4522,7 +4511,7 @@ bool CScript::ReadScript(const char* filename)
edit = m_interface->CreateEdit(Math::Point(0.0f, 0.0f), Math::Point(0.0f, 0.0f), 0, EVENT_EDIT9);
edit->SetMaxChar(Ui::EDITSTUDIOMAX);
edit->SetAutoIndent(m_engine->GetEditIndentMode());
- edit->ReadText(name.c_str());
+ edit->ReadText(filename);
GetScript(edit);
m_interface->DeleteControl(EVENT_EDIT9);
return true;
@@ -4533,16 +4522,6 @@ bool CScript::ReadScript(const char* filename)
bool CScript::WriteScript(const char* filename)
{
Ui::CEdit* edit;
- std::string name;
-
- if ( strchr(filename, '/') == 0 ) //we're writing non user script
- {
- name = CGameData::GetInstancePointer()->GetFilePath(DIR_AI, filename);
- }
- else
- {
- name = filename;
- }
if ( m_script == nullptr )
{
@@ -4554,7 +4533,7 @@ bool CScript::WriteScript(const char* filename)
edit->SetMaxChar(Ui::EDITSTUDIOMAX);
edit->SetAutoIndent(m_engine->GetEditIndentMode());
edit->SetText(m_script);
- edit->WriteText(name);
+ edit->WriteText(filename);
m_interface->DeleteControl(EVENT_EDIT9);
return true;
}
diff --git a/src/script/script.h b/src/script/script.h
index fb44342..029c875 100644
--- a/src/script/script.h
+++ b/src/script/script.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file script/script.h
diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp
index 8afbdd2..6dd991b 100644
--- a/src/sound/oalsound/alsound.cpp
+++ b/src/sound/oalsound/alsound.cpp
@@ -1,25 +1,25 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "sound/oalsound/alsound.h"
-#include "app/gamedata.h"
-
#include <algorithm>
#include <iomanip>
@@ -58,20 +58,14 @@ void ALSound::CleanUp()
delete channel.second;
}
- if (m_currentMusic)
- {
- delete m_currentMusic;
- }
-
+ delete m_currentMusic;
+
for (auto item : m_oldMusic)
{
delete item.music;
}
-
- if (m_previousMusic.music)
- {
- delete m_previousMusic.music;
- }
+
+ delete m_previousMusic.music;
for (auto item : m_sounds)
{
@@ -165,7 +159,7 @@ int ALSound::GetMusicVolume()
bool ALSound::Cache(Sound sound, const std::string &filename)
{
Buffer *buffer = new Buffer();
- if (buffer->LoadFromFile(CGameData::GetInstancePointer()->GetFilePath(DIR_SOUND, filename), sound))
+ if (buffer->LoadFromFile(filename, sound))
{
m_sounds[sound] = buffer;
return true;
@@ -175,18 +169,28 @@ bool ALSound::Cache(Sound sound, const std::string &filename)
bool ALSound::CacheMusic(const std::string &filename)
{
- if (m_music.find(filename) == m_music.end())
+ if (m_music.find("music/"+filename) == m_music.end())
{
Buffer *buffer = new Buffer();
- if (buffer->LoadFromFile(CGameData::GetInstancePointer()->GetFilePath(DIR_MUSIC, filename), static_cast<Sound>(-1)))
+ if (buffer->LoadFromFile("music/"+filename, static_cast<Sound>(-1)))
{
- m_music[filename] = buffer;
+ m_music["music/"+filename] = buffer;
return true;
}
}
return false;
}
+bool ALSound::IsCached(Sound sound)
+{
+ return m_sounds.find(sound) != m_sounds.end();
+}
+
+bool ALSound::IsCachedMusic(const std::string &filename)
+{
+ return m_music.find("music/"+filename) != m_music.end();
+}
+
int ALSound::GetPriority(Sound sound)
{
if ( sound == SOUND_FLYh ||
@@ -301,6 +305,7 @@ bool ALSound::SearchFreeBuffer(Sound sound, int &channel, bool &bAlreadyLoaded)
}
delete chn;
GetLogger()->Debug("Could not open additional channel to play sound!\n");
+ break;
}
}
}
@@ -635,30 +640,29 @@ bool ALSound::PlayMusic(const std::string &filename, bool bRepeat, float fadeTim
return false;
}
- std::string file = CGameData::GetInstancePointer()->GetFilePath(DIR_MUSIC, filename);
Buffer *buffer;
// check if we have music in cache
- if (m_music.find(filename) == m_music.end())
+ if (m_music.find("music/"+filename) == m_music.end())
{
GetLogger()->Debug("Music %s was not cached!\n", filename.c_str());
- if (!boost::filesystem::exists(file))
+ /* TODO: if (!boost::filesystem::exists("music/"+filename))
{
GetLogger()->Debug("Requested music %s was not found.\n", filename.c_str());
return false;
- }
+ } */
buffer = new Buffer();
- if (!buffer->LoadFromFile(file, static_cast<Sound>(-1)))
+ if (!buffer->LoadFromFile("music/"+filename, static_cast<Sound>(-1)))
{
return false;
}
- m_music[filename] = buffer;
+ m_music["music/"+filename] = buffer;
}
else
{
GetLogger()->Debug("Music loaded from cache\n");
- buffer = m_music[filename];
+ buffer = m_music["music/"+filename];
}
if (m_currentMusic)
diff --git a/src/sound/oalsound/alsound.h b/src/sound/oalsound/alsound.h
index bb9bf28..895b5ac 100644
--- a/src/sound/oalsound/alsound.h
+++ b/src/sound/oalsound/alsound.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file alsound.h
@@ -48,45 +50,46 @@ public:
ALSound();
~ALSound();
- bool Create();
- bool Cache(Sound, const std::string &);
- bool CacheMusic(const std::string &);
-
- bool GetEnable();
-
- void SetAudioVolume(int volume);
- int GetAudioVolume();
- void SetMusicVolume(int volume);
- int GetMusicVolume();
-
- void SetListener(const Math::Vector &eye, const Math::Vector &lookat);
- void FrameMove(float rTime);
-
- int Play(Sound sound, float amplitude=1.0f, float frequency=1.0f, bool bLoop = false);
- int Play(Sound sound, const Math::Vector &pos, float amplitude=1.0f, float frequency=1.0f, bool bLoop = false);
- bool FlushEnvelope(int channel);
- bool AddEnvelope(int channel, float amplitude, float frequency, float time, SoundNext oper);
- bool Position(int channel, const Math::Vector &pos);
- bool Frequency(int channel, float frequency);
- bool Stop(int channel);
- bool StopAll();
- bool MuteAll(bool bMute);
-
- bool PlayMusic(int rank, bool bRepeat, float fadeTime=2.0f);
- bool PlayMusic(const std::string &filename, bool bRepeat, float fadeTime=2.0f);
- bool RestartMusic();
- void SuspendMusic();
- void StopMusic(float fadeTime=2.0f);
- bool IsPlayingMusic();
- bool PlayPauseMusic(const std::string &filename, bool repeat);
- void StopPauseMusic();
-
- bool CheckChannel(int &channel);
+ bool Create() override;
+ bool Cache(Sound, const std::string &) override;
+ bool CacheMusic(const std::string &) override;
+ bool IsCached(Sound) override;
+ bool IsCachedMusic(const std::string &) override;
+
+ bool GetEnable() override;
+
+ void SetAudioVolume(int volume) override;
+ int GetAudioVolume() override;
+ void SetMusicVolume(int volume) override;
+ int GetMusicVolume() override;
+
+ void SetListener(const Math::Vector &eye, const Math::Vector &lookat) override;
+ void FrameMove(float rTime) override;
+
+ int Play(Sound sound, float amplitude=1.0f, float frequency=1.0f, bool bLoop = false) override;
+ int Play(Sound sound, const Math::Vector &pos, float amplitude=1.0f, float frequency=1.0f, bool bLoop = false) override;
+ bool FlushEnvelope(int channel) override;
+ bool AddEnvelope(int channel, float amplitude, float frequency, float time, SoundNext oper) override;
+ bool Position(int channel, const Math::Vector &pos) override;
+ bool Frequency(int channel, float frequency) override;
+ bool Stop(int channel) override;
+ bool StopAll() override;
+ bool MuteAll(bool bMute) override;
+
+ bool PlayMusic(int rank, bool bRepeat, float fadeTime=2.0f) override;
+ bool PlayMusic(const std::string &filename, bool bRepeat, float fadeTime=2.0f) override;
+ bool RestartMusic() override;
+ void SuspendMusic() override;
+ void StopMusic(float fadeTime=2.0f) override;
+ bool IsPlayingMusic() override;
+ bool PlayPauseMusic(const std::string &filename, bool repeat) override;
+ void StopPauseMusic() override;
private:
void CleanUp();
int GetPriority(Sound);
bool SearchFreeBuffer(Sound sound, int &channel, bool &bAlreadyLoaded);
+ bool CheckChannel(int &channel);
bool m_enabled;
float m_audioVolume;
diff --git a/src/sound/oalsound/buffer.cpp b/src/sound/oalsound/buffer.cpp
index b27029c..df31b82 100644
--- a/src/sound/oalsound/buffer.cpp
+++ b/src/sound/oalsound/buffer.cpp
@@ -1,23 +1,29 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "sound/oalsound/buffer.h"
-#include <cstring>
+#include <memory>
+
+#include "common/resources/resourcemanager.h"
+
Buffer::Buffer()
{
@@ -42,19 +48,17 @@ bool Buffer::LoadFromFile(std::string filename, Sound sound)
m_sound = sound;
GetLogger()->Debug("Loading audio file: %s\n", filename.c_str());
- SF_INFO fileInfo;
- memset(&fileInfo, 0, sizeof(SF_INFO));
- SNDFILE *file = sf_open(filename.c_str(), SFM_READ, &fileInfo);
+ std::unique_ptr<CSNDFile> file = std::unique_ptr<CSNDFile>(CResourceManager::GetSNDFileHandler(filename));
- GetLogger()->Trace(" channels %d\n", fileInfo.channels);
- GetLogger()->Trace(" format %d\n", fileInfo.format);
- GetLogger()->Trace(" frames %d\n", fileInfo.frames);
- GetLogger()->Trace(" samplerate %d\n", fileInfo.samplerate);
- GetLogger()->Trace(" sections %d\n", fileInfo.sections);
+ GetLogger()->Trace(" channels %d\n", file->GetFileInfo().channels);
+ GetLogger()->Trace(" format %d\n", file->GetFileInfo().format);
+ GetLogger()->Trace(" frames %d\n", file->GetFileInfo().frames);
+ GetLogger()->Trace(" samplerate %d\n", file->GetFileInfo().samplerate);
+ GetLogger()->Trace(" sections %d\n", file->GetFileInfo().sections);
- if (!file)
+ if (!file->IsOpen())
{
- GetLogger()->Warn("Could not load file. Reason: %s\n", sf_strerror(file));
+ GetLogger()->Warn("Could not load file %s. Reason: %s\n", filename.c_str(), file->GetLastError().c_str());
m_loaded = false;
return false;
}
@@ -64,23 +68,21 @@ bool Buffer::LoadFromFile(std::string filename, Sound sound)
{
GetLogger()->Warn("Could not create audio buffer\n");
m_loaded = false;
- sf_close(file);
return false;
}
// read chunks of 4096 samples
std::vector<uint16_t> data;
std::array<int16_t, 4096> buffer;
- data.reserve(fileInfo.frames);
+ data.reserve(file->GetFileInfo().frames);
size_t read = 0;
- while ((read = sf_read_short(file, buffer.data(), buffer.size())) != 0)
+ while ((read = file->Read(buffer.data(), buffer.size())) != 0)
{
data.insert(data.end(), buffer.begin(), buffer.begin() + read);
}
- sf_close(file);
- alBufferData(m_buffer, fileInfo.channels == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16, &data.front(), data.size() * sizeof(uint16_t), fileInfo.samplerate);
- m_duration = static_cast<float>(fileInfo.frames) / fileInfo.samplerate;
+ alBufferData(m_buffer, file->GetFileInfo().channels == 1 ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16, &data.front(), data.size() * sizeof(uint16_t), file->GetFileInfo().samplerate);
+ m_duration = static_cast<float>(file->GetFileInfo().frames) / file->GetFileInfo().samplerate;
m_loaded = true;
return true;
}
diff --git a/src/sound/oalsound/buffer.h b/src/sound/oalsound/buffer.h
index e693d75..a34f764 100644
--- a/src/sound/oalsound/buffer.h
+++ b/src/sound/oalsound/buffer.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file buffer.h
diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp
index 7021c2f..c7311f7 100644
--- a/src/sound/oalsound/channel.cpp
+++ b/src/sound/oalsound/channel.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "sound/oalsound/channel.h"
diff --git a/src/sound/oalsound/channel.h b/src/sound/oalsound/channel.h
index 1d988c9..4e0b52c 100644
--- a/src/sound/oalsound/channel.h
+++ b/src/sound/oalsound/channel.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file channel.h
diff --git a/src/sound/oalsound/check.h b/src/sound/oalsound/check.h
index b8f67c0..ec0a328 100644
--- a/src/sound/oalsound/check.h
+++ b/src/sound/oalsound/check.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// check.h
diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp
index 9cae1fd..ab92ec1 100644
--- a/src/sound/sound.cpp
+++ b/src/sound/sound.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012-2013, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "sound/sound.h"
@@ -46,7 +48,7 @@ void CSoundInterface::CacheAll()
for ( int i = 1; i < SOUND_MAX; i++ )
{
std::stringstream filename;
- filename << "sound" << std::setfill('0') << std::setw(3) << i << ".wav";
+ filename << "sounds/sound" << std::setfill('0') << std::setw(3) << i << ".wav";
if ( !Cache(static_cast<Sound>(i), filename.str()) )
GetLogger()->Warn("Unable to load audio: %s\n", filename.str().c_str());
}
@@ -70,6 +72,16 @@ bool CSoundInterface::CacheMusic(const std::string &bFile)
return true;
}
+bool CSoundInterface::IsCached(Sound bSound)
+{
+ return false;
+}
+
+bool CSoundInterface::IsCachedMusic(const std::string& bFile)
+{
+ return false;
+}
+
bool CSoundInterface::GetEnable()
{
return true;
diff --git a/src/sound/sound.h b/src/sound/sound.h
index 22a5ee2..20f459c 100644
--- a/src/sound/sound.h
+++ b/src/sound/sound.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file sound/sound.h
@@ -178,6 +180,18 @@ public:
* \return return true on success
*/
virtual bool CacheMusic(const std::string &bFile);
+
+ /** Function to check if sound effect file was cached.
+ * \param bSound - id of a sound effect file
+ * \return return true if the file was cached
+ */
+ virtual bool IsCached(Sound bSound);
+
+ /** Function called to check if music file was cached.
+ * \param bFile - file to check
+ * \return return true if the file was cached
+ */
+ virtual bool IsCachedMusic(const std::string &bFile);
/** Return if plugin is enabled
* \return return true if plugin is enabled
diff --git a/src/tools/convert_model.cpp b/src/tools/convert_model.cpp
index 57e8789..44afecd 100644
--- a/src/tools/convert_model.cpp
+++ b/src/tools/convert_model.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/logger.h"
#include "graphics/engine/modelfile.h"
diff --git a/src/ui/button.cpp b/src/ui/button.cpp
index 810d365..0a10379 100644
--- a/src/ui/button.cpp
+++ b/src/ui/button.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/button.h"
@@ -176,7 +178,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/button.h b/src/ui/button.h
index b71ef4a..2c66468 100644
--- a/src/ui/button.h
+++ b/src/ui/button.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// button.h
diff --git a/src/ui/check.cpp b/src/ui/check.cpp
index 6a92554..e590309 100644
--- a/src/ui/check.cpp
+++ b/src/ui/check.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/check.h"
@@ -102,7 +104,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/check.h b/src/ui/check.h
index 65bc367..cdb5134 100644
--- a/src/ui/check.h
+++ b/src/ui/check.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// check.h
diff --git a/src/ui/color.cpp b/src/ui/color.cpp
index d1dc746..ddf7629 100644
--- a/src/ui/color.cpp
+++ b/src/ui/color.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/color.h"
@@ -138,7 +140,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/color.h b/src/ui/color.h
index fe96b87..06b259e 100644
--- a/src/ui/color.h
+++ b/src/ui/color.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// color.h
diff --git a/src/ui/compass.cpp b/src/ui/compass.cpp
index d0fe96f..45977c5 100644
--- a/src/ui/compass.cpp
+++ b/src/ui/compass.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/compass.h"
@@ -88,7 +90,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/compass.h b/src/ui/compass.h
index 956631a..510d9e8 100644
--- a/src/ui/compass.h
+++ b/src/ui/compass.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// compass.h
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 4e64ee9..a4cdbfc 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-//
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/control.h"
@@ -437,7 +439,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 +493,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
}
@@ -506,19 +508,19 @@ void CControl::Draw()
if ( icon >= 192 )
{
icon -= 192;
- m_engine->SetTexture("text.png");
+ m_engine->SetTexture("textures/interface/text.png");
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
@@ -751,7 +753,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;
@@ -795,7 +797,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/control.h b/src/ui/control.h
index 1ca07cf..5306641 100644
--- a/src/ui/control.h
+++ b/src/ui/control.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code;
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// control.h
diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp
index e7748ae..aceb5b0 100644
--- a/src/ui/displayinfo.cpp
+++ b/src/ui/displayinfo.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/displayinfo.h"
@@ -156,28 +158,28 @@ bool CDisplayInfo::EventProcess(const Event &event)
{
m_main->SetFontSize(9.0f);
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
- if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/12.0f);
+ if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/15.0f);
ViewDisplayInfo();
}
if ( event.type == EVENT_HYPER_SIZE2 ) // size 2?
{
- m_main->SetFontSize(10.0f);
+ m_main->SetFontSize(14.0f);
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
- if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/12.0f);
+ if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/15.0f);
ViewDisplayInfo();
}
if ( event.type == EVENT_HYPER_SIZE3 ) // size 3?
{
- m_main->SetFontSize(12.0f);
+ m_main->SetFontSize(19.0f);
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
- if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/12.0f);
+ if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/15.0f);
ViewDisplayInfo();
}
if ( event.type == EVENT_HYPER_SIZE4 ) // size 4?
{
- m_main->SetFontSize(15.0f);
+ m_main->SetFontSize(24.0f);
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
- if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/12.0f);
+ if ( slider != 0 ) slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/15.0f);
ViewDisplayInfo();
}
@@ -185,7 +187,7 @@ bool CDisplayInfo::EventProcess(const Event &event)
{
slider = static_cast<Ui::CSlider*>(pw->SearchControl(EVENT_STUDIO_SIZE));
if ( slider == 0 ) return false;
- m_main->SetFontSize(9.0f+slider->GetVisibleValue()*12.0f);
+ m_main->SetFontSize(9.0f+slider->GetVisibleValue()*15.0f);
ViewDisplayInfo();
}
@@ -342,8 +344,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?
{
@@ -420,7 +420,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
button->SetState(STATE_SHADOW);
slider = pw->CreateSlider(pos, dim, 0, EVENT_STUDIO_SIZE);
slider->SetState(STATE_SHADOW);
- slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/6.0f);
+ slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/15.0f);
button = pw->CreateButton(pos, dim, 61, EVENT_HYPER_COPY);
button->SetState(STATE_SHADOW);
HyperUpdate();
@@ -935,284 +935,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..f820cd6 100644
--- a/src/ui/displayinfo.h
+++ b/src/ui/displayinfo.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// displayinfo.h
@@ -66,7 +68,6 @@ protected:
void UpdateCopyButton();
void ViewDisplayInfo();
CObject* SearchToto();
- void CreateObjectsFile();
protected:
Gfx::CEngine* m_engine;
diff --git a/src/ui/displaytext.cpp b/src/ui/displaytext.cpp
index 5b3144d..8e944de 100644
--- a/src/ui/displaytext.cpp
+++ b/src/ui/displaytext.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/displaytext.h"
diff --git a/src/ui/displaytext.h b/src/ui/displaytext.h
index 94572a8..3815407 100644
--- a/src/ui/displaytext.h
+++ b/src/ui/displaytext.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// displaytext.h
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp
index e2df62b..b6e6bbf 100644
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@ -1,29 +1,38 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/edit.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "clipboard/clipboard.h"
+#include "object/robotmain.h"
+
+#include "object/level/parserparam.h"
+
+#include "common/resources/inputstream.h"
+#include "common/resources/outputstream.h"
+
#include <string.h>
+#include <boost/algorithm/string.hpp>
namespace Ui {
@@ -115,21 +124,16 @@ CEdit::CEdit () : CControl ()
CEdit::~CEdit()
{
- int i;
-
FreeImage();
- for ( i=0 ; i<EDITUNDOMAX ; i++ )
+ for (int i = 0; i < EDITUNDOMAX; i++)
{
delete m_undo[i].text;
m_undo[i].text = nullptr;
}
- if (m_text != nullptr)
- {
- delete[] m_text;
- m_text = nullptr;
- }
+ delete[] m_text;
+ m_text = nullptr;
delete m_scroll;
m_scroll = nullptr;
@@ -373,23 +377,23 @@ bool CEdit::EventProcess(const Event &event)
MoveChar(1, bControl, bShift);
return true;
}
- if ( event.key.key == KEY(UP) )
+ if ( event.key.key == KEY(UP) && m_bMulti )
{
MoveLine(-1, bControl, bShift);
return true;
}
- if ( event.key.key == KEY(DOWN) )
+ if ( event.key.key == KEY(DOWN) && m_bMulti )
{
MoveLine(1, bControl, bShift);
return true;
}
- if ( event.key.key == KEY(PAGEUP) ) // PageUp ?
+ if ( event.key.key == KEY(PAGEUP) && m_bMulti ) // PageUp ?
{
MoveLine(-(m_lineVisible-1), bControl, bShift);
return true;
}
- if ( event.key.key == KEY(PAGEDOWN) ) // PageDown ?
+ if ( event.key.key == KEY(PAGEDOWN) && m_bMulti ) // PageDown ?
{
MoveLine(m_lineVisible-1, bControl, bShift);
return true;
@@ -782,16 +786,9 @@ 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");
+ filename = CLevelParserParam::InjectLevelDir(filename, "help/%lng%");
+ boost::replace_all(filename, "\\", "/"); //TODO: Fix this in files
if ( ReadText(filename) )
{
@@ -1145,7 +1142,9 @@ 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";
+ filename = CLevelParserParam::InjectLevelDir(filename, "icons");
+ boost::replace_all(filename, "\\", "/"); //TODO: Fix this in files
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 )
@@ -1225,7 +1224,7 @@ void CEdit::DrawPart(Math::Point pos, Math::Point dim, int icon)
Math::Point uv1, uv2;
float dp;
- m_engine->SetTexture("text.png");
+ m_engine->SetTexture("textures/interface/text.png");
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
uv1.x = (16.0f/256.0f)*(icon%16);
@@ -1423,7 +1422,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);
}
}
@@ -1433,7 +1432,9 @@ void CEdit::FreeImage()
void CEdit::LoadImage(std::string name)
{
std::string filename;
- filename = GetProfile().GetUserBasedPath(name, "../icons") + ".png";
+ filename = name + ".png";
+ filename = CLevelParserParam::InjectLevelDir(filename, "icons");
+ boost::replace_all(filename, "\\", "/"); //TODO: Fix this in files
m_engine->LoadTexture(filename);
}
@@ -1441,7 +1442,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];
@@ -1450,27 +1450,18 @@ bool CEdit::ReadText(std::string filename, int addSize)
InputSlot slot;
bool bInSoluce, bBOL;
- 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))
+ if ( filename == "" ) return false;
+
+ CInputStream stream;
+ stream.open(filename);
+
+ 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());
+ CLogger::GetInstancePointer()->Error("Failed to load text file %s\n", filename.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;
@@ -1479,8 +1470,7 @@ bool CEdit::ReadText(std::string filename, int addSize)
FreeImage();
- if (m_text != nullptr)
- delete[] m_text;
+ delete[] m_text;
m_text = new char[m_maxChar+1];
memset(m_text, 0, m_maxChar+1);
@@ -1488,7 +1478,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);
@@ -1497,7 +1487,7 @@ bool CEdit::ReadText(std::string filename, int addSize)
m_format.push_back(0);
}
- fclose(file);
+ stream.close();
bInSoluce = false;
font = m_fontType;
@@ -1891,14 +1881,19 @@ bool CEdit::ReadText(std::string filename, int addSize)
bool CEdit::WriteText(std::string filename)
{
- FILE* file;
char buffer[1000+20];
int i, j, k, n;
float iDim = 0.0f;
if ( filename[0] == 0 ) return false;
- file = fopen(filename.c_str(), "wb");
- if ( file == NULL ) return false;
+
+ COutputStream stream;
+ stream.open(filename);
+
+ if (!stream.is_open())
+ {
+ return false;
+ }
if ( m_bAutoIndent )
{
@@ -1929,7 +1924,7 @@ bool CEdit::WriteText(std::string filename)
if ( j >= 1000-1 )
{
- fwrite(buffer, 1, j, file);
+ stream.write(buffer, j);
j = 0;
}
@@ -1937,10 +1932,10 @@ bool CEdit::WriteText(std::string filename)
}
if ( j > 0 )
{
- fwrite(buffer, 1, j, file);
+ stream.write(buffer, j);
}
- fclose(file);
+ stream.close();
if ( m_bAutoIndent )
{
@@ -1958,8 +1953,7 @@ void CEdit::SetMaxChar(int max)
{
FreeImage();
- if (m_text != nullptr)
- delete[] m_text;
+ delete[] m_text;
m_maxChar = max;
diff --git a/src/ui/edit.h b/src/ui/edit.h
index 9484fc8..cbad394 100644
--- a/src/ui/edit.h
+++ b/src/ui/edit.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
diff --git a/src/ui/editvalue.cpp b/src/ui/editvalue.cpp
index 3fb9b79..676f2a6 100644
--- a/src/ui/editvalue.cpp
+++ b/src/ui/editvalue.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/editvalue.h"
diff --git a/src/ui/editvalue.h b/src/ui/editvalue.h
index 2734847..3011d55 100644
--- a/src/ui/editvalue.h
+++ b/src/ui/editvalue.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// editvalue.h
diff --git a/src/ui/gauge.cpp b/src/ui/gauge.cpp
index a8ee41c..92f4d7c 100644
--- a/src/ui/gauge.cpp
+++ b/src/ui/gauge.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/gauge.h"
@@ -75,7 +77,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/gauge.h b/src/ui/gauge.h
index 3dbeef8..798171f 100644
--- a/src/ui/gauge.h
+++ b/src/ui/gauge.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// gauge.h
diff --git a/src/ui/group.cpp b/src/ui/group.cpp
index 64495e0..e924ea6 100644
--- a/src/ui/group.cpp
+++ b/src/ui/group.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/group.h"
@@ -87,7 +90,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 +106,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 +120,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 +134,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 +148,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 +162,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 +176,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 +192,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 +206,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 +220,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 +234,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 +248,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 +265,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 +304,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 +325,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 +346,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 +367,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 +388,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 +404,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 +418,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 +432,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 +446,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 +460,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 +477,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 +493,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 +509,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 +525,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 +541,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 +559,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 +571,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/group.h b/src/ui/group.h
index 89996cc..e12bf78 100644
--- a/src/ui/group.h
+++ b/src/ui/group.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// group.h
diff --git a/src/ui/image.cpp b/src/ui/image.cpp
index 8f9b5ca..89e1fd2 100644
--- a/src/ui/image.cpp
+++ b/src/ui/image.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/image.h"
@@ -110,7 +112,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
@@ -127,8 +129,10 @@ void CImage::Draw()
if ( m_filename[0] != 0 ) // displays an image?
{
- m_engine->LoadTexture(m_filename);
- m_engine->SetTexture(m_filename);
+ std::string texFilename = m_filename;
+ texFilename = "textures/"+texFilename;
+ m_engine->LoadTexture(texFilename.c_str());
+ m_engine->SetTexture(texFilename);
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
pos = m_pos;
dim = m_dim;
diff --git a/src/ui/image.h b/src/ui/image.h
index fd71e33..cff43a8 100644
--- a/src/ui/image.h
+++ b/src/ui/image.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// image.h
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index ab2c01b..bd25bee 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/interface.h"
@@ -49,11 +51,8 @@ void CInterface::Flush()
{
for (int i = 0; i < MAXCONTROL; i++)
{
- if (m_table[i] != nullptr)
- {
- delete m_table[i];
- m_table[i] = nullptr;
- }
+ delete m_table[i];
+ m_table[i] = nullptr;
}
}
diff --git a/src/ui/interface.h b/src/ui/interface.h
index d5734f0..f3e81bb 100644
--- a/src/ui/interface.h
+++ b/src/ui/interface.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// interface.h
diff --git a/src/ui/key.cpp b/src/ui/key.cpp
index aacc8d8..fd9a77f 100644
--- a/src/ui/key.cpp
+++ b/src/ui/key.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/key.h"
@@ -136,7 +138,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/key.h b/src/ui/key.h
index d8e935c..0cc8a4c 100644
--- a/src/ui/key.h
+++ b/src/ui/key.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/**
* \file ui/key.h
diff --git a/src/ui/label.cpp b/src/ui/label.cpp
index 76a95f2..f4d0119 100644
--- a/src/ui/label.cpp
+++ b/src/ui/label.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/label.h"
diff --git a/src/ui/label.h b/src/ui/label.h
index 305aca2..36b6da1 100644
--- a/src/ui/label.h
+++ b/src/ui/label.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// label.h
diff --git a/src/ui/list.cpp b/src/ui/list.cpp
index f6c3ed9..9611533 100644
--- a/src/ui/list.cpp
+++ b/src/ui/list.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/list.h"
@@ -61,12 +63,10 @@ CList::~CList()
{
for (int i = 0; i < LISTMAXDISPLAY; i++)
{
- if (m_button[i] != nullptr)
- delete m_button[i];
+ delete m_button[i];
}
- if (m_scroll != nullptr)
- delete m_scroll;
+ delete m_scroll;
}
@@ -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/list.h b/src/ui/list.h
index a2e033f..4632f76 100644
--- a/src/ui/list.h
+++ b/src/ui/list.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// list.h
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index 11f8f4a..0bb1e36 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -1,24 +1,26 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/maindialog.h"
#include "app/app.h"
-#include "app/gamedata.h"
#include "app/system.h"
#include "common/config.h"
@@ -30,6 +32,12 @@
#include "common/restext.h"
#include "common/stringutils.h"
+#include "common/resources/resourcemanager.h"
+#include "common/resources/inputstream.h"
+#include "common/resources/outputstream.h"
+
+#include "object/level/parser.h"
+
#include "object/robotmain.h"
#include "script/cmdtoken.h"
@@ -162,6 +170,7 @@ CMainDialog::CMainDialog()
m_bCameraInvertX = false;
m_bCameraInvertY = false;
m_bEffect = true;
+ m_bBlood = true;
m_shotDelay = 0;
m_glintMouse = Math::Point(0.0f, 0.0f);
@@ -173,18 +182,10 @@ CMainDialog::CMainDialog()
m_partiTime[i] = 0.0f;
}
-
- m_sceneDir = "levels";
-
- #if DEV_BUILD
m_savegameDir = "savegame";
- #else
- m_savegameDir = GetSystemUtils()->GetSavegameDirectoryLocation();
- #endif
-
- m_publicDir = "program";
- m_userDir = "user";
- m_filesDir = m_savegameDir;
+ m_publicDir = CResourceManager::GetSaveLocation()+"/program"; //TODO: Refactor to use PHYSFS
+ m_filesDir = CResourceManager::GetSaveLocation()+"/files"; //TODO: Refactor to use PHYSFS
+ CLogger::GetInstancePointer()->Trace("Savegame path: normal=%s, physfs=%s\n", GetSavegameDir().c_str(), GetPHYSFSSavegameDir().c_str());
m_setupFull = m_app->GetVideoConfig().fullScreen;
@@ -315,7 +316,6 @@ void CMainDialog::ChangePhase(Phase phase)
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_QUIT);
pb->SetState(STATE_SHADOW);
- #if DEV_BUILD
if ( m_accessEnable && m_accessUser )
{
pos.x = 447.0f/640.0f;
@@ -323,8 +323,22 @@ void CMainDialog::ChangePhase(Phase phase)
ddim.x = 0.09f;
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_USER);
pb->SetState(STATE_SHADOW);
+
+ try {
+ CLevelParser* level = new CLevelParser("levels/custom/config.txt");
+ if(level->Exists()) {
+ level->Load();
+ CLevelParserLine* line = level->Get("Button");
+ if(line->GetParam("name")->IsDefined())
+ pb->SetName(line->GetParam("name")->AsString());
+ if(line->GetParam("tooltip")->IsDefined())
+ pb->SetTooltip(line->GetParam("tooltip")->AsString());
+ }
+ }
+ catch(CLevelParserException& e) {
+ CLogger::GetInstancePointer()->Error("Failed loading userlevel button name: %s\n", e.what());
+ }
}
- #endif
/*pos.x = 139.0f/640.0f;
pos.y = 313.0f/480.0f;
@@ -339,11 +353,11 @@ void CMainDialog::ChangePhase(Phase phase)
pg = pw->CreateGroup(pos, ddim, 1, EVENT_LABEL1);
pg->SetState(STATE_SHADOW);
pos.y -= 5.0f/480.0f;
- pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, "PPC Team");
+ pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, "TerranovaTeam");
pl->SetFontType(Gfx::FONT_COURIER);
pl->SetFontSize(Gfx::FONT_SIZE_SMALL);
- m_engine->SetBackground("interface.png",
+ m_engine->SetBackground("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),
@@ -450,7 +464,7 @@ void CMainDialog::ChangePhase(Phase phase)
UpdateNameControl();
UpdateNameFace();
- m_engine->SetBackground("interface.png",
+ m_engine->SetBackground("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),
@@ -693,7 +707,7 @@ void CMainDialog::ChangePhase(Phase phase)
m_phase != PHASE_SETUPcs &&
m_phase != PHASE_SETUPss )
{
- if (!m_sound->IsPlayingMusic())
+ if (!m_sound->IsPlayingMusic() && m_sound->IsCachedMusic("Intro1.ogg"))
{
m_sound->PlayMusic("Intro1.ogg", false);
}
@@ -703,7 +717,6 @@ void CMainDialog::ChangePhase(Phase phase)
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;
@@ -711,21 +724,19 @@ void CMainDialog::ChangePhase(Phase phase)
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 )
{
- strcpy(m_sceneName, "scene");
+ strcpy(m_sceneName, "missions");
ReadGamerInfo();
m_accessChap = GetChapPassed();
}
- if ( m_phase == PHASE_TRAINER ) strcpy(m_sceneName, "train");
- if ( m_phase == PHASE_DEFI ) strcpy(m_sceneName, "defi" );
- if ( m_phase == PHASE_MISSION ) strcpy(m_sceneName, "scene");
- if ( m_phase == PHASE_FREE ) strcpy(m_sceneName, "free");
- if ( m_phase == PHASE_TEEN ) strcpy(m_sceneName, "teen");
- if ( m_phase == PHASE_USER ) strcpy(m_sceneName, "user");
+ if ( m_phase == PHASE_TRAINER ) strcpy(m_sceneName, "exercises");
+ 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_USER ) strcpy(m_sceneName, "custom");
ReadGamerInfo();
@@ -739,7 +750,6 @@ void CMainDialog::ChangePhase(Phase phase)
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);
@@ -764,7 +774,6 @@ void CMainDialog::ChangePhase(Phase phase)
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);
@@ -787,7 +796,6 @@ void CMainDialog::ChangePhase(Phase phase)
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);
@@ -824,8 +832,7 @@ void CMainDialog::ChangePhase(Phase phase)
// 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;
@@ -882,7 +889,7 @@ void CMainDialog::ChangePhase(Phase phase)
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_BACK);
pb->SetState(STATE_SHADOW);
- m_engine->SetBackground("interface.png",
+ m_engine->SetBackground("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),
@@ -962,6 +969,9 @@ void CMainDialog::ChangePhase(Phase phase)
pb->SetState(STATE_SHADOW);
pb->SetState(STATE_CARD);
pb->SetState(STATE_CHECK, (m_phase == PHASE_SETUPd || m_phase == PHASE_SETUPds));
+ #if PLATFORM_WINDOWS
+ pb->SetState(STATE_ENABLE, !m_bSimulSetup);
+ #endif
pos.x += ddim.x+0.01f;
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_SETUPg);
@@ -1007,7 +1017,7 @@ void CMainDialog::ChangePhase(Phase phase)
if ( !m_bSimulSetup )
{
- m_engine->SetBackground("interface.png",
+ m_engine->SetBackground("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),
@@ -1044,6 +1054,14 @@ void CMainDialog::ChangePhase(Phase phase)
pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_FULL);
pc->SetState(STATE_SHADOW);
pc->SetState(STATE_CHECK, m_setupFull);
+
+ #if !PLATFORM_LINUX
+ ddim.x = 0.9f;
+ ddim.y = 0.1f;
+ pos.x = 0.05f;
+ pos.y = 0.20f;
+ pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, "The game will be restarted in order to apply changes. All unsaved progress will be lost.");
+ #endif
ddim.x = dim.x*6;
ddim.y = dim.y*1;
@@ -1223,6 +1241,9 @@ void CMainDialog::ChangePhase(Phase phase)
pos.y -= 0.048f;
pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_EFFECT);
pc->SetState(STATE_SHADOW);
+ pos.y -= 0.048f;
+ pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_BLOOD);
+ pc->SetState(STATE_SHADOW);
//? pos.y -= 0.048f;
//? pc = pw->CreateCheck(pos, ddim, -1, EVENT_INTERFACE_NICERST);
//? pc->SetState(STATE_SHADOW);
@@ -1496,7 +1517,7 @@ void CMainDialog::ChangePhase(Phase phase)
if ( m_phase == PHASE_READ )
{
- m_engine->SetBackground("interface.png",
+ m_engine->SetBackground("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),
@@ -1543,7 +1564,7 @@ void CMainDialog::ChangePhase(Phase phase)
pl->SetFontSize(12.0f);
pl->SetTextAlign(Gfx::TEXT_ALIGN_CENTER);
- m_engine->SetBackground("interface.png",
+ m_engine->SetBackground("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),
@@ -1565,7 +1586,7 @@ void CMainDialog::ChangePhase(Phase phase)
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("interface/intro1.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),
@@ -1584,7 +1605,7 @@ void CMainDialog::ChangePhase(Phase phase)
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("interface/intro2.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),
@@ -1603,7 +1624,7 @@ void CMainDialog::ChangePhase(Phase phase)
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("interface/intro3.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),
@@ -1669,7 +1690,7 @@ void CMainDialog::ChangePhase(Phase phase)
pb = pw->CreateButton(pos, ddim, 49, EVENT_INTERFACE_ABORT);
pb->SetState(STATE_SHADOW);
- m_engine->SetBackground("generico.png",
+ m_engine->SetBackground("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),
@@ -1684,7 +1705,6 @@ void CMainDialog::ChangePhase(Phase phase)
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 ||
@@ -1740,7 +1760,7 @@ bool CMainDialog::EventProcess(const Event &event)
m_phase != PHASE_SETUPcs &&
m_phase != PHASE_SETUPss )
{
- if (!m_sound->IsPlayingMusic())
+ if (!m_sound->IsPlayingMusic() && m_sound->IsCachedMusic("Intro2.ogg"))
{
m_sound->PlayMusic("Intro2.ogg", true);
}
@@ -1880,6 +1900,9 @@ bool CMainDialog::EventProcess(const Event &event)
{
StopDialog();
StartSuspend();
+ #if PLATFORM_WINDOWS
+ if ( m_phaseSetup == PHASE_SETUPd ) m_phaseSetup = PHASE_SETUPg;
+ #endif
if ( m_phaseSetup == PHASE_SETUPd ) ChangePhase(PHASE_SETUPds);
if ( m_phaseSetup == PHASE_SETUPg ) ChangePhase(PHASE_SETUPgs);
if ( m_phaseSetup == PHASE_SETUPp ) ChangePhase(PHASE_SETUPps);
@@ -1948,10 +1971,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;
@@ -2158,7 +2177,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));
@@ -2177,7 +2195,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 )
@@ -2320,7 +2337,6 @@ bool CMainDialog::EventProcess(const Event &event)
{
switch( event.type )
{
- case EVENT_LIST1:
case EVENT_LIST2:
UpdateApply();
break;
@@ -2352,8 +2368,7 @@ bool CMainDialog::EventProcess(const Event &event)
if ( pb == 0 ) break;
pb->ClearState(STATE_PRESS);
pb->ClearState(STATE_HILIGHT);
- // TODO: uncomment when changing display is implemented
- //ChangeDisplay();
+ ChangeDisplay();
UpdateApply();
break;
@@ -2554,6 +2569,13 @@ bool CMainDialog::EventProcess(const Event &event)
UpdateSetupButtons();
break;
+ case EVENT_INTERFACE_BLOOD:
+ m_bBlood = !m_bBlood;
+ m_camera->SetBlood(m_bBlood);
+ ChangeSetupButtons();
+ UpdateSetupButtons();
+ break;
+
default:
break;
}
@@ -2820,7 +2842,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));
@@ -3045,7 +3066,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 ||
@@ -3286,40 +3306,15 @@ void CMainDialog::NiceParticle(Math::Point mouse, bool bPress)
-// Specifies the special user folder if needed.
-
-void CMainDialog::SetUserDir(char *base, int rank)
-{
- std::string dir;
-
- if ( strcmp(base, "user") == 0 && rank >= 100 )
- {
- dir = m_userDir + "/" + m_userList.at(rank/100-1);
- GetProfile().SetUserDir(dir);
- }
- else
- {
- GetProfile().SetUserDir("");
- }
-}
-
// Builds the file name of a mission.
-void CMainDialog::BuildSceneName(std::string &filename, char *base, int rank)
+void CMainDialog::BuildSceneName(std::string &filename, char *base, int rank, bool sceneFile)
{
- std::ostringstream rankStream;
- if ( strcmp(base, "user") == 0 )
- {
- //TODO: Change this to point user dir according to operating system
- rankStream << std::setfill('0') << std::setw(2) << rank%100;
- filename = m_userDir + "/" + m_userList[rank/100-1] + "/" + rankStream.str() + ".txt";
- }
- else
- {
- rankStream << std::setfill('0') << std::setw(3) << rank;
- filename = base + rankStream.str() + ".txt";
- filename = CGameData::GetInstancePointer()->GetFilePath(DIR_LEVEL, filename);
- }
+ //TODO: Support for more than 9 chapters
+ int chapter = rank/100;
+ int new_rank = rank%100;
+
+ filename = CLevelParser::BuildSceneName(std::string(base), chapter, new_rank, sceneFile);
}
// Built the default descriptive name of a mission.
@@ -3357,13 +3352,13 @@ void CMainDialog::ReadNameList()
try
{
- if (! fs::exists(m_savegameDir) && fs::is_directory(m_savegameDir))
+ if (! fs::exists(GetSavegameDir()) && fs::is_directory(GetSavegameDir()))
{
GetLogger()->Error("Savegame dir does not exist %s\n",dir);
}
else
{
- fs::directory_iterator dirIt(m_savegameDir), dirEndIt;
+ fs::directory_iterator dirIt(GetSavegameDir()), dirEndIt;
for (; dirIt != dirEndIt; ++dirIt)
{
@@ -3557,7 +3552,7 @@ void CMainDialog::NameSelect()
GetGamerFace(m_main->GetGamerName());
- GetProfile().SetLocalProfileString("Gamer", "LastName", m_main->GetGamerName());
+ GetProfile().SetStringProperty("Gamer", "LastName", m_main->GetGamerName());
}
// Creates a new player.
@@ -3571,7 +3566,7 @@ void CMainDialog::NameCreate()
char c;
int len, i, j;
- GetLogger()->Debug("Creating new player\n");
+ GetLogger()->Info("Creating new player\n");
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == 0 ) return;
pe = static_cast<CEdit*>(pw->SearchControl(EVENT_INTERFACE_NEDIT));
@@ -3608,13 +3603,16 @@ void CMainDialog::NameCreate()
return;
}
- // TODO: _mkdir(m_savegameDir); // if does not exist yet!
-
- dir = m_savegameDir + "/" + name;
+ if(!CResourceManager::DirectoryExists(GetPHYSFSSavegameDir()))
+ CResourceManager::CreateDirectory(GetPHYSFSSavegameDir());
+
+ dir = GetSavegameDir() + "/" + name;
if (!fs::exists(dir))
{
fs::create_directories(dir);
+ if(!CResourceManager::DirectoryExists(GetPHYSFSSavegameDir()+"/"+name))
+ CResourceManager::CreateDirectory(GetPHYSFSSavegameDir()+"/"+name);
}
else
{
@@ -3681,7 +3679,7 @@ void CMainDialog::NameDelete()
gamer = pl->GetItemName(sel);
// Deletes all the contents of the file.
- sprintf(dir, "%s/%s", m_savegameDir.c_str(), gamer);
+ sprintf(dir, "%s/%s", GetSavegameDir().c_str(), gamer);
if ( !RemoveDir(dir) )
{
m_sound->Play(SOUND_TZOING);
@@ -3994,7 +3992,7 @@ bool CMainDialog::IsIOReadScene()
{
fs::directory_iterator end_iter;
- fs::path saveDir(m_savegameDir + "/" + m_main->GetGamerName());
+ fs::path saveDir(GetSavegameDir() + "/" + m_main->GetGamerName());
if (fs::exists(saveDir) && fs::is_directory(saveDir))
{
for( fs::directory_iterator dir_iter(saveDir) ; dir_iter != end_iter ; ++dir_iter)
@@ -4013,7 +4011,6 @@ bool CMainDialog::IsIOReadScene()
void CMainDialog::IOReadName()
{
- FILE* file;
CWindow* pw;
CEdit* pe;
std::string filename;
@@ -4035,10 +4032,12 @@ void CMainDialog::IOReadName()
sprintf(op, "Title.E");
sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar() );
- file = fopen(filename.c_str(), "r");
- if ( file != NULL )
+ CInputStream stream;
+ stream.open(filename);
+
+ if (stream.is_open())
{
- while ( fgets(line, 500, file) != NULL )
+ while (stream.getline(line, 500))
{
for ( i=0 ; i<500 ; i++ )
{
@@ -4060,7 +4059,7 @@ void CMainDialog::IOReadName()
break;
}
}
- fclose(file);
+ stream.close();
}
time(&now);
@@ -4090,7 +4089,7 @@ void CMainDialog::IOReadList()
pl->Flush();
- fs::path saveDir(m_savegameDir + "/" + m_main->GetGamerName());
+ fs::path saveDir(GetSavegameDir() + "/" + m_main->GetGamerName());
m_saveList.clear();
if (fs::exists(saveDir) && fs::is_directory(saveDir))
@@ -4167,6 +4166,11 @@ void CMainDialog::IOUpdateList()
return;
std::string filename = (m_saveList.at(sel) / "screen.png").make_preferred().string();
+ std::string savedir = CResourceManager::GetSaveLocation()+"/";
+ boost::replace_all(filename, "\\", "/");
+ boost::replace_all(savedir, "\\", "/");
+ boost::replace_all(filename, savedir, ""); //TODO: Refactor everything to PHYSFS, see issue #334
+ filename = "../"+filename;
if ( m_phase == PHASE_WRITE || m_phase == PHASE_WRITEs )
{
if ( sel < max-1 )
@@ -4267,7 +4271,7 @@ bool CMainDialog::IOWriteScene()
pe->GetText(info, 100);
if (static_cast<unsigned int>(sel) >= m_saveList.size())
{
- dir = fs::path(m_savegameDir) / m_main->GetGamerName() / ("save" + clearName(info));
+ dir = fs::path(GetSavegameDir()) / m_main->GetGamerName() / ("save" + clearName(info));
}
else
{
@@ -4394,7 +4398,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]);
@@ -4406,22 +4409,15 @@ void CMainDialog::AllMissionUpdate()
void CMainDialog::UpdateSceneChap(int &chap)
{
- FILE* file = NULL;
CWindow* pw;
CList* pl;
- //struct _finddata_t fileBuffer;
+
std::string fileName;
- char op[100];
- char op_i18n[100];
char line[500];
- char name[100];
- int i, j;
+ int j;
bool bPassed;
- memset(op, 0, 100);
- memset(op_i18n, 0, 100);
memset(line, 0, 500);
- memset(name, 0, 100);
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == 0 ) return;
@@ -4433,100 +4429,44 @@ void CMainDialog::UpdateSceneChap(int &chap)
if ( m_phase == PHASE_USER )
{
j = 0;
- fs::directory_iterator dirIt(m_savegameDir), dirEndIt;
- m_userList.clear();
-
- for (; dirIt != dirEndIt; ++dirIt)
- {
- const fs::path& p = *dirIt;
- if (fs::is_directory(p))
- {
- m_userList.push_back(p.leaf().string());
- }
- }
+ auto userLevelDirs = CResourceManager::ListDirectories("levels/custom/");
+ std::sort(userLevelDirs.begin(), userLevelDirs.end());
+ m_userList = userLevelDirs;
m_userTotal = m_userList.size();
for ( j=0 ; j<m_userTotal ; j++ )
{
- BuildSceneName(fileName, m_sceneName, (j+1)*100);
- file = fopen(fileName.c_str(), "r");
- if ( file == NULL )
- {
- strcpy(name, m_userList[j].c_str());
+ try {
+ CLevelParser* level = new CLevelParser("custom", j+1, 0);
+ level->Load();
+ pl->SetItemName(j, level->Get("Title")->GetParam("text")->AsString().c_str());
+ pl->SetEnable(j, true);
+ delete level;
}
- else
+ catch(CLevelParserException& e)
{
- BuildResumeName(name, m_sceneName, j+1); // default name
- sprintf(op, "Title.E");
- sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar());
-
- while ( fgets(line, 500, file) != NULL )
- {
- for ( i=0 ; i<500 ; i++ )
- {
- if ( line[i] == '\t' ) line[i] = ' '; // replaces tab by space
- if ( line[i] == '/' && line[i+1] == '/' )
- {
- line[i] = 0;
- break;
- }
- }
-
- if ( Cmd(line, op) )
- {
- OpString(line, "text", name);
- }
- if ( Cmd(line, op_i18n) )
- {
- OpString(line, "text", name);
- break;
- }
- }
- fclose(file);
+ pl->SetItemName(j, (std::string("[ERROR]: ")+e.what()).c_str());
+ pl->SetEnable(j, false);
}
-
- pl->SetItemName(j, name);
- pl->SetEnable(j, true);
}
}
else
{
for ( j=0 ; j<9 ; j++ )
{
- BuildSceneName(fileName, m_sceneName, (j+1)*100);
- file = fopen(fileName.c_str(), "r");
- if ( file == NULL ) break;
-
- BuildResumeName(name, m_sceneName, j+1); // default name
- sprintf(op, "Title.E");
- sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar());
-
- while ( fgets(line, 500, file) != NULL )
- {
- for ( i=0 ; i<500 ; i++ )
- {
- if ( line[i] == '\t' ) line[i] = ' '; // replaces tab by space
- if ( line[i] == '/' && line[i+1] == '/' )
- {
- line[i] = 0;
- break;
- }
- }
-
- if ( Cmd(line, op) )
- {
- OpString(line, "text", name);
- }
- if ( Cmd(line, op_i18n) )
- {
- OpString(line, "text", name);
- break;
- }
+ CLevelParser* level = new CLevelParser(m_sceneName, j+1, 0);
+ if(!level->Exists())
+ break;
+ try {
+ level->Load();
+ sprintf(line, "%d: %s", j+1, level->Get("Title")->GetParam("text")->AsString().c_str());
+ }
+ catch(CLevelParserException& e) {
+ sprintf(line, "%s", (std::string("[ERROR]: ")+e.what()).c_str());
}
- fclose(file);
+ delete level;
bPassed = GetGamerInfoPassed((j+1)*100);
- sprintf(line, "%d: %s", j+1, name);
pl->SetItemName(j, line);
pl->SetCheck(j, bPassed);
pl->SetEnable(j, true);
@@ -4555,21 +4495,14 @@ void CMainDialog::UpdateSceneChap(int &chap)
void CMainDialog::UpdateSceneList(int chap, int &sel)
{
- FILE* file = NULL;
CWindow* pw;
CList* pl;
std::string fileName;
- char op[100];
- char op_i18n[100];
char line[500];
- char name[100];
- int i, j;
+ int j;
bool bPassed;
- memset(op, 0, 100);
- memset(op_i18n, 0, 100);
memset(line, 0, 500);
- memset(name, 0, 100);
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == 0 ) return;
@@ -4577,64 +4510,47 @@ void CMainDialog::UpdateSceneList(int chap, int &sel)
if ( pl == 0 ) return;
pl->Flush();
+
+ if(chap < 0) return;
+ bool readAll = true;
for ( j=0 ; j<99 ; j++ )
{
- BuildSceneName(fileName, m_sceneName, (chap+1)*100+(j+1));
- file = fopen(fileName.c_str(), "r");
- if ( file == NULL ) break;
-
- BuildResumeName(name, m_sceneName, j+1); // default name
- sprintf(op, "Title.E");
- sprintf(op_i18n, "Title.%c", m_app->GetLanguageChar());
-
- while ( fgets(line, 500, file) != NULL )
- {
- for ( i=0 ; i<500 ; i++ )
- {
- if ( line[i] == '\t' ) line[i] = ' '; // replaces tab by space
- if ( line[i] == '/' && line[i+1] == '/' )
- {
- line[i] = 0;
- break;
- }
- }
-
- if ( Cmd(line, op) )
- {
- OpString(line, "text", name);
- }
- if ( Cmd(line, op_i18n) )
- {
- OpString(line, "text", name);
+ CLevelParser* level = new CLevelParser(m_sceneName, chap+1, j+1);
+ if(!level->Exists()) {
+ readAll = true;
+ break;
+ } else {
+ if(!readAll)
break;
- }
}
- fclose(file);
+ try {
+ level->Load();
+ sprintf(line, "%d: %s", j+1, level->Get("Title")->GetParam("text")->AsString().c_str());
+ }
+ catch(CLevelParserException& e) {
+ sprintf(line, "%s", (std::string("[ERROR]: ")+e.what()).c_str());
+ }
+ delete level;
bPassed = GetGamerInfoPassed((chap+1)*100+(j+1));
- sprintf(line, "%d: %s", j+1, name);
pl->SetItemName(j, line);
pl->SetCheck(j, bPassed);
pl->SetEnable(j, true);
if ( m_phase == PHASE_MISSION && !m_main->GetShowAll() && !bPassed )
{
- j ++;
- break;
+ readAll = false;
}
}
- BuildSceneName(fileName, m_sceneName, (chap+1)*100+(j+1));
- file = fopen(fileName.c_str(), "r");
- if ( file == NULL )
+ if(readAll)
{
m_maxList = j;
}
else
{
m_maxList = j+1; // this is not the last!
- fclose(file);
}
if ( sel > j-1 ) sel = j-1;
@@ -4655,7 +4571,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;
@@ -4686,16 +4601,11 @@ void CMainDialog::ShowSoluceUpdate()
void CMainDialog::UpdateSceneResume(int rank)
{
- FILE* file = NULL;
CWindow* pw;
CEdit* pe;
CCheck* pc;
std::string fileName;
- char op[100];
- char op_i18n[100];
- char line[500];
- char name[500];
- int i, numTry;
+ int numTry;
bool bPassed, bVisible;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
@@ -4721,80 +4631,18 @@ void CMainDialog::UpdateSceneResume(int rank)
m_bSceneSoluce = false;
}
}
-
- BuildSceneName(fileName, m_sceneName, rank);
- sprintf(op, "Resume.E");
- sprintf(op_i18n, "Resume.%c", m_app->GetLanguageChar());
-
- file = fopen(fileName.c_str(), "r");
- if ( file == NULL ) return;
-
- name[0] = 0;
- while ( fgets(line, 500, file) != NULL )
- {
- for ( i=0 ; i<500 ; i++ )
- {
- if (line[i] == 0)
- break;
-
- if ( line[i] == '\t' ) line[i] = ' '; // replaces tab by space
- if ( line[i] == '/' && line[i+1] == '/' )
- {
- line[i] = 0;
- break;
- }
- }
-
- if ( Cmd(line, op) )
- {
- OpString(line, "text", name);
- }
- if ( Cmd(line, op_i18n) )
- {
- OpString(line, "text", name);
- break;
- }
+
+ if(rank<100) return;
+
+ try {
+ CLevelParser* level = new CLevelParser(m_sceneName, rank/100, rank%100);
+ level->Load();
+ pe->SetText(level->Get("Resume")->GetParam("text")->AsString().c_str());
}
- fclose(file);
-
- pe->SetText(name);
-}
-
-// Updates the list of devices.
-
-void CMainDialog::UpdateDisplayDevice()
-{
- CWindow* pw;
- CList* pl;
- char bufDevices[1000];
- //char bufModes[5000];
- int i, j;
-
- pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
- if ( pw == 0 ) return;
- pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST1));
- if ( pl == 0 ) return;
- pl->Flush();
-
- //bufModes[0] = 0;
- /* TODO: remove device choice
- m_engine->EnumDevices(bufDevices, 1000,
- bufModes, 5000,
- totalDevices, selectDevices,
- totalModes, selectModes);*/
-
- i = 0;
- j = 0;
- while ( bufDevices[i] != 0 )
+ catch(CLevelParserException& e)
{
- pl->SetItemName(j++, bufDevices+i);
- while ( bufDevices[i++] != 0 );
+ pe->SetText((std::string("[ERROR]: ")+e.what()).c_str());
}
-
- pl->SetSelect(0);
- pl->ShowSelect(false);
-
- m_setupSelDevice = 0;
}
// Updates the list of modes.
@@ -4832,36 +4680,35 @@ void CMainDialog::ChangeDisplay()
CWindow* pw;
CList* pl;
CCheck* pc;
- //char* device;
- //char* mode;
bool bFull;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == 0 ) return;
- pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST1));
- if ( pl == 0 ) return;
- m_setupSelDevice = pl->GetSelect();
- //device = pl->GetItemName(m_setupSelDevice);
-
pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST2));
if ( pl == 0 ) return;
m_setupSelMode = pl->GetSelect();
- //mode = pl->GetItemName(m_setupSelMode);
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_FULL));
if ( pc == 0 ) return;
bFull = pc->TestState(STATE_CHECK);
m_setupFull = bFull;
-
- // TODO: remove device choice
- // m_engine->ChangeDevice(device, mode, bFull);
-
- if ( m_bSimulSetup )
- {
- m_main->ChangeColor();
- m_main->UpdateMap();
- }
+
+ SetupMemorize();
+
+ #if !PLATFORM_LINUX
+ // Windows causes problems, so we'll restart the game
+ // Mac OS was not tested so let's restart just to be sure
+ m_app->Restart();
+ #else
+ std::vector<Math::IntPoint> modes;
+ m_app->GetVideoResolutionList(modes, true, true);
+
+ Gfx::GLDeviceConfig config = m_app->GetVideoConfig();
+ config.size = modes[m_setupSelMode];
+ config.fullScreen = bFull;
+ m_app->ChangeVideoConfig(config);
+ #endif
}
@@ -4874,18 +4721,13 @@ void CMainDialog::UpdateApply()
CButton* pb;
CList* pl;
CCheck* pc;
- int sel1, sel2;
+ int sel2;
bool bFull;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == 0 ) return;
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_APPLY));
- if ( pb == 0 ) return;
-
- pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST1));
- if ( pl == 0 ) return;
- sel1 = pl->GetSelect();
pl = static_cast<CList*>(pw->SearchControl(EVENT_LIST2));
if ( pl == 0 ) return;
@@ -4894,8 +4736,7 @@ void CMainDialog::UpdateApply()
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_FULL));
bFull = pc->TestState(STATE_CHECK);
- if ( sel1 == m_setupSelDevice &&
- sel2 == m_setupSelMode &&
+ if ( sel2 == m_setupSelMode &&
bFull == m_setupFull )
{
pb->ClearState(STATE_ENABLE);
@@ -5011,6 +4852,12 @@ void CMainDialog::UpdateSetupButtons()
pc->SetState(STATE_CHECK, m_bEffect);
}
+ pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_BLOOD));
+ if ( pc != 0 )
+ {
+ pc->SetState(STATE_CHECK, m_bBlood);
+ }
+
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_SHADOW));
if ( pc != 0 )
{
@@ -5182,46 +5029,45 @@ void CMainDialog::ChangeSetupButtons()
void CMainDialog::SetupMemorize()
{
- GetProfile().SetLocalProfileString("Directory", "scene", m_sceneDir);
- GetProfile().SetLocalProfileString("Directory", "savegame", m_savegameDir);
- GetProfile().SetLocalProfileString("Directory", "public", m_publicDir);
- GetProfile().SetLocalProfileString("Directory", "user", m_userDir);
- GetProfile().SetLocalProfileString("Directory", "files", m_filesDir);
- GetProfile().SetLocalProfileInt("Setup", "Tooltips", m_bTooltip);
- GetProfile().SetLocalProfileInt("Setup", "InterfaceGlint", m_bGlint);
- GetProfile().SetLocalProfileInt("Setup", "InterfaceGlint", m_bRain);
- GetProfile().SetLocalProfileInt("Setup", "Soluce4", m_bSoluce4);
- GetProfile().SetLocalProfileInt("Setup", "Movies", m_bMovies);
- GetProfile().SetLocalProfileInt("Setup", "NiceReset", m_bNiceReset);
- GetProfile().SetLocalProfileInt("Setup", "HimselfDamage", m_bHimselfDamage);
- GetProfile().SetLocalProfileInt("Setup", "CameraScroll", m_bCameraScroll);
- GetProfile().SetLocalProfileInt("Setup", "CameraInvertX", m_bCameraInvertX);
- GetProfile().SetLocalProfileInt("Setup", "CameraInvertY", m_bCameraInvertY);
- GetProfile().SetLocalProfileInt("Setup", "InterfaceEffect", m_bEffect);
- GetProfile().SetLocalProfileInt("Setup", "GroundShadow", m_engine->GetShadow());
- GetProfile().SetLocalProfileInt("Setup", "GroundSpot", m_engine->GetGroundSpot());
- GetProfile().SetLocalProfileInt("Setup", "ObjectDirty", m_engine->GetDirty());
- GetProfile().SetLocalProfileInt("Setup", "FogMode", m_engine->GetFog());
- GetProfile().SetLocalProfileInt("Setup", "LensMode", m_engine->GetLensMode());
- GetProfile().SetLocalProfileInt("Setup", "SkyMode", m_engine->GetSkyMode());
- GetProfile().SetLocalProfileInt("Setup", "PlanetMode", m_engine->GetPlanetMode());
- GetProfile().SetLocalProfileInt("Setup", "LightMode", m_engine->GetLightMode());
- GetProfile().SetLocalProfileFloat("Setup", "ParticleDensity", m_engine->GetParticleDensity());
- GetProfile().SetLocalProfileFloat("Setup", "ClippingDistance", m_engine->GetClippingDistance());
- GetProfile().SetLocalProfileFloat("Setup", "ObjectDetail", m_engine->GetObjectDetail());
- GetProfile().SetLocalProfileFloat("Setup", "GadgetQuantity", m_engine->GetGadgetQuantity());
- GetProfile().SetLocalProfileInt("Setup", "TextureQuality", m_engine->GetTextureQuality());
- GetProfile().SetLocalProfileInt("Setup", "TotoMode", m_engine->GetTotoMode());
- GetProfile().SetLocalProfileInt("Setup", "AudioVolume", m_sound->GetAudioVolume());
- GetProfile().SetLocalProfileInt("Setup", "MusicVolume", m_sound->GetMusicVolume());
- GetProfile().SetLocalProfileInt("Setup", "EditIndentMode", m_engine->GetEditIndentMode());
- GetProfile().SetLocalProfileInt("Setup", "EditIndentValue", m_engine->GetEditIndentValue());
+ GetProfile().SetStringProperty("Directory", "savegame", m_savegameDir);
+ GetProfile().SetStringProperty("Directory", "public", m_publicDir);
+ GetProfile().SetStringProperty("Directory", "files", m_filesDir);
+ GetProfile().SetIntProperty("Setup", "Tooltips", m_bTooltip);
+ GetProfile().SetIntProperty("Setup", "InterfaceGlint", m_bGlint);
+ GetProfile().SetIntProperty("Setup", "InterfaceGlint", m_bRain);
+ GetProfile().SetIntProperty("Setup", "Soluce4", m_bSoluce4);
+ GetProfile().SetIntProperty("Setup", "Movies", m_bMovies);
+ GetProfile().SetIntProperty("Setup", "NiceReset", m_bNiceReset);
+ GetProfile().SetIntProperty("Setup", "HimselfDamage", m_bHimselfDamage);
+ GetProfile().SetIntProperty("Setup", "CameraScroll", m_bCameraScroll);
+ GetProfile().SetIntProperty("Setup", "CameraInvertX", m_bCameraInvertX);
+ GetProfile().SetIntProperty("Setup", "CameraInvertY", m_bCameraInvertY);
+ GetProfile().SetIntProperty("Setup", "InterfaceEffect", m_bEffect);
+ GetProfile().SetIntProperty("Setup", "Blood", m_bBlood);
+ GetProfile().SetIntProperty("Setup", "GroundShadow", m_engine->GetShadow());
+ GetProfile().SetIntProperty("Setup", "GroundSpot", m_engine->GetGroundSpot());
+ GetProfile().SetIntProperty("Setup", "ObjectDirty", m_engine->GetDirty());
+ GetProfile().SetIntProperty("Setup", "FogMode", m_engine->GetFog());
+ GetProfile().SetIntProperty("Setup", "LensMode", m_engine->GetLensMode());
+ GetProfile().SetIntProperty("Setup", "SkyMode", m_engine->GetSkyMode());
+ GetProfile().SetIntProperty("Setup", "PlanetMode", m_engine->GetPlanetMode());
+ GetProfile().SetIntProperty("Setup", "LightMode", m_engine->GetLightMode());
+ GetProfile().SetFloatProperty("Setup", "ParticleDensity", m_engine->GetParticleDensity());
+ GetProfile().SetFloatProperty("Setup", "ClippingDistance", m_engine->GetClippingDistance());
+ GetProfile().SetFloatProperty("Setup", "ObjectDetail", m_engine->GetObjectDetail());
+ GetProfile().SetFloatProperty("Setup", "GadgetQuantity", m_engine->GetGadgetQuantity());
+ GetProfile().SetIntProperty("Setup", "TextureQuality", m_engine->GetTextureQuality());
+ GetProfile().SetIntProperty("Setup", "TotoMode", m_engine->GetTotoMode());
+ GetProfile().SetIntProperty("Setup", "AudioVolume", m_sound->GetAudioVolume());
+ GetProfile().SetIntProperty("Setup", "MusicVolume", m_sound->GetMusicVolume());
+ GetProfile().SetIntProperty("Setup", "EditIndentMode", m_engine->GetEditIndentMode());
+ GetProfile().SetIntProperty("Setup", "EditIndentValue", m_engine->GetEditIndentValue());
/* screen setup */
if (m_setupFull)
- GetProfile().SetLocalProfileInt("Setup", "Fullscreen", 1);
+ GetProfile().SetIntProperty("Setup", "Fullscreen", 1);
else
- GetProfile().SetLocalProfileInt("Setup", "Fullscreen", 0);
+ GetProfile().SetIntProperty("Setup", "Fullscreen", 0);
CList *pl;
CWindow *pw;
@@ -5231,7 +5077,7 @@ void CMainDialog::SetupMemorize()
pl = static_cast<CList *>(pw->SearchControl(EVENT_LIST2));
if ( pl != 0 )
{
- GetProfile().SetLocalProfileInt("Setup", "Resolution", pl->GetSelect());
+ GetProfile().SetIntProperty("Setup", "Resolution", pl->GetSelect());
}
}
else
@@ -5248,9 +5094,9 @@ void CMainDialog::SetupMemorize()
key << b.secondary << " ";
}
- GetProfile().SetLocalProfileString("Setup", "KeyMap", key.str());
+ GetProfile().SetStringProperty("Setup", "KeyMap", key.str());
- GetProfile().SetLocalProfileInt("Setup", "DeleteGamer", m_bDeleteGamer);
+ GetProfile().SetIntProperty("Setup", "DeleteGamer", m_bDeleteGamer);
}
// Remember all the settings.
@@ -5261,48 +5107,38 @@ void CMainDialog::SetupRecall()
int iValue;
std::string key;
- if ( GetProfile().GetLocalProfileString("Directory", "scene", key) )
- {
- m_sceneDir = key;
- }
-
- if ( GetProfile().GetLocalProfileString("Directory", "savegame", key) )
+ if ( GetProfile().GetStringProperty("Directory", "savegame", key) )
{
m_savegameDir = key;
}
- if ( GetProfile().GetLocalProfileString("Directory", "public", key) )
+ if ( GetProfile().GetStringProperty("Directory", "public", key) )
{
m_publicDir = key;
}
- if ( GetProfile().GetLocalProfileString("Directory", "user", key) )
- {
- m_userDir = key;
- }
-
- if ( GetProfile().GetLocalProfileString("Directory", "files", key) )
+ if ( GetProfile().GetStringProperty("Directory", "files", key) )
{
m_filesDir = key;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "TotoMode", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "TotoMode", iValue) )
{
m_engine->SetTotoMode(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "Tooltips", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "Tooltips", iValue) )
{
m_bTooltip = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "InterfaceGlint", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "InterfaceGlint", iValue) )
{
m_bGlint = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "InterfaceGlint", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "InterfaceGlint", iValue) )
{
m_bRain = iValue;
}
@@ -5313,86 +5149,91 @@ void CMainDialog::SetupRecall()
// m_engine->SetNiceMouse(iValue);
// }
- if ( GetProfile().GetLocalProfileInt("Setup", "Soluce4", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "Soluce4", iValue) )
{
m_bSoluce4 = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "Movies", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "Movies", iValue) )
{
m_bMovies = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "NiceReset", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "NiceReset", iValue) )
{
m_bNiceReset = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "HimselfDamage", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "HimselfDamage", iValue) )
{
m_bHimselfDamage = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "CameraScroll", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "CameraScroll", iValue) )
{
m_bCameraScroll = iValue;
m_camera->SetCameraScroll(m_bCameraScroll);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "CameraInvertX", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "CameraInvertX", iValue) )
{
m_bCameraInvertX = iValue;
m_camera->SetCameraInvertX(m_bCameraInvertX);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "CameraInvertY", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "CameraInvertY", iValue) )
{
m_bCameraInvertY = iValue;
m_camera->SetCameraInvertY(m_bCameraInvertY);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "InterfaceEffect", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "InterfaceEffect", iValue) )
{
m_bEffect = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "GroundShadow", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "Blood", iValue) )
+ {
+ m_bBlood = iValue;
+ }
+
+ if ( GetProfile().GetIntProperty("Setup", "GroundShadow", iValue) )
{
m_engine->SetShadow(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "GroundSpot", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "GroundSpot", iValue) )
{
m_engine->SetGroundSpot(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "ObjectDirty", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "ObjectDirty", iValue) )
{
m_engine->SetDirty(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "FogMode", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "FogMode", iValue) )
{
m_engine->SetFog(iValue);
m_camera->SetOverBaseColor(Gfx::Color(0.0f, 0.0f, 0.0f, 0.0f)); // TODO: color ok?
}
- if ( GetProfile().GetLocalProfileInt("Setup", "LensMode", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "LensMode", iValue) )
{
m_engine->SetLensMode(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "SkyMode", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "SkyMode", iValue) )
{
m_engine->SetSkyMode(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "PlanetMode", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "PlanetMode", iValue) )
{
m_engine->SetPlanetMode(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "LightMode", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "LightMode", iValue) )
{
m_engine->SetLightMode(iValue);
}
@@ -5402,52 +5243,52 @@ void CMainDialog::SetupRecall()
// m_engine->SetJoystick(iValue);
// }
- if ( GetProfile().GetLocalProfileFloat("Setup", "ParticleDensity", fValue) )
+ if ( GetProfile().GetFloatProperty("Setup", "ParticleDensity", fValue) )
{
m_engine->SetParticleDensity(fValue);
}
- if ( GetProfile().GetLocalProfileFloat("Setup", "ClippingDistance", fValue) )
+ if ( GetProfile().GetFloatProperty("Setup", "ClippingDistance", fValue) )
{
m_engine->SetClippingDistance(fValue);
}
- if ( GetProfile().GetLocalProfileFloat("Setup", "ObjectDetail", fValue) )
+ if ( GetProfile().GetFloatProperty("Setup", "ObjectDetail", fValue) )
{
m_engine->SetObjectDetail(fValue);
}
- if ( GetProfile().GetLocalProfileFloat("Setup", "GadgetQuantity", fValue) )
+ if ( GetProfile().GetFloatProperty("Setup", "GadgetQuantity", fValue) )
{
m_engine->SetGadgetQuantity(fValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "TextureQuality", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "TextureQuality", iValue) )
{
m_engine->SetTextureQuality(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "AudioVolume", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "AudioVolume", iValue) )
{
m_sound->SetAudioVolume(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "MusicVolume", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "MusicVolume", iValue) )
{
m_sound->SetMusicVolume(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "EditIndentMode", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "EditIndentMode", iValue) )
{
m_engine->SetEditIndentMode(iValue);
}
- if ( GetProfile().GetLocalProfileInt("Setup", "EditIndentValue", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "EditIndentValue", iValue) )
{
m_engine->SetEditIndentValue(iValue);
}
- if (GetProfile().GetLocalProfileString("Setup", "KeyMap", key))
+ if (GetProfile().GetStringProperty("Setup", "KeyMap", key))
{
std::stringstream skey;
skey.str(key);
@@ -5460,17 +5301,17 @@ void CMainDialog::SetupRecall()
}
}
- if ( GetProfile().GetLocalProfileInt("Setup", "DeleteGamer", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "DeleteGamer", iValue) )
{
m_bDeleteGamer = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "Resolution", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "Resolution", iValue) )
{
m_setupSelMode = iValue;
}
- if ( GetProfile().GetLocalProfileInt("Setup", "Fullscreen", iValue) )
+ if ( GetProfile().GetIntProperty("Setup", "Fullscreen", iValue) )
{
m_setupFull = (iValue == 1);
}
@@ -5852,12 +5693,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;
@@ -6011,7 +5846,6 @@ void CMainDialog::FrameDialog(float rTime)
void CMainDialog::StopDialog()
{
CWindow* pw;
- CButton* pb;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW0));
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
@@ -6040,12 +5874,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;
@@ -6174,7 +6002,13 @@ bool CMainDialog::GetSceneSoluce()
// Returns the name of the folder to save.
-std::string & CMainDialog::GetSavegameDir()
+std::string CMainDialog::GetSavegameDir()
+{
+ return CResourceManager::GetSaveLocation()+"/"+m_savegameDir;
+}
+
+//TODO: Use PHYSFS everywhere
+std::string & CMainDialog::GetPHYSFSSavegameDir()
{
return m_savegameDir;
}
@@ -6232,7 +6066,7 @@ void CMainDialog::WriteGamerPerso(char *gamer)
char filename[100];
char line[100];
- sprintf(filename, "%s/%s/face.gam", m_savegameDir.c_str(), gamer);
+ sprintf(filename, "%s/%s/face.gam", GetSavegameDir().c_str(), gamer);
file = fopen(filename, "w");
if ( file == NULL ) return;
@@ -6265,7 +6099,7 @@ void CMainDialog::ReadGamerPerso(char *gamer)
m_perso.face = 0;
DefPerso();
- sprintf(filename, "%s/%s/face.gam", m_savegameDir.c_str(), gamer);
+ sprintf(filename, "%s/%s/face.gam", GetSavegameDir().c_str(), gamer);
file = fopen(filename, "r");
if ( file == NULL ) return;
@@ -6374,7 +6208,7 @@ bool CMainDialog::ReadGamerInfo()
m_sceneInfo[i].bPassed = false;
}
- sprintf(line, "%s/%s/%s.gam", m_savegameDir.c_str(), m_main->GetGamerName(), m_sceneName);
+ sprintf(line, "%s/%s/%s.gam", GetSavegameDir().c_str(), m_main->GetGamerName(), m_sceneName);
file = fopen(line, "r");
if ( file == NULL ) return false;
@@ -6410,7 +6244,7 @@ bool CMainDialog::WriteGamerInfo()
char line[100];
int i;
- sprintf(line, "%s/%s/%s.gam", m_savegameDir.c_str(), m_main->GetGamerName(), m_sceneName);
+ sprintf(line, "%s/%s/%s.gam", GetSavegameDir().c_str(), m_main->GetGamerName(), m_sceneName);
file = fopen(line, "w");
if ( file == NULL ) return false;
@@ -6420,7 +6254,7 @@ bool CMainDialog::WriteGamerInfo()
for ( i=0 ; i<MAXSCENE ; i++ )
{
- if ( m_sceneInfo[i].numTry == 0 ) continue;
+ if ( m_sceneInfo[i].numTry == 0 && !m_sceneInfo[i].bPassed ) continue;
sprintf(line, "Chapter %d: Scene %d: numTry=%d passed=%d\n",
i/100, i%100, m_sceneInfo[i].numTry, m_sceneInfo[i].bPassed);
@@ -6487,6 +6321,11 @@ bool CMainDialog::NextMission()
return true;
}
+std::string& CMainDialog::GetUserLevelName(int id)
+{
+ return m_userList[id-1];
+}
+
} // namespace Ui
diff --git a/src/ui/maindialog.h b/src/ui/maindialog.h
index 444a568..355b18e 100644
--- a/src/ui/maindialog.h
+++ b/src/ui/maindialog.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// maindialog.h
@@ -88,7 +91,8 @@ public:
int GetSceneRank();
const char* GetSceneDir();
bool GetSceneSoluce();
- std::string & GetSavegameDir();
+ std::string GetSavegameDir();
+ std::string & GetPHYSFSSavegameDir();
std::string & GetPublicDir();
bool GetTooltip();
@@ -98,8 +102,7 @@ public:
bool GetNiceReset();
bool GetHimselfDamage();
- void SetUserDir(char *base, int rank);
- void BuildSceneName(std::string &filename, char *base, int rank);
+ void BuildSceneName(std::string &filename, char *base, int rank, bool sceneFile = true);
void BuildResumeName(char *filename, char *base, int rank);
std::string & GetFilesDir();
@@ -140,6 +143,8 @@ public:
void AllMissionUpdate();
void ShowSoluceUpdate();
+
+ std::string& GetUserLevelName(int id);
protected:
void GlintMove();
@@ -169,7 +174,6 @@ protected:
void UpdateSceneChap(int &chap);
void UpdateSceneList(int chap, int &sel);
void UpdateSceneResume(int rank);
- void UpdateDisplayDevice();
void UpdateDisplayMode();
void ChangeDisplay();
void UpdateApply();
@@ -200,10 +204,8 @@ protected:
int m_persoTab; // perso: tab selected
float m_persoAngle; // perso: angle of presentation
- std::string m_sceneDir; // scene folder
std::string m_savegameDir; // savegame folder
std::string m_publicDir; // program folder
- std::string m_userDir; // user folder
std::string m_filesDir; // case files
int m_index; // 0..4
@@ -229,7 +231,6 @@ protected:
int m_shotDelay; // number of frames before copy
std::string m_shotName; // generate a file name
- int m_setupSelDevice;
int m_setupSelMode;
bool m_setupFull;
@@ -244,6 +245,7 @@ protected:
bool m_bCameraInvertX; // for CCamera
bool m_bCameraInvertY; // for CCamera
bool m_bEffect; // for CCamera
+ bool m_bBlood; // for CCamera
Math::Point m_glintMouse;
float m_glintTime;
diff --git a/src/ui/mainmap.cpp b/src/ui/mainmap.cpp
index 8c81160..11b2517 100644
--- a/src/ui/mainmap.cpp
+++ b/src/ui/mainmap.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/mainmap.h"
diff --git a/src/ui/mainmap.h b/src/ui/mainmap.h
index 9b20548..0cc7959 100644
--- a/src/ui/mainmap.h
+++ b/src/ui/mainmap.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// mainmap.h
diff --git a/src/ui/mainshort.cpp b/src/ui/mainshort.cpp
index f6dce4b..76fd569 100644
--- a/src/ui/mainshort.cpp
+++ b/src/ui/mainshort.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/mainshort.h"
diff --git a/src/ui/mainshort.h b/src/ui/mainshort.h
index b185aed..1d0a327 100644
--- a/src/ui/mainshort.h
+++ b/src/ui/mainshort.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// mainshort.h
diff --git a/src/ui/map.cpp b/src/ui/map.cpp
index c5f0062..f3f569a 100644
--- a/src/ui/map.cpp
+++ b/src/ui/map.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/map.h"
@@ -322,7 +324,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);
@@ -330,8 +332,10 @@ void CMap::Draw()
uv2.y = 0.5f - (m_offset.y - (m_half / m_zoom)) / (m_half * 2.0f);
DrawVertex(uv1, uv2, 0.97f); // drawing the map
} else { // still image?
- m_engine->LoadTexture(m_fixImage);
- m_engine->SetTexture(m_fixImage);
+ std::string texFilename = m_fixImage;
+ texFilename = "textures/"+texFilename;
+ m_engine->LoadTexture(texFilename.c_str());
+ m_engine->SetTexture(texFilename.c_str());
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
uv1.x = 0.0f;
uv1.y = 0.0f;
@@ -469,7 +473,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 +533,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 +676,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 +702,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 +722,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 +732,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 +742,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 +752,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 +762,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 +783,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 +898,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 +1056,8 @@ void CMap::UpdateTerrain()
}
}
- m_engine->DeleteTexture("map.png");
- m_engine->LoadTexture("map.png", &img);
+ m_engine->DeleteTexture("interface/map.png");
+ m_engine->LoadTexture("textures/interface/map.png", &img);
}
// Updates the field in the map.
diff --git a/src/ui/map.h b/src/ui/map.h
index 4ebe688..e1ad1a2 100644
--- a/src/ui/map.h
+++ b/src/ui/map.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// map.h
diff --git a/src/ui/scroll.cpp b/src/ui/scroll.cpp
index b3422ec..32c5818 100644
--- a/src/ui/scroll.cpp
+++ b/src/ui/scroll.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/scroll.h"
@@ -379,7 +381,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 +391,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 +401,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 +411,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/scroll.h b/src/ui/scroll.h
index c115aa4..505af09 100644
--- a/src/ui/scroll.h
+++ b/src/ui/scroll.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// scroll.h
diff --git a/src/ui/shortcut.cpp b/src/ui/shortcut.cpp
index a01864a..81495a7 100644
--- a/src/ui/shortcut.cpp
+++ b/src/ui/shortcut.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/shortcut.h"
@@ -114,7 +116,7 @@ void CShortcut::Draw()
zoom = 1.0f;
}
- m_engine->SetTexture("button3.png");
+ m_engine->SetTexture("textures/interface/button3.png");
if ( icon != -1 )
{
@@ -130,7 +132,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 +172,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/shortcut.h b/src/ui/shortcut.h
index 6495ba0..9f3a339 100644
--- a/src/ui/shortcut.h
+++ b/src/ui/shortcut.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// shortcut.h
diff --git a/src/ui/slider.cpp b/src/ui/slider.cpp
index 33293d1..58fcc26 100644
--- a/src/ui/slider.cpp
+++ b/src/ui/slider.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/slider.h"
@@ -498,7 +500,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 +512,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 +524,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/slider.h b/src/ui/slider.h
index bc38aec..c55d64b 100644
--- a/src/ui/slider.h
+++ b/src/ui/slider.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// slider.h
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index f83704e..efdbbbc 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/studio.h"
@@ -22,6 +24,8 @@
#include "app/app.h"
+#include "common/resources/resourcemanager.h"
+
#include "common/event.h"
#include "common/misc.h"
@@ -167,7 +171,7 @@ bool CStudio::EventProcess(const Event &event)
{
slider = static_cast< CSlider* >(pw->SearchControl(EVENT_STUDIO_SIZE));
if ( slider == nullptr ) return false;
- m_main->SetFontSize(9.0f+slider->GetVisibleValue()*12.0f);
+ m_main->SetFontSize(9.0f+slider->GetVisibleValue()*15.0f);
ViewEditScript();
}
@@ -573,10 +577,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);
@@ -638,7 +638,7 @@ void CStudio::StartEditScript(CScript *script, std::string name, int rank)
button->SetState(STATE_SHADOW);
slider = pw->CreateSlider(pos, dim, 0, EVENT_STUDIO_SIZE);
slider->SetState(STATE_SHADOW);
- slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/6.0f);
+ slider->SetVisibleValue((m_main->GetFontSize()-9.0f)/15.0f);
pw->CreateGroup(pos, dim, 19, EVENT_LABEL1); // SatCom logo
button = pw->CreateButton(pos, dim, 128+57, EVENT_STUDIO_TOOL);
button->SetState(STATE_SHADOW);
@@ -854,7 +854,6 @@ bool CStudio::StopEditScript(bool bCancel)
{
CWindow* pw;
CEdit* edit;
- CButton* button;
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW3));
if ( pw == nullptr ) return false;
@@ -877,12 +876,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);
@@ -1532,8 +1525,8 @@ void CStudio::UpdateDialogList()
// Constructs the name of the folder or open/save.
// If the folder does not exist, it will be created.
-
-std::string CStudio::SearchDirectory(bool bCreate)
+//TODO: Refactor to PHYSFS
+std::string CStudio::SearchDirectory(bool bCreate, bool physfsReady)
{
char dir[MAX_FNAME];
if ( m_main->GetIOPublic() )
@@ -1545,14 +1538,20 @@ std::string CStudio::SearchDirectory(bool bCreate)
sprintf(dir, "%s/%s/Program/", m_main->GetSavegameDir(), m_main->GetGamerName());
}
- fs::path path = fs::path(dir);
-
if ( bCreate )
{
- fs::create_directory(path);
+ fs::path path = fs::path(dir);
+ fs::create_directories(path);
}
- return path.make_preferred().string();
+ std::string dir2 = dir;
+ if(physfsReady) {
+ std::string savedir = CResourceManager::GetSaveLocation()+"/";
+ boost::replace_all(dir2, "\\", "/");
+ boost::replace_all(savedir, "\\", "/");
+ boost::replace_all(dir2, savedir, "");
+ }
+ return dir2;
}
// Reads a new program.
@@ -1578,7 +1577,7 @@ bool CStudio::ReadProgram()
{
strcat(filename, ".txt");
}
- strcpy(dir, SearchDirectory(true).c_str());
+ strcpy(dir, SearchDirectory(true, true).c_str());
strcat(dir, filename);
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW3));
@@ -1616,14 +1615,14 @@ bool CStudio::WriteProgram()
{
strcat(filename, ".txt");
}
- strcpy(dir, SearchDirectory(true).c_str());
+ strcpy(dir, SearchDirectory(true, true).c_str());
strcat(dir, filename);
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW3));
if ( pw == nullptr ) return false;
pe = static_cast< CEdit* >(pw->SearchControl(EVENT_STUDIO_EDIT));
if ( pe == nullptr ) return false;
-
+
if ( !pe->WriteText(std::string(dir)) ) return false;
m_script->SetFilename(filename);
diff --git a/src/ui/studio.h b/src/ui/studio.h
index d1c6a51..dda1368 100644
--- a/src/ui/studio.h
+++ b/src/ui/studio.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012 Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// studio.h
@@ -86,7 +88,7 @@ protected:
void UpdateDialogAction();
void UpdateDialogPublic();
void UpdateDialogList();
- std::string SearchDirectory(bool bCreate);
+ std::string SearchDirectory(bool bCreate, bool physfsReady=false);
bool ReadProgram();
bool WriteProgram();
diff --git a/src/ui/target.cpp b/src/ui/target.cpp
index 455c530..a406820 100644
--- a/src/ui/target.cpp
+++ b/src/ui/target.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/target.h"
diff --git a/src/ui/target.h b/src/ui/target.h
index 2344e59..4f95b6c 100644
--- a/src/ui/target.h
+++ b/src/ui/target.h
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// target.h
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index 98e1e6c..7b57a2f 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "ui/window.h"
@@ -64,34 +66,20 @@ CWindow::~CWindow()
void CWindow::Flush()
{
- int i;
-
- for ( i=0 ; i<MAXWINDOW ; i++ )
+ for (int i = 0 ; i < MAXWINDOW; i++)
{
- if ( m_table[i] != 0 )
- {
- delete m_table[i];
- m_table[i] = 0;
- }
+ delete m_table[i];
+ m_table[i] = nullptr;
}
- if ( m_buttonReduce != 0 )
- {
- delete m_buttonReduce;
- m_buttonReduce = 0;
- }
+ delete m_buttonReduce;
+ m_buttonReduce = nullptr;
- if ( m_buttonFull != 0 )
- {
- delete m_buttonFull;
- m_buttonFull = 0;
- }
+ delete m_buttonFull;
+ m_buttonFull = nullptr;
- if ( m_buttonClose != 0 )
- {
- delete m_buttonClose;
- m_buttonClose = 0;
- }
+ delete m_buttonClose;
+ m_buttonClose = nullptr;
}
@@ -583,23 +571,14 @@ void CWindow::SetName(std::string name, bool tooltip)
CControl::SetName(name, tooltip);
- if ( m_buttonReduce != 0 )
- {
- delete m_buttonReduce;
- m_buttonReduce = 0;
- }
+ delete m_buttonReduce;
+ m_buttonReduce = nullptr;
- if ( m_buttonFull != 0 )
- {
- delete m_buttonFull;
- m_buttonFull = 0;
- }
+ delete m_buttonFull;
+ m_buttonFull = nullptr;
- if ( m_buttonClose != 0 )
- {
- delete m_buttonClose;
- m_buttonClose = 0;
- }
+ delete m_buttonClose;
+ m_buttonClose = nullptr;
bAdjust = false;
@@ -1174,7 +1153,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 +1169,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 +1183,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 +1197,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 +1216,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/human.png");
m_engine->SetState(Gfx::ENG_RSTATE_NORMAL);
uv1.x = 140.0f/256.0f;
uv1.y = 32.0f/256.0f;
@@ -1254,7 +1233,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 +1252,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 +1288,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 +1299,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 +1371,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 +1385,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 +1399,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 +1413,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 +1429,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 +1449,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 +1463,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 +1479,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 +1495,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;
@@ -1542,7 +1521,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;
diff --git a/src/ui/window.h b/src/ui/window.h
index 87805e2..701407e 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -1,19 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
// window.h
diff --git a/test/cbot/CBot_console/CBotConsole.cpp b/test/cbot/CBot_console/CBotConsole.cpp
index e9209d3..1b0b185 100644
--- a/test/cbot/CBot_console/CBotConsole.cpp
+++ b/test/cbot/CBot_console/CBotConsole.cpp
@@ -1,4 +1,22 @@
/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+/*
* CBotConsole.cpp
*
* Created on: 08-08-2012
diff --git a/test/cbot/CBot_console/CBotConsole.h b/test/cbot/CBot_console/CBotConsole.h
index ac87911..83556f5 100644
--- a/test/cbot/CBot_console/CBotConsole.h
+++ b/test/cbot/CBot_console/CBotConsole.h
@@ -1,4 +1,22 @@
/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+/*
* CBotConsole.h
*
* Created on: 08-08-2012
diff --git a/test/cbot/CBot_console/CBotDoc.cpp b/test/cbot/CBot_console/CBotDoc.cpp
index 1c694c9..5871fb5 100644
--- a/test/cbot/CBot_console/CBotDoc.cpp
+++ b/test/cbot/CBot_console/CBotDoc.cpp
@@ -1,4 +1,22 @@
/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+/*
* CBotDoc.cpp
*
* Created on: 08-08-2012
diff --git a/test/cbot/CBot_console/CBotDoc.h b/test/cbot/CBot_console/CBotDoc.h
index 82af7b0..5f58ed5 100644
--- a/test/cbot/CBot_console/CBotDoc.h
+++ b/test/cbot/CBot_console/CBotDoc.h
@@ -1,4 +1,22 @@
/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+/*
* CBotDoc.h
*
* Created on: 08-08-2012
diff --git a/test/cbot/CBot_console/CClass.cpp b/test/cbot/CBot_console/CClass.cpp
index 9b7c842..ec6cd8f 100644
--- a/test/cbot/CBot_console/CClass.cpp
+++ b/test/cbot/CBot_console/CClass.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "CClass.h"
#include "routines.cpp"
diff --git a/test/cbot/CBot_console/CClass.h b/test/cbot/CBot_console/CClass.h
index da2c46c..187d090 100644
--- a/test/cbot/CBot_console/CClass.h
+++ b/test/cbot/CBot_console/CClass.h
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#pragma once
#include <CBot/CBot.h>
diff --git a/test/cbot/CBot_console/main.cpp b/test/cbot/CBot_console/main.cpp
index a2d3668..98c8c18 100644
--- a/test/cbot/CBot_console/main.cpp
+++ b/test/cbot/CBot_console/main.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "CClass.h"
#include "CBotDoc.h"
#include <iostream>
diff --git a/test/cbot/CBot_console/routines.cpp b/test/cbot/CBot_console/routines.cpp
index 8b8a1d4..a967305 100644
--- a/test/cbot/CBot_console/routines.cpp
+++ b/test/cbot/CBot_console/routines.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
////////////////////////////////////////////////////////////////////
// routine show()
diff --git a/test/envs/CMakeLists.txt b/test/envs/CMakeLists.txt
index 374c39f..3d535f3 100644
--- a/test/envs/CMakeLists.txt
+++ b/test/envs/CMakeLists.txt
@@ -1,2 +1,3 @@
# OpenGL tests
-add_subdirectory(opengl)
+# TODO: fix dependency on resource manager and re-enable
+#add_subdirectory(opengl)
diff --git a/test/envs/opengl/light_test.cpp b/test/envs/opengl/light_test.cpp
index 5c5af7c..7f1c652 100644
--- a/test/envs/opengl/light_test.cpp
+++ b/test/envs/opengl/light_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system.h"
#include "common/config.h"
diff --git a/test/envs/opengl/model_test.cpp b/test/envs/opengl/model_test.cpp
index fa4042c..006b16e 100644
--- a/test/envs/opengl/model_test.cpp
+++ b/test/envs/opengl/model_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system.h"
#include "common/config.h"
diff --git a/test/envs/opengl/texture_test.cpp b/test/envs/opengl/texture_test.cpp
index 5c27b43..0a0575b 100644
--- a/test/envs/opengl/texture_test.cpp
+++ b/test/envs/opengl/texture_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/config.h"
#include "common/logger.h"
#include "common/image.h"
diff --git a/test/envs/opengl/transform_test.cpp b/test/envs/opengl/transform_test.cpp
index 99ec9f0..9536740 100644
--- a/test/envs/opengl/transform_test.cpp
+++ b/test/envs/opengl/transform_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system.h"
#include "common/config.h"
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index bdb5a67..cd745c3 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -1,170 +1,3 @@
-set(SRC_DIR ${colobot_SOURCE_DIR}/src)
-
-# Additional libraries per platform
-if(MXE) # MXE requires special treatment
- set(PLATFORM_LIBS ${MXE_LIBS})
-elseif(PLATFORM_WINDOWS)
- # because it isn't included in standard linking libraries
- set(PLATFORM_LIBS "-lintl")
-elseif(PLATFORM_GNU)
- set(PLATFORM_LIBS "-lX11")
-elseif(PLATFORM_LINUX)
- # for clock_gettime
- set(PLATFORM_LIBS "-lrt -lX11")
-elseif(PLATFORM_MACOSX)
- find_library(LIBINTL_LIBRARY NAMES intl libintl )
- set(PLATFORM_LIBS ${LIBINTL_LIBRARY} ${X11_X11_LIB})
-endif()
-
-
-# Configure file
-configure_file(${SRC_DIR}/common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/config.h)
-
-# Code sources
-set(COLOBOT_SOURCES
-${SRC_DIR}/app/app.cpp
-${SRC_DIR}/app/gamedata.cpp
-${SRC_DIR}/app/pausemanager.cpp
-${SRC_DIR}/app/system.cpp
-${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
-${SRC_DIR}/app/system_other.cpp
-${SRC_DIR}/common/event.cpp
-${SRC_DIR}/common/image.cpp
-${SRC_DIR}/common/iman.cpp
-${SRC_DIR}/common/logger.cpp
-${SRC_DIR}/common/misc.cpp
-${SRC_DIR}/common/profile.cpp
-${SRC_DIR}/common/restext.cpp
-${SRC_DIR}/common/stringutils.cpp
-${SRC_DIR}/graphics/core/color.cpp
-${SRC_DIR}/graphics/engine/camera.cpp
-${SRC_DIR}/graphics/engine/cloud.cpp
-${SRC_DIR}/graphics/engine/engine.cpp
-${SRC_DIR}/graphics/engine/lightman.cpp
-${SRC_DIR}/graphics/engine/lightning.cpp
-${SRC_DIR}/graphics/engine/modelfile.cpp
-${SRC_DIR}/graphics/engine/modelmanager.cpp
-${SRC_DIR}/graphics/engine/particle.cpp
-${SRC_DIR}/graphics/engine/planet.cpp
-${SRC_DIR}/graphics/engine/pyro.cpp
-${SRC_DIR}/graphics/engine/terrain.cpp
-${SRC_DIR}/graphics/engine/text.cpp
-${SRC_DIR}/graphics/engine/water.cpp
-${SRC_DIR}/graphics/opengl/gldevice.cpp
-${SRC_DIR}/object/auto/auto.cpp
-${SRC_DIR}/object/auto/autobase.cpp
-${SRC_DIR}/object/auto/autoconvert.cpp
-${SRC_DIR}/object/auto/autoderrick.cpp
-${SRC_DIR}/object/auto/autodestroyer.cpp
-${SRC_DIR}/object/auto/autoegg.cpp
-${SRC_DIR}/object/auto/autoenergy.cpp
-${SRC_DIR}/object/auto/autofactory.cpp
-${SRC_DIR}/object/auto/autoflag.cpp
-${SRC_DIR}/object/auto/autohuston.cpp
-${SRC_DIR}/object/auto/autoinfo.cpp
-${SRC_DIR}/object/auto/autojostle.cpp
-${SRC_DIR}/object/auto/autokid.cpp
-${SRC_DIR}/object/auto/autolabo.cpp
-${SRC_DIR}/object/auto/automush.cpp
-${SRC_DIR}/object/auto/autonest.cpp
-${SRC_DIR}/object/auto/autonuclear.cpp
-${SRC_DIR}/object/auto/autopara.cpp
-${SRC_DIR}/object/auto/autoportico.cpp
-${SRC_DIR}/object/auto/autoradar.cpp
-${SRC_DIR}/object/auto/autorepair.cpp
-${SRC_DIR}/object/auto/autoresearch.cpp
-${SRC_DIR}/object/auto/autoroot.cpp
-${SRC_DIR}/object/auto/autosafe.cpp
-${SRC_DIR}/object/auto/autostation.cpp
-${SRC_DIR}/object/auto/autotower.cpp
-${SRC_DIR}/object/brain.cpp
-${SRC_DIR}/object/mainmovie.cpp
-${SRC_DIR}/object/motion/motion.cpp
-${SRC_DIR}/object/motion/motionant.cpp
-${SRC_DIR}/object/motion/motionbee.cpp
-${SRC_DIR}/object/motion/motionhuman.cpp
-${SRC_DIR}/object/motion/motionmother.cpp
-${SRC_DIR}/object/motion/motionspider.cpp
-${SRC_DIR}/object/motion/motiontoto.cpp
-${SRC_DIR}/object/motion/motionvehicle.cpp
-${SRC_DIR}/object/motion/motionworm.cpp
-${SRC_DIR}/object/motion/motiondummy.cpp
-${SRC_DIR}/object/object.cpp
-${SRC_DIR}/object/objman.cpp
-${SRC_DIR}/object/robotmain.cpp
-${SRC_DIR}/object/task/task.cpp
-${SRC_DIR}/object/task/taskadvance.cpp
-${SRC_DIR}/object/task/taskbuild.cpp
-${SRC_DIR}/object/task/taskfire.cpp
-${SRC_DIR}/object/task/taskfireant.cpp
-${SRC_DIR}/object/task/taskflag.cpp
-${SRC_DIR}/object/task/taskgoto.cpp
-${SRC_DIR}/object/task/taskgungoal.cpp
-${SRC_DIR}/object/task/taskinfo.cpp
-${SRC_DIR}/object/task/taskmanager.cpp
-${SRC_DIR}/object/task/taskmanip.cpp
-${SRC_DIR}/object/task/taskpen.cpp
-${SRC_DIR}/object/task/taskrecover.cpp
-${SRC_DIR}/object/task/taskreset.cpp
-${SRC_DIR}/object/task/tasksearch.cpp
-${SRC_DIR}/object/task/taskshield.cpp
-${SRC_DIR}/object/task/taskspiderexplo.cpp
-${SRC_DIR}/object/task/tasktake.cpp
-${SRC_DIR}/object/task/taskterraform.cpp
-${SRC_DIR}/object/task/taskturn.cpp
-${SRC_DIR}/object/task/taskwait.cpp
-${SRC_DIR}/physics/physics.cpp
-${SRC_DIR}/script/cbottoken.cpp
-${SRC_DIR}/script/cmdtoken.cpp
-${SRC_DIR}/script/script.cpp
-${SRC_DIR}/sound/sound.cpp
-${SRC_DIR}/ui/button.cpp
-${SRC_DIR}/ui/check.cpp
-${SRC_DIR}/ui/color.cpp
-${SRC_DIR}/ui/compass.cpp
-${SRC_DIR}/ui/control.cpp
-${SRC_DIR}/ui/displayinfo.cpp
-${SRC_DIR}/ui/displaytext.cpp
-${SRC_DIR}/ui/edit.cpp
-${SRC_DIR}/ui/editvalue.cpp
-${SRC_DIR}/ui/gauge.cpp
-${SRC_DIR}/ui/group.cpp
-${SRC_DIR}/ui/image.cpp
-${SRC_DIR}/ui/interface.cpp
-${SRC_DIR}/ui/key.cpp
-${SRC_DIR}/ui/label.cpp
-${SRC_DIR}/ui/list.cpp
-${SRC_DIR}/ui/maindialog.cpp
-${SRC_DIR}/ui/mainmap.cpp
-${SRC_DIR}/ui/mainshort.cpp
-${SRC_DIR}/ui/map.cpp
-${SRC_DIR}/ui/scroll.cpp
-${SRC_DIR}/ui/shortcut.cpp
-${SRC_DIR}/ui/slider.cpp
-${SRC_DIR}/ui/studio.cpp
-${SRC_DIR}/ui/target.cpp
-${SRC_DIR}/ui/window.cpp
-)
-
-set(OPENAL_SOURCES "")
-
-if(OPENAL_SOUND)
- set(OPENAL_SOURCES
- ${SRC_DIR}/sound/oalsound/alsound.cpp
- ${SRC_DIR}/sound/oalsound/buffer.cpp
- ${SRC_DIR}/sound/oalsound/channel.cpp
- )
-endif()
-
-# Optional libraries
-set(OPTIONAL_LIBS "")
-
-if(OPENAL_SOUND)
- set(OPTIONAL_LIBS ${OPENAL_LIBRARY})
- set(OPTIONAL_INCLUDES ${OPENAL_INCLUDE_DIR})
-endif()
-
-
# Platform-dependent tests
if(PLATFORM_WINDOWS)
set(PLATFORM_TESTS app/system_windows_test.cpp)
@@ -172,67 +5,58 @@ elseif(PLATFORM_LINUX)
set(PLATFORM_TESTS app/system_linux_test.cpp)
endif()
-# Tests
+# Sources
set(UT_SOURCES
-main.cpp
-app/app_test.cpp
-graphics/engine/lightman_test.cpp
-math/func_test.cpp
-math/geometry_test.cpp
-math/matrix_test.cpp
-math/vector_test.cpp
-${PLATFORM_TESTS}
+ main.cpp
+ app/app_test.cpp
+ common/profile_test.cpp
+ graphics/engine/lightman_test.cpp
+ math/func_test.cpp
+ math/geometry_test.cpp
+ math/matrix_test.cpp
+ math/vector_test.cpp
+ ${PLATFORM_TESTS}
)
-# Local
+# Includes
include_directories(
-.
-common
-math
-${SRC_DIR}
-${CMAKE_CURRENT_BINARY_DIR}
+ common
+ math
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${COLOBOT_LOCAL_INCLUDES}
)
-# System
include_directories(
-SYSTEM
-${GTEST_INCLUDE_DIR}
-${GMOCK_INCLUDE_DIR}
-${SDL_INCLUDE_DIR}
-${SDLIMAGE_INCLUDE_DIR}
-${SDLTTF_INCLUDE_DIR}
-${PNG_INCLUDE_DIRS}
-${GLEW_INCLUDE_PATH}
-${Boost_INCLUDE_DIRS}
-${OPTIONAL_INCLUDE_DIRS}
-${LIBSNDFILE_INCLUDE_DIR}
-${CLIPBOARD_INCLUDE_DIR}
-${LOCALENAME_INCLUDE_DIR}
+ SYSTEM
+ ${GTEST_INCLUDE_DIR}
+ ${GMOCK_INCLUDE_DIR}
+ ${COLOBOT_SYSTEM_INCLUDES}
)
+# Libraries
set(LIBS
-gtest
-gmock
-CBot
-clipboard
-localename
-${SDL_LIBRARY}
-${SDLIMAGE_LIBRARY}
-${SDLTTF_LIBRARY}
-${OPENGL_LIBRARY}
-${PNG_LIBRARIES}
-${GLEW_LIBRARY}
-${Boost_LIBRARIES}
-${OPTIONAL_LIBS}
-${PLATFORM_LIBS}
-${LIBSNDFILE_LIBRARY}
+ gtest
+ gmock
+ colobotbase
+ ${COLOBOT_LIBS}
)
-add_executable(colobot_ut ${COLOBOT_SOURCES} ${UT_SOURCES} ${OPENAL_SOURCES})
-target_link_libraries(colobot_ut ${LIBS})
+# Test files
-add_test(colobot_ut ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/colobot_ut)
+set(TEST_FILES
+ common/colobot.ini
+)
-# TODO: change the unit cases to independent automated tests to be included in colobot_ut
-add_subdirectory(common)
-add_subdirectory(ui)
+file(COPY ${TEST_FILES} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+
+# Targets
+
+add_executable(colobot_ut ${UT_SOURCES})
+target_link_libraries(colobot_ut ${LIBS})
+
+add_test(
+ NAME colobot_ut
+ COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/colobot_ut
+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+)
diff --git a/test/unit/app/app_test.cpp b/test/unit/app/app_test.cpp
index b517d7d..fff08a5 100644
--- a/test/unit/app/app_test.cpp
+++ b/test/unit/app/app_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/app.h"
#if defined(PLATFORM_WINDOWS)
diff --git a/test/unit/app/system_linux_test.cpp b/test/unit/app/system_linux_test.cpp
index b0a05ca..7b734c6 100644
--- a/test/unit/app/system_linux_test.cpp
+++ b/test/unit/app/system_linux_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system.h"
#include "app/system_linux.h"
diff --git a/test/unit/app/system_mock.h b/test/unit/app/system_mock.h
index 470a4e1..2f2c464 100644
--- a/test/unit/app/system_mock.h
+++ b/test/unit/app/system_mock.h
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#pragma once
#include "app/system.h"
diff --git a/test/unit/app/system_windows_test.cpp b/test/unit/app/system_windows_test.cpp
index 79f8c7f..cfba1ae 100644
--- a/test/unit/app/system_windows_test.cpp
+++ b/test/unit/app/system_windows_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "app/system.h"
#include "app/system_windows.h"
diff --git a/test/unit/common/CMakeLists.txt b/test/unit/common/CMakeLists.txt
deleted file mode 100644
index cf37961..0000000
--- a/test/unit/common/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-set(SRC_DIR ${colobot_SOURCE_DIR}/src)
-
-include_directories(
-${SRC_DIR}
-${GTEST_INCLUDE_DIR}
-)
-
-add_executable(image_test ${SRC_DIR}/common/image.cpp image_test.cpp)
-target_link_libraries(image_test ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${PNG_LIBRARIES})
-add_test(NAME image_test
- COMMAND ${CMAKE_BINARY_DIR}/image_test ${CMAKE_SOURCE_DIR}/test/envs/opengl/tex1.png ${CMAKE_BINARY_DIR}/tex1_test.png)
-
-file(COPY colobot.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-
-add_executable(profile_test ${SRC_DIR}/common/profile.cpp ${SRC_DIR}/common/logger.cpp profile_test.cpp)
-set_target_properties(profile_test PROPERTIES COMPILE_DEFINITIONS "DEV_BUILD=1")
-target_link_libraries(profile_test gtest ${Boost_LIBRARIES})
-
-add_test(NAME profile_test
- COMMAND ${CMAKE_BINARY_DIR}/profile_test
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/test/unit/common/image_test.cpp b/test/unit/common/image_test.cpp
deleted file mode 100644
index 2b20a17..0000000
--- a/test/unit/common/image_test.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "common/image.h"
-
-#include <SDL.h>
-#include <stdio.h>
-
-/* For now, just a simple test: loading a file from image
- * and saving it to another in PNG. */
-
-int main(int argc, char *argv[])
-{
- if (argc != 3)
- {
- printf("Usage: %s in_image out_image\n", argv[0]);
- return 0;
- }
-
- CImage image;
-
- if (! image.Load(argv[1]))
- {
- std::string err = image.GetError();
- printf("Error loading '%s': %s\n", argv[1], err.c_str());
- return 1;
- }
- Gfx::Color color;
- std::string str;
-
- color = image.GetPixel(Math::IntPoint(0, 0));
- str = color.ToString();
- printf("pixel @ (0,0): %s\n", str.c_str());
-
- color = image.GetPixel(Math::IntPoint(0, 1));
- str = color.ToString();
- printf("pixel @ (0,1): %s\n", str.c_str());
-
- color = image.GetPixel(Math::IntPoint(1, 0));
- str = color.ToString();
- printf("pixel @ (1,0): %s\n", str.c_str());
-
- color = image.GetPixel(Math::IntPoint(1, 1));
- str = color.ToString();
- printf("pixel @ (1,1): %s\n", str.c_str());
-
- image.SetPixel(Math::IntPoint(0, 0), Gfx::Color(0.1f, 0.2f, 0.3f, 0.0f));
- image.SetPixel(Math::IntPoint(1, 0), Gfx::Color(0.3f, 0.2f, 0.1f, 1.0f));
- image.SetPixel(Math::IntPoint(0, 1), Gfx::Color(1.0f, 1.0f, 1.0f, 1.0f));
- image.SetPixel(Math::IntPoint(1, 1), Gfx::Color(0.0f, 0.0f, 0.0f, 1.0f));
-
- if (! image.SavePNG(argv[2]))
- {
- std::string err = image.GetError();
- printf("Error saving PNG '%s': %s\n", argv[2], err.c_str());
- return 2;
- }
-
- return 0;
-}
diff --git a/test/unit/common/profile_test.cpp b/test/unit/common/profile_test.cpp
index dabcba6..d85017b 100644
--- a/test/unit/common/profile_test.cpp
+++ b/test/unit/common/profile_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/profile.h"
#include "common/logger.h"
#include "app/system.h"
@@ -11,34 +29,28 @@
class CProfileTest : public testing::Test
{
protected:
- CLogger m_logger;
CProfile m_profile;
-
};
TEST_F(CProfileTest, ReadTest)
{
- ASSERT_TRUE(m_profile.InitCurrentDirectory()); // load colobot.ini file
+ m_profile.SetUseCurrentDirectory(true);
+
+ ASSERT_TRUE(m_profile.Init()); // load colobot.ini file
std::string result;
- ASSERT_TRUE(m_profile.GetLocalProfileString("test_string", "string_value", result));
+ ASSERT_TRUE(m_profile.GetStringProperty("test_string", "string_value", result));
ASSERT_STREQ("Hello world", result.c_str());
int int_value;
- ASSERT_TRUE(m_profile.GetLocalProfileInt("test_int", "int_value", int_value));
+ ASSERT_TRUE(m_profile.GetIntProperty("test_int", "int_value", int_value));
ASSERT_EQ(42, int_value);
float float_value;
- ASSERT_TRUE(m_profile.GetLocalProfileFloat("test_float", "float_value", float_value));
+ ASSERT_TRUE(m_profile.GetFloatProperty("test_float", "float_value", float_value));
ASSERT_FLOAT_EQ(1.5, float_value);
std::vector<std::string> list;
- list = m_profile.GetLocalProfileSection("test_multi", "entry");
+ list = m_profile.GetSection("test_multi", "entry");
ASSERT_EQ(5u, list.size());
}
-
-int main(int argc, char *argv[])
-{
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/test/unit/graphics/core/device_mock.h b/test/unit/graphics/core/device_mock.h
index 498239f..5ab0b7d 100644
--- a/test/unit/graphics/core/device_mock.h
+++ b/test/unit/graphics/core/device_mock.h
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#pragma once
#include "graphics/core/device.h"
@@ -21,11 +39,8 @@ public:
MOCK_METHOD0(Clear, void());
MOCK_METHOD2(SetTransform, void(Gfx::TransformType type, const Math::Matrix &matrix));
- MOCK_METHOD1(GetTransform, const Math::Matrix& (Gfx::TransformType type));
- MOCK_METHOD2(MultiplyTransform, void(Gfx::TransformType type, const Math::Matrix &matrix));
MOCK_METHOD1(SetMaterial, void(const Gfx::Material &material));
- MOCK_METHOD0(GetMaterial, const Gfx::Material&());
MOCK_METHOD0(GetMaxLightCount, int());
@@ -33,7 +48,6 @@ public:
MOCK_METHOD1(GetLight, const Gfx::Light&(int index));
MOCK_METHOD2(SetLightEnabled, void(int index, bool enabled));
- MOCK_METHOD1(GetLightEnabled, bool(int index));
MOCK_METHOD2(CreateTexture, Gfx::Texture(CImage *image, const Gfx::TextureCreateParams &params));
MOCK_METHOD2(CreateTexture, Gfx::Texture(ImageData *data, const Gfx::TextureCreateParams &params));
@@ -45,13 +59,10 @@ public:
MOCK_METHOD2(SetTexture, void(int index, const Gfx::Texture &texture));
MOCK_METHOD2(SetTexture, void(int index, unsigned int textureId));
- MOCK_METHOD1(GetTexture, Gfx::Texture(int index));
MOCK_METHOD2(SetTextureEnabled, void(int index, bool enabled));
- MOCK_METHOD1(GetTextureEnabled, bool(int index));
MOCK_METHOD2(SetTextureStageParams, void(int index, const Gfx::TextureStageParams &params));
- MOCK_METHOD1(GetTextureStageParams, Gfx::TextureStageParams(int index));
MOCK_METHOD3(SetTextureStageWrap, void(int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT));
@@ -77,34 +88,24 @@ public:
MOCK_METHOD1(GetRenderState, bool(Gfx::RenderState state));
MOCK_METHOD1(SetDepthTestFunc, void(Gfx::CompFunc func));
- MOCK_METHOD0(GetDepthTestFunc, Gfx::CompFunc());
MOCK_METHOD1(SetDepthBias, void(float factor));
- MOCK_METHOD0(GetDepthBias, float());
MOCK_METHOD2(SetAlphaTestFunc, void(Gfx::CompFunc func, float refValue));
- MOCK_METHOD2(GetAlphaTestFunc, void(Gfx::CompFunc &func, float &refValue));
MOCK_METHOD2(SetBlendFunc, void(Gfx::BlendFunc srcBlend, Gfx::BlendFunc dstBlend));
- MOCK_METHOD2(GetBlendFunc, void(Gfx::BlendFunc &srcBlend, Gfx::BlendFunc &dstBlend));
MOCK_METHOD1(SetClearColor, void(const Gfx::Color &color));
- MOCK_METHOD0(GetClearColor, Gfx::Color());
MOCK_METHOD1(SetGlobalAmbient, void(const Gfx::Color &color));
- MOCK_METHOD0(GetGlobalAmbient, Gfx::Color());
MOCK_METHOD5(SetFogParams, void(Gfx::FogMode mode, const Gfx::Color &color, float start, float end, float density));
- MOCK_METHOD5(GetFogParams, void(Gfx::FogMode &mode, Gfx::Color &color, float &start, float &end, float &density));
MOCK_METHOD1(SetCullMode, void(Gfx::CullMode mode));
- MOCK_METHOD0(GetCullMode, Gfx::CullMode());
MOCK_METHOD1(SetShadeModel, void(Gfx::ShadeModel model));
- MOCK_METHOD0(GetShadeModel, Gfx::ShadeModel());
MOCK_METHOD1(SetFillMode, void(Gfx::FillMode mode));
- MOCK_METHOD0(GetFillMode, Gfx::FillMode());
MOCK_CONST_METHOD0(GetFrameBufferPixels, void*());
};
diff --git a/test/unit/graphics/engine/engine_mock.h b/test/unit/graphics/engine/engine_mock.h
index 1a15eca..72ceddb 100644
--- a/test/unit/graphics/engine/engine_mock.h
+++ b/test/unit/graphics/engine/engine_mock.h
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/engine.h"
#include <gmock/gmock.h>
diff --git a/test/unit/graphics/engine/lightman_test.cpp b/test/unit/graphics/engine/lightman_test.cpp
index e2dc785..d493afb 100644
--- a/test/unit/graphics/engine/lightman_test.cpp
+++ b/test/unit/graphics/engine/lightman_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/lightman.h"
#include "app/system_mock.h"
diff --git a/test/unit/graphics/engine/modelfile_test.cpp b/test/unit/graphics/engine/modelfile_test.cpp
index 0598e84..ba95d04 100644
--- a/test/unit/graphics/engine/modelfile_test.cpp
+++ b/test/unit/graphics/engine/modelfile_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "graphics/engine/modelfile.h"
#include "math/func.h"
diff --git a/test/unit/main.cpp b/test/unit/main.cpp
index 7d08f58..f136ebc 100644
--- a/test/unit/main.cpp
+++ b/test/unit/main.cpp
@@ -1,18 +1,21 @@
-// * This file is part of the COLOBOT source code
-// * Copyright (C) 2012, Polish Portal of Colobot (PPC)
-// *
-// * This program is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * This program is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with this program. If not, see http://www.gnu.org/licenses/.
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
#include "common/logger.h"
diff --git a/test/unit/math/func_test.cpp b/test/unit/math/func_test.cpp
index 57f1347..aa06f9e 100644
--- a/test/unit/math/func_test.cpp
+++ b/test/unit/math/func_test.cpp
@@ -1,4 +1,22 @@
/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+/*
Unit tests for math functions.
*/
diff --git a/test/unit/math/geometry_test.cpp b/test/unit/math/geometry_test.cpp
index 581ef89..49caaa4 100644
--- a/test/unit/math/geometry_test.cpp
+++ b/test/unit/math/geometry_test.cpp
@@ -1,3 +1,21 @@
+/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
/* Unit tests for functions in geometry.h */
#include "math/func.h"
diff --git a/test/unit/math/matrix_test.cpp b/test/unit/math/matrix_test.cpp
index 7693a85..3b67d69 100644
--- a/test/unit/math/matrix_test.cpp
+++ b/test/unit/math/matrix_test.cpp
@@ -1,4 +1,22 @@
/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+/*
Unit tests for Matrix struct
Test data was randomly generated and the expected results
diff --git a/test/unit/math/vector_test.cpp b/test/unit/math/vector_test.cpp
index 6fe30be..f8a8b10 100644
--- a/test/unit/math/vector_test.cpp
+++ b/test/unit/math/vector_test.cpp
@@ -1,4 +1,22 @@
/*
+ * This file is part of the Colobot: Gold Edition source code
+ * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
+ * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://gnu.org/licenses
+ */
+/*
Unit tests for Vector struct
Test data was randomly generated and the expected results
diff --git a/test/unit/ui/CMakeLists.txt b/test/unit/ui/CMakeLists.txt
deleted file mode 100644
index 7f7b2f8..0000000
--- a/test/unit/ui/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-set(SRC_DIR ${colobot_SOURCE_DIR}/src)
-
-include_directories(
-.
-${SRC_DIR}
-${GTEST_INCLUDE_DIR}
-${GMOCK_INCLUDE_DIR}
-${CLIPBOARD_INCLUDE_DIR}
-)
-
-# Platform-dependent implementation of CSystemUtils
-if(PLATFORM_WINDOWS)
-elseif(PLATFORM_MACOSX)
- set(ADDITIONAL_LIB "${X11_X11_LIB}")
-else()
- set(ADDITIONAL_LIB "-lX11")
-endif()
-
-add_executable(edit_test
-${SRC_DIR}/app/gamedata.cpp
-${SRC_DIR}/app/system.cpp
-${SRC_DIR}/app/${SYSTEM_CPP_MODULE}
-${SRC_DIR}/app/system_other.cpp
-${SRC_DIR}/common/event.cpp
-${SRC_DIR}/common/logger.cpp
-${SRC_DIR}/common/misc.cpp
-${SRC_DIR}/common/profile.cpp
-${SRC_DIR}/common/iman.cpp
-${SRC_DIR}/common/stringutils.cpp
-${SRC_DIR}/graphics/engine/text.cpp
-${SRC_DIR}/ui/button.cpp
-${SRC_DIR}/ui/control.cpp
-${SRC_DIR}/ui/edit.cpp
-${SRC_DIR}/ui/scroll.cpp
-stubs/app_stub.cpp
-stubs/engine_stub.cpp
-stubs/particle_stub.cpp
-stubs/restext_stub.cpp
-stubs/robotmain_stub.cpp
-edit_test.cpp)
-
-target_link_libraries(edit_test gtest gmock clipboard ${SDL_LIBRARY} ${SDLTTF_LIBRARY} ${Boost_LIBRARIES} ${ADDITIONAL_LIB})
-
-
-
-add_test(edit_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/edit_test)
diff --git a/test/unit/ui/edit_test.cpp b/test/unit/ui/edit_test.cpp
deleted file mode 100644
index 34af013..0000000
--- a/test/unit/ui/edit_test.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-#include "app/app.h"
-#include "app/gamedata.h"
-
-#include "ui/edit.h"
-
-#include "mocks/text_mock.h"
-
-#include <fstream>
-
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-class CEditTest : public testing::Test
-{
-public:
- CEditTest()
- : m_robotMain(nullptr)
- , m_gameData(nullptr)
- , m_engine(nullptr)
- , m_edit(nullptr)
- {}
-
- virtual void SetUp()
- {
- m_robotMain = new CRobotMain(&m_app, false);
-
- m_gameData = new CGameData();
-
- m_engine = new Gfx::CEngine(nullptr);
-
- m_edit = new Ui::CEdit;
- }
-
- virtual void TearDown()
- {
- delete m_edit;
- m_edit = nullptr;
- delete m_engine;
- m_engine = nullptr;
- delete m_gameData;
- m_gameData = nullptr;
- delete m_robotMain;
- m_robotMain = nullptr;
- }
- virtual ~CEditTest()
- {
-
- };
-
-protected:
- CApplication m_app;
- CRobotMain* m_robotMain;
- CGameData * m_gameData;
- Gfx::CEngine * m_engine;
- Ui::CEdit * m_edit;
- CLogger m_logger;
-};
-
-using ::testing::_;
-using ::testing::An;
-using ::testing::Return;
-
-TEST_F(CEditTest, WriteTest)
-{
- ASSERT_TRUE(true);
- CTextMock * text = dynamic_cast<CTextMock *>(m_engine->GetText());
- EXPECT_CALL(*text, GetCharWidth(_, _, _, _)).WillRepeatedly(Return(1.0f));
- EXPECT_CALL(*text, GetStringWidth(An<const std::string&>(), _, _, _)).WillOnce(Return(1.0f));
- std::string filename = "test.file";
- m_edit->SetMaxChar(Ui::EDITSTUDIOMAX);
- m_edit->SetAutoIndent(true);
- std::string inputScript = "{\ntext1\ntext2\n\ntext3\n{\ntext4\n}\n}";
- std::string expectedScript = "{\r\n\ttext1\r\n\ttext2\r\n\t\r\n\ttext3\r\n\t{\r\n\t\ttext4\r\n\t}\r\n}";
- m_edit->SetText(inputScript.c_str(), true);
- GetLogger()->Info("Writing text \n");
- m_edit->WriteText("script.txt");
-
- std::fstream scriptFile;
-
- scriptFile.open("script.txt", std::ios_base::binary | std::ios_base::in);
- std::string outputScript((std::istreambuf_iterator<char>(scriptFile)), std::istreambuf_iterator<char>());
- ASSERT_STREQ(expectedScript.c_str(), outputScript.c_str());
-}
-
-int main(int argc, char *argv[])
-{
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/test/unit/ui/mocks/text_mock.h b/test/unit/ui/mocks/text_mock.h
deleted file mode 100644
index b9af6d3..0000000
--- a/test/unit/ui/mocks/text_mock.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "common/logger.h"
-
-#include "graphics/engine/text.h"
-
-#include <gmock/gmock.h>
-
-class CTextMock : public Gfx::CText
-{
-public:
- CTextMock(Gfx::CEngine* engine) : CText(engine)
- {
- }
-
- virtual ~CTextMock()
- {
- };
-
- MOCK_METHOD4(GetCharWidth, float(Gfx::UTF8Char ch,
- Gfx::FontType type,
- float size,
- float offset));
- MOCK_METHOD4(GetStringWidth, float(const std::string &text,
- std::vector<Gfx::FontMetaChar>::iterator format,
- std::vector<Gfx::FontMetaChar>::iterator end,
- float size));
- MOCK_METHOD3(GetStringWidth, float(std::string text,
- Gfx::FontType font,
- float size));
- MOCK_METHOD4(GetStringWidth, float(Gfx::UTF8Char ch,
- Gfx::FontType font,
- float size,
- float offset));
-
-};
-
diff --git a/test/unit/ui/stubs/app_stub.cpp b/test/unit/ui/stubs/app_stub.cpp
deleted file mode 100644
index 95430d8..0000000
--- a/test/unit/ui/stubs/app_stub.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "app/app.h"
-
-#include "graphics/opengl/gldevice.h"
-
-template<> CApplication* CSingleton<CApplication>::m_instance = nullptr;
-
-namespace Gfx {
-
-GLDeviceConfig::GLDeviceConfig()
-{
-}
-
-} /* Gfx */
-
-
-CApplication::CApplication()
-{
-}
-
-CApplication::~CApplication()
-{
-}
-
-CSoundInterface* CApplication::GetSound()
-{
- return nullptr;
-}
-
-CEventQueue* CApplication::GetEventQueue()
-{
- return nullptr;
-}
-
-Event CApplication::CreateUpdateEvent()
-{
- return Event(EVENT_NULL);
-}
-
-char CApplication::GetLanguageChar() const
-{
- return 'E';
-}
diff --git a/test/unit/ui/stubs/engine_stub.cpp b/test/unit/ui/stubs/engine_stub.cpp
deleted file mode 100644
index 0a2777c..0000000
--- a/test/unit/ui/stubs/engine_stub.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-#include "graphics/engine/engine.h"
-#include "graphics/engine/text.h"
-
-#include "mocks/text_mock.h"
-
-template<> Gfx::CEngine* CSingleton<Gfx::CEngine>::m_instance = nullptr;
-
-namespace Gfx {
-
-CEngine::CEngine(CApplication* app) :
- m_app(app)
-{
- m_text = new CTextMock(this);
- m_text->Create();
-}
-
-CEngine::~CEngine()
-{
- delete m_text;
- m_text = nullptr;
-}
-
-CParticle* CEngine::GetParticle()
-{
- return nullptr;
-}
-
-Math::Point CEngine::WindowToInterfaceSize(Math::IntPoint size)
-{
- return Math::Point(size.x, size.y);
-}
-
-void CEngine::SetState(int state, const Color& color)
-{
- if (state == m_lastState && color == m_lastColor)
- return;
-
- m_lastState = state;
- m_lastColor = color;
-}
-
-Math::IntPoint CEngine::GetWindowSize()
-{
- return m_size;
-}
-
-void CEngine::AddStatisticTriangle(int count)
-{
- m_statisticTriangle += count;
-}
-
-void CEngine::SetMouseType(EngineMouseType type)
-{
- m_mouseType = type;
-}
-
-bool CEngine::SetTexture(const std::string& /* name */, int /* stage */)
-{
- return true;
-}
-
-CText* CEngine::GetText()
-{
- return m_text;
-}
-
-CDevice* CEngine::GetDevice()
-{
- return m_device;
-}
-
-int CEngine::GetEditIndentValue()
-{
- return m_editIndentValue;
-}
-
-void CEngine::DeleteTexture(const std::string& /* texName */)
-{
-}
-
-Texture CEngine::LoadTexture(const std::string& /* name */)
-{
- Texture texture;
- return texture;
-}
-
-Math::Vector CEngine::GetEyePt()
-{
- return Math::Vector();
-}
-
-Math::Vector CEngine::GetLookatPt()
-{
- return Math::Vector();
-}
-
-bool CEngine::GetPause()
-{
- return false;
-}
-
-
-} /* Gfx */
-
diff --git a/test/unit/ui/stubs/particle_stub.cpp b/test/unit/ui/stubs/particle_stub.cpp
deleted file mode 100644
index 34cf973..0000000
--- a/test/unit/ui/stubs/particle_stub.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-#include "graphics/engine/particle.h"
-
-#include "common/logger.h"
-
-
-// Graphics module namespace
-namespace Gfx {
-
-
-CParticle::CParticle(CEngine* /*engine*/)
-{
-}
-
-CParticle::~CParticle()
-{
-}
-
-void CParticle::SetDevice(CDevice* /*device*/)
-{
-}
-
-void CParticle::FlushParticle()
-{
-}
-
-void CParticle::FlushParticle(int /*sheet*/)
-{
-}
-
-int CParticle::CreateParticle(Math::Vector /*pos*/, Math::Vector /*speed*/, Math::Point /*dim*/,
- ParticleType /*type*/, float /*duration*/, float /*mass*/,
- float /*windSensitivity*/, int /*sheet*/)
-{
- return 0;
-}
-
-int CParticle::CreateFrag(Math::Vector /*pos*/, Math::Vector /*speed*/, EngineTriangle */*triangle*/,
- ParticleType /*type*/, float /*duration*/, float /*mass*/,
- float /*windSensitivity*/, int /*sheet*/)
-{
- return 0;
-}
-
-int CParticle::CreatePart(Math::Vector /*pos*/, Math::Vector /*speed*/, ParticleType /*type*/,
- float /*duration*/, float /*mass*/, float /*weight*/,
- float /*windSensitivity*/, int /*sheet*/)
-{
- return 0;
-}
-
-int CParticle::CreateRay(Math::Vector /*pos*/, Math::Vector /*goal*/, ParticleType /*type*/, Math::Point /*dim*/,
- float /*duration*/, int /*sheet*/)
-{
- return 0;
-}
-
-int CParticle::CreateTrack(Math::Vector /*pos*/, Math::Vector /*speed*/, Math::Point /*dim*/, ParticleType /*type*/,
- float /*duration*/, float /*mass*/, float /*length*/, float /*width*/)
-{
- return 0;
-}
-
-void CParticle::CreateWheelTrace(const Math::Vector &/*p1*/, const Math::Vector &/*p2*/, const Math::Vector &/*p3*/,
- const Math::Vector &/*p4*/, ParticleType /*type*/)
-{
-}
-
-void CParticle::DeleteParticle(ParticleType /*type*/)
-{
-}
-
-void CParticle::DeleteParticle(int /*channel*/)
-{
-}
-
-void CParticle::SetObjectLink(int /*channel*/, CObject */*object*/)
-{
-}
-
-void CParticle::SetObjectFather(int /*channel*/, CObject */*object*/)
-{
-}
-
-void CParticle::SetPosition(int /*channel*/, Math::Vector /*pos*/)
-{
-}
-
-void CParticle::SetDimension(int /*channel*/, Math::Point /*dim*/)
-{
-}
-
-void CParticle::SetZoom(int /*channel*/, float /*zoom*/)
-{
-}
-
-void CParticle::SetAngle(int /*channel*/, float /*angle*/)
-{
-}
-
-void CParticle::SetIntensity(int /*channel*/, float /*intensity*/)
-{
-}
-
-void CParticle::SetParam(int /*channel*/, Math::Vector /*pos*/, Math::Point /*dim*/, float /*zoom*/, float /*angle*/, float /*intensity*/)
-{
-}
-
-void CParticle::SetPhase(int /*channel*/, ParticlePhase /*phase*/, float /*duration*/)
-{
-}
-
-bool CParticle::GetPosition(int /*channel*/, Math::Vector &/*pos*/)
-{
- return true;
-}
-
-Color CParticle::GetFogColor(Math::Vector /*pos*/)
-{
- return Color();
-}
-
-void CParticle::SetFrameUpdate(int /*sheet*/, bool /*update*/)
-{
-}
-
-void CParticle::FrameParticle(float /*rTime*/)
-{
-}
-
-void CParticle::DrawParticle(int /*sheet*/)
-{
-}
-
-bool CParticle::WriteWheelTrace(const char */*filename*/, int /*width*/, int /*height*/, Math::Vector /*dl*/, Math::Vector /*ur*/)
-{
- return true;
-}
-
-void CParticle::DeleteRank(int /*rank*/)
-{
-}
-
-bool CParticle::CheckChannel(int &/*channel*/)
-{
- return true;
-}
-
-void CParticle::DrawParticleTriangle(int /*i*/)
-{
-}
-
-void CParticle::DrawParticleNorm(int /*i*/)
-{
-}
-
-void CParticle::DrawParticleFlat(int /*i*/)
-{
-}
-
-void CParticle::DrawParticleFog(int /*i*/)
-{
-}
-
-void CParticle::DrawParticleRay(int /*i*/)
-{
-}
-
-void CParticle::DrawParticleSphere(int /*i*/)
-{
-}
-
-void CParticle::DrawParticleCylinder(int /*i*/)
-{
-}
-
-void CParticle::DrawParticleWheel(int /*i*/)
-{
-}
-
-CObject* CParticle::SearchObjectGun(Math::Vector /*old*/, Math::Vector /*pos*/, ParticleType /*type*/, CObject */*father*/)
-{
- return nullptr;
-}
-
-CObject* CParticle::SearchObjectRay(Math::Vector /*pos*/, Math::Vector /*goal*/, ParticleType /*type*/, CObject */*father*/)
-{
- return nullptr;
-}
-
-void CParticle::Play(Sound /*sound*/, Math::Vector /*pos*/, float /*amplitude*/)
-{
-}
-
-bool CParticle::TrackMove(int /*i*/, Math::Vector /*pos*/, float /*progress*/)
-{
- return true;
-}
-
-void CParticle::TrackDraw(int /*i*/, ParticleType /*type*/)
-{
-}
-
-
-} // namespace Gfx
-
diff --git a/test/unit/ui/stubs/restext_stub.cpp b/test/unit/ui/stubs/restext_stub.cpp
deleted file mode 100644
index fa47da6..0000000
--- a/test/unit/ui/stubs/restext_stub.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "common/restext.h"
-
-bool GetResource(ResType /* type */, int /* num */, std::string& /* text */)
-{
- return true;
-}
-
-bool SearchKey(const char * /* cmd */, InputSlot & /* key */)
-{
- return true;
-}
-
diff --git a/test/unit/ui/stubs/robotmain_stub.cpp b/test/unit/ui/stubs/robotmain_stub.cpp
deleted file mode 100644
index 692f67f..0000000
--- a/test/unit/ui/stubs/robotmain_stub.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "object/robotmain.h"
-
-
-template<> CRobotMain* CSingleton<CRobotMain>::m_instance = nullptr;
-
-CRobotMain::CRobotMain(CApplication* app, bool loadProfile)
-{
-}
-
-CRobotMain::~CRobotMain()
-{
-}
-
-bool CRobotMain::GetGlint()
-{
- return false;
-}
-
-const InputBinding& CRobotMain::GetInputBinding(InputSlot slot)
-{
- unsigned int index = static_cast<unsigned int>(slot);
- assert(index >= 0 && index < INPUT_SLOT_MAX);
- return m_inputBindings[index];
-}
-
diff --git a/tools/blender-scripts.py b/tools/blender-scripts.py
index c2361c7..d2273d6 100644
--- a/tools/blender-scripts.py
+++ b/tools/blender-scripts.py
@@ -2,12 +2,12 @@
# Script for exporting Blender models (meshes) to Colobot model files
# (text format)
#
-# Copyright (C) 2012, PPC (Polish Portal of Colobot)
+# Copyright (C) 2012-2014, TerranovaTeam
#
bl_info = {
"name": "Colobot Model Format (.txt)",
- "author": "PPC (Polish Portal of Colobot)",
+ "author": "TerranovaTeam",
"version": (0, 0, 2),
"blender": (2, 6, 4),
"location": "File > Export > Colobot (.txt)",
diff --git a/tools/check-levels.sh b/tools/check-levels.sh
index 22544fb..127375f 100755
--- a/tools/check-levels.sh
+++ b/tools/check-levels.sh
@@ -2,8 +2,18 @@
# Runs every level in scenetest mode
-levels=`ls /usr/local/share/games/colobot/levels | cut -d "." -f 1`
-for level in $levels; do
- echo $level
- colobot -runscene $level -scenetest -loglevel warn
+categories=`ls /usr/local/share/games/colobot/levels`
+for category in $categories; do
+ if [ "$category" = "other" ]; then continue; fi
+ chapters=`ls /usr/local/share/games/colobot/levels/$category`
+ for chapter in $chapters; do
+ chapter=`echo -n $chapter | tail -c 1`
+ levels=`ls /usr/local/share/games/colobot/levels/$category/chapter00$chapter`
+ for level in $levels; do
+ if [ ! -d /usr/local/share/games/colobot/levels/$category/chapter00$chapter/$level ]; then continue; fi
+ level=`echo -n $level | cut -d . -f 1 | tail -c 3`
+ echo $category$chapter$level
+ colobot -runscene $category$chapter$level -scenetest -loglevel warn
+ done
+ done
done
diff --git a/tools/mission-time-loop.sh b/tools/mission-time-loop.sh
new file mode 100755
index 0000000..22d6107
--- /dev/null
+++ b/tools/mission-time-loop.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+# Works like mission-time.sh but execures in a loop
+while [ true ]; do
+ ./mission-time.sh $@
+done
diff --git a/tools/mission-time.sh b/tools/mission-time.sh
new file mode 100755
index 0000000..36c65e7
--- /dev/null
+++ b/tools/mission-time.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Returns mission time on stdout for a mission given on the commandline
+# Make sure the level actually uses MissionTimer, or the script will hang!
+
+colobot -headless -runscene $@ 2>&1 | while read -r line; do
+ if [[ $line =~ Mission[[:space:]]time:[[:space:]]([0-9:.]*) ]]; then
+ echo ${BASH_REMATCH[1]}
+ fi
+done
diff --git a/tools/update-license.sh b/tools/update-license.sh
new file mode 100755
index 0000000..870e173
--- /dev/null
+++ b/tools/update-license.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Replaces license text with contents of file provided as an argument
+if [ ! $# -eq 1 ]; then
+ echo "Usage: $0 [file with new license header]"
+ exit 1
+fi
+find . -name "*.cpp" -or -name "*.h" | while read file; do
+ echo $file
+ sed '/\/\/ \* This.*/,/If not\, see.*/d' $file > $file.tmp
+ cat $1 $file.tmp > $file
+ rm $file.tmp
+done