diff --git a/generator.py b/generator.py index ecc133cf2..385a3db42 100644 --- a/generator.py +++ b/generator.py @@ -12,7 +12,7 @@ def generateElements(elementFiles, outputCpp, outputH): #include -#include "simulation/Element.h" +#include "simulation/SimulationData.h" #include "simulation/elements/Element.h" """ @@ -106,7 +106,8 @@ std::vector GetElements(); #endif """ - elementContent = """#include "ElementClasses.h" + elementContent = """#include "simulation/ElementDefs.h" +#include "ElementClasses.h" std::vector GetElements() { diff --git a/src/Format.cpp b/src/Format.cpp index 8008c9ff7..cc1c2e54d 100644 --- a/src/Format.cpp +++ b/src/Format.cpp @@ -1,12 +1,13 @@ +#include "Format.h" #include -#include "common/String.h" #include #include #include +#include #include #include -#include "Format.h" + #include "graphics/Graphics.h" ByteString format::URLEncode(ByteString source) diff --git a/src/Misc.cpp b/src/Misc.cpp index e6813164c..fb0005a9a 100644 --- a/src/Misc.cpp +++ b/src/Misc.cpp @@ -1,11 +1,12 @@ -#include -#include +#include "Misc.h" + +#include "Config.h" +#include "icondoc.h" + #include #include #include -#include "Config.h" -#include "Misc.h" -#include "icondoc.h" + #include "common/tpt-minmax.h" //Signum function diff --git a/src/Platform.cpp b/src/Platform.cpp index 62939f4fe..dd7ec77e6 100644 --- a/src/Platform.cpp +++ b/src/Platform.cpp @@ -1,3 +1,5 @@ +#include "Platform.h" + #include #include #include @@ -15,7 +17,7 @@ #ifdef MACOSX #include #endif -#include "Platform.h" + #include "Misc.h" namespace Platform diff --git a/src/PowderToy.h b/src/PowderToy.h index e177234c8..e14f47280 100644 --- a/src/PowderToy.h +++ b/src/PowderToy.h @@ -1,5 +1,7 @@ #pragma once +#include "common/String.h" + void EngineProcess(); void ClipboardPush(ByteString text); ByteString ClipboardPull(); diff --git a/src/PowderToyRenderer.cpp b/src/PowderToyRenderer.cpp index aaf5176dc..8330371ae 100644 --- a/src/PowderToyRenderer.cpp +++ b/src/PowderToyRenderer.cpp @@ -1,5 +1,8 @@ #if defined(RENDERER) +#include "graphics/Graphics.h" +#include "graphics/Renderer.h" + #include #include #include @@ -9,8 +12,6 @@ #include "Config.h" #include "Format.h" #include "gui/interface/Engine.h" -#include "graphics/Graphics.h" -#include "graphics/Renderer.h" #include "client/GameSave.h" #include "simulation/Simulation.h" diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 8c0500ceb..c303cc255 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -1,7 +1,6 @@ #ifndef RENDERER #include -#include "common/String.h" #include #include #ifdef WIN @@ -18,7 +17,6 @@ #include #include "Config.h" -#include "graphics/Graphics.h" #if defined(LIN) #include "icon.h" #endif @@ -34,22 +32,23 @@ #endif #include "Format.h" +#include "Misc.h" +#include "graphics/Graphics.h" + +#include "client/SaveInfo.h" #include "client/GameSave.h" #include "client/SaveFile.h" -#include "simulation/SaveRenderer.h" #include "client/Client.h" -#include "Misc.h" #include "gui/game/GameController.h" #include "gui/game/GameView.h" - #include "gui/font/FontEditor.h" - #include "gui/dialogues/ErrorMessage.h" #include "gui/dialogues/ConfirmPrompt.h" #include "gui/interface/Keys.h" #include "gui/Style.h" +#include "gui/interface/Engine.h" using namespace std; diff --git a/src/Probability.cpp b/src/Probability.cpp index e2dfc5960..9df04015f 100644 --- a/src/Probability.cpp +++ b/src/Probability.cpp @@ -13,9 +13,10 @@ * along with this program. If not, see . */ +#include "Probability.h" + #include #include -#include "Probability.h" #include "common/tpt-rand.h" namespace Probability diff --git a/src/Update.cpp b/src/Update.cpp index 52f2eac5a..3d799758a 100644 --- a/src/Update.cpp +++ b/src/Update.cpp @@ -1,3 +1,5 @@ +#include "Update.h" + #include #include #ifndef WIN @@ -21,7 +23,6 @@ #include #endif -#include "Update.h" #include "Platform.h" // returns 1 on failure, 0 on success diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 24ff64240..3bed0fa58 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -1,11 +1,12 @@ +#include "Client.h" + #include -#include #include #include +#include #include #include #include -#include #include #include @@ -28,25 +29,23 @@ #include "common/String.h" #include "Config.h" #include "Format.h" -#include "Client.h" #include "MD5.h" -#include "graphics/Graphics.h" -#include "Misc.h" #include "Platform.h" #include "Update.h" -#include "simulation/SaveRenderer.h" -#include "gui/interface/Point.h" +#include "ClientListener.h" + +#include "graphics/Graphics.h" + +#include "gui/preview/Comment.h" + #include "client/SaveInfo.h" #include "client/SaveFile.h" #include "client/GameSave.h" #include "client/UserInfo.h" -#include "gui/preview/Comment.h" -#include "ClientListener.h" #include "client/http/Request.h" #include "client/http/RequestManager.h" -#include "json/json.h" extern "C" { diff --git a/src/client/Client.h b/src/client/Client.h index eb0d7a976..e5a6c55e9 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -1,18 +1,14 @@ #ifndef CLIENT_H #define CLIENT_H -#include #include #include #include "common/String.h" -#include "Config.h" #include "common/Singleton.h" +#include "json/json.h" #include "User.h" -#include "UserInfo.h" - -#include "json/json.h" class SaveInfo; class SaveFile; diff --git a/src/client/ClientListener.h b/src/client/ClientListener.h index 0d3345fa9..09d3494b8 100644 --- a/src/client/ClientListener.h +++ b/src/client/ClientListener.h @@ -1,6 +1,8 @@ #ifndef CLIENTLISTENER_H_ #define CLIENTLISTENER_H_ +#include "common/String.h" + class Client; class ClientListener { diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index ed3498115..cace44ddc 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -1,18 +1,20 @@ -#include "common/tpt-minmax.h" +#include "GameSave.h" + #include #include #include #include -#include #include #include +#include + #include "Config.h" #include "Format.h" -#include "GameSave.h" -#include "simulation/SimulationData.h" -#include "ElementClasses.h" #include "hmap.h" +#include "simulation/Simulation.h" +#include "ElementClasses.h" + GameSave::GameSave(GameSave & save): majorVersion(save.majorVersion), waterEEnabled(save.waterEEnabled), @@ -2785,3 +2787,19 @@ GameSave::~GameSave() { dealloc(); } + +GameSave& GameSave::operator << (Particle &v) +{ + if(particlesCount -#include #include "common/String.h" -#include -#include #ifdef GetUserName # undef GetUserName // dammit windows diff --git a/src/client/http/AvatarRequest.cpp b/src/client/http/AvatarRequest.cpp index 2e0ee144f..fb8890ba8 100644 --- a/src/client/http/AvatarRequest.cpp +++ b/src/client/http/AvatarRequest.cpp @@ -1,4 +1,5 @@ #include "AvatarRequest.h" + #include "Config.h" namespace http diff --git a/src/client/http/AvatarRequest.h b/src/client/http/AvatarRequest.h index a7a7e57ba..79dda8cf5 100644 --- a/src/client/http/AvatarRequest.h +++ b/src/client/http/AvatarRequest.h @@ -2,7 +2,6 @@ #define AVATARREQUEST2_H #include "ImageRequest.h" -#include "common/String.h" namespace http { diff --git a/src/client/http/GetUserInfoRequest.cpp b/src/client/http/GetUserInfoRequest.cpp index 71bde9c1d..30ec0f390 100644 --- a/src/client/http/GetUserInfoRequest.cpp +++ b/src/client/http/GetUserInfoRequest.cpp @@ -1,5 +1,8 @@ #include "GetUserInfoRequest.h" +#include "Config.h" +#include "client/UserInfo.h" + namespace http { GetUserInfoRequest::GetUserInfoRequest(ByteString username) : diff --git a/src/client/http/GetUserInfoRequest.h b/src/client/http/GetUserInfoRequest.h index 03be3de63..9328bd185 100644 --- a/src/client/http/GetUserInfoRequest.h +++ b/src/client/http/GetUserInfoRequest.h @@ -1,14 +1,9 @@ #ifndef GETUSERINFOREQUEST2_H #define GETUSERINFOREQUEST2_H -#include "Request.h" -#include "common/String.h" -#include "json/json.h" -#include "client/Client.h" #include "APIRequest.h" -#include -#include +class UserInfo; namespace http { diff --git a/src/client/http/ImageRequest.h b/src/client/http/ImageRequest.h index 92c5400e8..1d855c7fb 100644 --- a/src/client/http/ImageRequest.h +++ b/src/client/http/ImageRequest.h @@ -7,6 +7,7 @@ #include class VideoBuffer; + namespace http { class ImageRequest : public Request diff --git a/src/client/http/Request.cpp b/src/client/http/Request.cpp index e8808f205..e66a9ed6e 100644 --- a/src/client/http/Request.cpp +++ b/src/client/http/Request.cpp @@ -1,6 +1,6 @@ #include "Request.h" + #include "RequestManager.h" -#include "Platform.h" namespace http { diff --git a/src/client/http/RequestManager.cpp b/src/client/http/RequestManager.cpp index 068ed9f70..ea53758c1 100644 --- a/src/client/http/RequestManager.cpp +++ b/src/client/http/RequestManager.cpp @@ -1,10 +1,10 @@ #include "RequestManager.h" -#include "Request.h" -#include "Config.h" -#include "Platform.h" #include +#include "Request.h" +#include "Config.h" + const int curl_multi_wait_timeout_ms = 100; const long curl_max_host_connections = 6; diff --git a/src/client/http/RequestManager.h b/src/client/http/RequestManager.h index 19e1e2df3..a9010a668 100644 --- a/src/client/http/RequestManager.h +++ b/src/client/http/RequestManager.h @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include "common/Singleton.h" diff --git a/src/client/http/SaveUserInfoRequest.cpp b/src/client/http/SaveUserInfoRequest.cpp index c7d687ef1..cd579eb4d 100644 --- a/src/client/http/SaveUserInfoRequest.cpp +++ b/src/client/http/SaveUserInfoRequest.cpp @@ -1,8 +1,11 @@ #include "SaveUserInfoRequest.h" +#include "Config.h" +#include "client/UserInfo.h" + namespace http { - SaveUserInfoRequest::SaveUserInfoRequest(UserInfo info) : + SaveUserInfoRequest::SaveUserInfoRequest(UserInfo &info) : APIRequest(SCHEME SERVER "/Profile.json") { AddPostData({ diff --git a/src/client/http/SaveUserInfoRequest.h b/src/client/http/SaveUserInfoRequest.h index 48ef7ba9f..c9b63055f 100644 --- a/src/client/http/SaveUserInfoRequest.h +++ b/src/client/http/SaveUserInfoRequest.h @@ -1,21 +1,16 @@ #ifndef SAVEUSERINFOREQUEST2_H #define SAVEUSERINFOREQUEST2_H -#include "Request.h" -#include "common/String.h" -#include "json/json.h" -#include "client/Client.h" #include "APIRequest.h" -#include -#include +class UserInfo; namespace http { class SaveUserInfoRequest : public APIRequest { public: - SaveUserInfoRequest(UserInfo info); + SaveUserInfoRequest(UserInfo &info); virtual ~SaveUserInfoRequest(); bool Finish(); diff --git a/src/client/http/ThumbnailRequest.cpp b/src/client/http/ThumbnailRequest.cpp index 8581df245..905762fd9 100644 --- a/src/client/http/ThumbnailRequest.cpp +++ b/src/client/http/ThumbnailRequest.cpp @@ -1,4 +1,5 @@ #include "ThumbnailRequest.h" + #include "Config.h" namespace http diff --git a/src/client/http/ThumbnailRequest.h b/src/client/http/ThumbnailRequest.h index 04001462a..b6f951ed8 100644 --- a/src/client/http/ThumbnailRequest.h +++ b/src/client/http/ThumbnailRequest.h @@ -2,7 +2,6 @@ #define THUMBNAILREQUEST2_H #include "ImageRequest.h" -#include "common/String.h" namespace http { diff --git a/src/debug/DebugInfo.h b/src/debug/DebugInfo.h index d41809664..f2785d5e8 100644 --- a/src/debug/DebugInfo.h +++ b/src/debug/DebugInfo.h @@ -1,7 +1,6 @@ #pragma once #include "gui/interface/Point.h" -#include "common/tpt-compat.h" class DebugInfo { diff --git a/src/debug/DebugLines.cpp b/src/debug/DebugLines.cpp index 7de5665b4..12e9521a3 100644 --- a/src/debug/DebugLines.cpp +++ b/src/debug/DebugLines.cpp @@ -1,7 +1,11 @@ #include "DebugLines.h" + #include "gui/game/GameView.h" + #include "gui/game/GameController.h" +#include "graphics/Graphics.h" + DebugLines::DebugLines(unsigned int id, GameView * view, GameController * controller): DebugInfo(id), view(view), diff --git a/src/debug/DebugParts.cpp b/src/debug/DebugParts.cpp index ffab84228..8587b8a33 100644 --- a/src/debug/DebugParts.cpp +++ b/src/debug/DebugParts.cpp @@ -1,8 +1,11 @@ -#include #include "DebugParts.h" + #include "gui/interface/Engine.h" + #include "simulation/Simulation.h" +#include "graphics/Graphics.h" + DebugParts::DebugParts(unsigned int id, Simulation * sim): DebugInfo(id), sim(sim) diff --git a/src/debug/ElementPopulation.cpp b/src/debug/ElementPopulation.cpp index c9739bd84..a6fa75284 100644 --- a/src/debug/ElementPopulation.cpp +++ b/src/debug/ElementPopulation.cpp @@ -1,7 +1,10 @@ #include "ElementPopulation.h" + #include "gui/interface/Engine.h" + #include "simulation/Simulation.h" -#include "Format.h" + +#include "graphics/Graphics.h" ElementPopulationDebug::ElementPopulationDebug(unsigned int id, Simulation * sim): DebugInfo(id), diff --git a/src/debug/ParticleDebug.cpp b/src/debug/ParticleDebug.cpp index 1df0e9e87..ed92b7eb7 100644 --- a/src/debug/ParticleDebug.cpp +++ b/src/debug/ParticleDebug.cpp @@ -1,7 +1,8 @@ #include "ParticleDebug.h" -#include "gui/interface/Engine.h" -#include "gui/game/GameView.h" -#include "gui/game/GameController.h" + +#include "gui/game/GameModel.h" + +#include "simulation/Simulation.h" ParticleDebug::ParticleDebug(unsigned int id, Simulation * sim, GameModel * model): DebugInfo(id), diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp index c44a2a751..17c08621f 100644 --- a/src/graphics/Graphics.cpp +++ b/src/graphics/Graphics.cpp @@ -1,10 +1,11 @@ +#include "Graphics.h" + #include #include +#include +#include #include -#include "common/String.h" -#include "Config.h" -#include "Misc.h" -#include "Graphics.h" + #include "FontReader.h" #ifdef HIGH_QUALITY_RESAMPLE #include "resampler/resampler.h" diff --git a/src/graphics/Graphics.h b/src/graphics/Graphics.h index 5bfb8216c..f58eef316 100644 --- a/src/graphics/Graphics.h +++ b/src/graphics/Graphics.h @@ -2,9 +2,6 @@ #define GRAPHICS_H #include "common/String.h" -#include -#include -#include #if defined(OGLI) #include "OpenGLHeaders.h" #endif diff --git a/src/graphics/RasterGraphics.cpp b/src/graphics/RasterGraphics.cpp index 8b0e00f12..a55175e5d 100644 --- a/src/graphics/RasterGraphics.cpp +++ b/src/graphics/RasterGraphics.cpp @@ -1,5 +1,8 @@ #include "Graphics.h" +#include +#include + #ifndef OGLI Graphics::Graphics(): diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index 905fd473e..47452aa37 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -1,3 +1,5 @@ +#include "Renderer.h" + #include #include #include @@ -6,15 +8,18 @@ #include #include "Config.h" #include "Misc.h" -#include "Renderer.h" -#include "Graphics.h" -#include "common/tpt-compat.h" -#include "common/tpt-minmax.h" + #include "common/tpt-rand.h" +#include "common/tpt-compat.h" + #include "gui/game/RenderPreset.h" -#include "simulation/Elements.h" + +#include "simulation/Simulation.h" #include "simulation/ElementGraphics.h" #include "simulation/Air.h" +#include "simulation/Gravity.h" +#include "ElementClasses.h" + #ifdef LUACONSOLE #include "lua/LuaScriptInterface.h" #include "lua/LuaScriptHelper.h" diff --git a/src/graphics/Renderer.h b/src/graphics/Renderer.h index b14143b7b..cf4b752b8 100644 --- a/src/graphics/Renderer.h +++ b/src/graphics/Renderer.h @@ -6,13 +6,12 @@ #include "OpenGLHeaders.h" #endif -#include "Config.h" #include "Graphics.h" +#include "Config.h" #include "gui/interface/Point.h" class RenderPreset; class Simulation; -class Graphics; struct gcache_item { diff --git a/src/gui/Style.cpp b/src/gui/Style.cpp index 5c9b124d4..9305645bc 100644 --- a/src/gui/Style.cpp +++ b/src/gui/Style.cpp @@ -1,7 +1,4 @@ -#include - #include "gui/Style.h" -#include "gui/interface/Colour.h" namespace style { ui::Colour Colour::InformationTitle = ui::Colour(140, 140, 255); diff --git a/src/gui/Style.h b/src/gui/Style.h index c4702ee9a..51d161bdd 100644 --- a/src/gui/Style.h +++ b/src/gui/Style.h @@ -1,7 +1,7 @@ #ifndef STYLE_H_ #define STYLE_H_ -namespace ui { class Colour; } +#include "gui/interface/Colour.h" namespace style { @@ -20,6 +20,7 @@ namespace style static ui::Colour ActiveBackground; static ui::Colour InactiveBackground; }; + class Metrics { }; diff --git a/src/gui/colourpicker/ColourPickerActivity.cpp b/src/gui/colourpicker/ColourPickerActivity.cpp index 9893bbb6f..49c8f2599 100644 --- a/src/gui/colourpicker/ColourPickerActivity.cpp +++ b/src/gui/colourpicker/ColourPickerActivity.cpp @@ -1,13 +1,14 @@ -#include -#include #include "ColourPickerActivity.h" + #include "gui/interface/Textbox.h" +#include "gui/interface/Button.h" #include "gui/interface/Label.h" #include "gui/interface/Keys.h" -#include "gui/game/Tool.h" #include "gui/Style.h" -#include "Format.h" -#include "gui/game/GameModel.h" + +#include "graphics/Graphics.h" + +#include "Misc.h" ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, ColourPickedCallback * callback) : WindowActivity(ui::Point(-1, -1), ui::Point(266, 175)), diff --git a/src/gui/colourpicker/ColourPickerActivity.h b/src/gui/colourpicker/ColourPickerActivity.h index 8e2b4b845..7efffc39d 100644 --- a/src/gui/colourpicker/ColourPickerActivity.h +++ b/src/gui/colourpicker/ColourPickerActivity.h @@ -1,10 +1,14 @@ #pragma once -#include #include "common/String.h" #include "Activity.h" -#include "gui/interface/Window.h" -#include "gui/interface/Textbox.h" +#include "gui/interface/Colour.h" + +namespace ui +{ + class Textbox; + class Label; +} class ColourPickedCallback { diff --git a/src/gui/console/ConsoleCommand.h b/src/gui/console/ConsoleCommand.h index 87e85e406..95e438715 100644 --- a/src/gui/console/ConsoleCommand.h +++ b/src/gui/console/ConsoleCommand.h @@ -1,6 +1,8 @@ #ifndef CONSOLECOMMAND_H_ #define CONSOLECOMMAND_H_ +#include "common/String.h" + class ConsoleCommand { public: diff --git a/src/gui/console/ConsoleController.cpp b/src/gui/console/ConsoleController.cpp index 6ed5eee58..2503e12c5 100644 --- a/src/gui/console/ConsoleController.cpp +++ b/src/gui/console/ConsoleController.cpp @@ -1,6 +1,12 @@ -#include #include "ConsoleController.h" +#include "Controller.h" +#include "ConsoleView.h" +#include "ConsoleModel.h" +#include "ConsoleCommand.h" + +#include "lua/CommandInterface.h" + ConsoleController::ConsoleController(ControllerCallback * callback, CommandInterface * commandInterface): HasDone(false) { diff --git a/src/gui/console/ConsoleController.h b/src/gui/console/ConsoleController.h index 26f61acbe..aea6ab98d 100644 --- a/src/gui/console/ConsoleController.h +++ b/src/gui/console/ConsoleController.h @@ -2,15 +2,13 @@ #define CONSOLECONTROLLER_H_ #include "common/String.h" -#include "Controller.h" -#include "ConsoleView.h" -#include "ConsoleModel.h" -#include "ConsoleCommand.h" -#include "lua/CommandInterface.h" +class CommandInterface; class ConsoleModel; class ConsoleView; -class ConsoleController { +class ControllerCallback; +class ConsoleController +{ ControllerCallback * callback; ConsoleView * consoleView; ConsoleModel * consoleModel; diff --git a/src/gui/console/ConsoleModel.cpp b/src/gui/console/ConsoleModel.cpp index bd516a84b..6470f0aa4 100644 --- a/src/gui/console/ConsoleModel.cpp +++ b/src/gui/console/ConsoleModel.cpp @@ -1,6 +1,9 @@ -#include "client/Client.h" #include "ConsoleModel.h" +#include "ConsoleView.h" + +#include "client/Client.h" + ConsoleModel::ConsoleModel() { std::vector previousHistory = Client::Ref().GetPrefStringArray("Console.History"); for(std::vector::reverse_iterator iter = previousHistory.rbegin(), end = previousHistory.rend(); iter != end; ++iter) diff --git a/src/gui/console/ConsoleModel.h b/src/gui/console/ConsoleModel.h index e2948498f..81f32d44e 100644 --- a/src/gui/console/ConsoleModel.h +++ b/src/gui/console/ConsoleModel.h @@ -3,11 +3,11 @@ #include #include -#include "ConsoleView.h" #include "ConsoleCommand.h" class ConsoleView; -class ConsoleModel { +class ConsoleModel +{ size_t currentCommandIndex; std::vector observers; std::deque previousCommands; diff --git a/src/gui/console/ConsoleView.cpp b/src/gui/console/ConsoleView.cpp index fb1a0bc75..1c60dad91 100644 --- a/src/gui/console/ConsoleView.cpp +++ b/src/gui/console/ConsoleView.cpp @@ -1,5 +1,19 @@ #include "ConsoleView.h" + +#include "ConsoleController.h" +#include "ConsoleModel.h" + +#include + +#include "graphics/Graphics.h" + +#include "Config.h" + +#include "ConsoleCommand.h" + #include "gui/interface/Keys.h" +#include "gui/interface/Label.h" +#include "gui/interface/Textbox.h" ConsoleView::ConsoleView(): ui::Window(ui::Point(0, 0), ui::Point(WINDOWW, 150)), diff --git a/src/gui/console/ConsoleView.h b/src/gui/console/ConsoleView.h index 8b45afce0..33700ab8b 100644 --- a/src/gui/console/ConsoleView.h +++ b/src/gui/console/ConsoleView.h @@ -2,18 +2,18 @@ #define CONSOLEVIEW_H_ #include -#include -#include "gui/interface/Label.h" #include "gui/interface/Window.h" -#include "ConsoleController.h" -#include "ConsoleModel.h" -#include "gui/interface/Textbox.h" -#include "ConsoleCommand.h" +namespace ui +{ + class Label; + class Textbox; +} class ConsoleController; class ConsoleModel; -class ConsoleView: public ui::Window { +class ConsoleView: public ui::Window +{ ConsoleController * c; ui::Textbox * commandField; std::vector commandList; diff --git a/src/gui/dialogues/ConfirmPrompt.cpp b/src/gui/dialogues/ConfirmPrompt.cpp index 4b8a8efe4..738e3f597 100644 --- a/src/gui/dialogues/ConfirmPrompt.cpp +++ b/src/gui/dialogues/ConfirmPrompt.cpp @@ -1,11 +1,16 @@ #include "ConfirmPrompt.h" + #include "gui/Style.h" + #include "gui/interface/Button.h" #include "gui/interface/Engine.h" #include "gui/interface/Label.h" #include "gui/interface/ScrollPanel.h" + #include "PowderToy.h" +#include "graphics/Graphics.h" + ConfirmPrompt::ConfirmPrompt(String title, String message, ConfirmDialogueCallback * callback_): ui::Window(ui::Point(-1, -1), ui::Point(250, 35)), callback(callback_) diff --git a/src/gui/dialogues/ConfirmPrompt.h b/src/gui/dialogues/ConfirmPrompt.h index 6796868cf..42f571f15 100644 --- a/src/gui/dialogues/ConfirmPrompt.h +++ b/src/gui/dialogues/ConfirmPrompt.h @@ -1,7 +1,6 @@ #ifndef CONFIRMPROMPT_H_ #define CONFIRMPROMPT_H_ -#include "common/String.h" #include "gui/interface/Window.h" class ConfirmDialogueCallback; diff --git a/src/gui/dialogues/ErrorMessage.cpp b/src/gui/dialogues/ErrorMessage.cpp index bf7ffad30..c643b7335 100644 --- a/src/gui/dialogues/ErrorMessage.cpp +++ b/src/gui/dialogues/ErrorMessage.cpp @@ -1,10 +1,15 @@ -#include "gui/Style.h" #include "ErrorMessage.h" + +#include "gui/Style.h" + #include "gui/interface/Button.h" #include "gui/interface/Engine.h" #include "gui/interface/Label.h" + #include "PowderToy.h" +#include "graphics/Graphics.h" + ErrorMessage::ErrorMessage(String title, String message, ErrorMessageCallback * callback_): ui::Window(ui::Point(-1, -1), ui::Point(200, 35)), callback(callback_) diff --git a/src/gui/dialogues/InformationMessage.cpp b/src/gui/dialogues/InformationMessage.cpp index 233782217..38056fdb7 100644 --- a/src/gui/dialogues/InformationMessage.cpp +++ b/src/gui/dialogues/InformationMessage.cpp @@ -1,10 +1,13 @@ -#include "gui/Style.h" #include "InformationMessage.h" + +#include "gui/Style.h" #include "gui/interface/Button.h" #include "gui/interface/Engine.h" #include "gui/interface/Label.h" #include "gui/interface/ScrollPanel.h" +#include "graphics/Graphics.h" + InformationMessage::InformationMessage(String title, String message, bool large): ui::Window(ui::Point(-1, -1), ui::Point(200, 35)) { diff --git a/src/gui/dialogues/SaveIDMessage.cpp b/src/gui/dialogues/SaveIDMessage.cpp index 5c1c702e0..8c81689f8 100644 --- a/src/gui/dialogues/SaveIDMessage.cpp +++ b/src/gui/dialogues/SaveIDMessage.cpp @@ -1,9 +1,13 @@ -#include "gui/Style.h" #include "SaveIDMessage.h" + +#include "gui/Style.h" + #include "graphics/Graphics.h" + #include "gui/interface/Button.h" #include "gui/interface/CopyTextButton.h" #include "gui/interface/Label.h" + #include "Format.h" SaveIDMessage::SaveIDMessage(int id): diff --git a/src/gui/dialogues/TextPrompt.cpp b/src/gui/dialogues/TextPrompt.cpp index c56e4093c..439917ca9 100644 --- a/src/gui/dialogues/TextPrompt.cpp +++ b/src/gui/dialogues/TextPrompt.cpp @@ -1,11 +1,15 @@ -#include #include "TextPrompt.h" + #include "gui/interface/Label.h" #include "gui/interface/Button.h" #include "gui/interface/Engine.h" +#include "gui/interface/Textbox.h" + #include "gui/Style.h" #include "PowderToy.h" +#include "graphics/Graphics.h" + class CloseAction: public ui::ButtonAction { public: diff --git a/src/gui/dialogues/TextPrompt.h b/src/gui/dialogues/TextPrompt.h index 3ca7f7942..c59f683c1 100644 --- a/src/gui/dialogues/TextPrompt.h +++ b/src/gui/dialogues/TextPrompt.h @@ -2,10 +2,15 @@ #define TEXTPROMPT_H_ #include "gui/interface/Window.h" -#include "gui/interface/Textbox.h" + +namespace ui +{ + class Textbox; +} class TextDialogueCallback; -class TextPrompt: public ui::Window { +class TextPrompt: public ui::Window +{ protected: ui::Textbox * textField; public: diff --git a/src/gui/elementsearch/ElementSearchActivity.cpp b/src/gui/elementsearch/ElementSearchActivity.cpp index 7a1b8581a..ffc357e26 100644 --- a/src/gui/elementsearch/ElementSearchActivity.cpp +++ b/src/gui/elementsearch/ElementSearchActivity.cpp @@ -1,6 +1,5 @@ -#include -#include "common/String.h" #include "ElementSearchActivity.h" + #include "gui/interface/Textbox.h" #include "gui/interface/Label.h" #include "gui/interface/Keys.h" @@ -8,6 +7,9 @@ #include "gui/Style.h" #include "gui/game/Favorite.h" #include "gui/game/GameController.h" +#include "gui/game/ToolButton.h" + +#include "graphics/Graphics.h" class ElementSearchActivity::ToolAction: public ui::ButtonAction { diff --git a/src/gui/elementsearch/ElementSearchActivity.h b/src/gui/elementsearch/ElementSearchActivity.h index e17ce44e2..e3a17e197 100644 --- a/src/gui/elementsearch/ElementSearchActivity.h +++ b/src/gui/elementsearch/ElementSearchActivity.h @@ -3,13 +3,18 @@ #include #include "Activity.h" -#include "gui/interface/Window.h" -#include "gui/interface/Textbox.h" -#include "gui/game/ToolButton.h" +#include "common/String.h" +#include "gui/interface/Point.h" class Tool; +class ToolButton; class GameController; +namespace ui +{ + class Textbox; +} + class ElementSearchActivity: public WindowActivity { Tool * firstResult; diff --git a/src/gui/filebrowser/FileBrowserActivity.cpp b/src/gui/filebrowser/FileBrowserActivity.cpp index 89f5ac505..c0189c4bb 100644 --- a/src/gui/filebrowser/FileBrowserActivity.cpp +++ b/src/gui/filebrowser/FileBrowserActivity.cpp @@ -1,21 +1,24 @@ -#include -#include #include "FileBrowserActivity.h" + #include "gui/interface/Label.h" #include "gui/interface/Textbox.h" #include "gui/interface/ScrollPanel.h" #include "gui/interface/SaveButton.h" #include "gui/interface/ProgressBar.h" + #include "client/Client.h" #include "client/SaveFile.h" #include "client/GameSave.h" + #include "gui/Style.h" #include "tasks/Task.h" -#include "simulation/SaveRenderer.h" + #include "gui/dialogues/TextPrompt.h" #include "gui/dialogues/ConfirmPrompt.h" #include "gui/dialogues/ErrorMessage.h" +#include "graphics/Graphics.h" + class SaveSelectedAction: public ui::SaveButtonAction { FileBrowserActivity * a; diff --git a/src/gui/filebrowser/FileBrowserActivity.h b/src/gui/filebrowser/FileBrowserActivity.h index d12407ce7..78172b1a4 100644 --- a/src/gui/filebrowser/FileBrowserActivity.h +++ b/src/gui/filebrowser/FileBrowserActivity.h @@ -3,10 +3,8 @@ #include #include "common/String.h" #include "Activity.h" -#include "gui/interface/Window.h" #include "tasks/TaskListener.h" - class SaveFile; class FileSelectedCallback { diff --git a/src/gui/font/FontEditor.cpp b/src/gui/font/FontEditor.cpp index 0bdb80ce8..980a75dbf 100644 --- a/src/gui/font/FontEditor.cpp +++ b/src/gui/font/FontEditor.cpp @@ -7,6 +7,7 @@ #include "FontEditor.h" #include "Config.h" +#include "gui/interface/Textbox.h" #include "gui/interface/Engine.h" #include "gui/interface/Point.h" #include "gui/interface/Button.h" diff --git a/src/gui/font/FontEditor.h b/src/gui/font/FontEditor.h index 5643188c1..439504281 100644 --- a/src/gui/font/FontEditor.h +++ b/src/gui/font/FontEditor.h @@ -8,7 +8,13 @@ #include "font.h" #include "gui/interface/Window.h" -#include "gui/interface/Textbox.h" + +namespace ui +{ + class Textbox; + class Label; + class Button; +} #define MAX_WIDTH 64 class FontEditor: public ui::Window diff --git a/src/gui/game/BitmapBrush.cpp b/src/gui/game/BitmapBrush.cpp new file mode 100644 index 000000000..75f6796f7 --- /dev/null +++ b/src/gui/game/BitmapBrush.cpp @@ -0,0 +1,80 @@ +#include "BitmapBrush.h" + +#include +#include "Misc.h" + +#include "common/tpt-minmax.h" + +BitmapBrush::BitmapBrush(std::vector newBitmap, ui::Point rectSize_): + Brush(ui::Point(0, 0)), + origSize(0, 0) +{ + ui::Point newSize = rectSize_; + + //Ensure the rect has odd dimensions so we can pull an integer radius with a 1x1 centre + if(!(newSize.X % 2)) + newSize.X += 1; + if(!(newSize.Y % 2)) + newSize.Y += 1; + + radius = (newSize-ui::Point(1, 1))/2; + size = newSize; + origSize = size; + + origBitmap = new unsigned char[size.X*size.Y]; + std::fill(origBitmap, origBitmap+(size.X*size.Y), 0); + for(int y = 0; y < rectSize_.Y; y++) + { + for(int x = 0; x < rectSize_.X; x++) + { + if(newBitmap[(y*rectSize_.X)+x] >= 128) + origBitmap[(y*size.X)+x] = newBitmap[(y*rectSize_.X)+x]; + } + } + + SetRadius(radius); +}; + +void BitmapBrush::GenerateBitmap() +{ + if(origBitmap) + { + delete[] bitmap; + bitmap = new unsigned char[size.X*size.Y]; + if(size == origSize) + std::copy(origBitmap, origBitmap+(origSize.X*origSize.Y), bitmap); + else + { + //Bilinear interpolation + float factorX = ((float)origSize.X)/((float)size.X); + float factorY = ((float)origSize.Y)/((float)size.Y); + for(int y = 0; y < size.Y; y++) + { + for(int x = 0; x < size.X; x++) + { + float originalY = ((float)y)*factorY; + float originalX = ((float)x)*factorX; + + int lowerX = std::floor(originalX); + int upperX = std::min((float)(origSize.X-1), std::floor(originalX+1.0f)); + int lowerY = std::floor(originalY); + int upperY = std::min((float)(origSize.Y-1), std::floor(originalY+1.0f)); + + unsigned char topRight = origBitmap[(lowerY*origSize.X)+upperX]; + unsigned char topLeft = origBitmap[(lowerY*origSize.X)+lowerX]; + unsigned char bottomRight = origBitmap[(upperY*origSize.X)+upperX]; + unsigned char bottomLeft = origBitmap[(upperY*origSize.X)+lowerX]; + float top = LinearInterpolate(topLeft, topRight, lowerX, upperX, originalX); + float bottom = LinearInterpolate(bottomLeft, bottomRight, lowerX, upperX, originalX); + float mid = LinearInterpolate(top, bottom, lowerY, upperY, originalY); + bitmap[(y*size.X)+x] = mid > 128 ? 255 : 0; + } + } + } + } +} + +BitmapBrush::~BitmapBrush() +{ + delete[] origBitmap; +} diff --git a/src/gui/game/BitmapBrush.h b/src/gui/game/BitmapBrush.h index 174b4c69b..e7e56fdd4 100644 --- a/src/gui/game/BitmapBrush.h +++ b/src/gui/game/BitmapBrush.h @@ -9,7 +9,6 @@ #define BTIMAPBRUSH_H_ #include -#include #include "Brush.h" class BitmapBrush: public Brush @@ -18,77 +17,9 @@ protected: ui::Point origSize; unsigned char * origBitmap; public: - BitmapBrush(std::vector newBitmap, ui::Point rectSize_): - Brush(ui::Point(0, 0)), - origSize(0, 0) - { - ui::Point newSize = rectSize_; - - //Ensure the rect has odd dimensions so we can pull an integer radius with a 1x1 centre - if(!(newSize.X % 2)) - newSize.X += 1; - if(!(newSize.Y % 2)) - newSize.Y += 1; - - radius = (newSize-ui::Point(1, 1))/2; - size = newSize; - origSize = size; - - origBitmap = new unsigned char[size.X*size.Y]; - std::fill(origBitmap, origBitmap+(size.X*size.Y), 0); - for(int y = 0; y < rectSize_.Y; y++) - { - for(int x = 0; x < rectSize_.X; x++) - { - if(newBitmap[(y*rectSize_.X)+x] >= 128) - origBitmap[(y*size.X)+x] = newBitmap[(y*rectSize_.X)+x]; - } - } - - SetRadius(radius); - }; - void GenerateBitmap() override - { - if(origBitmap) - { - delete[] bitmap; - bitmap = new unsigned char[size.X*size.Y]; - if(size == origSize) - std::copy(origBitmap, origBitmap+(origSize.X*origSize.Y), bitmap); - else - { - //Bilinear interpolation - float factorX = ((float)origSize.X)/((float)size.X); - float factorY = ((float)origSize.Y)/((float)size.Y); - for(int y = 0; y < size.Y; y++) - { - for(int x = 0; x < size.X; x++) - { - float originalY = ((float)y)*factorY; - float originalX = ((float)x)*factorX; - - int lowerX = std::floor(originalX); - int upperX = std::min((float)(origSize.X-1), std::floor(originalX+1.0f)); - int lowerY = std::floor(originalY); - int upperY = std::min((float)(origSize.Y-1), std::floor(originalY+1.0f)); - - unsigned char topRight = origBitmap[(lowerY*origSize.X)+upperX]; - unsigned char topLeft = origBitmap[(lowerY*origSize.X)+lowerX]; - unsigned char bottomRight = origBitmap[(upperY*origSize.X)+upperX]; - unsigned char bottomLeft = origBitmap[(upperY*origSize.X)+lowerX]; - float top = LinearInterpolate(topLeft, topRight, lowerX, upperX, originalX); - float bottom = LinearInterpolate(bottomLeft, bottomRight, lowerX, upperX, originalX); - float mid = LinearInterpolate(top, bottom, lowerY, upperY, originalY); - bitmap[(y*size.X)+x] = mid > 128 ? 255 : 0; - } - } - } - } - } - virtual ~BitmapBrush() - { - delete[] origBitmap; - } + BitmapBrush(std::vector newBitmap, ui::Point rectSize); + void GenerateBitmap() override; + virtual ~BitmapBrush(); }; #endif /* BTIMAPBRUSH_H_ */ diff --git a/src/gui/game/Brush.cpp b/src/gui/game/Brush.cpp index 96f400f22..c14a1eb78 100644 --- a/src/gui/game/Brush.cpp +++ b/src/gui/game/Brush.cpp @@ -1,6 +1,81 @@ #include "Brush.h" #include "graphics/Renderer.h" +Brush::Brush(ui::Point size_): + outline(NULL), + bitmap(NULL), + size(0, 0), + radius(0, 0) +{ + SetRadius(size_); +}; + +Brush::~Brush() +{ + delete[] bitmap; + delete[] outline; +} + +void Brush::updateOutline() +{ + if(!bitmap) + GenerateBitmap(); + if(!bitmap) + return; + delete[] outline; + outline = new unsigned char[size.X*size.Y]; + for(int x = 0; x < size.X; x++) + { + for(int y = 0; y < size.Y; y++) + { + if(bitmap[y*size.X+x] && (!y || !x || x == size.X-1 || y == size.Y-1 || !bitmap[y*size.X+(x+1)] || !bitmap[y*size.X+(x-1)] || !bitmap[(y-1)*size.X+x] || !bitmap[(y+1)*size.X+x])) + { + outline[y*size.X+x] = 255; + } + else + outline[y*size.X+x] = 0; + } + } +} + +void Brush::SetRadius(ui::Point radius) +{ + this->radius = radius; + this->size = radius+radius+ui::Point(1, 1); + + GenerateBitmap(); + updateOutline(); +} + +void Brush::GenerateBitmap() +{ + delete[] bitmap; + bitmap = new unsigned char[size.X*size.Y]; + for(int x = 0; x < size.X; x++) + { + for(int y = 0; y < size.Y; y++) + { + bitmap[(y*size.X)+x] = 255; + } + } +} + +unsigned char *Brush::GetBitmap() +{ + if(!bitmap) + GenerateBitmap(); + return bitmap; +} + +unsigned char *Brush::GetOutline() +{ + if(!outline) + updateOutline(); + if(!outline) + return NULL; + return outline; +} + void Brush::RenderRect(Renderer * ren, ui::Point position1, ui::Point position2) { int width, height; diff --git a/src/gui/game/Brush.h b/src/gui/game/Brush.h index e5ffa2f64..aabe5d738 100644 --- a/src/gui/game/Brush.h +++ b/src/gui/game/Brush.h @@ -1,7 +1,6 @@ #ifndef BRUSH_H_ #define BRUSH_H_ -#include #include "gui/interface/Point.h" class Renderer; @@ -12,36 +11,9 @@ protected: unsigned char * bitmap; ui::Point size; ui::Point radius; - void updateOutline() - { - if(!bitmap) - GenerateBitmap(); - if(!bitmap) - return; - delete[] outline; - outline = new unsigned char[size.X*size.Y]; - for(int x = 0; x < size.X; x++) - { - for(int y = 0; y < size.Y; y++) - { - if(bitmap[y*size.X+x] && (!y || !x || x == size.X-1 || y == size.Y-1 || !bitmap[y*size.X+(x+1)] || !bitmap[y*size.X+(x-1)] || !bitmap[(y-1)*size.X+x] || !bitmap[(y+1)*size.X+x])) - { - outline[y*size.X+x] = 255; - } - else - outline[y*size.X+x] = 0; - } - } - } + void updateOutline(); public: - Brush(ui::Point size_): - outline(NULL), - bitmap(NULL), - size(0, 0), - radius(0, 0) - { - SetRadius(size_); - }; + Brush(ui::Point size); //Radius of the brush 0x0 - infxinf (Radius of 0x0 would be 1x1, radius of 1x1 would be 3x3) ui::Point GetRadius() @@ -54,50 +26,17 @@ public: { return size; } - virtual void SetRadius(ui::Point radius) - { - this->radius = radius; - this->size = radius+radius+ui::Point(1, 1); - - GenerateBitmap(); - updateOutline(); - } - virtual ~Brush() { - delete[] bitmap; - delete[] outline; - } + virtual void SetRadius(ui::Point radius); + virtual ~Brush(); virtual void RenderRect(Renderer * ren, ui::Point position1, ui::Point position2); virtual void RenderLine(Renderer * ren, ui::Point position1, ui::Point position2); virtual void RenderPoint(Renderer * ren, ui::Point position); virtual void RenderFill(Renderer * ren, ui::Point position); - virtual void GenerateBitmap() - { - delete[] bitmap; - bitmap = new unsigned char[size.X*size.Y]; - for(int x = 0; x < size.X; x++) - { - for(int y = 0; y < size.Y; y++) - { - bitmap[(y*size.X)+x] = 255; - } - } - } + virtual void GenerateBitmap(); //Get a bitmap for drawing particles - unsigned char * GetBitmap() - { - if(!bitmap) - GenerateBitmap(); - return bitmap; - } + unsigned char * GetBitmap(); - unsigned char * GetOutline() - { - if(!outline) - updateOutline(); - if(!outline) - return NULL; - return outline; - } + unsigned char * GetOutline(); }; diff --git a/src/gui/game/DecorationTool.cpp b/src/gui/game/DecorationTool.cpp new file mode 100644 index 000000000..1e4b9ef85 --- /dev/null +++ b/src/gui/game/DecorationTool.cpp @@ -0,0 +1,88 @@ +#include "DecorationTool.h" + +#include "graphics/Renderer.h" + +#include "simulation/SimulationData.h" +#include "simulation/Simulation.h" + +VideoBuffer *DecorationTool::GetIcon(int toolID, int width, int height) +{ + VideoBuffer * newTexture = new VideoBuffer(width, height); + for (int y=0; ySetPixel(x, y, 0, 255-5*x, 5*x, 255); + else if (toolID == DECO_DRAW || toolID == DECO_CLEAR) + newTexture->SetPixel(x, y, Red, Green, Blue, Alpha); + else + newTexture->SetPixel(x, y, 50, 50, 50, 255); + } + } + if (toolID == DECO_CLEAR) + { + int reverseRed = (Red+127)%256; + int reverseGreen = (Green+127)%256; + int reverseBlue = (Blue+127)%256; + for (int y=4; y<12; y++) + { + newTexture->SetPixel(y+5, y-1, reverseRed, reverseGreen, reverseBlue, 255); + newTexture->SetPixel(y+6, y-1, reverseRed, reverseGreen, reverseBlue, 255); + newTexture->SetPixel(20-y, y-1, reverseRed, reverseGreen, reverseBlue, 255); + newTexture->SetPixel(21-y, y-1, reverseRed, reverseGreen, reverseBlue, 255); + } + } + else if (toolID == DECO_ADD) + newTexture->AddCharacter(11, 4, '+', Red, Green, Blue, 255); + else if (toolID == DECO_SUBTRACT) + newTexture->AddCharacter(11, 4, '-', Red, Green, Blue, 255); + else if (toolID == DECO_MULTIPLY) + newTexture->AddCharacter(11, 3, 'x', Red, Green, Blue, 255); + else if (toolID == DECO_DIVIDE) + newTexture->AddCharacter(11, 4, '/', Red, Green, Blue, 255); + return newTexture; +} + +DecorationTool::DecorationTool(Renderer *ren_, int decoMode, String name, String description, int r, int g, int b, ByteString identifier): + Tool(decoMode, name, description, r, g, b, identifier), + Red(0), + Green(0), + Blue(0), + Alpha(0), + ren(ren_) +{ +} + +DecorationTool::~DecorationTool() +{ +} + +void DecorationTool::Draw(Simulation * sim, Brush * brush, ui::Point position) +{ + sim->ApplyDecorationPoint(position.X, position.Y, Red, Green, Blue, Alpha, toolID, brush); +} + +void DecorationTool::DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) +{ + sim->ApplyDecorationLine(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID, brush); +} + +void DecorationTool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) +{ + sim->ApplyDecorationBox(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID); +} + +void DecorationTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) +{ + pixel loc = ren->vid[position.X+position.Y*WINDOWW]; + if (toolID == DECO_CLEAR) + sim->ApplyDecorationFill(ren, position.X, position.Y, 0, 0, 0, 0, PIXR(loc), PIXG(loc), PIXB(loc)); + else + sim->ApplyDecorationFill(ren, position.X, position.Y, Red, Green, Blue, Alpha, PIXR(loc), PIXG(loc), PIXB(loc)); +} + diff --git a/src/gui/game/DecorationTool.h b/src/gui/game/DecorationTool.h index 08e909c82..d194e93d3 100644 --- a/src/gui/game/DecorationTool.h +++ b/src/gui/game/DecorationTool.h @@ -1,4 +1,3 @@ - #ifndef DECORATIONTOOL_H_ #define DECORATIONTOOL_H_ @@ -15,75 +14,14 @@ public: unsigned char Alpha; Renderer *ren; - VideoBuffer * GetIcon(int toolID, int width, int height) - { - VideoBuffer * newTexture = new VideoBuffer(width, height); - for (int y=0; ySetPixel(x, y, 0, 255-5*x, 5*x, 255); - else if (toolID == DECO_DRAW || toolID == DECO_CLEAR) - newTexture->SetPixel(x, y, Red, Green, Blue, Alpha); - else - newTexture->SetPixel(x, y, 50, 50, 50, 255); - } - } - if (toolID == DECO_CLEAR) - { - int reverseRed = (Red+127)%256; - int reverseGreen = (Green+127)%256; - int reverseBlue = (Blue+127)%256; - for (int y=4; y<12; y++) - { - newTexture->SetPixel(y+5, y-1, reverseRed, reverseGreen, reverseBlue, 255); - newTexture->SetPixel(y+6, y-1, reverseRed, reverseGreen, reverseBlue, 255); - newTexture->SetPixel(20-y, y-1, reverseRed, reverseGreen, reverseBlue, 255); - newTexture->SetPixel(21-y, y-1, reverseRed, reverseGreen, reverseBlue, 255); - } - } - else if (toolID == DECO_ADD) - newTexture->AddCharacter(11, 4, '+', Red, Green, Blue, 255); - else if (toolID == DECO_SUBTRACT) - newTexture->AddCharacter(11, 4, '-', Red, Green, Blue, 255); - else if (toolID == DECO_MULTIPLY) - newTexture->AddCharacter(11, 3, 'x', Red, Green, Blue, 255); - else if (toolID == DECO_DIVIDE) - newTexture->AddCharacter(11, 4, '/', Red, Green, Blue, 255); - return newTexture; - } + VideoBuffer * GetIcon(int toolID, int width, int height); - DecorationTool(Renderer *ren_, int decoMode, String name, String description, int r, int g, int b, ByteString identifier): - Tool(decoMode, name, description, r, g, b, identifier), - Red(0), - Green(0), - Blue(0), - Alpha(0), - ren(ren_) - { - } - virtual ~DecorationTool() {} - void Draw(Simulation * sim, Brush * brush, ui::Point position) override{ - sim->ApplyDecorationPoint(position.X, position.Y, Red, Green, Blue, Alpha, toolID, brush); - } - void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) override { - sim->ApplyDecorationLine(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID, brush); - } - void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { - sim->ApplyDecorationBox(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID); - } - void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { - pixel loc = ren->vid[position.X+position.Y*WINDOWW]; - if (toolID == DECO_CLEAR) - sim->ApplyDecorationFill(ren, position.X, position.Y, 0, 0, 0, 0, PIXR(loc), PIXG(loc), PIXB(loc)); - else - sim->ApplyDecorationFill(ren, position.X, position.Y, Red, Green, Blue, Alpha, PIXR(loc), PIXG(loc), PIXB(loc)); - } + DecorationTool(Renderer *ren_, int decoMode, String name, String description, int r, int g, int b, ByteString identifier); + virtual ~DecorationTool(); + void Draw(Simulation * sim, Brush * brush, ui::Point position) override; + void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) override; + void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override; + void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override; }; #endif diff --git a/src/gui/game/Favorite.cpp b/src/gui/game/Favorite.cpp index 7aee82433..c51e1825b 100644 --- a/src/gui/game/Favorite.cpp +++ b/src/gui/game/Favorite.cpp @@ -1,6 +1,8 @@ #include "Favorite.h" + #include "json/json.h" #include "client/Client.h" + #include Favorite::Favorite(): diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 65d888f39..1b97708f1 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -1,37 +1,64 @@ -#include -#include +#include "GameController.h" + +#include "GameView.h" +#include "GameModel.h" + +#include "RenderPreset.h" +#include "Menu.h" +#include "Tool.h" +#include "Brush.h" +#include "QuickOptions.h" +#include "GameModelException.h" + #include "Config.h" #include "Format.h" #include "Platform.h" -#include "GameController.h" -#include "GameModel.h" -#include "client/SaveInfo.h" +#include "Controller.h" +#include "Notification.h" + #include "client/GameSave.h" +#include "client/Client.h" + #include "gui/search/SearchController.h" #include "gui/render/RenderController.h" #include "gui/login/LoginController.h" -#include "gui/interface/Point.h" +#include "gui/preview/PreviewController.h" +#include "gui/tags/TagsController.h" +#include "gui/console/ConsoleController.h" +#include "gui/localbrowser/LocalBrowserController.h" +#include "gui/options/OptionsController.h" + #include "gui/dialogues/ErrorMessage.h" #include "gui/dialogues/InformationMessage.h" #include "gui/dialogues/ConfirmPrompt.h" -#include "GameModelException.h" -#include "simulation/Air.h" + #include "gui/elementsearch/ElementSearchActivity.h" #include "gui/profile/ProfileActivity.h" #include "gui/colourpicker/ColourPickerActivity.h" #include "gui/update/UpdateActivity.h" -#include "Notification.h" #include "gui/filebrowser/FileBrowserActivity.h" #include "gui/save/LocalSaveActivity.h" #include "gui/save/ServerSaveActivity.h" + +#include "gui/tags/TagsView.h" +#include "gui/search/SearchView.h" +#include "gui/render/RenderView.h" +#include "gui/preview/PreviewView.h" +#include "gui/options/OptionsView.h" +#include "gui/login/LoginView.h" +#include "gui/localbrowser/LocalBrowserView.h" +#include "gui/console/ConsoleView.h" + #include "gui/interface/Keys.h" #include "gui/interface/Mouse.h" -#include "simulation/Snapshot.h" +#include "gui/interface/Engine.h" + #include "debug/DebugInfo.h" #include "debug/DebugParts.h" #include "debug/ElementPopulation.h" #include "debug/DebugLines.h" #include "debug/ParticleDebug.h" + #ifdef LUACONSOLE #include "lua/LuaScriptInterface.h" #else @@ -39,6 +66,14 @@ #endif #include "lua/LuaEvents.h" +#include "graphics/Renderer.h" + +#include "simulation/Simulation.h" +#include "simulation/SimulationData.h" +#include "simulation/Air.h" +#include "simulation/Snapshot.h" +#include "ElementClasses.h" + #ifdef GetUserName # undef GetUserName // dammit windows #endif diff --git a/src/gui/game/GameController.h b/src/gui/game/GameController.h index cbecda932..a767748ee 100644 --- a/src/gui/game/GameController.h +++ b/src/gui/game/GameController.h @@ -1,30 +1,36 @@ #ifndef GAMECONTROLLER_H #define GAMECONTROLLER_H -#include -#include "GameView.h" -#include "GameModel.h" -#include "simulation/Simulation.h" -#include "gui/interface/Point.h" -#include "gui/search/SearchController.h" -#include "gui/render/RenderController.h" -#include "gui/preview/PreviewController.h" -#include "gui/login/LoginController.h" -#include "gui/tags/TagsController.h" -#include "gui/console/ConsoleController.h" -#include "gui/localbrowser/LocalBrowserController.h" -#include "gui/options/OptionsController.h" -#include "client/ClientListener.h" -#include "RenderPreset.h" -#include "Menu.h" +#include +#include -using namespace std; +#include "client/ClientListener.h" + +#include "gui/interface/Point.h" +#include "gui/interface/Colour.h" + +#include "simulation/Sign.h" +#include "simulation/Particle.h" + +#include "Misc.h" class DebugInfo; +class SaveFile; class Notification; class GameModel; class GameView; +class OptionsController; +class LocalBrowserController; +class SearchController; +class PreviewController; +class RenderController; class CommandInterface; +class Tool; +class Menu; +class SaveInfo; +class GameSave; +class LoginController; +class TagsController; class ConsoleController; class GameController: public ClientListener { @@ -43,7 +49,7 @@ private: LocalBrowserController * localBrowser; OptionsController * options; CommandInterface * commandInterface; - vector debugInfo; + std::vector debugInfo; unsigned int debugFlags; public: bool HasDone; diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp index 246fa4521..8e193ae90 100644 --- a/src/gui/game/GameModel.cpp +++ b/src/gui/game/GameModel.cpp @@ -1,28 +1,37 @@ #include "GameModel.h" + #include "GameView.h" +#include "GameController.h" + #include "ToolClasses.h" -#include "Brush.h" #include "EllipseBrush.h" #include "TriangleBrush.h" #include "BitmapBrush.h" #include "QuickOptions.h" #include "GameModelException.h" #include "Format.h" +#include "Menu.h" #include "Favorite.h" +#include "Notification.h" #include "client/Client.h" #include "client/GameSave.h" #include "client/SaveFile.h" -#include "common/tpt-minmax.h" +#include "client/SaveInfo.h" + #include "graphics/Renderer.h" + #include "simulation/Air.h" #include "simulation/Simulation.h" #include "simulation/Snapshot.h" +#include "simulation/Gravity.h" +#include "simulation/ElementGraphics.h" +#include "ElementClasses.h" #include "gui/game/DecorationTool.h" #include "gui/interface/Engine.h" -#include "gui/interface/Point.h" +#include GameModel::GameModel(): clipboard(NULL), @@ -496,7 +505,7 @@ Brush * GameModel::GetBrush() return brushList[currentBrush]; } -vector GameModel::GetBrushList() +std::vector GameModel::GetBrushList() { return brushList; } @@ -567,12 +576,12 @@ void GameModel::SetActiveMenu(int menuID) } } -vector GameModel::GetUnlistedTools() +std::vector GameModel::GetUnlistedTools() { return extraElementTools; } -vector GameModel::GetToolList() +std::vector GameModel::GetToolList() { return toolList; } @@ -604,12 +613,12 @@ void GameModel::SetActiveTool(int selection, Tool * tool) notifyActiveToolsChanged(); } -vector GameModel::GetQuickOptions() +std::vector GameModel::GetQuickOptions() { return quickOptions; } -vector GameModel::GetMenuList() +std::vector GameModel::GetMenuList() { return menuList; } @@ -884,7 +893,7 @@ void GameModel::SetColourSelectorColour(ui::Colour colour_) { colour = colour_; - vector tools = GetMenuList()[SC_DECO]->GetToolList(); + std::vector tools = GetMenuList()[SC_DECO]->GetToolList(); for (size_t i = 0; i < tools.size(); i++) { ((DecorationTool*)tools[i])->Red = colour.Red; @@ -1057,7 +1066,7 @@ void GameModel::Log(String message, bool printToFile) std::cout << message.ToUtf8() << std::endl; } -deque GameModel::GetLog() +std::deque GameModel::GetLog() { return consoleLog; } diff --git a/src/gui/game/GameModel.h b/src/gui/game/GameModel.h index 0e97ed1c2..8983ed6d3 100644 --- a/src/gui/game/GameModel.h +++ b/src/gui/game/GameModel.h @@ -3,26 +3,24 @@ #include #include -#include "client/SaveInfo.h" -#include "simulation/Simulation.h" + #include "gui/interface/Colour.h" -#include "graphics/Renderer.h" -#include "GameView.h" -#include "GameController.h" -#include "Brush.h" #include "client/User.h" -#include "Notification.h" -#include "QuickOption.h" -#include "Tool.h" -#include "Menu.h" - -using namespace std; +#include "gui/interface/Point.h" +class Menu; +class Tool; +class QuickOption; +class Brush; class GameView; +class Notification; class GameController; +class SaveInfo; class SaveFile; class Simulation; class Renderer; +class Snapshot; +class GameSave; class ToolSelection { @@ -36,27 +34,27 @@ public: class GameModel { private: - vector notifications; + std::vector notifications; //int clipboardSize; //unsigned char * clipboardData; GameSave * clipboard; GameSave * placeSave; - deque consoleLog; - vector observers; - vector toolList; + std::deque consoleLog; + std::vector observers; + std::vector toolList; //All tools that are associated with elements - vector elementTools; + std::vector elementTools; //Tools that are present in elementTools, but don't have an associated menu and need to be freed manually - vector extraElementTools; + std::vector extraElementTools; Simulation * sim; Renderer * ren; - vector menuList; - vector quickOptions; + std::vector menuList; + std::vector quickOptions; int activeMenu; int currentBrush; - vector brushList; + std::vector brushList; SaveInfo * currentSave; SaveFile * currentFile; Tool * lastTool; @@ -151,11 +149,11 @@ public: void SetLastTool(Tool * newTool); Tool * GetToolFromIdentifier(ByteString identifier); Tool * GetElementTool(int elementID); - vector GetToolList(); - vector GetUnlistedTools(); + std::vector GetToolList(); + std::vector GetUnlistedTools(); Brush * GetBrush(); - vector GetBrushList(); + std::vector GetBrushList(); int GetBrushID(); void SetBrushID(int i); @@ -177,8 +175,8 @@ public: bool GetGravityGrid(); void ShowGravityGrid(bool showGrid); void ClearSimulation(); - vector GetMenuList(); - vector GetQuickOptions(); + std::vector GetMenuList(); + std::vector GetQuickOptions(); void SetActiveMenu(int menuID); int GetActiveMenu(); void FrameStep(int frames); @@ -201,7 +199,7 @@ public: void SetClipboard(GameSave * save); void SetPlaceSave(GameSave * save); void Log(String message, bool printToFile); - deque GetLog(); + std::deque GetLog(); GameSave * GetClipboard(); GameSave * GetPlaceSave(); diff --git a/src/gui/game/GameModelException.h b/src/gui/game/GameModelException.h index c7fdcdc8a..b4b2393a2 100644 --- a/src/gui/game/GameModelException.h +++ b/src/gui/game/GameModelException.h @@ -4,7 +4,8 @@ #include "common/String.h" #include -struct GameModelException: public exception { +struct GameModelException: public std::exception +{ ByteString message; public: GameModelException(String message_): message(message_.ToUtf8()) {} diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 11893e761..475997981 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -1,26 +1,40 @@ -#include -#include #include "GameView.h" +#include "GameController.h" +#include "GameModel.h" + #include "Config.h" +#include "Misc.h" #include "Favorite.h" #include "Format.h" + +#include "Notification.h" +#include "Brush.h" #include "IntroText.h" #include "QuickOptions.h" #include "DecorationTool.h" +#include "ToolButton.h" +#include "Menu.h" + +#include "client/SaveInfo.h" #include "client/SaveFile.h" +#include "client/Client.h" + #include "graphics/Graphics.h" +#include "graphics/Renderer.h" + #include "gui/Style.h" #include "gui/dialogues/ConfirmPrompt.h" #include "gui/dialogues/InformationMessage.h" #include "gui/interface/Button.h" #include "gui/interface/Colour.h" #include "gui/interface/Keys.h" -#include "gui/interface/Mouse.h" -#include "gui/interface/Slider.h" -#include "gui/interface/Window.h" +#include "gui/interface/Engine.h" + #include "simulation/SaveRenderer.h" #include "simulation/SimulationData.h" +#include "simulation/ElementDefs.h" +#include "ElementClasses.h" #ifdef GetUserName # undef GetUserName // dammit windows @@ -584,10 +598,9 @@ void GameView::NotifyQuickOptionsChanged(GameModel * sender) } int currentY = 1; - vector optionList = sender->GetQuickOptions(); - for(vector::iterator iter = optionList.begin(), end = optionList.end(); iter != end; ++iter) + std::vector optionList = sender->GetQuickOptions(); + for(auto *option : optionList) { - QuickOption * option = *iter; ui::Button * tempButton = new ui::Button(ui::Point(WINDOWW-16, currentY), ui::Point(15, 15), option->GetIcon(), option->GetDescription()); //tempButton->Appearance.Margin = ui::Border(0, 2, 3, 2); tempButton->SetTogglable(true); @@ -615,7 +628,7 @@ void GameView::NotifyMenuListChanged(GameModel * sender) delete toolButtons[i]; } toolButtons.clear(); - vector menuList = sender->GetMenuList(); + std::vector menuList = sender->GetMenuList(); for (int i = (int)menuList.size()-1; i >= 0; i--) { if (menuList[i]->GetVisible()) @@ -750,7 +763,7 @@ void GameView::NotifyToolListChanged(GameModel * sender) delete toolButtons[i]; } toolButtons.clear(); - vector toolList = sender->GetToolList(); + std::vector toolList = sender->GetToolList(); int currentX = 0; for (size_t i = 0; i < toolList.size(); i++) { @@ -1106,9 +1119,8 @@ void GameView::updateToolButtonScroll() } scrollBar->Size.X=scrollSize; int offsetDelta = toolButtons[0]->Position.X - newInitialX; - for(vector::iterator iter = toolButtons.begin(), end = toolButtons.end(); iter!=end; ++iter) + for(auto *button : toolButtons) { - ToolButton * button = *iter; button->Position.X -= offsetDelta; if (button->Position.X+button->Size.X <= 0 || (button->Position.X+button->Size.X) > XRES-2) button->Visible = false; @@ -1119,9 +1131,8 @@ void GameView::updateToolButtonScroll() //Ensure that mouseLeave events are make their way to the buttons should they move from underneath the mouse pointer if(toolButtons[0]->Position.Y < y && toolButtons[0]->Position.Y+toolButtons[0]->Size.Y > y) { - for(vector::iterator iter = toolButtons.begin(), end = toolButtons.end(); iter!=end; ++iter) + for(auto *button : toolButtons) { - ToolButton * button = *iter; if(button->Position.X < x && button->Position.X+button->Size.X > x) button->OnMouseEnter(x, y); else @@ -2244,7 +2255,7 @@ void GameView::OnDraw() { int startX = 20; int startY = YRES-20; - deque >::iterator iter; + std::deque >::iterator iter; for(iter = logEntries.begin(); iter != logEntries.end(); iter++) { String message = (*iter).first; diff --git a/src/gui/game/GameView.h b/src/gui/game/GameView.h index dbe1feabd..30713c53b 100644 --- a/src/gui/game/GameView.h +++ b/src/gui/game/GameView.h @@ -2,22 +2,11 @@ #define GAMEVIEW_H #include -#include #include #include "common/String.h" -#include "GameController.h" -#include "GameModel.h" #include "gui/interface/Window.h" -#include "gui/interface/Point.h" -#include "gui/interface/Button.h" -#include "gui/interface/Slider.h" -#include "gui/interface/Textbox.h" -#include "ToolButton.h" -#include "Brush.h" #include "simulation/Sample.h" -using namespace std; - enum DrawMode { DrawPoints, DrawLine, DrawRect, DrawFill @@ -28,7 +17,18 @@ enum SelectMode SelectNone, SelectStamp, SelectCopy, SelectCut, PlaceSave }; +namespace ui +{ + class Button; + class Slider; + class Textbox; +} + +class Renderer; +class VideoBuffer; +class ToolButton; class GameController; +class Brush; class GameModel; class GameView: public ui::Window { @@ -76,11 +76,11 @@ private: Renderer * ren; Brush * activeBrush; //UI Elements - vector quickOptionButtons; - vector menuButtons; - vector toolButtons; - vector notificationComponents; - deque > logEntries; + std::vector quickOptionButtons; + std::vector menuButtons; + std::vector toolButtons; + std::vector notificationComponents; + std::deque > logEntries; ui::Button * scrollBar; ui::Button * searchButton; ui::Button * reloadButton; @@ -97,7 +97,7 @@ private: ui::Button * pauseButton; ui::Button * colourPicker; - vector colourPresets; + std::vector colourPresets; DrawMode drawMode; ui::Point drawPoint1; diff --git a/src/gui/game/Menu.cpp b/src/gui/game/Menu.cpp new file mode 100644 index 000000000..1440531be --- /dev/null +++ b/src/gui/game/Menu.cpp @@ -0,0 +1,31 @@ +#include "Menu.h" + +#include "Tool.h" + +Menu::Menu(String::value_type icon_, String description_, int visible_): + icon(icon_), + description(description_), + tools(std::vector()), + visible(visible_ ? true : false) +{ + +} + +Menu::~Menu() +{ + for(unsigned int i = 0; i < tools.size(); i++) + { + delete tools[i]; + } + tools.clear(); +} + +void Menu::AddTool(Tool * tool_) +{ + tools.push_back(tool_); +} + +void Menu::ClearTools() +{ + tools.clear(); +} diff --git a/src/gui/game/Menu.h b/src/gui/game/Menu.h index 66543b7ef..2625a1a5b 100644 --- a/src/gui/game/Menu.h +++ b/src/gui/game/Menu.h @@ -2,8 +2,8 @@ #define MENU_H_ #include "common/String.h" -#include "Tool.h" +class Tool; class Menu { String::value_type icon; @@ -11,23 +11,8 @@ class Menu std::vector tools; bool visible; public: - Menu(String::value_type icon_, String description_, int visible_): - icon(icon_), - description(description_), - tools(std::vector()), - visible(visible_ ? true : false) - { - - } - - virtual ~Menu() - { - for(unsigned int i = 0; i < tools.size(); i++) - { - delete tools[i]; - } - tools.clear(); - } + Menu(String::value_type icon_, String description_, int visible_); + virtual ~Menu(); std::vector GetToolList() { @@ -49,15 +34,8 @@ public: return visible; } - void AddTool(Tool * tool_) - { - tools.push_back(tool_); - } - - void ClearTools() - { - tools.clear(); - } + void AddTool(Tool * tool_); + void ClearTools(); }; diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp index 84caba967..72b6b4246 100644 --- a/src/gui/game/PropertyTool.cpp +++ b/src/gui/game/PropertyTool.cpp @@ -1,6 +1,7 @@ -#include #include "Tool.h" + #include "client/Client.h" + #include "gui/Style.h" #include "gui/game/Brush.h" #include "gui/interface/Window.h" @@ -10,8 +11,13 @@ #include "gui/interface/DropDown.h" #include "gui/interface/Keys.h" #include "gui/dialogues/ErrorMessage.h" + #include "simulation/Simulation.h" +#include "graphics/Graphics.h" + +#include + class PropertyWindow: public ui::Window { public: diff --git a/src/gui/game/QuickOption.h b/src/gui/game/QuickOption.h index 688acc784..99f1e613c 100644 --- a/src/gui/game/QuickOption.h +++ b/src/gui/game/QuickOption.h @@ -1,6 +1,7 @@ #pragma once #include "common/String.h" + #include class GameModel; diff --git a/src/gui/game/QuickOptions.cpp b/src/gui/game/QuickOptions.cpp new file mode 100644 index 000000000..eb1a4d101 --- /dev/null +++ b/src/gui/game/QuickOptions.cpp @@ -0,0 +1,100 @@ +#include "QuickOptions.h" + +#include "GameModel.h" +#include "GameController.h" + +#include "simulation/Simulation.h" + +SandEffectOption::SandEffectOption(GameModel * m): +QuickOption("P", "Sand effect", m, Toggle) +{ + +} +bool SandEffectOption::GetToggle() +{ + return m->GetSimulation()->pretty_powder; +} +void SandEffectOption::perform() +{ + m->GetSimulation()->pretty_powder = !m->GetSimulation()->pretty_powder; +} + + + +DrawGravOption::DrawGravOption(GameModel * m): +QuickOption("G", "Draw gravity field \bg(ctrl+g)", m, Toggle) +{ + +} +bool DrawGravOption::GetToggle() +{ + return m->GetGravityGrid(); +} +void DrawGravOption::perform() +{ + m->ShowGravityGrid(!m->GetGravityGrid()); +} + + + +DecorationsOption::DecorationsOption(GameModel * m): +QuickOption("D", "Draw decorations \bg(ctrl+b)", m, Toggle) +{ + +} +bool DecorationsOption::GetToggle() +{ + return m->GetDecoration(); +} +void DecorationsOption::perform() +{ + m->SetDecoration(!m->GetDecoration()); +} + + + +NGravityOption::NGravityOption(GameModel * m): +QuickOption("N", "Newtonian Gravity \bg(n)", m, Toggle) +{ + +} +bool NGravityOption::GetToggle() +{ + return m->GetNewtonianGrvity(); +} +void NGravityOption::perform() +{ + m->SetNewtonianGravity(!m->GetNewtonianGrvity()); +} + + + +AHeatOption::AHeatOption(GameModel * m): +QuickOption("A", "Ambient heat \bg(u)", m, Toggle) +{ + +} +bool AHeatOption::GetToggle() +{ + return m->GetAHeatEnable(); +} +void AHeatOption::perform() +{ + m->SetAHeatEnable(!m->GetAHeatEnable()); +} + + + +ConsoleShowOption::ConsoleShowOption(GameModel * m, GameController * c_): +QuickOption("C", "Show Console \bg(~)", m, Toggle) +{ + c = c_; +} +bool ConsoleShowOption::GetToggle() +{ + return 0; +} +void ConsoleShowOption::perform() +{ + c->ShowConsole(); +} diff --git a/src/gui/game/QuickOptions.h b/src/gui/game/QuickOptions.h index 3ce1313b6..7f3169a1e 100644 --- a/src/gui/game/QuickOptions.h +++ b/src/gui/game/QuickOptions.h @@ -1,111 +1,52 @@ #include "QuickOption.h" -#include "GameModel.h" + +class GameController; class SandEffectOption: public QuickOption { public: - SandEffectOption(GameModel * m): - QuickOption("P", "Sand effect", m, Toggle) - { - - } - bool GetToggle() override - { - return m->GetSimulation()->pretty_powder; - } - void perform() override - { - m->GetSimulation()->pretty_powder = !m->GetSimulation()->pretty_powder; - } + SandEffectOption(GameModel * m); + bool GetToggle() override; + void perform() override; }; class DrawGravOption: public QuickOption { public: - DrawGravOption(GameModel * m): - QuickOption("G", "Draw gravity field \bg(ctrl+g)", m, Toggle) - { - - } - bool GetToggle() override - { - return m->GetGravityGrid(); - } - void perform() override - { - m->ShowGravityGrid(!m->GetGravityGrid()); - } + DrawGravOption(GameModel * m); + bool GetToggle() override; + void perform() override; }; class DecorationsOption: public QuickOption { public: - DecorationsOption(GameModel * m): - QuickOption("D", "Draw decorations \bg(ctrl+b)", m, Toggle) - { - - } - bool GetToggle() override - { - return m->GetDecoration(); - } - void perform() override - { - m->SetDecoration(!m->GetDecoration()); - } + DecorationsOption(GameModel * m); + bool GetToggle() override; + void perform() override; }; class NGravityOption: public QuickOption { public: - NGravityOption(GameModel * m): - QuickOption("N", "Newtonian Gravity \bg(n)", m, Toggle) - { - - } - bool GetToggle() override - { - return m->GetNewtonianGrvity(); - } - void perform() override - { - m->SetNewtonianGravity(!m->GetNewtonianGrvity()); - } + NGravityOption(GameModel * m); + bool GetToggle() override; + void perform() override; }; class AHeatOption: public QuickOption { public: - AHeatOption(GameModel * m): - QuickOption("A", "Ambient heat \bg(u)", m, Toggle) - { - - } - bool GetToggle() override - { - return m->GetAHeatEnable(); - } - void perform() override - { - m->SetAHeatEnable(!m->GetAHeatEnable()); - } + AHeatOption(GameModel * m); + bool GetToggle() override; + void perform() override; }; class ConsoleShowOption: public QuickOption { GameController * c; public: - ConsoleShowOption(GameModel * m, GameController * c_): - QuickOption("C", "Show Console \bg(~)", m, Toggle) - { - c = c_; - } - bool GetToggle() override - { - return 0; - } - void perform() override - { - c->ShowConsole(); - } + ConsoleShowOption(GameModel * m, GameController * c_); + bool GetToggle() override; + void perform() override; }; diff --git a/src/gui/game/SampleTool.cpp b/src/gui/game/SampleTool.cpp index 113ba330d..1e4cdc046 100644 --- a/src/gui/game/SampleTool.cpp +++ b/src/gui/game/SampleTool.cpp @@ -1,9 +1,16 @@ -#include -#include "graphics/Graphics.h" #include "Tool.h" -#include "GameModel.h" + +#include "graphics/Graphics.h" +#include "graphics/Renderer.h" + +#include "gui/game/GameModel.h" #include "gui/interface/Colour.h" +#include "simulation/Simulation.h" +#include "ElementClasses.h" + +#include "Menu.h" + VideoBuffer * SampleTool::GetIcon(int toolID, int width, int height) { VideoBuffer * newTexture = new VideoBuffer(width, height); diff --git a/src/gui/game/SignTool.cpp b/src/gui/game/SignTool.cpp index 1a8cad401..cf94199f9 100644 --- a/src/gui/game/SignTool.cpp +++ b/src/gui/game/SignTool.cpp @@ -1,7 +1,8 @@ -#include -#include "gui/Style.h" -#include "simulation/Simulation.h" #include "Tool.h" + +#include "simulation/Simulation.h" + +#include "gui/Style.h" #include "gui/interface/Window.h" #include "gui/interface/Button.h" #include "gui/interface/Label.h" @@ -9,6 +10,8 @@ #include "gui/interface/DropDown.h" #include "gui/game/GameModel.h" +#include "graphics/Graphics.h" + class SignWindow: public ui::Window { public: diff --git a/src/gui/game/Tool.cpp b/src/gui/game/Tool.cpp index e293e4a18..669b02228 100644 --- a/src/gui/game/Tool.cpp +++ b/src/gui/game/Tool.cpp @@ -1,8 +1,10 @@ -#include "common/String.h" #include "Tool.h" + #include "gui/game/Brush.h" #include "simulation/Simulation.h" +#include "simulation/SimulationData.h" +#include "ElementClasses.h" using namespace std; diff --git a/src/gui/game/Tool.h b/src/gui/game/Tool.h index 5f8dd1cd5..771d294e7 100644 --- a/src/gui/game/Tool.h +++ b/src/gui/game/Tool.h @@ -1,8 +1,6 @@ #ifndef TOOL_H_ #define TOOL_H_ -#include - #include "common/String.h" #include "gui/interface/Point.h" #include "simulation/StructProperty.h" diff --git a/src/gui/game/ToolButton.cpp b/src/gui/game/ToolButton.cpp index e6d2e8f50..1d1d7e042 100644 --- a/src/gui/game/ToolButton.cpp +++ b/src/gui/game/ToolButton.cpp @@ -1,7 +1,10 @@ #include "ToolButton.h" + #include "graphics/Graphics.h" + #include "gui/interface/Keys.h" #include "gui/interface/Mouse.h" + #include "Favorite.h" ToolButton::ToolButton(ui::Point position, ui::Point size, String text, ByteString toolIdentifier, String toolTip): diff --git a/src/gui/interface/AvatarButton.cpp b/src/gui/interface/AvatarButton.cpp index 1f7579522..bb98eb527 100644 --- a/src/gui/interface/AvatarButton.cpp +++ b/src/gui/interface/AvatarButton.cpp @@ -1,6 +1,7 @@ #include #include +#include "Button.h" #include "AvatarButton.h" #include "Format.h" #include "client/Client.h" diff --git a/src/gui/interface/Button.cpp b/src/gui/interface/Button.cpp index aa7061b25..e38005c10 100644 --- a/src/gui/interface/Button.cpp +++ b/src/gui/interface/Button.cpp @@ -1,8 +1,10 @@ -#include #include "gui/interface/Button.h" + #include "gui/interface/Window.h" + #include "graphics/Graphics.h" #include "Misc.h" +#include "Colour.h" namespace ui { diff --git a/src/gui/interface/Button.h b/src/gui/interface/Button.h index d3a20e54f..69a0b8996 100644 --- a/src/gui/interface/Button.h +++ b/src/gui/interface/Button.h @@ -2,9 +2,7 @@ #define BUTTON_H_ #include "common/String.h" -#include "Misc.h" #include "Component.h" -#include "Colour.h" namespace ui { diff --git a/src/gui/interface/Checkbox.cpp b/src/gui/interface/Checkbox.cpp index 36db2e90e..efb52dc6b 100644 --- a/src/gui/interface/Checkbox.cpp +++ b/src/gui/interface/Checkbox.cpp @@ -1,5 +1,7 @@ #include "Checkbox.h" + #include "graphics/Graphics.h" + #include "gui/interface/Window.h" using namespace ui; diff --git a/src/gui/interface/Component.cpp b/src/gui/interface/Component.cpp index a9e0fb5a6..bbc3a01d3 100644 --- a/src/gui/interface/Component.cpp +++ b/src/gui/interface/Component.cpp @@ -1,7 +1,6 @@ -#include -#include "graphics/Graphics.h" #include "gui/interface/Component.h" -#include "gui/interface/Engine.h" + +#include "graphics/Graphics.h" #include "gui/interface/Point.h" #include "gui/interface/Window.h" #include "gui/interface/Panel.h" diff --git a/src/gui/interface/Component.h b/src/gui/interface/Component.h index ae42f68f3..072252969 100644 --- a/src/gui/interface/Component.h +++ b/src/gui/interface/Component.h @@ -1,7 +1,6 @@ #pragma once #include "common/String.h" -#include "common/tpt-compat.h" #include "Appearance.h" #include "Point.h" diff --git a/src/gui/interface/ContextMenu.cpp b/src/gui/interface/ContextMenu.cpp index 77f2a103c..e592f8544 100644 --- a/src/gui/interface/ContextMenu.cpp +++ b/src/gui/interface/ContextMenu.cpp @@ -1,7 +1,9 @@ #include "ContextMenu.h" -#include "common/tpt-minmax.h" + #include "graphics/Graphics.h" +#include "common/tpt-minmax.h" + using namespace ui; class ContextMenu::ItemSelectedAction: public ButtonAction diff --git a/src/gui/interface/ContextMenu.h b/src/gui/interface/ContextMenu.h index 7f9d95e36..82d19dbac 100644 --- a/src/gui/interface/ContextMenu.h +++ b/src/gui/interface/ContextMenu.h @@ -7,7 +7,8 @@ namespace ui { - + class Button; + class ContextMenuItem { public: diff --git a/src/gui/interface/CopyTextButton.cpp b/src/gui/interface/CopyTextButton.cpp index bf96d8724..70a21109e 100644 --- a/src/gui/interface/CopyTextButton.cpp +++ b/src/gui/interface/CopyTextButton.cpp @@ -1,7 +1,10 @@ #include "CopyTextButton.h" + #include "Colour.h" -#include "PowderToy.h" #include "gui/Style.h" +#include "Label.h" + +#include "PowderToy.h" namespace ui { diff --git a/src/gui/interface/CopyTextButton.h b/src/gui/interface/CopyTextButton.h index 85d51482b..56b0de053 100644 --- a/src/gui/interface/CopyTextButton.h +++ b/src/gui/interface/CopyTextButton.h @@ -2,10 +2,10 @@ #define COPYTEXTBUTTON_H #include "Button.h" -#include "Label.h" namespace ui { + class Label; class CopyTextButton : public Button { ui::Label *copyTextLabel; diff --git a/src/gui/interface/DropDown.cpp b/src/gui/interface/DropDown.cpp index 0692b40c1..9b90eae3d 100644 --- a/src/gui/interface/DropDown.cpp +++ b/src/gui/interface/DropDown.cpp @@ -1,8 +1,8 @@ -#include +#include "DropDown.h" + #include "graphics/Graphics.h" #include "gui/Style.h" #include "Button.h" -#include "DropDown.h" #include "gui/interface/Window.h" namespace ui { diff --git a/src/gui/interface/DropDown.h b/src/gui/interface/DropDown.h index 5853b9cd6..454601108 100644 --- a/src/gui/interface/DropDown.h +++ b/src/gui/interface/DropDown.h @@ -3,7 +3,6 @@ #include #include "Component.h" -#include "Colour.h" namespace ui { diff --git a/src/gui/interface/Engine.cpp b/src/gui/interface/Engine.cpp index 7a5c768a1..ce92a4eac 100644 --- a/src/gui/interface/Engine.cpp +++ b/src/gui/interface/Engine.cpp @@ -1,14 +1,17 @@ -#include -#include -#include +#include "gui/interface/Engine.h" + +#include "Window.h" + #include +#include + +#include "gui/dialogues/ConfirmPrompt.h" + +#include "graphics/Graphics.h" #include "Config.h" #include "Platform.h" -#include "gui/interface/Window.h" -#include "gui/interface/Engine.h" -#include "gui/dialogues/ConfirmPrompt.h" -#include "graphics/Graphics.h" +#include "PowderToy.h" using namespace ui; using namespace std; diff --git a/src/gui/interface/Engine.h b/src/gui/interface/Engine.h index 2d7c69151..6d79a1d79 100644 --- a/src/gui/interface/Engine.h +++ b/src/gui/interface/Engine.h @@ -1,11 +1,12 @@ #pragma once #include +#include "common/String.h" #include "common/Singleton.h" -#include "graphics/Graphics.h" -#include "Window.h" -#include "PowderToy.h" +#include "graphics/Pixel.h" +#include "gui/interface/Point.h" +class Graphics; namespace ui { class Window; diff --git a/src/gui/interface/Label.cpp b/src/gui/interface/Label.cpp index e9b5022fa..8788dbd9e 100644 --- a/src/gui/interface/Label.cpp +++ b/src/gui/interface/Label.cpp @@ -1,11 +1,12 @@ -#include "Config.h" +#include "Label.h" + #include "Format.h" #include "Point.h" -#include "Label.h" #include "Keys.h" #include "Mouse.h" #include "PowderToy.h" #include "ContextMenu.h" + #include "graphics/Graphics.h" using namespace ui; diff --git a/src/gui/interface/Panel.cpp b/src/gui/interface/Panel.cpp index 87684acdf..cee6fe38d 100644 --- a/src/gui/interface/Panel.cpp +++ b/src/gui/interface/Panel.cpp @@ -1,10 +1,8 @@ -#include - #include "gui/interface/Panel.h" + #include "gui/interface/Engine.h" -#include "gui/interface/Point.h" #include "gui/interface/Window.h" -#include "gui/interface/Component.h" + #include "graphics/Graphics.h" using namespace ui; diff --git a/src/gui/interface/Panel.h b/src/gui/interface/Panel.h index f3033a4f5..92107c6f7 100644 --- a/src/gui/interface/Panel.h +++ b/src/gui/interface/Panel.h @@ -3,7 +3,6 @@ #include "graphics/Pixel.h" #include "gui/interface/Point.h" -#include "gui/interface/Window.h" #include "gui/interface/Component.h" #ifdef OGLI diff --git a/src/gui/interface/ProgressBar.cpp b/src/gui/interface/ProgressBar.cpp index fb55e7d4b..c5eb5f81e 100644 --- a/src/gui/interface/ProgressBar.cpp +++ b/src/gui/interface/ProgressBar.cpp @@ -1,8 +1,11 @@ #include "ProgressBar.h" -#include "common/tpt-minmax.h" + #include "graphics/Graphics.h" + #include "gui/Style.h" +#include "common/tpt-minmax.h" + using namespace ui; ProgressBar::ProgressBar(Point position, Point size, int startProgress, String startStatus): diff --git a/src/gui/interface/RichLabel.cpp b/src/gui/interface/RichLabel.cpp index 7405bb17a..471be0e07 100644 --- a/src/gui/interface/RichLabel.cpp +++ b/src/gui/interface/RichLabel.cpp @@ -1,12 +1,17 @@ +#include "RichLabel.h" + #include #include -#include "RichLabel.h" #include "Platform.h" + #include "gui/interface/Point.h" #include "gui/interface/Component.h" + #include "graphics/Graphics.h" +#include "Colour.h" + using namespace ui; struct RichTextParseException: public std::exception { diff --git a/src/gui/interface/RichLabel.h b/src/gui/interface/RichLabel.h index 4d056fc66..14dd844df 100644 --- a/src/gui/interface/RichLabel.h +++ b/src/gui/interface/RichLabel.h @@ -1,9 +1,7 @@ #pragma once #include "common/String.h" - #include "Component.h" -#include "Colour.h" namespace ui { diff --git a/src/gui/interface/SaveButton.cpp b/src/gui/interface/SaveButton.cpp index 8d589e500..c67740c29 100644 --- a/src/gui/interface/SaveButton.cpp +++ b/src/gui/interface/SaveButton.cpp @@ -1,17 +1,16 @@ -#include -#include +#include "SaveButton.h" #include "ContextMenu.h" #include "Format.h" #include "Keys.h" #include "Mouse.h" -#include "SaveButton.h" + #include "client/Client.h" -#include "client/SaveInfo.h" #include "client/ThumbnailRendererTask.h" -#include "simulation/SaveRenderer.h" -#include "client/GameSave.h" -#include "simulation/SaveRenderer.h" +#include "client/SaveFile.h" +#include "client/SaveInfo.h" + +#include "graphics/Graphics.h" namespace ui { diff --git a/src/gui/interface/SaveButton.h b/src/gui/interface/SaveButton.h index 84bc9a2cc..fc4a3bae2 100644 --- a/src/gui/interface/SaveButton.h +++ b/src/gui/interface/SaveButton.h @@ -4,16 +4,14 @@ #include "common/String.h" #include "Component.h" -#include "client/SaveFile.h" -#include "client/SaveInfo.h" -#include "graphics/Graphics.h" -#include "gui/interface/Colour.h" #include "client/http/ThumbnailRequest.h" #include "client/http/RequestMonitor.h" -#include "graphics/Graphics.h" #include +class VideoBuffer; +class SaveFile; +class SaveInfo; class ThumbnailRendererTask; namespace ui { diff --git a/src/gui/interface/ScrollPanel.cpp b/src/gui/interface/ScrollPanel.cpp index 6ae271bd5..6d7d2a8a9 100644 --- a/src/gui/interface/ScrollPanel.cpp +++ b/src/gui/interface/ScrollPanel.cpp @@ -1,8 +1,9 @@ -#include #include "ScrollPanel.h" -#include "common/tpt-minmax.h" + #include "graphics/Graphics.h" +#include "common/tpt-minmax.h" + using namespace ui; ScrollPanel::ScrollPanel(Point position, Point size): diff --git a/src/gui/interface/Slider.cpp b/src/gui/interface/Slider.cpp index 6d7c895b3..64a252210 100644 --- a/src/gui/interface/Slider.cpp +++ b/src/gui/interface/Slider.cpp @@ -1,6 +1,5 @@ -#include #include "Slider.h" -#include "Colour.h" + #include "graphics/Graphics.h" namespace ui { diff --git a/src/gui/interface/Spinner.cpp b/src/gui/interface/Spinner.cpp index bc51717a5..19485d1ec 100644 --- a/src/gui/interface/Spinner.cpp +++ b/src/gui/interface/Spinner.cpp @@ -1,6 +1,7 @@ -#include -#include #include "Spinner.h" + +#include + #include "graphics/Graphics.h" using namespace ui; diff --git a/src/gui/interface/Textbox.cpp b/src/gui/interface/Textbox.cpp index 246b1444e..94888ccde 100644 --- a/src/gui/interface/Textbox.cpp +++ b/src/gui/interface/Textbox.cpp @@ -1,14 +1,16 @@ -#include "common/String.h" -#include -#include +#include "gui/interface/Textbox.h" + #include "Config.h" #include "Platform.h" #include "Format.h" +#include "PowderToy.h" + #include "graphics/Graphics.h" + #include "gui/interface/Point.h" -#include "gui/interface/Textbox.h" #include "gui/interface/Keys.h" #include "gui/interface/Mouse.h" + #include "ContextMenu.h" using namespace ui; diff --git a/src/gui/interface/Textbox.h b/src/gui/interface/Textbox.h index da8baf045..176c2a76f 100644 --- a/src/gui/interface/Textbox.h +++ b/src/gui/interface/Textbox.h @@ -1,10 +1,7 @@ #ifndef TEXTBOX_H #define TEXTBOX_H -#include "common/String.h" - #include "Label.h" -#include "PowderToy.h" namespace ui { @@ -66,7 +63,7 @@ protected: size_t limit; unsigned long repeatTime; int keyDown; - Uint16 characterDown; + unsigned short characterDown; bool mouseDown; bool masked, border; int cursor, cursorPositionX, cursorPositionY; diff --git a/src/gui/interface/Window.cpp b/src/gui/interface/Window.cpp index bae26f2a7..bfab4ebfe 100644 --- a/src/gui/interface/Window.cpp +++ b/src/gui/interface/Window.cpp @@ -1,11 +1,12 @@ -#include #include "Window.h" + #include "Engine.h" #include "Keys.h" #include "Component.h" -#include "gui/interface/Point.h" #include "gui/interface/Button.h" +#include "graphics/Graphics.h" + using namespace ui; Window::Window(Point _position, Point _size): diff --git a/src/gui/interface/Window.h b/src/gui/interface/Window.h index 4e515baea..6db939333 100644 --- a/src/gui/interface/Window.h +++ b/src/gui/interface/Window.h @@ -3,7 +3,6 @@ #include "common/String.h" #include -#include "common/tpt-compat.h" #include "gui/interface/Point.h" class Graphics; diff --git a/src/gui/localbrowser/LocalBrowserController.cpp b/src/gui/localbrowser/LocalBrowserController.cpp index 1550012e0..fee580152 100644 --- a/src/gui/localbrowser/LocalBrowserController.cpp +++ b/src/gui/localbrowser/LocalBrowserController.cpp @@ -1,12 +1,16 @@ -#include "client/Client.h" #include "LocalBrowserController.h" -#include "gui/interface/Engine.h" + +#include "LocalBrowserModel.h" +#include "LocalBrowserView.h" + +#include "client/Client.h" #include "gui/dialogues/ConfirmPrompt.h" #include "tasks/TaskWindow.h" #include "tasks/Task.h" -#include "LocalBrowserModel.h" -#include "LocalBrowserView.h" +#include "Controller.h" + +#include "common/tpt-minmax.h" LocalBrowserController::LocalBrowserController(ControllerCallback * callback): HasDone(false) diff --git a/src/gui/localbrowser/LocalBrowserController.h b/src/gui/localbrowser/LocalBrowserController.h index 18edf01c5..eb7bb9344 100644 --- a/src/gui/localbrowser/LocalBrowserController.h +++ b/src/gui/localbrowser/LocalBrowserController.h @@ -1,10 +1,10 @@ #ifndef STAMPSCONTROLLER_H_ #define STAMPSCONTROLLER_H_ -#include "Controller.h" -#include "LocalBrowserView.h" -#include "client/SaveInfo.h" +#include "common/String.h" +class ControllerCallback; +class SaveFile; class LocalBrowserView; class LocalBrowserModel; class LocalBrowserController { diff --git a/src/gui/localbrowser/LocalBrowserModel.cpp b/src/gui/localbrowser/LocalBrowserModel.cpp index e499bd144..fcae7fa8a 100644 --- a/src/gui/localbrowser/LocalBrowserModel.cpp +++ b/src/gui/localbrowser/LocalBrowserModel.cpp @@ -1,9 +1,14 @@ #include "LocalBrowserModel.h" + #include "LocalBrowserView.h" -#include "LocalBrowserModelException.h" + +#include + #include "client/Client.h" #include "client/SaveFile.h" +#include "common/tpt-minmax.h" + LocalBrowserModel::LocalBrowserModel(): stamp(NULL), currentPage(1), diff --git a/src/gui/localbrowser/LocalBrowserModel.h b/src/gui/localbrowser/LocalBrowserModel.h index c52bf3941..f3ae6c829 100644 --- a/src/gui/localbrowser/LocalBrowserModel.h +++ b/src/gui/localbrowser/LocalBrowserModel.h @@ -3,7 +3,6 @@ #include #include "common/String.h" -#include class SaveFile; diff --git a/src/gui/localbrowser/LocalBrowserModelException.h b/src/gui/localbrowser/LocalBrowserModelException.h index 7851d1e61..4da4ac359 100644 --- a/src/gui/localbrowser/LocalBrowserModelException.h +++ b/src/gui/localbrowser/LocalBrowserModelException.h @@ -4,7 +4,8 @@ #include "common/String.h" #include -class LocalBrowserModelException { +class LocalBrowserModelException : std::exception +{ ByteString message; public: LocalBrowserModelException(String message_): message(message_.ToUtf8()) {}; diff --git a/src/gui/localbrowser/LocalBrowserView.cpp b/src/gui/localbrowser/LocalBrowserView.cpp index 8fa7faf89..8ebc13ae5 100644 --- a/src/gui/localbrowser/LocalBrowserView.cpp +++ b/src/gui/localbrowser/LocalBrowserView.cpp @@ -1,7 +1,7 @@ -#include "client/Client.h" -#include "Format.h" #include "LocalBrowserView.h" -#include "PowderToy.h" + +#include "LocalBrowserController.h" +#include "LocalBrowserModel.h" #include "gui/interface/Button.h" #include "gui/interface/Textbox.h" @@ -9,11 +9,12 @@ #include "gui/interface/SaveButton.h" #include "gui/interface/Keys.h" -#include "gui/dialogues/ErrorMessage.h" -#include "gui/dialogues/ConfirmPrompt.h" -#include "LocalBrowserController.h" -#include "LocalBrowserModel.h" -#include "LocalBrowserModelException.h" +#include "PowderToy.h" +#include "Config.h" + +#include "client/SaveFile.h" + +#include "graphics/Graphics.h" LocalBrowserView::LocalBrowserView(): ui::Window(ui::Point(0, 0), ui::Point(WINDOWW, WINDOWH)), diff --git a/src/gui/login/LoginController.cpp b/src/gui/login/LoginController.cpp index f58e7c1f8..3fcbe47a1 100644 --- a/src/gui/login/LoginController.cpp +++ b/src/gui/login/LoginController.cpp @@ -1,7 +1,11 @@ #include "LoginController.h" -#include "client/User.h" + #include "client/Client.h" +#include "LoginView.h" +#include "LoginModel.h" +#include "Controller.h" + LoginController::LoginController(ControllerCallback * callback): HasExited(false) { diff --git a/src/gui/login/LoginController.h b/src/gui/login/LoginController.h index fbf5236d2..3659d5755 100644 --- a/src/gui/login/LoginController.h +++ b/src/gui/login/LoginController.h @@ -2,16 +2,13 @@ #define LOGINCONTROLLER_H_ #include "common/String.h" -#include "LoginView.h" -#include "LoginModel.h" -#include "Controller.h" #include "client/User.h" -using namespace std; - class LoginView; class LoginModel; -class LoginController { +class ControllerCallback; +class LoginController +{ LoginView * loginView; LoginModel * loginModel; ControllerCallback * callback; diff --git a/src/gui/login/LoginModel.cpp b/src/gui/login/LoginModel.cpp index fed7ddc15..970d95862 100644 --- a/src/gui/login/LoginModel.cpp +++ b/src/gui/login/LoginModel.cpp @@ -1,5 +1,9 @@ #include "LoginModel.h" +#include "LoginView.h" + +#include "client/Client.h" + LoginModel::LoginModel(): currentUser(0, "") { diff --git a/src/gui/login/LoginModel.h b/src/gui/login/LoginModel.h index d21450678..29229b825 100644 --- a/src/gui/login/LoginModel.h +++ b/src/gui/login/LoginModel.h @@ -3,14 +3,12 @@ #include #include "common/String.h" -#include "LoginView.h" -#include "client/Client.h" - -using namespace std; +#include "client/User.h" class LoginView; -class LoginModel { - vector observers; +class LoginModel +{ + std::vector observers; String statusText; bool loginStatus; void notifyStatusChanged(); diff --git a/src/gui/login/LoginView.cpp b/src/gui/login/LoginView.cpp index f7712fd0c..ea4fc0163 100644 --- a/src/gui/login/LoginView.cpp +++ b/src/gui/login/LoginView.cpp @@ -1,5 +1,8 @@ #include "LoginView.h" +#include "LoginModel.h" +#include "LoginController.h" + #include "graphics/Graphics.h" #include "gui/interface/Button.h" #include "gui/interface/Label.h" @@ -7,6 +10,10 @@ #include "gui/interface/Keys.h" #include "gui/Style.h" +#include "client/Client.h" + +#include "Misc.h" + class LoginView::LoginAction : public ui::ButtonAction { LoginView * v; diff --git a/src/gui/login/LoginView.h b/src/gui/login/LoginView.h index 0f2801a59..bac4b0230 100644 --- a/src/gui/login/LoginView.h +++ b/src/gui/login/LoginView.h @@ -2,8 +2,6 @@ #define LOGINVIEW_H_ #include "gui/interface/Window.h" -#include "LoginController.h" -#include "LoginModel.h" namespace ui { @@ -13,8 +11,9 @@ namespace ui } class LoginController; -class LoginMode; -class LoginView: public ui::Window { +class LoginModel; +class LoginView: public ui::Window +{ LoginController * c; ui::Button * loginButton; ui::Button * cancelButton; diff --git a/src/gui/options/OptionsController.cpp b/src/gui/options/OptionsController.cpp index d592f9c09..e42095ee7 100644 --- a/src/gui/options/OptionsController.cpp +++ b/src/gui/options/OptionsController.cpp @@ -1,7 +1,9 @@ #include "OptionsController.h" -#include "gui/dialogues/ErrorMessage.h" -#include "gui/interface/Engine.h" -#include "gui/game/GameModel.h" + +#include "OptionsView.h" +#include "OptionsModel.h" + +#include "Controller.h" OptionsController::OptionsController(GameModel * gModel_, ControllerCallback * callback_): gModel(gModel_), diff --git a/src/gui/options/OptionsController.h b/src/gui/options/OptionsController.h index 50bab5a89..c5acd1178 100644 --- a/src/gui/options/OptionsController.h +++ b/src/gui/options/OptionsController.h @@ -1,15 +1,12 @@ #ifndef OPTIONSCONTROLLER_H_ #define OPTIONSCONTROLLER_H_ -#include "Controller.h" -#include "simulation/Simulation.h" -#include "OptionsView.h" -#include "OptionsModel.h" - +class ControllerCallback; class GameModel; class OptionsModel; class OptionsView; -class OptionsController { +class OptionsController +{ GameModel * gModel; OptionsView * view; OptionsModel * model; diff --git a/src/gui/options/OptionsModel.cpp b/src/gui/options/OptionsModel.cpp index cf871bce8..2dcdf6e2c 100644 --- a/src/gui/options/OptionsModel.cpp +++ b/src/gui/options/OptionsModel.cpp @@ -1,7 +1,16 @@ -#include "simulation/Air.h" -#include "gui/game/GameModel.h" #include "OptionsModel.h" +#include "OptionsView.h" + +#include "simulation/Simulation.h" +#include "simulation/Air.h" +#include "simulation/Gravity.h" + +#include "client/Client.h" + +#include "gui/interface/Engine.h" +#include "gui/game/GameModel.h" + OptionsModel::OptionsModel(GameModel * gModel_) { gModel = gModel_; sim = gModel->GetSimulation(); diff --git a/src/gui/options/OptionsModel.h b/src/gui/options/OptionsModel.h index ad38e0651..d1fa53374 100644 --- a/src/gui/options/OptionsModel.h +++ b/src/gui/options/OptionsModel.h @@ -1,13 +1,13 @@ #ifndef OPTIONSMODEL_H_ #define OPTIONSMODEL_H_ + #include -#include "OptionsView.h" -#include "simulation/Simulation.h" class GameModel; class Simulation; class OptionsView; -class OptionsModel { +class OptionsModel +{ GameModel * gModel; Simulation * sim; std::vector observers; diff --git a/src/gui/options/OptionsView.cpp b/src/gui/options/OptionsView.cpp index ee1a728ee..4e990e2ec 100644 --- a/src/gui/options/OptionsView.cpp +++ b/src/gui/options/OptionsView.cpp @@ -1,3 +1,8 @@ +#include "OptionsView.h" + +#include "OptionsController.h" +#include "OptionsModel.h" + #include #ifdef WIN #include @@ -7,14 +12,15 @@ #endif #include "SDLCompat.h" -#include "OptionsView.h" -#include "Format.h" #include "gui/Style.h" #include "gui/interface/Button.h" #include "gui/interface/Label.h" #include "gui/interface/DropDown.h" #include "gui/interface/Engine.h" -#include "gui/dialogues/ErrorMessage.h" +#include "gui/interface/Checkbox.h" +#include "gui/interface/DropDown.h" + +#include "graphics/Graphics.h" OptionsView::OptionsView(): ui::Window(ui::Point(-1, -1), ui::Point(300, 389)){ diff --git a/src/gui/options/OptionsView.h b/src/gui/options/OptionsView.h index 5dd19b808..a9dc3fcce 100644 --- a/src/gui/options/OptionsView.h +++ b/src/gui/options/OptionsView.h @@ -2,15 +2,18 @@ #define OPTIONSVIEW_H_ #include "gui/interface/Window.h" -#include "OptionsController.h" -#include "gui/interface/Checkbox.h" -#include "gui/interface/DropDown.h" -#include "gui/interface/Textbox.h" -#include "OptionsModel.h" + +namespace ui +{ + class Checkbox; + class DropDown; + class DropDown; +} class OptionsModel; class OptionsController; -class OptionsView: public ui::Window { +class OptionsView: public ui::Window +{ OptionsController * c; ui::Checkbox * heatSimulation; ui::Checkbox * ambientHeatSimulation; diff --git a/src/gui/preview/PreviewController.cpp b/src/gui/preview/PreviewController.cpp index d55454f17..cdd5bf29c 100644 --- a/src/gui/preview/PreviewController.cpp +++ b/src/gui/preview/PreviewController.cpp @@ -1,13 +1,21 @@ -#include "client/Client.h" #include "PreviewController.h" + #include "PreviewView.h" #include "PreviewModel.h" + +#include "client/Client.h" +#include "client/SaveInfo.h" + #include "PreviewModelException.h" + #include "gui/dialogues/InformationMessage.h" #include "gui/dialogues/ErrorMessage.h" #include "gui/login/LoginController.h" +#include "gui/login/LoginView.h" + #include "Controller.h" #include "Platform.h" +#include "Config.h" PreviewController::PreviewController(int saveID, int saveDate, bool instant, ControllerCallback * callback): saveId(saveID), diff --git a/src/gui/preview/PreviewController.h b/src/gui/preview/PreviewController.h index eda620190..cbc3996a7 100644 --- a/src/gui/preview/PreviewController.h +++ b/src/gui/preview/PreviewController.h @@ -1,12 +1,10 @@ #ifndef PREVIEWCONTROLLER_H_ #define PREVIEWCONTROLLER_H_ -#include "gui/preview/PreviewModel.h" -#include "gui/preview/PreviewView.h" -#include "Controller.h" -#include "client/SaveInfo.h" #include "client/ClientListener.h" +class SaveInfo; +class ControllerCallback; class LoginController; class PreviewModel; class PreviewView; diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp index 774b63374..ac594da7d 100644 --- a/src/gui/preview/PreviewModel.cpp +++ b/src/gui/preview/PreviewModel.cpp @@ -1,11 +1,20 @@ -#include #include "PreviewModel.h" + +#include +#include + #include "Format.h" + #include "client/Client.h" #include "client/GameSave.h" -#include "common/tpt-minmax.h" +#include "client/SaveInfo.h" +#include "client/http/Request.h" + #include "gui/dialogues/ErrorMessage.h" +#include "gui/preview/Comment.h" + #include "PreviewModelException.h" +#include "PreviewView.h" PreviewModel::PreviewModel(): doOpen(false), diff --git a/src/gui/preview/PreviewModel.h b/src/gui/preview/PreviewModel.h index 8ad3f666b..ac13a9bba 100644 --- a/src/gui/preview/PreviewModel.h +++ b/src/gui/preview/PreviewModel.h @@ -2,19 +2,21 @@ #define PREVIEWMODEL_H #include -#include -#include "PreviewView.h" -#include "client/SaveInfo.h" -#include "gui/preview/Comment.h" -#include "client/http/Request.h" +#include "common/String.h" -using namespace std; +namespace http +{ + class Request; +} class PreviewView; -class PreviewModel { +class SaveInfo; +class SaveComment; +class PreviewModel +{ bool doOpen; bool canOpen; - vector observers; + std::vector observers; SaveInfo * saveInfo; std::vector * saveData; std::vector * saveComments; diff --git a/src/gui/preview/PreviewModelException.h b/src/gui/preview/PreviewModelException.h index 42656d7ca..e73bbe41f 100644 --- a/src/gui/preview/PreviewModelException.h +++ b/src/gui/preview/PreviewModelException.h @@ -3,9 +3,9 @@ #include "common/String.h" #include -using namespace std; -struct PreviewModelException: public exception { +struct PreviewModelException: public std::exception +{ String message; public: PreviewModelException(String message_): message(message_) {} diff --git a/src/gui/preview/PreviewView.cpp b/src/gui/preview/PreviewView.cpp index 2acef1eae..926365fdd 100644 --- a/src/gui/preview/PreviewView.cpp +++ b/src/gui/preview/PreviewView.cpp @@ -1,21 +1,30 @@ -#include -#include -#include #include "PreviewView.h" -#include "gui/dialogues/TextPrompt.h" + #include "simulation/SaveRenderer.h" -#include "gui/interface/Point.h" -#include "gui/interface/Window.h" -#include "gui/interface/Textbox.h" -#include "gui/Style.h" -#include "Format.h" -#include "gui/profile/ProfileActivity.h" + #include "client/Client.h" +#include "client/SaveInfo.h" + +#include "gui/dialogues/TextPrompt.h" +#include "gui/profile/ProfileActivity.h" #include "gui/interface/ScrollPanel.h" #include "gui/interface/AvatarButton.h" +#include "gui/preview/PreviewController.h" +#include "gui/preview/PreviewModel.h" +#include "gui/interface/Button.h" #include "gui/interface/Keys.h" +#include "gui/interface/CopyTextButton.h" +#include "gui/interface/Label.h" +#include "gui/interface/Textbox.h" #include "gui/dialogues/ErrorMessage.h" +#include "gui/interface/Point.h" +#include "gui/interface/Window.h" +#include "gui/Style.h" + #include "common/tpt-rand.h" +#include "Comment.h" +#include "Format.h" +#include "Misc.h" #ifdef GetUserName # undef GetUserName // dammit windows diff --git a/src/gui/preview/PreviewView.h b/src/gui/preview/PreviewView.h index 587332258..d8a7faa62 100644 --- a/src/gui/preview/PreviewView.h +++ b/src/gui/preview/PreviewView.h @@ -4,17 +4,14 @@ #include #include #include "common/String.h" -#include "Comment.h" #include "gui/interface/Window.h" -#include "gui/preview/PreviewController.h" -#include "gui/preview/PreviewModel.h" -#include "gui/interface/Button.h" -#include "gui/interface/CopyTextButton.h" -#include "gui/interface/Label.h" -#include "gui/interface/Textbox.h" namespace ui { + class Button; + class CopyTextButton; + class Label; + class Textbox; class ScrollPanel; class AvatarButton; } @@ -22,7 +19,8 @@ namespace ui class VideoBuffer; class PreviewModel; class PreviewController; -class PreviewView: public ui::Window { +class PreviewView: public ui::Window +{ class SubmitCommentAction; class LoginAction; class AutoCommentSizeAction; diff --git a/src/gui/profile/ProfileActivity.cpp b/src/gui/profile/ProfileActivity.cpp index 70d844e3a..b79c4cd0a 100644 --- a/src/gui/profile/ProfileActivity.cpp +++ b/src/gui/profile/ProfileActivity.cpp @@ -1,16 +1,15 @@ -#include #include "ProfileActivity.h" + #include "gui/interface/Button.h" #include "gui/interface/Textbox.h" #include "gui/interface/Label.h" #include "gui/interface/AvatarButton.h" #include "gui/interface/ScrollPanel.h" -#include "gui/interface/Keys.h" #include "gui/dialogues/ErrorMessage.h" #include "gui/Style.h" + #include "client/Client.h" -#include "client/UserInfo.h" -#include "Format.h" + #include "Platform.h" ProfileActivity::ProfileActivity(ByteString username) : diff --git a/src/gui/profile/ProfileActivity.h b/src/gui/profile/ProfileActivity.h index a811c2cac..0498588b6 100644 --- a/src/gui/profile/ProfileActivity.h +++ b/src/gui/profile/ProfileActivity.h @@ -4,7 +4,6 @@ #include "common/String.h" #include "Activity.h" #include "client/UserInfo.h" -#include "gui/interface/Window.h" #include "client/http/SaveUserInfoRequest.h" #include "client/http/GetUserInfoRequest.h" #include "client/http/RequestMonitor.h" diff --git a/src/gui/render/RenderController.cpp b/src/gui/render/RenderController.cpp index fb6d77261..14b35b766 100644 --- a/src/gui/render/RenderController.cpp +++ b/src/gui/render/RenderController.cpp @@ -1,5 +1,10 @@ #include "RenderController.h" +#include "RenderView.h" +#include "RenderModel.h" + +#include "Controller.h" + RenderController::RenderController(Renderer * ren, ControllerCallback * callback): HasExited(false) { diff --git a/src/gui/render/RenderController.h b/src/gui/render/RenderController.h index 42adb6502..17925a1bf 100644 --- a/src/gui/render/RenderController.h +++ b/src/gui/render/RenderController.h @@ -1,20 +1,18 @@ #ifndef RENDERCONTROLLER_H_ #define RENDERCONTROLLER_H_ -#include "RenderView.h" -#include "RenderModel.h" -#include "graphics/Renderer.h" -#include "Controller.h" - +class ControllerCallback; class RenderView; class RenderModel; -class RenderController { +class Renderer; +class RenderController +{ RenderView * renderView; RenderModel * renderModel; ControllerCallback * callback; public: bool HasExited; - RenderController(Renderer * ren, ControllerCallback * callback = NULL); + RenderController(Renderer * ren, ControllerCallback * callback = nullptr); void Exit(); RenderView * GetView() { return renderView; } virtual ~RenderController(); diff --git a/src/gui/render/RenderModel.cpp b/src/gui/render/RenderModel.cpp index 25e65027d..a4a949b9d 100644 --- a/src/gui/render/RenderModel.cpp +++ b/src/gui/render/RenderModel.cpp @@ -1,6 +1,11 @@ #include "RenderModel.h" + +#include "RenderView.h" + #include "gui/game/RenderPreset.h" +#include "graphics/Renderer.h" + RenderModel::RenderModel(): renderer(NULL) { diff --git a/src/gui/render/RenderModel.h b/src/gui/render/RenderModel.h index 2cd24a54a..c072c16b0 100644 --- a/src/gui/render/RenderModel.h +++ b/src/gui/render/RenderModel.h @@ -2,14 +2,14 @@ #define RENDERMODEL_H_ #include -#include "RenderView.h" -#include "graphics/Renderer.h" using namespace std; class RenderView; -class RenderModel { - vector observers; +class Renderer; +class RenderModel +{ + std::vector observers; Renderer * renderer; void notifyRendererChanged(); void notifyRenderChanged(); diff --git a/src/gui/render/RenderView.cpp b/src/gui/render/RenderView.cpp index 526382641..db0de985c 100644 --- a/src/gui/render/RenderView.cpp +++ b/src/gui/render/RenderView.cpp @@ -1,7 +1,15 @@ +#include "RenderView.h" + #include "simulation/ElementGraphics.h" + #include "graphics/Graphics.h" #include "graphics/Renderer.h" -#include "RenderView.h" + +#include "RenderController.h" +#include "RenderModel.h" + +#include "gui/interface/Checkbox.h" +#include "gui/interface/Button.h" class RenderView::RenderModeAction: public ui::CheckboxAction { diff --git a/src/gui/render/RenderView.h b/src/gui/render/RenderView.h index ba83ba54b..3b1945070 100644 --- a/src/gui/render/RenderView.h +++ b/src/gui/render/RenderView.h @@ -1,15 +1,15 @@ #ifndef RENDERVIEW_H_ #define RENDERVIEW_H_ - #include #include "gui/interface/Window.h" -#include "RenderController.h" -#include "RenderModel.h" -#include "graphics/Renderer.h" -#include "gui/interface/Checkbox.h" -#include "gui/interface/Button.h" +namespace ui +{ + class Checkbox; +} + +class Renderer; class RenderController; class RenderModel; class RenderView: public ui::Window { diff --git a/src/gui/save/LocalSaveActivity.cpp b/src/gui/save/LocalSaveActivity.cpp index 7df1ec07e..aec90a206 100644 --- a/src/gui/save/LocalSaveActivity.cpp +++ b/src/gui/save/LocalSaveActivity.cpp @@ -1,9 +1,13 @@ #include "LocalSaveActivity.h" + #include "images.h" #include "client/Client.h" #include "client/GameSave.h" +#include "client/ThumbnailRendererTask.h" + #include "graphics/Graphics.h" + #include "gui/Style.h" #include "gui/dialogues/ConfirmPrompt.h" @@ -11,7 +15,6 @@ #include "gui/interface/Button.h" #include "gui/interface/Label.h" #include "gui/interface/Textbox.h" -#include "client/ThumbnailRendererTask.h" class LocalSaveActivity::CancelAction: public ui::ButtonAction diff --git a/src/gui/save/ServerSaveActivity.cpp b/src/gui/save/ServerSaveActivity.cpp index 496d33e2b..f2dc0d813 100644 --- a/src/gui/save/ServerSaveActivity.cpp +++ b/src/gui/save/ServerSaveActivity.cpp @@ -1,5 +1,7 @@ #include "ServerSaveActivity.h" + #include "graphics/Graphics.h" + #include "gui/interface/Label.h" #include "gui/interface/Textbox.h" #include "gui/interface/Button.h" @@ -8,12 +10,16 @@ #include "gui/dialogues/SaveIDMessage.h" #include "gui/dialogues/ConfirmPrompt.h" #include "gui/dialogues/InformationMessage.h" + #include "client/Client.h" -#include "tasks/Task.h" -#include "gui/Style.h" -#include "client/GameSave.h" -#include "images.h" #include "client/ThumbnailRendererTask.h" +#include "client/GameSave.h" + +#include "tasks/Task.h" + +#include "gui/Style.h" + +#include "images.h" class ServerSaveActivity::CancelAction: public ui::ButtonAction { diff --git a/src/gui/search/SearchController.cpp b/src/gui/search/SearchController.cpp index 2b80fc6b4..bf3431988 100644 --- a/src/gui/search/SearchController.cpp +++ b/src/gui/search/SearchController.cpp @@ -1,17 +1,24 @@ -#include "common/String.h" #include "SearchController.h" + #include "SearchModel.h" #include "SearchView.h" -#include "graphics/Graphics.h" -#include "gui/interface/Panel.h" + #include "gui/dialogues/ConfirmPrompt.h" -#include "gui/dialogues/ErrorMessage.h" #include "gui/preview/PreviewController.h" -#include "client/Client.h" -#include "Platform.h" +#include "gui/preview/PreviewView.h" + #include "tasks/Task.h" #include "tasks/TaskWindow.h" +#include "Platform.h" +#include "Controller.h" + +#include "graphics/Graphics.h" + +#include "client/Client.h" + +#include "common/tpt-minmax.h" + class SearchController::OpenCallback: public ControllerCallback { SearchController * cc; diff --git a/src/gui/search/SearchController.h b/src/gui/search/SearchController.h index 191b6b38d..6cb543f34 100644 --- a/src/gui/search/SearchController.h +++ b/src/gui/search/SearchController.h @@ -1,13 +1,12 @@ #ifndef SEARCHCONTROLLER_H #define SEARCHCONTROLLER_H -#include "gui/interface/Panel.h" -#include "SearchModel.h" -#include "SearchView.h" -#include "gui/preview/PreviewController.h" -#include "Controller.h" -#include "client/SaveInfo.h" +#include "common/String.h" +class ControllerCallback; +class SaveInfo; +class PreviewController; +class PreviewController; class SearchView; class SearchModel; class SearchController diff --git a/src/gui/search/SearchModel.cpp b/src/gui/search/SearchModel.cpp index de8caf111..af8551316 100644 --- a/src/gui/search/SearchModel.cpp +++ b/src/gui/search/SearchModel.cpp @@ -1,9 +1,14 @@ #include "SearchModel.h" -#include "client/SaveInfo.h" +#include "SearchView.h" + +#include "client/SaveInfo.h" #include "client/Client.h" #include +#include + +#include "common/tpt-minmax.h" SearchModel::SearchModel(): loadedSave(NULL), @@ -278,3 +283,11 @@ SearchModel::~SearchModel() { delete loadedSave; } + +int SearchModel::GetPageCount() +{ + if (!showOwn && !showFavourite && currentSort == "best" && lastQuery == "") + return std::max(1, (int)(ceil(resultCount/20.0f))+1); //add one for front page (front page saves are repeated twice) + else + return std::max(1, (int)(ceil(resultCount/20.0f))); +} diff --git a/src/gui/search/SearchModel.h b/src/gui/search/SearchModel.h index fc62d0c80..c73627f5d 100644 --- a/src/gui/search/SearchModel.h +++ b/src/gui/search/SearchModel.h @@ -3,12 +3,9 @@ #include #include "common/String.h" -#include "common/tpt-minmax.h" #include -#include -#include "client/SaveInfo.h" -#include "SearchView.h" +class SaveInfo; class SearchView; class SearchModel { @@ -57,13 +54,7 @@ public: std::vector GetSaveList(); std::vector > GetTagList(); String GetLastError() { return lastError; } - int GetPageCount() - { - if (!showOwn && !showFavourite && currentSort == "best" && lastQuery == "") - return std::max(1, (int)(ceil(resultCount/20.0f))+1); //add one for front page (front page saves are repeated twice) - else - return std::max(1, (int)(ceil(resultCount/20.0f))); - } + int GetPageCount(); int GetPageNum() { return currentPage; } String GetLastQuery() { return lastQuery; } void SetSort(ByteString sort) { if(!updateSaveListWorking) { currentSort = sort; } notifySortChanged(); } diff --git a/src/gui/search/SearchView.cpp b/src/gui/search/SearchView.cpp index d1098cc86..4b1bbf1f3 100644 --- a/src/gui/search/SearchView.cpp +++ b/src/gui/search/SearchView.cpp @@ -1,5 +1,11 @@ #include "SearchView.h" + +#include "SearchController.h" +#include "SearchModel.h" + #include "client/Client.h" +#include "client/SaveInfo.h" + #include "gui/interface/Keys.h" #include "gui/interface/SaveButton.h" #include "gui/interface/Button.h" @@ -7,9 +13,11 @@ #include "gui/interface/RichLabel.h" #include "gui/interface/Textbox.h" #include "gui/interface/Spinner.h" -#include "Misc.h" -#include "Format.h" + #include "PowderToy.h" +#include "Config.h" + +#include "graphics/Graphics.h" #ifdef GetUserName # undef GetUserName // dammit windows @@ -18,7 +26,7 @@ SearchView::SearchView(): ui::Window(ui::Point(0, 0), ui::Point(WINDOWW, WINDOWH)), c(NULL), - saveButtons(vector()), + saveButtons(std::vector()), errorLabel(NULL), changed(true), lastChanged(0), @@ -473,7 +481,7 @@ void SearchView::NotifyTagListChanged(SearchModel * sender) int tagWidth = 0, tagHeight = 0, tagX = 0, tagY = 0, tagsX = 6, tagsY = 4, tagPadding = 1; int tagAreaWidth, tagAreaHeight, tagXOffset = 0, tagYOffset = 0; - vector > tags = sender->GetTagList(); + std::vector > tags = sender->GetTagList(); if (motdLabel) { @@ -534,7 +542,7 @@ void SearchView::NotifyTagListChanged(SearchModel * sender) { int maxTagVotes = tags[0].second; - pair tag = tags[i]; + std::pair tag = tags[i]; if (tagX == tagsX) { @@ -578,7 +586,7 @@ void SearchView::NotifySaveListChanged(SearchModel * sender) int buttonWidth, buttonHeight, saveX = 0, saveY = 0, savesX = 5, savesY = 4, buttonPadding = 1; int buttonAreaWidth, buttonAreaHeight, buttonXOffset, buttonYOffset; - vector saves = sender->GetSaveList(); + std::vector saves = sender->GetSaveList(); //string messageOfTheDay = sender->GetMessageOfTheDay(); if(sender->GetShowFavourite()) @@ -721,7 +729,7 @@ void SearchView::NotifySaveListChanged(SearchModel * sender) void SearchView::NotifySelectedChanged(SearchModel * sender) { - vector selected = sender->GetSelected(); + std::vector selected = sender->GetSelected(); size_t published = 0; for (size_t j = 0; j < saveButtons.size(); j++) { diff --git a/src/gui/search/SearchView.h b/src/gui/search/SearchView.h index 36aea6dee..38314906d 100644 --- a/src/gui/search/SearchView.h +++ b/src/gui/search/SearchView.h @@ -2,10 +2,8 @@ #define SEARCHVIEW_H #include -#include "SearchController.h" #include "client/ClientListener.h" - -using namespace std; +#include "gui/interface/Window.h" namespace ui { @@ -24,8 +22,8 @@ class SearchView: public ui::Window, public ClientListener { private: SearchController * c; - vector saveButtons; - vector tagButtons; + std::vector saveButtons; + std::vector tagButtons; ui::Button * favButton; ui::Button * nextButton; ui::Button * previousButton; diff --git a/src/gui/tags/TagsController.cpp b/src/gui/tags/TagsController.cpp index da9cce04f..ea5cc5a5a 100644 --- a/src/gui/tags/TagsController.cpp +++ b/src/gui/tags/TagsController.cpp @@ -1,9 +1,12 @@ #include "TagsController.h" -#include "gui/interface/Engine.h" #include "TagsModel.h" #include "TagsView.h" +#include "gui/interface/Engine.h" +#include "client/SaveInfo.h" +#include "Controller.h" + TagsController::TagsController(ControllerCallback * callback, SaveInfo * save): HasDone(false) { diff --git a/src/gui/tags/TagsController.h b/src/gui/tags/TagsController.h index 788b1532c..4069d34fe 100644 --- a/src/gui/tags/TagsController.h +++ b/src/gui/tags/TagsController.h @@ -1,13 +1,14 @@ #ifndef TAGSCONTROLLER_H_ #define TAGSCONTROLLER_H_ -#include "Controller.h" -#include "TagsView.h" -#include "client/SaveInfo.h" +#include "common/String.h" +class ControllerCallback; +class SaveInfo; class TagsView; class TagsModel; -class TagsController { +class TagsController +{ ControllerCallback * callback; TagsView * tagsView; TagsModel * tagsModel; diff --git a/src/gui/tags/TagsModel.cpp b/src/gui/tags/TagsModel.cpp index 2ccbaa531..76bc586c6 100644 --- a/src/gui/tags/TagsModel.cpp +++ b/src/gui/tags/TagsModel.cpp @@ -1,7 +1,9 @@ #include "TagsModel.h" + #include "TagsView.h" -#include "client/Client.h" #include "TagsModelException.h" + +#include "client/Client.h" #include "client/SaveInfo.h" TagsModel::TagsModel(): diff --git a/src/gui/tags/TagsView.cpp b/src/gui/tags/TagsView.cpp index 48b9817c7..ad412d6eb 100644 --- a/src/gui/tags/TagsView.cpp +++ b/src/gui/tags/TagsView.cpp @@ -1,12 +1,15 @@ -#include "client/Client.h" #include "TagsView.h" -#include "graphics/Graphics.h" -#include "gui/dialogues/ErrorMessage.h" #include "TagsController.h" #include "TagsModel.h" #include "TagsModelException.h" +#include "client/Client.h" +#include "client/SaveInfo.h" + +#include "graphics/Graphics.h" + +#include "gui/dialogues/ErrorMessage.h" #include "gui/interface/Button.h" #include "gui/interface/Textbox.h" #include "gui/interface/Label.h" diff --git a/src/gui/update/UpdateActivity.cpp b/src/gui/update/UpdateActivity.cpp index 9f8fd288d..5baf3bc89 100644 --- a/src/gui/update/UpdateActivity.cpp +++ b/src/gui/update/UpdateActivity.cpp @@ -1,13 +1,19 @@ +#include "UpdateActivity.h" + #include + #include "gui/dialogues/ConfirmPrompt.h" #include "gui/interface/Engine.h" -#include "UpdateActivity.h" -#include "tasks/Task.h" -#include "client/Client.h" -#include "Update.h" -#include "client/http/Request.h" -#include "Platform.h" +#include "tasks/Task.h" +#include "tasks/TaskWindow.h" + +#include "client/Client.h" +#include "client/http/Request.h" + +#include "Update.h" +#include "Config.h" +#include "Platform.h" class UpdateDownloadTask : public Task { diff --git a/src/gui/update/UpdateActivity.h b/src/gui/update/UpdateActivity.h index 6ba5fb37b..861f62408 100644 --- a/src/gui/update/UpdateActivity.h +++ b/src/gui/update/UpdateActivity.h @@ -1,9 +1,10 @@ #ifndef UPDATEACTIVITY_H_ #define UPDATEACTIVITY_H_ -#include "tasks/TaskWindow.h" - -class UpdateActivity { +class Task; +class TaskWindow; +class UpdateActivity +{ Task * updateDownloadTask; TaskWindow * updateWindow; public: diff --git a/src/lua/CommandInterface.cpp b/src/lua/CommandInterface.cpp index 13d7d1e4c..7d6a98e24 100644 --- a/src/lua/CommandInterface.cpp +++ b/src/lua/CommandInterface.cpp @@ -1,11 +1,13 @@ -#include +#include "CommandInterface.h" + #include #if !defined(WIN) || defined(__GNUC__) #include #endif -#include "CommandInterface.h" + #include "gui/game/GameModel.h" -#include "gui/game/GameController.h" + +#include "simulation/Particle.h" CommandInterface::CommandInterface(GameController * c, GameModel * m) { this->m = m; diff --git a/src/lua/CommandInterface.h b/src/lua/CommandInterface.h index d247a28f1..cd98462cf 100644 --- a/src/lua/CommandInterface.h +++ b/src/lua/CommandInterface.h @@ -3,7 +3,6 @@ #include "common/String.h" #include "lua/LuaEvents.h" -#include "gui/interface/Engine.h" class Event; class GameModel; diff --git a/src/lua/LegacyLuaAPI.cpp b/src/lua/LegacyLuaAPI.cpp index e45564724..3d61fb8c4 100644 --- a/src/lua/LegacyLuaAPI.cpp +++ b/src/lua/LegacyLuaAPI.cpp @@ -5,6 +5,8 @@ #include #include "client/http/Request.h" +#include "client/Client.h" + #include "Format.h" #include "LuaScriptInterface.h" #include "LuaScriptHelper.h" @@ -17,9 +19,16 @@ #include "gui/dialogues/TextPrompt.h" #include "gui/dialogues/ConfirmPrompt.h" #include "gui/game/GameModel.h" +#include "gui/game/GameController.h" #include "gui/interface/Keys.h" -#include "simulation/Simulation.h" +#include "gui/interface/Engine.h" +#include "simulation/Simulation.h" +#include "simulation/Gravity.h" +#include "simulation/SimulationData.h" + +#include "graphics/Graphics.h" +#include "graphics/Renderer.h" std::map legacyPropNames; std::map legacyTransitionNames; diff --git a/src/lua/LuaButton.cpp b/src/lua/LuaButton.cpp index 64167ffe5..303437e47 100644 --- a/src/lua/LuaButton.cpp +++ b/src/lua/LuaButton.cpp @@ -1,8 +1,9 @@ #ifdef LUACONSOLE -#include #include "LuaButton.h" + #include "LuaScriptInterface.h" + #include "gui/interface/Button.h" const char LuaButton::className[] = "Button"; diff --git a/src/lua/LuaCheckbox.cpp b/src/lua/LuaCheckbox.cpp index c669d3bb7..a2ae2b412 100644 --- a/src/lua/LuaCheckbox.cpp +++ b/src/lua/LuaCheckbox.cpp @@ -1,8 +1,9 @@ #ifdef LUACONSOLE -#include #include "LuaCheckbox.h" + #include "LuaScriptInterface.h" + #include "gui/interface/Checkbox.h" const char LuaCheckbox::className[] = "Checkbox"; diff --git a/src/lua/LuaComponent.cpp b/src/lua/LuaComponent.cpp index efa8a8746..85b7d5a6c 100644 --- a/src/lua/LuaComponent.cpp +++ b/src/lua/LuaComponent.cpp @@ -1,9 +1,11 @@ #ifdef LUACONSOLE -#include #include "LuaComponent.h" + #include "LuaScriptInterface.h" + #include "gui/interface/Component.h" +#include "gui/interface/Window.h" int LuaComponentCallback::CheckAndAssignArg1() { diff --git a/src/lua/LuaLabel.cpp b/src/lua/LuaLabel.cpp index 53318a147..3534b8307 100644 --- a/src/lua/LuaLabel.cpp +++ b/src/lua/LuaLabel.cpp @@ -1,8 +1,9 @@ #ifdef LUACONSOLE -#include #include "LuaScriptInterface.h" + #include "LuaLabel.h" + #include "gui/interface/Label.h" const char LuaLabel::className[] = "Label"; diff --git a/src/lua/LuaProgressBar.cpp b/src/lua/LuaProgressBar.cpp index 7a70e608a..6d38de40e 100644 --- a/src/lua/LuaProgressBar.cpp +++ b/src/lua/LuaProgressBar.cpp @@ -1,8 +1,9 @@ #ifdef LUACONSOLE -#include #include "LuaProgressBar.h" + #include "LuaScriptInterface.h" + #include "gui/interface/ProgressBar.h" const char LuaProgressBar::className[] = "ProgressBar"; diff --git a/src/lua/LuaScriptHelper.h b/src/lua/LuaScriptHelper.h index f2dc0dbdb..73fbf334d 100644 --- a/src/lua/LuaScriptHelper.h +++ b/src/lua/LuaScriptHelper.h @@ -1,6 +1,18 @@ #ifndef LUASCRIPTHELPER_H_ #define LUASCRIPTHELPER_H_ +#include "simulation/Particle.h" +#include "simulation/ElementDefs.h" +#include "common/String.h" +#include "LuaCompat.h" + +class GameModel; +class GameController; +class Simulation; +class LuaScriptInterface; +class Graphics; +class Renderer; + extern GameModel * luacon_model; extern GameController * luacon_controller; extern Simulation * luacon_sim; diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 02cf8cdd9..bd0d8dccc 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -1,31 +1,18 @@ #ifdef LUACONSOLE -#include + +#include "LuaScriptInterface.h" + #include -#include -#include #include -#include + #include "Config.h" #include "Format.h" -#include "LuaLuna.h" -#include "LuaScriptInterface.h" -#include "TPTScriptInterface.h" -#include "gui/dialogues/ErrorMessage.h" -#include "gui/dialogues/InformationMessage.h" -#include "gui/dialogues/TextPrompt.h" -#include "gui/dialogues/ConfirmPrompt.h" -#include "simulation/Simulation.h" -#include "simulation/Air.h" -#include "ToolClasses.h" -#include "gui/game/GameModel.h" -#include "gui/game/Tool.h" -#include "LuaScriptHelper.h" -#include "client/GameSave.h" -#include "client/SaveFile.h" -#include "Misc.h" #include "Platform.h" #include "PowderToy.h" +#include "TPTScriptInterface.h" +#include "LuaScriptHelper.h" +#include "LuaLuna.h" #include "LuaBit.h" #include "LuaButton.h" #include "LuaCheckbox.h" @@ -36,6 +23,29 @@ #include "LuaTextbox.h" #include "LuaWindow.h" +#include "gui/interface/Window.h" +#include "gui/interface/Engine.h" +#include "gui/game/GameView.h" +#include "gui/game/GameController.h" +#include "gui/game/GameModel.h" +#include "gui/game/Tool.h" +#include "gui/game/Brush.h" + +#include "simulation/Simulation.h" +#include "simulation/ElementGraphics.h" +#include "simulation/Air.h" + +#include "ToolClasses.h" +#include "ElementClasses.h" + +#include "client/GameSave.h" +#include "client/SaveFile.h" +#include "client/SaveInfo.h" +#include "client/Client.h" + +#include "graphics/Graphics.h" +#include "graphics/Renderer.h" + #ifndef WIN #include #endif @@ -1257,7 +1267,7 @@ int LuaScriptInterface::simulation_createParts(lua_State * l) int brush = luaL_optint(l,6,CIRCLE_BRUSH); int flags = luaL_optint(l,7,luacon_sim->replaceModeFlags); - vector brushList = luacon_model->GetBrushList(); + std::vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush >= (int)brushList.size()) return luaL_error(l, "Invalid brush id '%d'", brush); ui::Point tempRadius = brushList[brush]->GetRadius(); @@ -1281,7 +1291,7 @@ int LuaScriptInterface::simulation_createLine(lua_State * l) int brush = luaL_optint(l,8,CIRCLE_BRUSH); int flags = luaL_optint(l,9,luacon_sim->replaceModeFlags); - vector brushList = luacon_model->GetBrushList(); + std::vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush >= (int)brushList.size()) return luaL_error(l, "Invalid brush id '%d'", brush); ui::Point tempRadius = brushList[brush]->GetRadius(); @@ -1397,7 +1407,7 @@ int LuaScriptInterface::simulation_toolBrush(lua_State * l) else if (tool < 0 || tool > (int)luacon_sim->tools.size()) return luaL_error(l, "Invalid tool id '%d'", tool); - vector brushList = luacon_model->GetBrushList(); + std::vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush >= (int)brushList.size()) return luaL_error(l, "Invalid brush id '%d'", brush); ui::Point tempRadius = brushList[brush]->GetRadius(); @@ -1423,7 +1433,7 @@ int LuaScriptInterface::simulation_toolLine(lua_State * l) if (tool < 0 || tool >= (int)luacon_sim->tools.size()+1) return luaL_error(l, "Invalid tool id '%d'", tool); - vector brushList = luacon_model->GetBrushList(); + std::vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush >= (int)brushList.size()) return luaL_error(l, "Invalid brush id '%d'", brush); ui::Point tempRadius = brushList[brush]->GetRadius(); @@ -1476,7 +1486,7 @@ int LuaScriptInterface::simulation_decoBrush(lua_State * l) int tool = luaL_optint(l,9,DECO_DRAW); int brush = luaL_optint(l,10,CIRCLE_BRUSH); - vector brushList = luacon_model->GetBrushList(); + std::vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush >= (int)brushList.size()) return luaL_error(l, "Invalid brush id '%d'", brush); ui::Point tempRadius = brushList[brush]->GetRadius(); @@ -1502,7 +1512,7 @@ int LuaScriptInterface::simulation_decoLine(lua_State * l) int tool = luaL_optint(l,11,DECO_DRAW); int brush = luaL_optint(l,12,CIRCLE_BRUSH); - vector brushList = luacon_model->GetBrushList(); + std::vector brushList = luacon_model->GetBrushList(); if (brush < 0 || brush >= (int)brushList.size()) return luaL_error(l, "Invalid brush id '%d'", brush); ui::Point tempRadius = brushList[brush]->GetRadius(); @@ -1961,7 +1971,7 @@ int LuaScriptInterface::simulation_brush(lua_State * l) } int brushID = luaL_optint(l, 5, luacon_model->GetBrushID()); - vector brushList = luacon_model->GetBrushList(); + std::vector brushList = luacon_model->GetBrushList(); if (brushID < 0 || brushID >= (int)brushList.size()) return luaL_error(l, "Invalid brush id '%d'", brushID); diff --git a/src/lua/LuaScriptInterface.h b/src/lua/LuaScriptInterface.h index 9b4a24ff6..74a15890a 100644 --- a/src/lua/LuaScriptInterface.h +++ b/src/lua/LuaScriptInterface.h @@ -6,7 +6,7 @@ #include "CommandInterface.h" #include "lua/LuaEvents.h" -#include "simulation/Simulation.h" +#include "simulation/StructProperty.h" #include @@ -37,6 +37,7 @@ class Tool; lua_pushinteger(L, NAME);\ lua_setfield(L, -2, #NAME) +class Simulation; class TPTScriptInterface; class LuaComponent; diff --git a/src/lua/LuaSlider.cpp b/src/lua/LuaSlider.cpp index 24c897eca..171269554 100644 --- a/src/lua/LuaSlider.cpp +++ b/src/lua/LuaSlider.cpp @@ -1,8 +1,9 @@ #ifdef LUACONSOLE -#include #include "LuaSlider.h" + #include "LuaScriptInterface.h" + #include "gui/interface/Slider.h" const char LuaSlider::className[] = "Slider"; diff --git a/src/lua/LuaTextbox.cpp b/src/lua/LuaTextbox.cpp index d51a3098c..e614bfeec 100644 --- a/src/lua/LuaTextbox.cpp +++ b/src/lua/LuaTextbox.cpp @@ -1,8 +1,9 @@ #ifdef LUACONSOLE -#include -#include "LuaScriptInterface.h" #include "LuaTextbox.h" + +#include "LuaScriptInterface.h" + #include "gui/interface/Textbox.h" const char LuaTextbox::className[] = "Textbox"; diff --git a/src/lua/LuaWindow.cpp b/src/lua/LuaWindow.cpp index 58ba63677..f015caddf 100644 --- a/src/lua/LuaWindow.cpp +++ b/src/lua/LuaWindow.cpp @@ -1,17 +1,19 @@ #ifdef LUACONSOLE -#include -#include "LuaScriptInterface.h" #include "LuaWindow.h" + +#include "LuaScriptInterface.h" #include "LuaButton.h" #include "LuaLabel.h" #include "LuaTextbox.h" #include "LuaCheckbox.h" #include "LuaSlider.h" #include "LuaProgressBar.h" -#include "gui/interface/Button.h" -#include "gui/interface/Label.h" + #include "gui/interface/Window.h" +#include "gui/interface/Engine.h" + +#include "graphics/Graphics.h" const char LuaWindow::className[] = "Window"; diff --git a/src/lua/TPTSTypes.cpp b/src/lua/TPTSTypes.cpp index 21a2093b3..00b84bec1 100644 --- a/src/lua/TPTSTypes.cpp +++ b/src/lua/TPTSTypes.cpp @@ -1,5 +1,3 @@ -#include -#include #include "TPTSTypes.h" AnyType::AnyType(ValueType type_, ValueValue value_): diff --git a/src/lua/TPTSTypes.h b/src/lua/TPTSTypes.h index 93b16fbc5..d83a119a0 100644 --- a/src/lua/TPTSTypes.h +++ b/src/lua/TPTSTypes.h @@ -2,7 +2,6 @@ #define TPTSTYPES_H_ #include "common/String.h" -#include #include "gui/interface/Point.h" enum ValueType { TypeNumber, TypeFloat, TypePoint, TypeString, TypeNull, TypeFunction }; diff --git a/src/lua/TPTScriptInterface.cpp b/src/lua/TPTScriptInterface.cpp index ddd1fa75d..fd2d754b3 100644 --- a/src/lua/TPTScriptInterface.cpp +++ b/src/lua/TPTScriptInterface.cpp @@ -1,14 +1,24 @@ -#include -#include +#include "TPTScriptInterface.h" + #include -#include #ifdef MACOSX #include #endif #include -#include "TPTScriptInterface.h" -#include "gui/game/GameModel.h" +#include + +#include "Config.h" + +#include "simulation/Simulation.h" #include "simulation/Air.h" +#include "ElementClasses.h" + +#include "gui/game/GameController.h" +#include "gui/game/GameModel.h" + +#include "gui/interface/Engine.h" + +#include "common/tpt-compat.h" TPTScriptInterface::TPTScriptInterface(GameController * c, GameModel * m): CommandInterface(c, m) { diff --git a/src/lua/TPTScriptInterface.h b/src/lua/TPTScriptInterface.h index cad31d1ba..d04aacbe7 100644 --- a/src/lua/TPTScriptInterface.h +++ b/src/lua/TPTScriptInterface.h @@ -3,6 +3,7 @@ #include "CommandInterface.h" #include "TPTSTypes.h" +#include class TPTScriptInterface: public CommandInterface { protected: diff --git a/src/simulation/Air.cpp b/src/simulation/Air.cpp index 718bd6da4..97e58b2f9 100644 --- a/src/simulation/Air.cpp +++ b/src/simulation/Air.cpp @@ -1,11 +1,10 @@ +#include "Air.h" + #include #include -#include "Config.h" -#include "Air.h" + #include "Simulation.h" -//#include -//#include -#include "Gravity.h" +#include "ElementClasses.h" #include "common/tpt-rand.h" /*float kernel[9]; diff --git a/src/simulation/Element.h b/src/simulation/ElementCommon.h similarity index 76% rename from src/simulation/Element.h rename to src/simulation/ElementCommon.h index cd12d1c75..afec485b5 100644 --- a/src/simulation/Element.h +++ b/src/simulation/ElementCommon.h @@ -1,14 +1,21 @@ -#ifndef ELEMENT_H -#define ELEMENT_H +#ifndef ELEMENTCOMMON_H +#define ELEMENTCOMMON_H // This header should be included by all files in src/elements/ #include -#include "ElementGraphics.h" -#include "Gravity.h" + #include "Misc.h" -#include "Simulation.h" -#include "common/tpt-compat.h" + #include "common/tpt-rand.h" +#include "common/tpt-compat.h" +#include "common/tpt-minmax.h" + +#include "ElementDefs.h" +#include "ElementClasses.h" +#include "Particle.h" +#include "ElementGraphics.h" +#include "Simulation.h" + #include "graphics/Renderer.h" #define IPL -257.0f diff --git a/src/simulation/Elements.h b/src/simulation/ElementDefs.h similarity index 98% rename from src/simulation/Elements.h rename to src/simulation/ElementDefs.h index 295e6ee78..c16f6f127 100644 --- a/src/simulation/Elements.h +++ b/src/simulation/ElementDefs.h @@ -1,7 +1,7 @@ #ifndef ELEMENTS_H_ #define ELEMENTS_H_ -//#include "Config.h" +#include "Config.h" //#include "Simulation.h" #define R_TEMP 22 @@ -69,7 +69,5 @@ struct playerst; -#include "ElementClasses.h" - #endif /* ELEMENTS_H_ */ diff --git a/src/simulation/Gravity.cpp b/src/simulation/Gravity.cpp index 1c119bbb2..455c46c75 100755 --- a/src/simulation/Gravity.cpp +++ b/src/simulation/Gravity.cpp @@ -1,9 +1,14 @@ +#include "Gravity.h" + +#include "SimulationData.h" + #include #include -#include "Config.h" -#include "Gravity.h" + #include "Misc.h" +#include "Simulation.h" + void Gravity::bilinear_interpolation(float *src, float *dst, int sw, int sh, int rw, int rh) { int y, x, fxceil, fyceil; diff --git a/src/simulation/Gravity.h b/src/simulation/Gravity.h index 54ba20357..312b87585 100644 --- a/src/simulation/Gravity.h +++ b/src/simulation/Gravity.h @@ -5,7 +5,6 @@ #include #include #include "Config.h" -#include "Simulation.h" #ifdef GRAVFFT #include diff --git a/src/simulation/Sample.h b/src/simulation/Sample.h index 8b9d94595..d14344727 100644 --- a/src/simulation/Sample.h +++ b/src/simulation/Sample.h @@ -1,5 +1,3 @@ - - #ifndef The_Powder_Toy_Sample_h #define The_Powder_Toy_Sample_h diff --git a/src/simulation/SaveRenderer.cpp b/src/simulation/SaveRenderer.cpp index 8b745f8bb..468eeae2b 100644 --- a/src/simulation/SaveRenderer.cpp +++ b/src/simulation/SaveRenderer.cpp @@ -1,9 +1,11 @@ #include "SaveRenderer.h" + #include "client/GameSave.h" + #include "graphics/Graphics.h" -#include "Simulation.h" #include "graphics/Renderer.h" +#include "Simulation.h" SaveRenderer::SaveRenderer(){ g = new Graphics(); diff --git a/src/simulation/Sign.cpp b/src/simulation/Sign.cpp index 7ae3f13a5..27fe8e932 100644 --- a/src/simulation/Sign.cpp +++ b/src/simulation/Sign.cpp @@ -1,5 +1,5 @@ -#include #include "Sign.h" + #include "graphics/Graphics.h" #include "simulation/Simulation.h" diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index b3305563f..c81872890 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1,3 +1,6 @@ +#include "Simulation.h" + +#include #include #include #ifdef _MSC_VER @@ -5,18 +8,22 @@ #else #include #endif + #include "Air.h" #include "Config.h" #include "CoordStack.h" -#include "Elements.h" -#include "elements/Element.h" +#include "ElementClasses.h" #include "Gravity.h" #include "Sample.h" -#include "Simulation.h" #include "Snapshot.h" #include "Misc.h" #include "ToolClasses.h" +#include "Config.h" +#include "SimulationData.h" + +#include "graphics/Renderer.h" + #include "client/GameSave.h" #include "common/tpt-compat.h" #include "common/tpt-minmax.h" @@ -5573,3 +5580,18 @@ String Simulation::BasicParticleInfo(Particle const &sample_part) } return sampleInfo.Build(); } + +bool Simulation::InBounds(int x, int y) +{ + return (x>=0 && y>=0 && x=0 ? 0 : y); +} + +float Simulation::remainder_p(float x, float y) +{ + return std::fmod(x, y) + (x>=0 ? 0 : y); +} diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index 481fbe8b7..995167a62 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -1,18 +1,18 @@ #ifndef SIMULATION_H #define SIMULATION_H + #include #include #include -#include "Config.h" -#include "Elements.h" -#include "SimulationData.h" -#include "Sign.h" #include "Particle.h" #include "Stickman.h" #include "WallType.h" +#include "Sign.h" +#include "ElementDefs.h" #include "GOLMenu.h" #include "MenuSection.h" + #include "elements/Element.h" #define CHANNELS ((int)(MAX_TEMP-73)/100+2) @@ -210,20 +210,11 @@ public: Simulation(); ~Simulation(); - bool InBounds(int x, int y) - { - return (x>=0 && y>=0 && x=0 ? 0 : y); - } - static float remainder_p(float x, float y) - { - return std::fmod(x, y) + (x>=0 ? 0 : y); - } + static int remainder_p(int x, int y); + static float remainder_p(float x, float y); String ElementResolve(int type, int ctype); String BasicParticleInfo(Particle const &sample_part); diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp index ec338f54e..8fc7b099e 100644 --- a/src/simulation/SimulationData.cpp +++ b/src/simulation/SimulationData.cpp @@ -1,7 +1,14 @@ #include "SimulationData.h" -//#include "ElementFunctions.h" + #include "ElementGraphics.h" -#include "Elements.h" +#include "ElementDefs.h" +#include "ElementClasses.h" + +#include "GOLMenu.h" +#include "WallType.h" +#include "MenuSection.h" + +#include "graphics/Renderer.h" std::vector LoadGOLMenu() { diff --git a/src/simulation/SimulationData.h b/src/simulation/SimulationData.h index c823b5552..ac0058c27 100644 --- a/src/simulation/SimulationData.h +++ b/src/simulation/SimulationData.h @@ -1,3 +1,6 @@ +#ifndef SIMULATIONDATA_H +#define SIMULATIONDATA_H + #include #include @@ -130,9 +133,6 @@ #define REPLACE_MODE 0x1 #define SPECIFIC_DELETE 0x2 -#ifndef SIMULATIONDATA_H -#define SIMULATIONDATA_H - struct part_type; struct part_transition; diff --git a/src/simulation/StorageClasses.h b/src/simulation/StorageClasses.h index 5f493075f..df94eadb9 100644 --- a/src/simulation/StorageClasses.h +++ b/src/simulation/StorageClasses.h @@ -1,7 +1,8 @@ #ifndef STORAGECLASSES_H_ #define STORAGECLASSES_H_ -#include "Elements.h" +#include "ElementDefs.h" +#include "ElementClasses.h" class Renderer; class Simulation; diff --git a/src/simulation/ToolCommon.h b/src/simulation/ToolCommon.h new file mode 100644 index 000000000..6019afb60 --- /dev/null +++ b/src/simulation/ToolCommon.h @@ -0,0 +1,10 @@ +#ifndef SIMTOOLCOMMON_H +#define SIMTOOLCOMMON_H + +#include "ToolClasses.h" +#include "Simulation.h" +#include "graphics/Renderer.h" +#include "ElementDefs.h" +#include "ElementClasses.h" + +#endif // SIMTOOLCOMMON_H diff --git a/src/simulation/elements/116.cpp b/src/simulation/elements/116.cpp index d5ce4c6cb..c8ecf4c00 100644 --- a/src/simulation/elements/116.cpp +++ b/src/simulation/elements/116.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_116 PT_116 116 Element_116::Element_116() { diff --git a/src/simulation/elements/146.cpp b/src/simulation/elements/146.cpp index 6c7736af5..929e8ecc0 100644 --- a/src/simulation/elements/146.cpp +++ b/src/simulation/elements/146.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_146 PT_146 146 Element_146::Element_146() { diff --git a/src/simulation/elements/ACEL.cpp b/src/simulation/elements/ACEL.cpp index cb2fdb52d..bbae0a1e8 100644 --- a/src/simulation/elements/ACEL.cpp +++ b/src/simulation/elements/ACEL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ACEL PT_ACEL 137 Element_ACEL::Element_ACEL() { diff --git a/src/simulation/elements/ACID.cpp b/src/simulation/elements/ACID.cpp index ecb2daf87..deb57954f 100644 --- a/src/simulation/elements/ACID.cpp +++ b/src/simulation/elements/ACID.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ACID PT_ACID 21 Element_ACID::Element_ACID() { diff --git a/src/simulation/elements/AMTR.cpp b/src/simulation/elements/AMTR.cpp index afa87a068..3139ab351 100644 --- a/src/simulation/elements/AMTR.cpp +++ b/src/simulation/elements/AMTR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_AMTR PT_AMTR 72 Element_AMTR::Element_AMTR() { diff --git a/src/simulation/elements/ANAR.cpp b/src/simulation/elements/ANAR.cpp index 354c324c8..5a87ba172 100644 --- a/src/simulation/elements/ANAR.cpp +++ b/src/simulation/elements/ANAR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ANAR PT_ANAR 113 Element_ANAR::Element_ANAR() { diff --git a/src/simulation/elements/ARAY.cpp b/src/simulation/elements/ARAY.cpp index 2f451f0c7..f8ce046c2 100644 --- a/src/simulation/elements/ARAY.cpp +++ b/src/simulation/elements/ARAY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ARAY PT_ARAY 126 Element_ARAY::Element_ARAY() { diff --git a/src/simulation/elements/BANG.cpp b/src/simulation/elements/BANG.cpp index ab471e987..a1b09f4a4 100644 --- a/src/simulation/elements/BANG.cpp +++ b/src/simulation/elements/BANG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BANG PT_BANG 139 Element_BANG::Element_BANG() { diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp index c4bacaeff..2b88b2320 100644 --- a/src/simulation/elements/BCLN.cpp +++ b/src/simulation/elements/BCLN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BCLN PT_BCLN 93 Element_BCLN::Element_BCLN() { diff --git a/src/simulation/elements/BCOL.cpp b/src/simulation/elements/BCOL.cpp index 23624d5be..e741a23a1 100644 --- a/src/simulation/elements/BCOL.cpp +++ b/src/simulation/elements/BCOL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BCOL PT_BCOL 73 Element_BCOL::Element_BCOL() { diff --git a/src/simulation/elements/BGLA.cpp b/src/simulation/elements/BGLA.cpp index e2d602714..3fb7d4637 100644 --- a/src/simulation/elements/BGLA.cpp +++ b/src/simulation/elements/BGLA.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BGLA PT_BGLA 47 Element_BGLA::Element_BGLA() { diff --git a/src/simulation/elements/BHOL.cpp b/src/simulation/elements/BHOL.cpp index ce1c9e506..11fdd0ba2 100644 --- a/src/simulation/elements/BHOL.cpp +++ b/src/simulation/elements/BHOL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BHOL PT_BHOL 39 Element_BHOL::Element_BHOL() { diff --git a/src/simulation/elements/BIZR.cpp b/src/simulation/elements/BIZR.cpp index bae9c43c6..0cc323721 100644 --- a/src/simulation/elements/BIZR.cpp +++ b/src/simulation/elements/BIZR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BIZR PT_BIZR 103 Element_BIZR::Element_BIZR() { diff --git a/src/simulation/elements/BIZRG.cpp b/src/simulation/elements/BIZRG.cpp index d17242fed..471027899 100644 --- a/src/simulation/elements/BIZRG.cpp +++ b/src/simulation/elements/BIZRG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BIZRG PT_BIZRG 104 Element_BIZRG::Element_BIZRG() { diff --git a/src/simulation/elements/BIZRS.cpp b/src/simulation/elements/BIZRS.cpp index 31d5912ba..a6f73869b 100644 --- a/src/simulation/elements/BIZRS.cpp +++ b/src/simulation/elements/BIZRS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BIZRS PT_BIZRS 105 Element_BIZRS::Element_BIZRS() { diff --git a/src/simulation/elements/BMTL.cpp b/src/simulation/elements/BMTL.cpp index 258de6b5f..190cf5a18 100644 --- a/src/simulation/elements/BMTL.cpp +++ b/src/simulation/elements/BMTL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BMTL PT_BMTL 29 Element_BMTL::Element_BMTL() { diff --git a/src/simulation/elements/BOMB.cpp b/src/simulation/elements/BOMB.cpp index 7531e1763..a86f7f62d 100644 --- a/src/simulation/elements/BOMB.cpp +++ b/src/simulation/elements/BOMB.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BOMB PT_BOMB 129 Element_BOMB::Element_BOMB() { diff --git a/src/simulation/elements/BOYL.cpp b/src/simulation/elements/BOYL.cpp index f73f634a5..e60879bb3 100644 --- a/src/simulation/elements/BOYL.cpp +++ b/src/simulation/elements/BOYL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BOYL PT_BOYL 141 Element_BOYL::Element_BOYL() { diff --git a/src/simulation/elements/BRAY.cpp b/src/simulation/elements/BRAY.cpp index b3bb096d0..026e2e443 100644 --- a/src/simulation/elements/BRAY.cpp +++ b/src/simulation/elements/BRAY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BRAY PT_BRAY 127 Element_BRAY::Element_BRAY() { diff --git a/src/simulation/elements/BRCK.cpp b/src/simulation/elements/BRCK.cpp index 585efb8aa..4557c7812 100644 --- a/src/simulation/elements/BRCK.cpp +++ b/src/simulation/elements/BRCK.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BRCK PT_BRCK 67 Element_BRCK::Element_BRCK() { diff --git a/src/simulation/elements/BREC.cpp b/src/simulation/elements/BREC.cpp index 13e9cb4e6..94dce3c00 100644 --- a/src/simulation/elements/BREC.cpp +++ b/src/simulation/elements/BREC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BREC PT_BREC 135 Element_BREC::Element_BREC() { diff --git a/src/simulation/elements/BRMT.cpp b/src/simulation/elements/BRMT.cpp index 672781a5f..8f1632b29 100644 --- a/src/simulation/elements/BRMT.cpp +++ b/src/simulation/elements/BRMT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BRMT PT_BRMT 30 Element_BRMT::Element_BRMT() { diff --git a/src/simulation/elements/BTRY.cpp b/src/simulation/elements/BTRY.cpp index 62b81c3a0..c9d634125 100644 --- a/src/simulation/elements/BTRY.cpp +++ b/src/simulation/elements/BTRY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BTRY PT_BTRY 53 Element_BTRY::Element_BTRY() { diff --git a/src/simulation/elements/BVBR.cpp b/src/simulation/elements/BVBR.cpp index 17de3ae23..c64bfc559 100644 --- a/src/simulation/elements/BVBR.cpp +++ b/src/simulation/elements/BVBR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_BVBR PT_BVBR 166 Element_BVBR::Element_BVBR() { diff --git a/src/simulation/elements/C5.cpp b/src/simulation/elements/C5.cpp index 495f0424e..566ca57eb 100644 --- a/src/simulation/elements/C5.cpp +++ b/src/simulation/elements/C5.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_C5 PT_C5 130 Element_C5::Element_C5() { diff --git a/src/simulation/elements/CAUS.cpp b/src/simulation/elements/CAUS.cpp index 6d655537d..272f78caf 100644 --- a/src/simulation/elements/CAUS.cpp +++ b/src/simulation/elements/CAUS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CAUS PT_CAUS 86 Element_CAUS::Element_CAUS() { diff --git a/src/simulation/elements/CBNW.cpp b/src/simulation/elements/CBNW.cpp index 5b37f6db6..8348881f4 100644 --- a/src/simulation/elements/CBNW.cpp +++ b/src/simulation/elements/CBNW.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CBNW PT_CBNW 82 Element_CBNW::Element_CBNW() { diff --git a/src/simulation/elements/CFLM.cpp b/src/simulation/elements/CFLM.cpp index 26ebb6792..fbda76e00 100644 --- a/src/simulation/elements/CFLM.cpp +++ b/src/simulation/elements/CFLM.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "hmap.h" //#TPT-Directive ElementClass Element_CFLM PT_CFLM 68 diff --git a/src/simulation/elements/CLNE.cpp b/src/simulation/elements/CLNE.cpp index 57c12739c..cc7ae5777 100644 --- a/src/simulation/elements/CLNE.cpp +++ b/src/simulation/elements/CLNE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CLNE PT_CLNE 9 Element_CLNE::Element_CLNE() { diff --git a/src/simulation/elements/CLST.cpp b/src/simulation/elements/CLST.cpp index da4582799..16546ff80 100644 --- a/src/simulation/elements/CLST.cpp +++ b/src/simulation/elements/CLST.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CLST PT_CLST 155 Element_CLST::Element_CLST() { diff --git a/src/simulation/elements/CNCT.cpp b/src/simulation/elements/CNCT.cpp index 66195dcf0..a63e7a1e9 100644 --- a/src/simulation/elements/CNCT.cpp +++ b/src/simulation/elements/CNCT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CNCT PT_CNCT 24 Element_CNCT::Element_CNCT() { diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp index ca3e89766..080f07dac 100644 --- a/src/simulation/elements/CO2.cpp +++ b/src/simulation/elements/CO2.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CO2 PT_CO2 80 Element_CO2::Element_CO2() { diff --git a/src/simulation/elements/COAL.cpp b/src/simulation/elements/COAL.cpp index 18fa8ff00..0a2d66cf9 100644 --- a/src/simulation/elements/COAL.cpp +++ b/src/simulation/elements/COAL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_COAL PT_COAL 59 Element_COAL::Element_COAL() { diff --git a/src/simulation/elements/CONV.cpp b/src/simulation/elements/CONV.cpp index f1b46300e..44d256050 100644 --- a/src/simulation/elements/CONV.cpp +++ b/src/simulation/elements/CONV.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CONV PT_CONV 85 Element_CONV::Element_CONV() { diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp index fa91a05fe..d8326a9a0 100644 --- a/src/simulation/elements/CRAY.cpp +++ b/src/simulation/elements/CRAY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CRAY PT_CRAY 167 Element_CRAY::Element_CRAY() { diff --git a/src/simulation/elements/CRMC.cpp b/src/simulation/elements/CRMC.cpp index bdb9e425f..72bac82f0 100644 --- a/src/simulation/elements/CRMC.cpp +++ b/src/simulation/elements/CRMC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_CRMC PT_CRMC 179 Element_CRMC::Element_CRMC() { diff --git a/src/simulation/elements/DCEL.cpp b/src/simulation/elements/DCEL.cpp index be797cff8..ebd5ea293 100644 --- a/src/simulation/elements/DCEL.cpp +++ b/src/simulation/elements/DCEL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DCEL PT_DCEL 138 Element_DCEL::Element_DCEL() { diff --git a/src/simulation/elements/DESL.cpp b/src/simulation/elements/DESL.cpp index 59efb2535..c3208d1b4 100644 --- a/src/simulation/elements/DESL.cpp +++ b/src/simulation/elements/DESL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DESL PT_DESL 58 Element_DESL::Element_DESL() { diff --git a/src/simulation/elements/DEST.cpp b/src/simulation/elements/DEST.cpp index fd4f6530b..3ea67d3ce 100644 --- a/src/simulation/elements/DEST.cpp +++ b/src/simulation/elements/DEST.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DEST PT_DEST 89 Element_DEST::Element_DEST() { diff --git a/src/simulation/elements/DEUT.cpp b/src/simulation/elements/DEUT.cpp index 7b2795643..62c2b0e01 100644 --- a/src/simulation/elements/DEUT.cpp +++ b/src/simulation/elements/DEUT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DEUT PT_DEUT 95 Element_DEUT::Element_DEUT() { diff --git a/src/simulation/elements/DLAY.cpp b/src/simulation/elements/DLAY.cpp index 9865659ae..6c53f096c 100644 --- a/src/simulation/elements/DLAY.cpp +++ b/src/simulation/elements/DLAY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DLAY PT_DLAY 79 Element_DLAY::Element_DLAY() { diff --git a/src/simulation/elements/DMG.cpp b/src/simulation/elements/DMG.cpp index 94ed6c14c..96942004f 100644 --- a/src/simulation/elements/DMG.cpp +++ b/src/simulation/elements/DMG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DMG PT_DMG 163 Element_DMG::Element_DMG() { diff --git a/src/simulation/elements/DMND.cpp b/src/simulation/elements/DMND.cpp index 5cb46a32a..eb5859dff 100644 --- a/src/simulation/elements/DMND.cpp +++ b/src/simulation/elements/DMND.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DMND PT_DMND 28 Element_DMND::Element_DMND() { diff --git a/src/simulation/elements/DRAY.cpp b/src/simulation/elements/DRAY.cpp index 3b7a5b1e4..f9b574e6e 100644 --- a/src/simulation/elements/DRAY.cpp +++ b/src/simulation/elements/DRAY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DRAY PT_DRAY 178 Element_DRAY::Element_DRAY() { diff --git a/src/simulation/elements/DRIC.cpp b/src/simulation/elements/DRIC.cpp index ab7fbe5b0..c32ada7a9 100644 --- a/src/simulation/elements/DRIC.cpp +++ b/src/simulation/elements/DRIC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DRIC PT_DRIC 81 Element_DRIC::Element_DRIC() { diff --git a/src/simulation/elements/DSTW.cpp b/src/simulation/elements/DSTW.cpp index e9c379d57..72ce2f1de 100644 --- a/src/simulation/elements/DSTW.cpp +++ b/src/simulation/elements/DSTW.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DSTW PT_DSTW 25 Element_DSTW::Element_DSTW() { diff --git a/src/simulation/elements/DTEC.cpp b/src/simulation/elements/DTEC.cpp index f30602632..6654aa698 100644 --- a/src/simulation/elements/DTEC.cpp +++ b/src/simulation/elements/DTEC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DTEC PT_DTEC 162 Element_DTEC::Element_DTEC() { diff --git a/src/simulation/elements/DUST.cpp b/src/simulation/elements/DUST.cpp index 78bee8e72..8e2ff8dbe 100644 --- a/src/simulation/elements/DUST.cpp +++ b/src/simulation/elements/DUST.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DUST PT_DUST 1 Element_DUST::Element_DUST() { diff --git a/src/simulation/elements/DYST.cpp b/src/simulation/elements/DYST.cpp index 710df1c4d..d087897da 100644 --- a/src/simulation/elements/DYST.cpp +++ b/src/simulation/elements/DYST.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_DYST PT_DYST 64 Element_DYST::Element_DYST() { diff --git a/src/simulation/elements/ELEC.cpp b/src/simulation/elements/ELEC.cpp index 9bde3df16..0cf72d72e 100644 --- a/src/simulation/elements/ELEC.cpp +++ b/src/simulation/elements/ELEC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ELEC PT_ELEC 136 Element_ELEC::Element_ELEC() { diff --git a/src/simulation/elements/EMBR.cpp b/src/simulation/elements/EMBR.cpp index 90dd4953e..a5b1a8d5c 100644 --- a/src/simulation/elements/EMBR.cpp +++ b/src/simulation/elements/EMBR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_EMBR PT_EMBR 147 Element_EMBR::Element_EMBR() { diff --git a/src/simulation/elements/EMP.cpp b/src/simulation/elements/EMP.cpp index 4ab6d57cb..4971c1941 100644 --- a/src/simulation/elements/EMP.cpp +++ b/src/simulation/elements/EMP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "Probability.h" //#TPT-Directive ElementClass Element_EMP PT_EMP 134 diff --git a/src/simulation/elements/ETRD.cpp b/src/simulation/elements/ETRD.cpp index 5c7980ff9..0d2b62a9e 100644 --- a/src/simulation/elements/ETRD.cpp +++ b/src/simulation/elements/ETRD.cpp @@ -1,5 +1,5 @@ #include -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ETRD PT_ETRD 50 Element_ETRD::Element_ETRD() diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp index c489c3b7b..c6c24213c 100644 --- a/src/simulation/elements/EXOT.cpp +++ b/src/simulation/elements/EXOT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_EXOT PT_EXOT 145 Element_EXOT::Element_EXOT() { diff --git a/src/simulation/elements/Element.cpp b/src/simulation/elements/Element.cpp index 67f6e47ea..4c4fbd723 100644 --- a/src/simulation/elements/Element.cpp +++ b/src/simulation/elements/Element.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "simulation/StructProperty.h" Element::Element(): diff --git a/src/simulation/elements/Element.h b/src/simulation/elements/Element.h index 61bdde109..85c3374ee 100644 --- a/src/simulation/elements/Element.h +++ b/src/simulation/elements/Element.h @@ -2,9 +2,8 @@ #define ELEMENTCLASS_H #include "graphics/Pixel.h" -#include "simulation/Simulation.h" -#include "simulation/Elements.h" #include "simulation/StructProperty.h" +#include "simulation/ElementDefs.h" class Simulation; class Renderer; diff --git a/src/simulation/elements/FIGH.cpp b/src/simulation/elements/FIGH.cpp index c32e68e3f..45bc40568 100644 --- a/src/simulation/elements/FIGH.cpp +++ b/src/simulation/elements/FIGH.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FIGH PT_FIGH 158 Element_FIGH::Element_FIGH() { diff --git a/src/simulation/elements/FILT.cpp b/src/simulation/elements/FILT.cpp index 65025da33..3a70feed3 100644 --- a/src/simulation/elements/FILT.cpp +++ b/src/simulation/elements/FILT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FILT PT_FILT 125 Element_FILT::Element_FILT() { diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index b666cbe32..7f96e6d87 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -1,5 +1,5 @@ #include "common/tpt-minmax.h" -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FIRE PT_FIRE 4 Element_FIRE::Element_FIRE() diff --git a/src/simulation/elements/FIRW.cpp b/src/simulation/elements/FIRW.cpp index 691059ca3..e38b4da24 100644 --- a/src/simulation/elements/FIRW.cpp +++ b/src/simulation/elements/FIRW.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "hmap.h" //#TPT-Directive ElementClass Element_FIRW PT_FIRW 69 Element_FIRW::Element_FIRW() diff --git a/src/simulation/elements/FOG.cpp b/src/simulation/elements/FOG.cpp index 2458b40df..843da60a5 100644 --- a/src/simulation/elements/FOG.cpp +++ b/src/simulation/elements/FOG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FOG PT_FOG 92 Element_FOG::Element_FOG() { diff --git a/src/simulation/elements/FRAY.cpp b/src/simulation/elements/FRAY.cpp index abeb938fa..ddc1d6217 100644 --- a/src/simulation/elements/FRAY.cpp +++ b/src/simulation/elements/FRAY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FRAY PT_FRAY 159 Element_FRAY::Element_FRAY() { diff --git a/src/simulation/elements/FRME.cpp b/src/simulation/elements/FRME.cpp index b94896a29..667f39443 100644 --- a/src/simulation/elements/FRME.cpp +++ b/src/simulation/elements/FRME.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FRME PT_FRME 169 Element_FRME::Element_FRME() { diff --git a/src/simulation/elements/FRZW.cpp b/src/simulation/elements/FRZW.cpp index e6da0bfd1..cba9fc3d8 100644 --- a/src/simulation/elements/FRZW.cpp +++ b/src/simulation/elements/FRZW.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FRZW PT_FRZW 101 Element_FRZW::Element_FRZW() { diff --git a/src/simulation/elements/FRZZ.cpp b/src/simulation/elements/FRZZ.cpp index 6140534ab..487e4822c 100644 --- a/src/simulation/elements/FRZZ.cpp +++ b/src/simulation/elements/FRZZ.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FRZZ PT_FRZZ 100 Element_FRZZ::Element_FRZZ() { diff --git a/src/simulation/elements/FSEP.cpp b/src/simulation/elements/FSEP.cpp index 22a3225dc..ffb25a358 100644 --- a/src/simulation/elements/FSEP.cpp +++ b/src/simulation/elements/FSEP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FSEP PT_FSEP 71 Element_FSEP::Element_FSEP() { diff --git a/src/simulation/elements/FUSE.cpp b/src/simulation/elements/FUSE.cpp index 573603652..48a203cf5 100644 --- a/src/simulation/elements/FUSE.cpp +++ b/src/simulation/elements/FUSE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FUSE PT_FUSE 70 Element_FUSE::Element_FUSE() { diff --git a/src/simulation/elements/FWRK.cpp b/src/simulation/elements/FWRK.cpp index d3beb141e..52bfe0915 100644 --- a/src/simulation/elements/FWRK.cpp +++ b/src/simulation/elements/FWRK.cpp @@ -1,5 +1,5 @@ #include "common/tpt-minmax.h" -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_FWRK PT_FWRK 98 Element_FWRK::Element_FWRK() diff --git a/src/simulation/elements/GAS.cpp b/src/simulation/elements/GAS.cpp index 01a039455..f24e9d810 100644 --- a/src/simulation/elements/GAS.cpp +++ b/src/simulation/elements/GAS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GAS PT_GAS 10 Element_GAS::Element_GAS() { diff --git a/src/simulation/elements/GBMB.cpp b/src/simulation/elements/GBMB.cpp index 0b597cbdb..a0a7c298b 100644 --- a/src/simulation/elements/GBMB.cpp +++ b/src/simulation/elements/GBMB.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GBMB PT_GBMB 157 Element_GBMB::Element_GBMB() { diff --git a/src/simulation/elements/GEL.cpp b/src/simulation/elements/GEL.cpp index d10ecc058..04452278f 100644 --- a/src/simulation/elements/GEL.cpp +++ b/src/simulation/elements/GEL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GEL PT_GEL 142 Element_GEL::Element_GEL() { diff --git a/src/simulation/elements/GLAS.cpp b/src/simulation/elements/GLAS.cpp index 1fa7cfebf..b3249b340 100644 --- a/src/simulation/elements/GLAS.cpp +++ b/src/simulation/elements/GLAS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GLAS PT_GLAS 45 Element_GLAS::Element_GLAS() { diff --git a/src/simulation/elements/GLOW.cpp b/src/simulation/elements/GLOW.cpp index 39a9053a8..b40df3e3c 100644 --- a/src/simulation/elements/GLOW.cpp +++ b/src/simulation/elements/GLOW.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GLOW PT_GLOW 66 Element_GLOW::Element_GLOW() { diff --git a/src/simulation/elements/GOLD.cpp b/src/simulation/elements/GOLD.cpp index 2ffb3af75..1b07df05b 100644 --- a/src/simulation/elements/GOLD.cpp +++ b/src/simulation/elements/GOLD.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "simulation/Air.h" //#TPT-Directive ElementClass Element_GOLD PT_GOLD 170 Element_GOLD::Element_GOLD() diff --git a/src/simulation/elements/GOO.cpp b/src/simulation/elements/GOO.cpp index c32f7da82..c3600276b 100644 --- a/src/simulation/elements/GOO.cpp +++ b/src/simulation/elements/GOO.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GOO PT_GOO 12 Element_GOO::Element_GOO() { diff --git a/src/simulation/elements/GPMP.cpp b/src/simulation/elements/GPMP.cpp index 7555b93c5..bbb2a5cf6 100644 --- a/src/simulation/elements/GPMP.cpp +++ b/src/simulation/elements/GPMP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GPMP PT_GPMP 154 Element_GPMP::Element_GPMP() { diff --git a/src/simulation/elements/GRAV.cpp b/src/simulation/elements/GRAV.cpp index b4e394ffb..b55ef8d57 100644 --- a/src/simulation/elements/GRAV.cpp +++ b/src/simulation/elements/GRAV.cpp @@ -1,5 +1,5 @@ #include "common/tpt-minmax.h" -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GRAV PT_GRAV 102 Element_GRAV::Element_GRAV() diff --git a/src/simulation/elements/GRVT.cpp b/src/simulation/elements/GRVT.cpp index f6a3a902f..2fe50f5b1 100644 --- a/src/simulation/elements/GRVT.cpp +++ b/src/simulation/elements/GRVT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GRVT PT_GRVT 177 Element_GRVT::Element_GRVT() { diff --git a/src/simulation/elements/GUNP.cpp b/src/simulation/elements/GUNP.cpp index 5232c2763..3c78e1b70 100644 --- a/src/simulation/elements/GUNP.cpp +++ b/src/simulation/elements/GUNP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_GUNP PT_GUNP 7 Element_GUNP::Element_GUNP() { diff --git a/src/simulation/elements/H2.cpp b/src/simulation/elements/H2.cpp index 2ea5b157a..58fadb9f7 100644 --- a/src/simulation/elements/H2.cpp +++ b/src/simulation/elements/H2.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_H2 PT_H2 148 Element_H2::Element_H2() { diff --git a/src/simulation/elements/HEAC.cpp b/src/simulation/elements/HEAC.cpp index 19675b8bd..5d704b56c 100644 --- a/src/simulation/elements/HEAC.cpp +++ b/src/simulation/elements/HEAC.cpp @@ -1,6 +1,6 @@ #include #include -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "simulation/Air.h" //#TPT-Directive ElementClass Element_HEAC PT_HEAC 180 Element_HEAC::Element_HEAC() diff --git a/src/simulation/elements/HSWC.cpp b/src/simulation/elements/HSWC.cpp index e17c17904..a6a62f029 100644 --- a/src/simulation/elements/HSWC.cpp +++ b/src/simulation/elements/HSWC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_HSWC PT_HSWC 75 Element_HSWC::Element_HSWC() { diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp index 78e9f9b5b..78a8218ca 100644 --- a/src/simulation/elements/ICEI.cpp +++ b/src/simulation/elements/ICEI.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ICEI PT_ICEI 13 Element_ICEI::Element_ICEI() { diff --git a/src/simulation/elements/IGNT.cpp b/src/simulation/elements/IGNT.cpp index 652d9049c..125180579 100644 --- a/src/simulation/elements/IGNT.cpp +++ b/src/simulation/elements/IGNT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_IGNT PT_IGNT 140 Element_IGNT::Element_IGNT() { diff --git a/src/simulation/elements/INSL.cpp b/src/simulation/elements/INSL.cpp index 8469ca073..883335f6d 100644 --- a/src/simulation/elements/INSL.cpp +++ b/src/simulation/elements/INSL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_INSL PT_INSL 38 Element_INSL::Element_INSL() { diff --git a/src/simulation/elements/INST.cpp b/src/simulation/elements/INST.cpp index 495b03576..d6767d553 100644 --- a/src/simulation/elements/INST.cpp +++ b/src/simulation/elements/INST.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_INST PT_INST 106 Element_INST::Element_INST() { diff --git a/src/simulation/elements/INVIS.cpp b/src/simulation/elements/INVIS.cpp index 3abba0720..fcc669cc4 100644 --- a/src/simulation/elements/INVIS.cpp +++ b/src/simulation/elements/INVIS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_INVIS PT_INVIS 115 Element_INVIS::Element_INVIS() { diff --git a/src/simulation/elements/INWR.cpp b/src/simulation/elements/INWR.cpp index 90be6ebf2..59d826f17 100644 --- a/src/simulation/elements/INWR.cpp +++ b/src/simulation/elements/INWR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_INWR PT_INWR 62 Element_INWR::Element_INWR() { diff --git a/src/simulation/elements/IRON.cpp b/src/simulation/elements/IRON.cpp index 8ee1ac09a..5e6ebcd6c 100644 --- a/src/simulation/elements/IRON.cpp +++ b/src/simulation/elements/IRON.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_IRON PT_IRON 76 Element_IRON::Element_IRON() { diff --git a/src/simulation/elements/ISOZ.cpp b/src/simulation/elements/ISOZ.cpp index c3ea9b6c3..489b1bd20 100644 --- a/src/simulation/elements/ISOZ.cpp +++ b/src/simulation/elements/ISOZ.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ISOZ PT_ISOZ 107 Element_ISOZ::Element_ISOZ() { diff --git a/src/simulation/elements/ISZS.cpp b/src/simulation/elements/ISZS.cpp index ddce97448..d1e5fd2d6 100644 --- a/src/simulation/elements/ISZS.cpp +++ b/src/simulation/elements/ISZS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_ISZS PT_ISZS 108 Element_ISZS::Element_ISZS() { diff --git a/src/simulation/elements/LAVA.cpp b/src/simulation/elements/LAVA.cpp index 04d282374..cb9d526b3 100644 --- a/src/simulation/elements/LAVA.cpp +++ b/src/simulation/elements/LAVA.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LAVA PT_LAVA 6 Element_LAVA::Element_LAVA() { diff --git a/src/simulation/elements/LCRY.cpp b/src/simulation/elements/LCRY.cpp index 33831d259..9eb10e5e8 100644 --- a/src/simulation/elements/LCRY.cpp +++ b/src/simulation/elements/LCRY.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LCRY PT_LCRY 54 Element_LCRY::Element_LCRY() { diff --git a/src/simulation/elements/LDTC.cpp b/src/simulation/elements/LDTC.cpp index 829e4d413..9ead06d91 100644 --- a/src/simulation/elements/LDTC.cpp +++ b/src/simulation/elements/LDTC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include //#TPT-Directive ElementClass Element_LDTC PT_LDTC 186 diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp index 310bcc517..1c409b10f 100644 --- a/src/simulation/elements/LIFE.cpp +++ b/src/simulation/elements/LIFE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" bool Element_GOL_colourInit = false; pixel Element_GOL_colour[NGOL]; diff --git a/src/simulation/elements/LIGH.cpp b/src/simulation/elements/LIGH.cpp index 1770769bb..9dcf5dfb3 100644 --- a/src/simulation/elements/LIGH.cpp +++ b/src/simulation/elements/LIGH.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LIGH PT_LIGH 87 Element_LIGH::Element_LIGH() diff --git a/src/simulation/elements/LNTG.cpp b/src/simulation/elements/LNTG.cpp index ae4bb73a5..0dcfd5a1d 100644 --- a/src/simulation/elements/LNTG.cpp +++ b/src/simulation/elements/LNTG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LNTG PT_LNTG 37 Element_LNTG::Element_LNTG() { diff --git a/src/simulation/elements/LO2.cpp b/src/simulation/elements/LO2.cpp index 30de1c6c8..8a5c10c48 100644 --- a/src/simulation/elements/LO2.cpp +++ b/src/simulation/elements/LO2.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LO2 PT_LO2 60 Element_LO2::Element_LO2() { diff --git a/src/simulation/elements/LOLZ.cpp b/src/simulation/elements/LOLZ.cpp index 5c883c4fa..ef0b14636 100644 --- a/src/simulation/elements/LOLZ.cpp +++ b/src/simulation/elements/LOLZ.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LOLZ PT_LOLZ 123 Element_LOLZ::Element_LOLZ() { diff --git a/src/simulation/elements/LOVE.cpp b/src/simulation/elements/LOVE.cpp index c62f4bf51..3e2d4606f 100644 --- a/src/simulation/elements/LOVE.cpp +++ b/src/simulation/elements/LOVE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LOVE PT_LOVE 94 Element_LOVE::Element_LOVE() { diff --git a/src/simulation/elements/LRBD.cpp b/src/simulation/elements/LRBD.cpp index bbefa04fb..578d14326 100644 --- a/src/simulation/elements/LRBD.cpp +++ b/src/simulation/elements/LRBD.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LRBD PT_LRBD 42 Element_LRBD::Element_LRBD() { diff --git a/src/simulation/elements/LSNS.cpp b/src/simulation/elements/LSNS.cpp index f4014cf1f..83009a08e 100644 --- a/src/simulation/elements/LSNS.cpp +++ b/src/simulation/elements/LSNS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_LSNS PT_LSNS 185 Element_LSNS::Element_LSNS() { diff --git a/src/simulation/elements/MERC.cpp b/src/simulation/elements/MERC.cpp index 3dc29ed02..92ec7293b 100644 --- a/src/simulation/elements/MERC.cpp +++ b/src/simulation/elements/MERC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_MERC PT_MERC 152 Element_MERC::Element_MERC() { diff --git a/src/simulation/elements/METL.cpp b/src/simulation/elements/METL.cpp index de59cbfd6..e7565643b 100644 --- a/src/simulation/elements/METL.cpp +++ b/src/simulation/elements/METL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_METL PT_METL 14 Element_METL::Element_METL() { diff --git a/src/simulation/elements/MORT.cpp b/src/simulation/elements/MORT.cpp index a55bfd137..fb4bd900d 100644 --- a/src/simulation/elements/MORT.cpp +++ b/src/simulation/elements/MORT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_MORT PT_MORT 77 Element_MORT::Element_MORT() { diff --git a/src/simulation/elements/MWAX.cpp b/src/simulation/elements/MWAX.cpp index 4770b08df..097b3f8f2 100644 --- a/src/simulation/elements/MWAX.cpp +++ b/src/simulation/elements/MWAX.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_MWAX PT_MWAX 34 Element_MWAX::Element_MWAX() { diff --git a/src/simulation/elements/NBHL.cpp b/src/simulation/elements/NBHL.cpp index 8f9fde5bb..5fcc0708f 100644 --- a/src/simulation/elements/NBHL.cpp +++ b/src/simulation/elements/NBHL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NBHL PT_NBHL 150 Element_NBHL::Element_NBHL() { diff --git a/src/simulation/elements/NBLE.cpp b/src/simulation/elements/NBLE.cpp index 9041d0e99..8e155b5c1 100644 --- a/src/simulation/elements/NBLE.cpp +++ b/src/simulation/elements/NBLE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NBLE PT_NBLE 52 Element_NBLE::Element_NBLE() { diff --git a/src/simulation/elements/NEUT.cpp b/src/simulation/elements/NEUT.cpp index e5a42c50b..5aa259526 100644 --- a/src/simulation/elements/NEUT.cpp +++ b/src/simulation/elements/NEUT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NEUT PT_NEUT 18 Element_NEUT::Element_NEUT() { diff --git a/src/simulation/elements/NICE.cpp b/src/simulation/elements/NICE.cpp index 0d9a8a0bd..19a58a39c 100644 --- a/src/simulation/elements/NICE.cpp +++ b/src/simulation/elements/NICE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NICE PT_NICE 51 Element_NICE::Element_NICE() { diff --git a/src/simulation/elements/NITR.cpp b/src/simulation/elements/NITR.cpp index 16d03b2ff..0b087db44 100644 --- a/src/simulation/elements/NITR.cpp +++ b/src/simulation/elements/NITR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NITR PT_NITR 8 Element_NITR::Element_NITR() { diff --git a/src/simulation/elements/NONE.cpp b/src/simulation/elements/NONE.cpp index c48bdae93..b3f7632ae 100644 --- a/src/simulation/elements/NONE.cpp +++ b/src/simulation/elements/NONE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NONE PT_NONE 0 Element_NONE::Element_NONE() { diff --git a/src/simulation/elements/NSCN.cpp b/src/simulation/elements/NSCN.cpp index cbe056c2d..665152114 100644 --- a/src/simulation/elements/NSCN.cpp +++ b/src/simulation/elements/NSCN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NSCN PT_NSCN 36 Element_NSCN::Element_NSCN() { diff --git a/src/simulation/elements/NTCT.cpp b/src/simulation/elements/NTCT.cpp index 08f7b525a..14c6f4ed4 100644 --- a/src/simulation/elements/NTCT.cpp +++ b/src/simulation/elements/NTCT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NTCT PT_NTCT 43 Element_NTCT::Element_NTCT() { diff --git a/src/simulation/elements/NWHL.cpp b/src/simulation/elements/NWHL.cpp index fd1716805..23cfd5825 100644 --- a/src/simulation/elements/NWHL.cpp +++ b/src/simulation/elements/NWHL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_NWHL PT_NWHL 151 Element_NWHL::Element_NWHL() { diff --git a/src/simulation/elements/O2.cpp b/src/simulation/elements/O2.cpp index 2622e72c1..aaf8a7a1a 100644 --- a/src/simulation/elements/O2.cpp +++ b/src/simulation/elements/O2.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_O2 PT_O2 61 Element_O2::Element_O2() { diff --git a/src/simulation/elements/OIL.cpp b/src/simulation/elements/OIL.cpp index 6f2327a00..b5c7d7904 100644 --- a/src/simulation/elements/OIL.cpp +++ b/src/simulation/elements/OIL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_OIL PT_OIL 3 Element_OIL::Element_OIL() { diff --git a/src/simulation/elements/PBCN.cpp b/src/simulation/elements/PBCN.cpp index adc55fc73..cce4cb3f4 100644 --- a/src/simulation/elements/PBCN.cpp +++ b/src/simulation/elements/PBCN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PBCN PT_PBCN 153 Element_PBCN::Element_PBCN() { diff --git a/src/simulation/elements/PCLN.cpp b/src/simulation/elements/PCLN.cpp index 908dec34a..269852723 100644 --- a/src/simulation/elements/PCLN.cpp +++ b/src/simulation/elements/PCLN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PCLN PT_PCLN 74 Element_PCLN::Element_PCLN() { diff --git a/src/simulation/elements/PHOT.cpp b/src/simulation/elements/PHOT.cpp index d3a7034ed..215fb5f1d 100644 --- a/src/simulation/elements/PHOT.cpp +++ b/src/simulation/elements/PHOT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PHOT PT_PHOT 31 Element_PHOT::Element_PHOT() { diff --git a/src/simulation/elements/PIPE.cpp b/src/simulation/elements/PIPE.cpp index 35001d79f..9b83275aa 100644 --- a/src/simulation/elements/PIPE.cpp +++ b/src/simulation/elements/PIPE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //Temp particle used for graphics Particle tpart; diff --git a/src/simulation/elements/PLEX.cpp b/src/simulation/elements/PLEX.cpp index 0a1fa9809..51a6f5b58 100644 --- a/src/simulation/elements/PLEX.cpp +++ b/src/simulation/elements/PLEX.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PLEX PT_PLEX 11 Element_PLEX::Element_PLEX() { diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp index d74a72689..6eaa2f573 100644 --- a/src/simulation/elements/PLNT.cpp +++ b/src/simulation/elements/PLNT.cpp @@ -1,5 +1,5 @@ #include "common/tpt-minmax.h" -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PLNT PT_PLNT 20 Element_PLNT::Element_PLNT() diff --git a/src/simulation/elements/PLSM.cpp b/src/simulation/elements/PLSM.cpp index 14eef8bb4..e1d2c0162 100644 --- a/src/simulation/elements/PLSM.cpp +++ b/src/simulation/elements/PLSM.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PLSM PT_PLSM 49 Element_PLSM::Element_PLSM() { diff --git a/src/simulation/elements/PLUT.cpp b/src/simulation/elements/PLUT.cpp index 4f88bc13c..121abacec 100644 --- a/src/simulation/elements/PLUT.cpp +++ b/src/simulation/elements/PLUT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PLUT PT_PLUT 19 Element_PLUT::Element_PLUT() { diff --git a/src/simulation/elements/POLO.cpp b/src/simulation/elements/POLO.cpp index 5aeb7ce1e..70340ed02 100644 --- a/src/simulation/elements/POLO.cpp +++ b/src/simulation/elements/POLO.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_POLO PT_POLO 182 Element_POLO::Element_POLO() { diff --git a/src/simulation/elements/PPIP.cpp b/src/simulation/elements/PPIP.cpp index a86f9d859..78f9feea0 100644 --- a/src/simulation/elements/PPIP.cpp +++ b/src/simulation/elements/PPIP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PPIP PT_PPIP 161 Element_PPIP::Element_PPIP() { diff --git a/src/simulation/elements/PQRT.cpp b/src/simulation/elements/PQRT.cpp index be3c61178..9d0b65cf1 100644 --- a/src/simulation/elements/PQRT.cpp +++ b/src/simulation/elements/PQRT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PQRT PT_PQRT 133 Element_PQRT::Element_PQRT() { diff --git a/src/simulation/elements/PROT.cpp b/src/simulation/elements/PROT.cpp index af99b3883..e7203dbc7 100644 --- a/src/simulation/elements/PROT.cpp +++ b/src/simulation/elements/PROT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PROT PT_PROT 173 Element_PROT::Element_PROT() { diff --git a/src/simulation/elements/PRTI.cpp b/src/simulation/elements/PRTI.cpp index d1dab4274..310ce3481 100644 --- a/src/simulation/elements/PRTI.cpp +++ b/src/simulation/elements/PRTI.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PRTI PT_PRTI 109 Element_PRTI::Element_PRTI() { diff --git a/src/simulation/elements/PRTO.cpp b/src/simulation/elements/PRTO.cpp index f126c28cc..8445f6d87 100644 --- a/src/simulation/elements/PRTO.cpp +++ b/src/simulation/elements/PRTO.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PRTO PT_PRTO 110 Element_PRTO::Element_PRTO() { diff --git a/src/simulation/elements/PSCN.cpp b/src/simulation/elements/PSCN.cpp index 750c1536c..21fc18500 100644 --- a/src/simulation/elements/PSCN.cpp +++ b/src/simulation/elements/PSCN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PSCN PT_PSCN 35 Element_PSCN::Element_PSCN() { diff --git a/src/simulation/elements/PSNS.cpp b/src/simulation/elements/PSNS.cpp index f43166048..47d498369 100644 --- a/src/simulation/elements/PSNS.cpp +++ b/src/simulation/elements/PSNS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PSNS PT_PSNS 172 Element_PSNS::Element_PSNS() { diff --git a/src/simulation/elements/PSTE.cpp b/src/simulation/elements/PSTE.cpp index 827b89d54..116efb1c7 100644 --- a/src/simulation/elements/PSTE.cpp +++ b/src/simulation/elements/PSTE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PSTE PT_PSTE 111 Element_PSTE::Element_PSTE() { diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp index ac77938de..1ccbaef2e 100644 --- a/src/simulation/elements/PSTN.cpp +++ b/src/simulation/elements/PSTN.cpp @@ -1,5 +1,5 @@ #include "common/tpt-minmax.h" -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PSTN PT_PSTN 168 Element_PSTN::Element_PSTN() diff --git a/src/simulation/elements/PSTS.cpp b/src/simulation/elements/PSTS.cpp index b92b309c2..7d81f342a 100644 --- a/src/simulation/elements/PSTS.cpp +++ b/src/simulation/elements/PSTS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PSTS PT_PSTS 112 Element_PSTS::Element_PSTS() { diff --git a/src/simulation/elements/PTCT.cpp b/src/simulation/elements/PTCT.cpp index cd002c487..02773ca90 100644 --- a/src/simulation/elements/PTCT.cpp +++ b/src/simulation/elements/PTCT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PTCT PT_PTCT 46 Element_PTCT::Element_PTCT() { diff --git a/src/simulation/elements/PUMP.cpp b/src/simulation/elements/PUMP.cpp index 72736927b..7c54bb251 100644 --- a/src/simulation/elements/PUMP.cpp +++ b/src/simulation/elements/PUMP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PUMP PT_PUMP 97 Element_PUMP::Element_PUMP() { diff --git a/src/simulation/elements/PVOD.cpp b/src/simulation/elements/PVOD.cpp index 1d26a32f1..2b2efee01 100644 --- a/src/simulation/elements/PVOD.cpp +++ b/src/simulation/elements/PVOD.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_PVOD PT_PVOD 84 Element_PVOD::Element_PVOD() { diff --git a/src/simulation/elements/QRTZ.cpp b/src/simulation/elements/QRTZ.cpp index ca25acd50..fac6c96fe 100644 --- a/src/simulation/elements/QRTZ.cpp +++ b/src/simulation/elements/QRTZ.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_QRTZ PT_QRTZ 132 Element_QRTZ::Element_QRTZ() { diff --git a/src/simulation/elements/RBDM.cpp b/src/simulation/elements/RBDM.cpp index 5d2664b2a..8658d4e92 100644 --- a/src/simulation/elements/RBDM.cpp +++ b/src/simulation/elements/RBDM.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_RBDM PT_RBDM 41 Element_RBDM::Element_RBDM() { diff --git a/src/simulation/elements/RFGL.cpp b/src/simulation/elements/RFGL.cpp index 74cb14829..b9936e3f9 100644 --- a/src/simulation/elements/RFGL.cpp +++ b/src/simulation/elements/RFGL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_RFGL PT_RFGL 184 Element_RFGL::Element_RFGL() { diff --git a/src/simulation/elements/RFRG.cpp b/src/simulation/elements/RFRG.cpp index 5792164cc..0e20f4046 100644 --- a/src/simulation/elements/RFRG.cpp +++ b/src/simulation/elements/RFRG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_RFRG PT_RFRG 183 Element_RFRG::Element_RFRG() { diff --git a/src/simulation/elements/RIME.cpp b/src/simulation/elements/RIME.cpp index 1769e4ee9..00c0ff420 100644 --- a/src/simulation/elements/RIME.cpp +++ b/src/simulation/elements/RIME.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_RIME PT_RIME 91 Element_RIME::Element_RIME() { diff --git a/src/simulation/elements/RPEL.cpp b/src/simulation/elements/RPEL.cpp index 1822cb196..db9524359 100644 --- a/src/simulation/elements/RPEL.cpp +++ b/src/simulation/elements/RPEL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_RPEL PT_RPEL 160 Element_RPEL::Element_RPEL() { diff --git a/src/simulation/elements/SALT.cpp b/src/simulation/elements/SALT.cpp index 98bbfa592..9bba25020 100644 --- a/src/simulation/elements/SALT.cpp +++ b/src/simulation/elements/SALT.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SALT PT_SALT 26 Element_SALT::Element_SALT() { diff --git a/src/simulation/elements/SAND.cpp b/src/simulation/elements/SAND.cpp index 0a9419605..405c71bdc 100644 --- a/src/simulation/elements/SAND.cpp +++ b/src/simulation/elements/SAND.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SAND PT_SAND 44 Element_SAND::Element_SAND() { diff --git a/src/simulation/elements/SAWD.cpp b/src/simulation/elements/SAWD.cpp index 77ae46e77..dc2345e58 100644 --- a/src/simulation/elements/SAWD.cpp +++ b/src/simulation/elements/SAWD.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SAWD PT_SAWD 181 Element_SAWD::Element_SAWD() { diff --git a/src/simulation/elements/SHLD1.cpp b/src/simulation/elements/SHLD1.cpp index 34be83ead..20a0c7a8f 100644 --- a/src/simulation/elements/SHLD1.cpp +++ b/src/simulation/elements/SHLD1.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SHLD1 PT_SHLD1 119 Element_SHLD1::Element_SHLD1() { diff --git a/src/simulation/elements/SHLD2.cpp b/src/simulation/elements/SHLD2.cpp index 551aff0f1..b83208690 100644 --- a/src/simulation/elements/SHLD2.cpp +++ b/src/simulation/elements/SHLD2.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SHLD2 PT_SHLD2 120 Element_SHLD2::Element_SHLD2() { diff --git a/src/simulation/elements/SHLD3.cpp b/src/simulation/elements/SHLD3.cpp index ba96d95bc..db6f821ef 100644 --- a/src/simulation/elements/SHLD3.cpp +++ b/src/simulation/elements/SHLD3.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SHLD3 PT_SHLD3 121 Element_SHLD3::Element_SHLD3() { diff --git a/src/simulation/elements/SHLD4.cpp b/src/simulation/elements/SHLD4.cpp index 6be508ea4..ad82882c4 100644 --- a/src/simulation/elements/SHLD4.cpp +++ b/src/simulation/elements/SHLD4.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SHLD4 PT_SHLD4 122 Element_SHLD4::Element_SHLD4() { diff --git a/src/simulation/elements/SING.cpp b/src/simulation/elements/SING.cpp index 51cf628ed..bb39fbc20 100644 --- a/src/simulation/elements/SING.cpp +++ b/src/simulation/elements/SING.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SING PT_SING 131 Element_SING::Element_SING() { diff --git a/src/simulation/elements/SLTW.cpp b/src/simulation/elements/SLTW.cpp index 0a011fa33..2be31fd50 100644 --- a/src/simulation/elements/SLTW.cpp +++ b/src/simulation/elements/SLTW.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SLTW PT_SLTW 27 Element_SLTW::Element_SLTW() { diff --git a/src/simulation/elements/SMKE.cpp b/src/simulation/elements/SMKE.cpp index 2d0483bc1..0671befce 100644 --- a/src/simulation/elements/SMKE.cpp +++ b/src/simulation/elements/SMKE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SMKE PT_SMKE 57 Element_SMKE::Element_SMKE() { diff --git a/src/simulation/elements/SNOW.cpp b/src/simulation/elements/SNOW.cpp index c0c7a4fe9..8ecc8584f 100644 --- a/src/simulation/elements/SNOW.cpp +++ b/src/simulation/elements/SNOW.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SNOW PT_SNOW 16 Element_SNOW::Element_SNOW() { diff --git a/src/simulation/elements/SOAP.cpp b/src/simulation/elements/SOAP.cpp index 577d053c2..54697ead0 100644 --- a/src/simulation/elements/SOAP.cpp +++ b/src/simulation/elements/SOAP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SOAP PT_SOAP 149 Element_SOAP::Element_SOAP() { diff --git a/src/simulation/elements/SPAWN.cpp b/src/simulation/elements/SPAWN.cpp index 28b57f4a4..44eabba0c 100644 --- a/src/simulation/elements/SPAWN.cpp +++ b/src/simulation/elements/SPAWN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SPAWN PT_SPAWN 118 Element_SPAWN::Element_SPAWN() { diff --git a/src/simulation/elements/SPAWN2.cpp b/src/simulation/elements/SPAWN2.cpp index e4450f9b9..71a6792fd 100644 --- a/src/simulation/elements/SPAWN2.cpp +++ b/src/simulation/elements/SPAWN2.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SPAWN2 PT_SPAWN2 117 Element_SPAWN2::Element_SPAWN2() { diff --git a/src/simulation/elements/SPNG.cpp b/src/simulation/elements/SPNG.cpp index e679869de..9dadc4dfd 100644 --- a/src/simulation/elements/SPNG.cpp +++ b/src/simulation/elements/SPNG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SPNG PT_SPNG 90 Element_SPNG::Element_SPNG() { diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index dd8b979b7..6a582eba8 100644 --- a/src/simulation/elements/SPRK.cpp +++ b/src/simulation/elements/SPRK.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SPRK PT_SPRK 15 Element_SPRK::Element_SPRK() { diff --git a/src/simulation/elements/STKM.cpp b/src/simulation/elements/STKM.cpp index 0d1533b06..54ec7e99e 100644 --- a/src/simulation/elements/STKM.cpp +++ b/src/simulation/elements/STKM.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_STKM PT_STKM 55 Element_STKM::Element_STKM() { diff --git a/src/simulation/elements/STKM2.cpp b/src/simulation/elements/STKM2.cpp index 5f1c344ae..9d7030726 100644 --- a/src/simulation/elements/STKM2.cpp +++ b/src/simulation/elements/STKM2.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_STKM2 PT_STKM2 128 Element_STKM2::Element_STKM2() { diff --git a/src/simulation/elements/STNE.cpp b/src/simulation/elements/STNE.cpp index 7dbfc7cda..7a17258e5 100644 --- a/src/simulation/elements/STNE.cpp +++ b/src/simulation/elements/STNE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_STNE PT_STNE 5 Element_STNE::Element_STNE() { diff --git a/src/simulation/elements/STOR.cpp b/src/simulation/elements/STOR.cpp index 2ce2a9180..7e1475e9e 100644 --- a/src/simulation/elements/STOR.cpp +++ b/src/simulation/elements/STOR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_STOR PT_STOR 83 Element_STOR::Element_STOR() { diff --git a/src/simulation/elements/SWCH.cpp b/src/simulation/elements/SWCH.cpp index 4c21b2cef..85659d567 100644 --- a/src/simulation/elements/SWCH.cpp +++ b/src/simulation/elements/SWCH.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_SWCH PT_SWCH 56 Element_SWCH::Element_SWCH() { diff --git a/src/simulation/elements/TESC.cpp b/src/simulation/elements/TESC.cpp index a115ff1e6..7a19de692 100644 --- a/src/simulation/elements/TESC.cpp +++ b/src/simulation/elements/TESC.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_TESC PT_TESC 88 Element_TESC::Element_TESC() { diff --git a/src/simulation/elements/THDR.cpp b/src/simulation/elements/THDR.cpp index 9d61ba672..7bda360cc 100644 --- a/src/simulation/elements/THDR.cpp +++ b/src/simulation/elements/THDR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_THDR PT_THDR 48 Element_THDR::Element_THDR() { diff --git a/src/simulation/elements/THRM.cpp b/src/simulation/elements/THRM.cpp index 6c7839135..eb52bb7d8 100644 --- a/src/simulation/elements/THRM.cpp +++ b/src/simulation/elements/THRM.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_THRM PT_THRM 65 Element_THRM::Element_THRM() { diff --git a/src/simulation/elements/TRON.cpp b/src/simulation/elements/TRON.cpp index 99309d138..6cd6e922f 100644 --- a/src/simulation/elements/TRON.cpp +++ b/src/simulation/elements/TRON.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_TRON PT_TRON 143 Element_TRON::Element_TRON() { diff --git a/src/simulation/elements/TSNS.cpp b/src/simulation/elements/TSNS.cpp index ce9fd153a..1c8ec1bc6 100644 --- a/src/simulation/elements/TSNS.cpp +++ b/src/simulation/elements/TSNS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_TSNS PT_TSNS 164 Element_TSNS::Element_TSNS() { diff --git a/src/simulation/elements/TTAN.cpp b/src/simulation/elements/TTAN.cpp index 1241a5921..eb6bcecf3 100644 --- a/src/simulation/elements/TTAN.cpp +++ b/src/simulation/elements/TTAN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "simulation/Air.h" //#TPT-Directive ElementClass Element_TTAN PT_TTAN 144 Element_TTAN::Element_TTAN() diff --git a/src/simulation/elements/TUNG.cpp b/src/simulation/elements/TUNG.cpp index 8cf743361..2bd27db04 100644 --- a/src/simulation/elements/TUNG.cpp +++ b/src/simulation/elements/TUNG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" #include "simulation/Air.h" //#TPT-Directive ElementClass Element_TUNG PT_TUNG 171 Element_TUNG::Element_TUNG() diff --git a/src/simulation/elements/URAN.cpp b/src/simulation/elements/URAN.cpp index cf7c59acb..61ba2f8ba 100644 --- a/src/simulation/elements/URAN.cpp +++ b/src/simulation/elements/URAN.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_URAN PT_URAN 32 Element_URAN::Element_URAN() { diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index c686d8d4b..4a47b1cfd 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_VIBR PT_VIBR 165 Element_VIBR::Element_VIBR() { diff --git a/src/simulation/elements/VINE.cpp b/src/simulation/elements/VINE.cpp index 0d726bc6c..9092111d2 100644 --- a/src/simulation/elements/VINE.cpp +++ b/src/simulation/elements/VINE.cpp @@ -1,5 +1,5 @@ #include "common/tpt-minmax.h" -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_VINE PT_VINE 114 Element_VINE::Element_VINE() diff --git a/src/simulation/elements/VIRS.cpp b/src/simulation/elements/VIRS.cpp index 3b40e0a2b..e6eeee7de 100644 --- a/src/simulation/elements/VIRS.cpp +++ b/src/simulation/elements/VIRS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_VIRS PT_VIRS 174 Element_VIRS::Element_VIRS() { diff --git a/src/simulation/elements/VOID.cpp b/src/simulation/elements/VOID.cpp index 8e0a5f63b..2fb5cace0 100644 --- a/src/simulation/elements/VOID.cpp +++ b/src/simulation/elements/VOID.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_VOID PT_VOID 22 Element_VOID::Element_VOID() { diff --git a/src/simulation/elements/VRSG.cpp b/src/simulation/elements/VRSG.cpp index d39146e8c..9d238903f 100644 --- a/src/simulation/elements/VRSG.cpp +++ b/src/simulation/elements/VRSG.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_VRSG PT_VRSG 176 Element_VRSG::Element_VRSG() { diff --git a/src/simulation/elements/VRSS.cpp b/src/simulation/elements/VRSS.cpp index 06266e609..30714b900 100644 --- a/src/simulation/elements/VRSS.cpp +++ b/src/simulation/elements/VRSS.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_VRSS PT_VRSS 175 Element_VRSS::Element_VRSS() { diff --git a/src/simulation/elements/WARP.cpp b/src/simulation/elements/WARP.cpp index 097c7d8e0..b9a1e2ae2 100644 --- a/src/simulation/elements/WARP.cpp +++ b/src/simulation/elements/WARP.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WARP PT_WARP 96 Element_WARP::Element_WARP() { diff --git a/src/simulation/elements/WATR.cpp b/src/simulation/elements/WATR.cpp index 868632c46..8c1d1466c 100644 --- a/src/simulation/elements/WATR.cpp +++ b/src/simulation/elements/WATR.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WATR PT_WATR 2 Element_WATR::Element_WATR() { diff --git a/src/simulation/elements/WAX.cpp b/src/simulation/elements/WAX.cpp index b472c3b2e..279afbe45 100644 --- a/src/simulation/elements/WAX.cpp +++ b/src/simulation/elements/WAX.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WAX PT_WAX 33 Element_WAX::Element_WAX() { diff --git a/src/simulation/elements/WHOL.cpp b/src/simulation/elements/WHOL.cpp index ce5932be3..8bdf8c7bd 100644 --- a/src/simulation/elements/WHOL.cpp +++ b/src/simulation/elements/WHOL.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WHOL PT_WHOL 40 Element_WHOL::Element_WHOL() { diff --git a/src/simulation/elements/WIFI.cpp b/src/simulation/elements/WIFI.cpp index c3ab4d106..3b022caec 100644 --- a/src/simulation/elements/WIFI.cpp +++ b/src/simulation/elements/WIFI.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WIFI PT_WIFI 124 Element_WIFI::Element_WIFI() { diff --git a/src/simulation/elements/WIRE.cpp b/src/simulation/elements/WIRE.cpp index 6812cd6db..b985d66ab 100644 --- a/src/simulation/elements/WIRE.cpp +++ b/src/simulation/elements/WIRE.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WIRE PT_WIRE 156 Element_WIRE::Element_WIRE() { diff --git a/src/simulation/elements/WOOD.cpp b/src/simulation/elements/WOOD.cpp index 5e179ffe3..9c56da033 100644 --- a/src/simulation/elements/WOOD.cpp +++ b/src/simulation/elements/WOOD.cpp @@ -1,5 +1,5 @@ #include "common/tpt-minmax.h" -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WOOD PT_WOOD 17 Element_WOOD::Element_WOOD() diff --git a/src/simulation/elements/WTRV.cpp b/src/simulation/elements/WTRV.cpp index 8cb029b90..41b0c2ab8 100644 --- a/src/simulation/elements/WTRV.cpp +++ b/src/simulation/elements/WTRV.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_WTRV PT_WTRV 23 Element_WTRV::Element_WTRV() { diff --git a/src/simulation/elements/YEST.cpp b/src/simulation/elements/YEST.cpp index a2f963ffc..ed8b0564e 100644 --- a/src/simulation/elements/YEST.cpp +++ b/src/simulation/elements/YEST.cpp @@ -1,4 +1,4 @@ -#include "simulation/Elements.h" +#include "simulation/ElementCommon.h" //#TPT-Directive ElementClass Element_YEST PT_YEST 63 Element_YEST::Element_YEST() { diff --git a/src/simulation/simtools/AirTool.cpp b/src/simulation/simtools/AirTool.cpp index 2694de1f6..b90e4646c 100644 --- a/src/simulation/simtools/AirTool.cpp +++ b/src/simulation/simtools/AirTool.cpp @@ -1,5 +1,6 @@ -#include "ToolClasses.h" +#include "simulation/ToolCommon.h" #include "simulation/Air.h" + //#TPT-Directive ToolClass Tool_Air TOOL_AIR 2 Tool_Air::Tool_Air() { diff --git a/src/simulation/simtools/Cool.cpp b/src/simulation/simtools/Cool.cpp index 5c9ba55c0..05ed9c54b 100644 --- a/src/simulation/simtools/Cool.cpp +++ b/src/simulation/simtools/Cool.cpp @@ -1,4 +1,5 @@ -#include "ToolClasses.h" +#include "simulation/ToolCommon.h" + //#TPT-Directive ToolClass Tool_Cool TOOL_COOL 1 Tool_Cool::Tool_Cool() { diff --git a/src/simulation/simtools/Cyclone.cpp b/src/simulation/simtools/Cyclone.cpp index db97dde0c..768d16b06 100644 --- a/src/simulation/simtools/Cyclone.cpp +++ b/src/simulation/simtools/Cyclone.cpp @@ -1,6 +1,8 @@ -#include "ToolClasses.h" +#include "simulation/ToolCommon.h" #include "simulation/Air.h" +#include + //#TPT-Directive ToolClass Tool_Cycl TOOL_CYCL 7 Tool_Cycl::Tool_Cycl() diff --git a/src/simulation/simtools/Heat.cpp b/src/simulation/simtools/Heat.cpp index 8355a2daf..5b564a094 100644 --- a/src/simulation/simtools/Heat.cpp +++ b/src/simulation/simtools/Heat.cpp @@ -1,4 +1,5 @@ -#include "ToolClasses.h" +#include "simulation/ToolCommon.h" + //#TPT-Directive ToolClass Tool_Heat TOOL_HEAT 0 Tool_Heat::Tool_Heat() { diff --git a/src/simulation/simtools/Mix.cpp b/src/simulation/simtools/Mix.cpp index fc9270f51..562401117 100755 --- a/src/simulation/simtools/Mix.cpp +++ b/src/simulation/simtools/Mix.cpp @@ -1,4 +1,8 @@ -#include "ToolClasses.h" +#include "simulation/ToolCommon.h" + +#include "common/tpt-rand.h" +#include + //#TPT-Directive ToolClass Tool_Mix TOOL_MIX 6 Tool_Mix::Tool_Mix() { diff --git a/src/simulation/simtools/NGrv.cpp b/src/simulation/simtools/NGrv.cpp index 81d13d0bb..b9ed258d6 100644 --- a/src/simulation/simtools/NGrv.cpp +++ b/src/simulation/simtools/NGrv.cpp @@ -1,5 +1,5 @@ -#include "ToolClasses.h" -#include "simulation/Simulation.h" +#include "simulation/ToolCommon.h" + //#TPT-Directive ToolClass Tool_NGrv TOOL_NGRV 5 Tool_NGrv::Tool_NGrv() { diff --git a/src/simulation/simtools/PGrv.cpp b/src/simulation/simtools/PGrv.cpp index 61043b2ff..fb27ce568 100644 --- a/src/simulation/simtools/PGrv.cpp +++ b/src/simulation/simtools/PGrv.cpp @@ -1,5 +1,5 @@ -#include "ToolClasses.h" -#include "simulation/Simulation.h" +#include "simulation/ToolCommon.h" + //#TPT-Directive ToolClass Tool_PGrv TOOL_PGRV 4 Tool_PGrv::Tool_PGrv() { diff --git a/src/simulation/simtools/SimTool.cpp b/src/simulation/simtools/SimTool.cpp index 0fdec2b54..93b7db558 100644 --- a/src/simulation/simtools/SimTool.cpp +++ b/src/simulation/simtools/SimTool.cpp @@ -1,4 +1,12 @@ -#include "simulation/Element.h" +#include +#include "simulation/ElementGraphics.h" +#include "simulation/Gravity.h" +#include "Misc.h" +#include "simulation/Simulation.h" +#include "common/tpt-compat.h" +#include "common/tpt-rand.h" +#include "graphics/Renderer.h" + #include "ToolClasses.h" SimTool::SimTool(): diff --git a/src/simulation/simtools/SimTool.h b/src/simulation/simtools/SimTool.h index a91b24c7d..aa787bf48 100644 --- a/src/simulation/simtools/SimTool.h +++ b/src/simulation/simtools/SimTool.h @@ -1,9 +1,8 @@ #ifndef SIMTOOL_H #define SIMTOOL_H -#include "simulation/Simulation.h" -#include "graphics/Renderer.h" -#include "simulation/Elements.h" +#include "common/String.h" +#include "graphics/Pixel.h" class Simulation; struct Particle; diff --git a/src/simulation/simtools/Vac.cpp b/src/simulation/simtools/Vac.cpp index f780bbcfb..6f3e0b4e1 100644 --- a/src/simulation/simtools/Vac.cpp +++ b/src/simulation/simtools/Vac.cpp @@ -1,5 +1,6 @@ -#include "ToolClasses.h" +#include "simulation/ToolCommon.h" #include "simulation/Air.h" + //#TPT-Directive ToolClass Tool_Vac TOOL_VAC 3 Tool_Vac::Tool_Vac() { diff --git a/src/tasks/AbandonableTask.cpp b/src/tasks/AbandonableTask.cpp index 147aa8318..416c3c2a0 100644 --- a/src/tasks/AbandonableTask.cpp +++ b/src/tasks/AbandonableTask.cpp @@ -1,7 +1,5 @@ #include "AbandonableTask.h" -#include "Platform.h" - void AbandonableTask::doWork_wrapper() { Task::doWork_wrapper(); diff --git a/src/tasks/Task.cpp b/src/tasks/Task.cpp index 7ed8872d0..014b43726 100644 --- a/src/tasks/Task.cpp +++ b/src/tasks/Task.cpp @@ -1,5 +1,5 @@ -#include "Config.h" #include "Task.h" + #include "TaskListener.h" void Task::AddTaskListener(TaskListener * listener) diff --git a/src/tasks/Task.h b/src/tasks/Task.h index 4d747abea..ae4abb769 100644 --- a/src/tasks/Task.h +++ b/src/tasks/Task.h @@ -2,8 +2,6 @@ #define TASK_H_ #include "common/String.h" -#include "TaskListener.h" -#include "Config.h" #include #include diff --git a/src/tasks/TaskWindow.cpp b/src/tasks/TaskWindow.cpp index c742ad298..3ff447b24 100644 --- a/src/tasks/TaskWindow.cpp +++ b/src/tasks/TaskWindow.cpp @@ -1,10 +1,15 @@ -#include "common/tpt-minmax.h" +#include "TaskWindow.h" + +#include "Task.h" + #include "gui/interface/Label.h" #include "gui/interface/Engine.h" -#include "TaskWindow.h" #include "gui/dialogues/ErrorMessage.h" #include "gui/Style.h" -#include "Task.h" + +#include "graphics/Graphics.h" + +#include "common/tpt-minmax.h" TaskWindow::TaskWindow(String title_, Task * task_, bool closeOnDone): ui::Window(ui::Point(-1, -1), ui::Point(240, 60)), diff --git a/src/tasks/TaskWindow.h b/src/tasks/TaskWindow.h index f70b38c7a..9c2cc3f31 100644 --- a/src/tasks/TaskWindow.h +++ b/src/tasks/TaskWindow.h @@ -1,10 +1,14 @@ #ifndef TASKWINDOW_H_ #define TASKWINDOW_H_ -#include "gui/interface/Label.h" #include "gui/interface/Window.h" #include "tasks/TaskListener.h" +namespace ui +{ + class Label; +} + class Task; class TaskWindow: public ui::Window, public TaskListener { Task * task;