diff --git a/src/client/animatedtext.h b/src/client/animatedtext.h index 744a95fea7..75f5bfece5 100644 --- a/src/client/animatedtext.h +++ b/src/client/animatedtext.h @@ -25,7 +25,6 @@ #include "declarations.h" #include #include -#include #include // @bindclass diff --git a/src/client/attachableobject.cpp b/src/client/attachableobject.cpp index 8c2a733dc4..a6a7532acb 100644 --- a/src/client/attachableobject.cpp +++ b/src/client/attachableobject.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -34,7 +33,6 @@ #include "client.h" #include "game.h" #include "map.h" -#include "tile.h" #include "uimap.h" extern ParticleManager g_particles; diff --git a/src/client/attachedeffect.h b/src/client/attachedeffect.h index bf5711e03c..2e6bbd8e75 100644 --- a/src/client/attachedeffect.h +++ b/src/client/attachedeffect.h @@ -119,7 +119,7 @@ onTop, uint8_t minHeight{ 0 }; uint8_t height{ 0 }; uint16_t speed{ 0 }; - Timer timer; + Timer timer{}; }; private: diff --git a/src/client/attachedeffectmanager.cpp b/src/client/attachedeffectmanager.cpp index 100bdea3e7..8e589f2704 100644 --- a/src/client/attachedeffectmanager.cpp +++ b/src/client/attachedeffectmanager.cpp @@ -22,7 +22,6 @@ #include "attachedeffectmanager.h" #include "attachedeffect.h" -#include "spritemanager.h" #include "thingtypemanager.h" #include diff --git a/src/client/client.cpp b/src/client/client.cpp index 99aa6beb1b..ddac7e8ca9 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -31,8 +31,6 @@ #include #include -#include -#include #include #include diff --git a/src/client/client.h b/src/client/client.h index 9c33f26c3e..a1d6a37280 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -27,7 +27,6 @@ #include "uimap.h" #include -#include class Client : public ApplicationDrawEvents { diff --git a/src/client/creature.cpp b/src/client/creature.cpp index 73b3b40f14..bca6578520 100644 --- a/src/client/creature.cpp +++ b/src/client/creature.cpp @@ -26,7 +26,6 @@ #include "localplayer.h" #include "luavaluecasts_client.h" #include "map.h" -#include "statictext.h" #include "thingtypemanager.h" #include "tile.h" @@ -34,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/src/client/effect.h b/src/client/effect.h index e8772caddd..5538c4e910 100644 --- a/src/client/effect.h +++ b/src/client/effect.h @@ -24,9 +24,8 @@ #include "thing.h" #include -#include - // @bindclass +// @bindclass class Effect final : public Thing { public: diff --git a/src/client/game.h b/src/client/game.h index 36b804609a..db9dcdd471 100644 --- a/src/client/game.h +++ b/src/client/game.h @@ -22,11 +22,9 @@ #pragma once -#include "animatedtext.h" #include "container.h" #include "creature.h" #include "declarations.h" -#include "item.h" #include "outfit.h" #include "protocolgame.h" #include diff --git a/src/client/item.cpp b/src/client/item.cpp index be7d8b8a24..3b9d82289c 100644 --- a/src/client/item.cpp +++ b/src/client/item.cpp @@ -23,17 +23,13 @@ #include "item.h" #include "container.h" #include "game.h" -#include "map.h" #include "spritemanager.h" #include "thing.h" #include "thingtypemanager.h" #include "tile.h" -#include #include -#include #include -#include #include ItemPtr Item::create(const int id) diff --git a/src/client/item.h b/src/client/item.h index 67580a6e50..0abfee01fb 100644 --- a/src/client/item.h +++ b/src/client/item.h @@ -22,7 +22,6 @@ #pragma once -#include "effect.h" #include "thing.h" #include diff --git a/src/client/lightview.cpp b/src/client/lightview.cpp index d1c74fb1ec..39da7661f9 100644 --- a/src/client/lightview.cpp +++ b/src/client/lightview.cpp @@ -22,8 +22,6 @@ #include "lightview.h" #include "map.h" -#include "mapview.h" -#include "spritemanager.h" #include #include diff --git a/src/client/mapview.cpp b/src/client/mapview.cpp index 0c2c0916c7..3f0c57b069 100644 --- a/src/client/mapview.cpp +++ b/src/client/mapview.cpp @@ -33,7 +33,6 @@ #include "tile.h" #include "framework/graphics/texturemanager.h" -#include #include #include #include diff --git a/src/client/mapview.h b/src/client/mapview.h index 123eecdc6b..25765c5769 100644 --- a/src/client/mapview.h +++ b/src/client/mapview.h @@ -25,7 +25,6 @@ #include "lightview.h" #include #include -#include #include struct AwareRange diff --git a/src/client/minimap.cpp b/src/client/minimap.cpp index bceb6b0288..40d6de2fa3 100644 --- a/src/client/minimap.cpp +++ b/src/client/minimap.cpp @@ -23,7 +23,6 @@ #include "minimap.h" #include "tile.h" -#include #include #include #include diff --git a/src/client/missile.h b/src/client/missile.h index dd5d9a2713..857faf4381 100644 --- a/src/client/missile.h +++ b/src/client/missile.h @@ -24,9 +24,8 @@ #include "thing.h" #include -#include - // @bindclass +// @bindclass class Missile final : public Thing { public: diff --git a/src/client/position.h b/src/client/position.h index 8371e51b46..af34ca8a40 100644 --- a/src/client/position.h +++ b/src/client/position.h @@ -24,7 +24,6 @@ #include "const.h" #include -#include #include #include diff --git a/src/client/protocolcodes.cpp b/src/client/protocolcodes.cpp index 258f99f510..d2bad20f25 100644 --- a/src/client/protocolcodes.cpp +++ b/src/client/protocolcodes.cpp @@ -22,8 +22,6 @@ #include "protocolcodes.h" -#include - namespace Proto { stdext::map messageModesMap; diff --git a/src/client/protocolgameparse.cpp b/src/client/protocolgameparse.cpp index d3c20babeb..3e3913f5fa 100644 --- a/src/client/protocolgameparse.cpp +++ b/src/client/protocolgameparse.cpp @@ -31,7 +31,6 @@ #include "luavaluecasts_client.h" #include "map.h" #include "missile.h" -#include "statictext.h" #include "thingtypemanager.h" #include "tile.h" #include @@ -1074,7 +1073,7 @@ void ProtocolGame::parseStoreError(const InputMessagePtr& msg) const const uint8_t errorType = msg->getU8(); const auto& message = msg->getString(); - g_lua.callGlobalField("g_game", "onParseStoreError", message); + g_lua.callGlobalField("g_game", "onParseStoreError", message, errorType); } void ProtocolGame::parseUnjustifiedStats(const InputMessagePtr& msg) diff --git a/src/client/protocolgamesend.cpp b/src/client/protocolgamesend.cpp index 6281b124b2..9348e2a826 100644 --- a/src/client/protocolgamesend.cpp +++ b/src/client/protocolgamesend.cpp @@ -23,8 +23,6 @@ #include "framework/net/outputmessage.h" #include "game.h" #include "protocolgame.h" -#include -#include #include void ProtocolGame::send(const OutputMessagePtr& outputMessage) diff --git a/src/client/spriteappearances.cpp b/src/client/spriteappearances.cpp index d595b5f5ee..e77a74d2c9 100644 --- a/src/client/spriteappearances.cpp +++ b/src/client/spriteappearances.cpp @@ -23,7 +23,6 @@ #include "spriteappearances.h" #include "game.h" #include -#include #include #include diff --git a/src/client/spritemanager.cpp b/src/client/spritemanager.cpp index 7f24f3af11..c939db1d39 100644 --- a/src/client/spritemanager.cpp +++ b/src/client/spritemanager.cpp @@ -25,7 +25,6 @@ #include "gameconfig.h" #include "spriteappearances.h" #include -#include #include #include #include diff --git a/src/client/thing.cpp b/src/client/thing.cpp index a6a25fd2e0..fd82cc15f5 100644 --- a/src/client/thing.cpp +++ b/src/client/thing.cpp @@ -23,11 +23,7 @@ #include "thing.h" #include "game.h" #include "map.h" -#include "thingtypemanager.h" -#include "tile.h" -#include -#include #include void Thing::setPosition(const Position& position, uint8_t /*stackPos*/, bool /*hasElevation*/) diff --git a/src/client/thingtype.h b/src/client/thingtype.h index fbcb501bfb..8df3c6aa47 100644 --- a/src/client/thingtype.h +++ b/src/client/thingtype.h @@ -24,14 +24,10 @@ #include "animator.h" #include "declarations.h" -#include "gameconfig.h" -#include #include #include -#include #include -#include #include #include diff --git a/src/client/thingtypemanager.cpp b/src/client/thingtypemanager.cpp index edbbe7c5bf..b6d29a6bcf 100644 --- a/src/client/thingtypemanager.cpp +++ b/src/client/thingtypemanager.cpp @@ -30,14 +30,11 @@ #include "creatures.h" #endif -#include -#include #include #include #include #include -#include #include diff --git a/src/client/tile.cpp b/src/client/tile.cpp index 945bc69485..115ec889a1 100644 --- a/src/client/tile.cpp +++ b/src/client/tile.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -33,11 +32,8 @@ #include "effect.h" #include "game.h" #include "item.h" -#include "lightview.h" -#include "localplayer.h" #include "map.h" #include "protocolgame.h" -#include "statictext.h" #include "uimap.h" #include diff --git a/src/client/tile.h b/src/client/tile.h index fc2fdb39e1..db09d1ec3a 100644 --- a/src/client/tile.h +++ b/src/client/tile.h @@ -26,11 +26,8 @@ #include "attachableobject.h" #include "declarations.h" -#include "effect.h" #include "item.h" #include "mapview.h" -#include "statictext.h" -#include #ifdef FRAMEWORK_EDITOR enum tileflags_t : uint32_t diff --git a/src/client/uimap.cpp b/src/client/uimap.cpp index 18b757ae87..983fc2aaaf 100644 --- a/src/client/uimap.cpp +++ b/src/client/uimap.cpp @@ -24,10 +24,7 @@ #include "game.h" #include "map.h" #include "mapview.h" -#include -#include #include -#include UIMap::UIMap() { diff --git a/src/client/uiprogressrect.cpp b/src/client/uiprogressrect.cpp index ac335c81bd..7ca6679058 100644 --- a/src/client/uiprogressrect.cpp +++ b/src/client/uiprogressrect.cpp @@ -21,7 +21,6 @@ */ #include "uiprogressrect.h" -#include #include "framework/graphics/drawpool.h" #include "framework/graphics/drawpoolmanager.h" diff --git a/src/framework/core/adaptativeframecounter.cpp b/src/framework/core/adaptativeframecounter.cpp index abb121f4a9..df9db2058e 100644 --- a/src/framework/core/adaptativeframecounter.cpp +++ b/src/framework/core/adaptativeframecounter.cpp @@ -21,9 +21,7 @@ */ #include "adaptativeframecounter.h" -#include #include -#include bool AdaptativeFrameCounter::update() { diff --git a/src/framework/core/application.h b/src/framework/core/application.h index a4ed4cf010..3d37c92ecf 100644 --- a/src/framework/core/application.h +++ b/src/framework/core/application.h @@ -23,7 +23,6 @@ #pragma once #include -#include class ApplicationContext { @@ -92,7 +91,6 @@ class Application }; #ifdef FRAMEWORK_GRAPHICS -#include "graphicalapplication.h" #else #include "consoleapplication.h" #endif diff --git a/src/framework/core/eventdispatcher.cpp b/src/framework/core/eventdispatcher.cpp index 0843b16109..1a0485d790 100644 --- a/src/framework/core/eventdispatcher.cpp +++ b/src/framework/core/eventdispatcher.cpp @@ -24,7 +24,6 @@ #include "asyncdispatcher.h" #include "timer.h" -#include EventDispatcher g_dispatcher, g_textDispatcher, g_mainDispatcher; int16_t g_mainThreadId = stdext::getThreadId(); diff --git a/src/framework/core/eventdispatcher.h b/src/framework/core/eventdispatcher.h index 394f4efb18..b07b3f6cf5 100644 --- a/src/framework/core/eventdispatcher.h +++ b/src/framework/core/eventdispatcher.h @@ -22,12 +22,9 @@ #pragma once -#include "clock.h" #include "scheduledevent.h" -#include - - // @bindsingleton g_dispatcher +// @bindsingleton g_dispatcher class EventDispatcher { public: diff --git a/src/framework/core/filestream.cpp b/src/framework/core/filestream.cpp index faf7cc98b9..cc20a601e4 100644 --- a/src/framework/core/filestream.cpp +++ b/src/framework/core/filestream.cpp @@ -22,6 +22,7 @@ #include "filestream.h" #include "binarytree.h" +#include "graphicalapplication.h" #include #include diff --git a/src/framework/core/graphicalapplication.cpp b/src/framework/core/graphicalapplication.cpp index 1c2a78dabf..802ff5dd49 100644 --- a/src/framework/core/graphicalapplication.cpp +++ b/src/framework/core/graphicalapplication.cpp @@ -46,8 +46,6 @@ #include #endif -#include - GraphicalApplication g_app; void GraphicalApplication::init(std::vector& args, ApplicationContext* context) diff --git a/src/framework/core/graphicalapplication.h b/src/framework/core/graphicalapplication.h index 39a7dfcca8..1405d8b66b 100644 --- a/src/framework/core/graphicalapplication.h +++ b/src/framework/core/graphicalapplication.h @@ -26,7 +26,6 @@ #include #include -#include #include #include diff --git a/src/framework/core/logger.h b/src/framework/core/logger.h index c5aa8b64aa..50d7b8ef36 100644 --- a/src/framework/core/logger.h +++ b/src/framework/core/logger.h @@ -25,7 +25,6 @@ #include "../global.h" #include -#include struct LogMessage { diff --git a/src/framework/core/module.cpp b/src/framework/core/module.cpp index 7913e1ee88..70e6b80b93 100644 --- a/src/framework/core/module.cpp +++ b/src/framework/core/module.cpp @@ -27,8 +27,6 @@ #include #include -#include - Module::Module(const std::string_view name) : m_sandboxEnv(g_lua.newSandboxEnv()), m_name(name.data()) {} bool Module::load() diff --git a/src/framework/core/resourcemanager.cpp b/src/framework/core/resourcemanager.cpp index 7d7d9c5f5d..02fd1f9bab 100644 --- a/src/framework/core/resourcemanager.cpp +++ b/src/framework/core/resourcemanager.cpp @@ -224,13 +224,13 @@ std::string ResourceManager::readFileContents(const std::string& fileName) PHYSFS_readBytes(file, &buffer[0], fileSize); PHYSFS_close(file); +#if ENABLE_ENCRYPTION == 1 bool hasHeader = false; if (buffer.size() >= std::string(ENCRYPTION_HEADER).size() && buffer.substr(0, std::string(ENCRYPTION_HEADER).size()) == std::string(ENCRYPTION_HEADER)) { hasHeader = true; } -#if ENABLE_ENCRYPTION == 1 if (g_game.getFeature(Otc::GameAllowCustomBotScripts)) { if (fullPath.find(g_resources.getByteStrings(1)) != std::string::npos && !hasHeader) { return buffer; diff --git a/src/framework/graphics/drawpool.h b/src/framework/graphics/drawpool.h index a6cfd8e9a4..0de81d4f17 100644 --- a/src/framework/graphics/drawpool.h +++ b/src/framework/graphics/drawpool.h @@ -27,7 +27,6 @@ #include "declarations.h" #include "framebuffer.h" #include "framework/core/timer.h" -#include "texture.h" #include #include diff --git a/src/framework/graphics/drawpoolmanager.cpp b/src/framework/graphics/drawpoolmanager.cpp index f4270511b6..efceaaf830 100644 --- a/src/framework/graphics/drawpoolmanager.cpp +++ b/src/framework/graphics/drawpoolmanager.cpp @@ -23,6 +23,7 @@ #include "drawpoolmanager.h" #include "declarations.h" #include "drawpool.h" +#include "graphics.h" thread_local static uint8_t CURRENT_POOL = static_cast(DrawPoolType::LAST); diff --git a/src/framework/graphics/drawpoolmanager.h b/src/framework/graphics/drawpoolmanager.h index e4454fb5dc..2b0926f024 100644 --- a/src/framework/graphics/drawpoolmanager.h +++ b/src/framework/graphics/drawpoolmanager.h @@ -25,7 +25,6 @@ #include #include #include -#include class DrawPoolManager { diff --git a/src/framework/graphics/framebuffer.cpp b/src/framework/graphics/framebuffer.cpp index d20fdd4aaf..04a74a7f0b 100644 --- a/src/framework/graphics/framebuffer.cpp +++ b/src/framework/graphics/framebuffer.cpp @@ -27,9 +27,9 @@ #include #include #include -#include #include -#include + +#include "framework/core/graphicalapplication.h" uint32_t FrameBuffer::boundFbo = 0; @@ -102,6 +102,10 @@ void FrameBuffer::bind() } } +bool FrameBuffer::canDraw() const { + return m_texture && m_coordsBuffer.getVertexCount() > 0; +} + void FrameBuffer::release() const { internalRelease(); diff --git a/src/framework/graphics/framebuffer.h b/src/framework/graphics/framebuffer.h index 8c750025a4..9e3356b6b7 100644 --- a/src/framework/graphics/framebuffer.h +++ b/src/framework/graphics/framebuffer.h @@ -42,9 +42,7 @@ class FrameBuffer bool resize(const Size& size); bool isValid() const { return m_texture != nullptr; } - bool canDraw() const { - return m_texture && m_coordsBuffer.getVertexCount() > 0; - } + bool canDraw() const; TexturePtr getTexture() const { return m_texture; } TexturePtr extractTexture(); diff --git a/src/framework/graphics/hardwarebuffer.cpp b/src/framework/graphics/hardwarebuffer.cpp index 6cd52c2b24..d3f18405b3 100644 --- a/src/framework/graphics/hardwarebuffer.cpp +++ b/src/framework/graphics/hardwarebuffer.cpp @@ -26,6 +26,8 @@ #include #include +#include "framework/core/graphicalapplication.h" + HardwareBuffer::HardwareBuffer(const Type type) :m_type(type) { glGenBuffers(1, &m_id); diff --git a/src/framework/graphics/image.cpp b/src/framework/graphics/image.cpp index dc6c5b5e4c..f675239f61 100644 --- a/src/framework/graphics/image.cpp +++ b/src/framework/graphics/image.cpp @@ -26,7 +26,6 @@ #include #include -#include "framework/stdext/math.h" #include "framework/stdext/qrcodegen.h" using namespace qrcodegen; diff --git a/src/framework/graphics/particletype.h b/src/framework/graphics/particletype.h index ae00e98e37..91ffd6095a 100644 --- a/src/framework/graphics/particletype.h +++ b/src/framework/graphics/particletype.h @@ -25,7 +25,6 @@ #include "declarations.h" #include #include -#include #include class ParticleType diff --git a/src/framework/graphics/shader.cpp b/src/framework/graphics/shader.cpp index b9cf043d56..2f75d67e55 100644 --- a/src/framework/graphics/shader.cpp +++ b/src/framework/graphics/shader.cpp @@ -27,6 +27,8 @@ #include #include +#include "framework/core/graphicalapplication.h" + Shader::Shader(ShaderType shaderType) : m_shaderId(glCreateShader(static_cast(shaderType))), m_shaderType(shaderType) { if (!m_shaderId) diff --git a/src/framework/graphics/shaderprogram.cpp b/src/framework/graphics/shaderprogram.cpp index c96410fbe7..a1c1aaac78 100644 --- a/src/framework/graphics/shaderprogram.cpp +++ b/src/framework/graphics/shaderprogram.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include "framework/core/graphicalapplication.h" uint32_t ShaderProgram::m_currentProgram = 0; diff --git a/src/framework/graphics/texture.cpp b/src/framework/graphics/texture.cpp index 93070bd017..8c64a8a18f 100644 --- a/src/framework/graphics/texture.cpp +++ b/src/framework/graphics/texture.cpp @@ -25,10 +25,11 @@ #include "graphics.h" #include "image.h" -#include "framework/stdext/math.h" #include #include +#include "framework/core/graphicalapplication.h" + // UINT16_MAX = just to avoid conflicts with GL generated ID. static std::atomic_uint32_t UID(UINT16_MAX); diff --git a/src/framework/luaengine/luaobject.cpp b/src/framework/luaengine/luaobject.cpp index f72f024693..8b12757edc 100644 --- a/src/framework/luaengine/luaobject.cpp +++ b/src/framework/luaengine/luaobject.cpp @@ -24,6 +24,8 @@ #include "luainterface.h" #include +#include "framework/core/graphicalapplication.h" + #include int16_t g_luaThreadId = -1; diff --git a/src/framework/luafunctions.cpp b/src/framework/luafunctions.cpp index 6b91a864f8..fee0bdfe7f 100644 --- a/src/framework/luafunctions.cpp +++ b/src/framework/luafunctions.cpp @@ -63,6 +63,9 @@ #include +#include "net/inputmessage.h" +#include "net/outputmessage.h" + void Application::registerLuaFunctions() { // conversion globals diff --git a/src/framework/net/connection.cpp b/src/framework/net/connection.cpp index ed074ba213..b62bdad498 100644 --- a/src/framework/net/connection.cpp +++ b/src/framework/net/connection.cpp @@ -24,11 +24,14 @@ #include "connection.h" #include +#include "framework/core/graphicalapplication.h" #include #include #include +#include + asio::io_service g_ioService; std::list> Connection::m_outputStreams; diff --git a/src/framework/net/declarations.h b/src/framework/net/declarations.h index fe92c39135..3ed3236729 100644 --- a/src/framework/net/declarations.h +++ b/src/framework/net/declarations.h @@ -22,10 +22,8 @@ #pragma once -#include #include #include -#include class InputMessage; class OutputMessage; diff --git a/src/framework/net/httplogin.cpp b/src/framework/net/httplogin.cpp index 9827e3d60b..585513c124 100644 --- a/src/framework/net/httplogin.cpp +++ b/src/framework/net/httplogin.cpp @@ -24,7 +24,6 @@ #include #include -#include #include #include #include diff --git a/src/framework/net/protocol.cpp b/src/framework/net/protocol.cpp index 0dde79248c..f27dcc7c1a 100644 --- a/src/framework/net/protocol.cpp +++ b/src/framework/net/protocol.cpp @@ -24,6 +24,10 @@ #include #include #include + +#include "inputmessage.h" +#include "outputmessage.h" +#include "framework/core/graphicalapplication.h" #ifdef __EMSCRIPTEN__ #include "webconnection.h" #else diff --git a/src/framework/net/protocol.h b/src/framework/net/protocol.h index de33689628..6058ef633b 100644 --- a/src/framework/net/protocol.h +++ b/src/framework/net/protocol.h @@ -27,8 +27,6 @@ #include "connection.h" #endif #include "declarations.h" -#include "inputmessage.h" -#include "outputmessage.h" #include #include diff --git a/src/framework/net/protocolhttp.h b/src/framework/net/protocolhttp.h index 6a0d716291..4b6dbc3071 100644 --- a/src/framework/net/protocolhttp.h +++ b/src/framework/net/protocolhttp.h @@ -30,7 +30,6 @@ #include #include -#include #include // result diff --git a/src/framework/net/server.cpp b/src/framework/net/server.cpp index 85044d877b..5cd7d9a642 100644 --- a/src/framework/net/server.cpp +++ b/src/framework/net/server.cpp @@ -24,6 +24,7 @@ #include "server.h" #include "connection.h" +#include extern asio::io_service g_ioService; diff --git a/src/framework/otml/otmlnode.cpp b/src/framework/otml/otmlnode.cpp index dd945c8ae9..c297140509 100644 --- a/src/framework/otml/otmlnode.cpp +++ b/src/framework/otml/otmlnode.cpp @@ -23,7 +23,6 @@ #include "otmlnode.h" #include "otmlemitter.h" -#include OTMLNodePtr OTMLNode::create(const std::string_view tag, const bool unique) { diff --git a/src/framework/platform/platform.h b/src/framework/platform/platform.h index dd1d02eaf2..7777580c37 100644 --- a/src/framework/platform/platform.h +++ b/src/framework/platform/platform.h @@ -23,7 +23,6 @@ #pragma once #include -#include #include #include #include diff --git a/src/framework/platform/win32crashhandler.cpp b/src/framework/platform/win32crashhandler.cpp index b1f07ad28b..ab241949f2 100644 --- a/src/framework/platform/win32crashhandler.cpp +++ b/src/framework/platform/win32crashhandler.cpp @@ -42,6 +42,8 @@ #endif +#include + const char* getExceptionName(const DWORD exceptionCode) { switch (exceptionCode) { diff --git a/src/framework/proxy/proxy_client.cpp b/src/framework/proxy/proxy_client.cpp index 0da17cf6ea..a057283ba7 100644 --- a/src/framework/proxy/proxy_client.cpp +++ b/src/framework/proxy/proxy_client.cpp @@ -178,7 +178,7 @@ void Proxy::ping() send(packet); } -void Proxy::onPing(uint32_t packetId) +void Proxy::onPing(uint32_t /*packetId*/) { if (m_state == STATE_CONNECTING_WAIT_FOR_PING) { m_state = STATE_CONNECTED; @@ -421,7 +421,7 @@ void Session::selectProxies() candidate_proxy->send(packet.second); } } - if (static_cast(m_proxies.size()) > m_maxConnections) { + if (m_proxies.size() > m_maxConnections) { #ifdef PROXY_DEBUG std::clog << "[Session " << m_id << "] remove proxy: " << worst_ping->getHost() << std::endl; #endif @@ -496,7 +496,7 @@ void Session::readHeader() }); } -void Session::onHeader(const std::error_code& ec, std::size_t bytes_transferred) +void Session::onHeader(const std::error_code& ec, std::size_t /*bytes_transferred*/) { if (ec) { #ifdef PROXY_DEBUG @@ -565,7 +565,7 @@ void Session::onPacket(const ProxyPacketPtr& packet) }); } -void Session::onSent(const std::error_code& ec, std::size_t bytes_transferred) +void Session::onSent(const std::error_code& ec, std::size_t /*bytes_transferred*/) { if (ec) { #ifdef PROXY_DEBUG diff --git a/src/framework/proxy/proxy_client.h b/src/framework/proxy/proxy_client.h index d42ecb2f8b..29af6cb4fb 100644 --- a/src/framework/proxy/proxy_client.h +++ b/src/framework/proxy/proxy_client.h @@ -176,7 +176,7 @@ class Session : public std::enable_shared_from_this std::set m_proxies; - int m_maxConnections; + size_t m_maxConnections; uint8_t m_buffer[BUFFER_SIZE]; std::map m_sendQueue; diff --git a/src/framework/sound/soundeffect.cpp b/src/framework/sound/soundeffect.cpp index f8f57c551d..18f5825495 100644 --- a/src/framework/sound/soundeffect.cpp +++ b/src/framework/sound/soundeffect.cpp @@ -21,13 +21,8 @@ */ #include "soundeffect.h" -#include "declarations.h" -#include "soundbuffer.h" #include "soundfile.h" #include "soundmanager.h" -#include "soundsource.h" - -#include "framework/stdext/time.h" #include #include diff --git a/src/framework/sound/soundeffect.h b/src/framework/sound/soundeffect.h index 07cebbfaf8..c0930cd901 100644 --- a/src/framework/sound/soundeffect.h +++ b/src/framework/sound/soundeffect.h @@ -22,8 +22,9 @@ #ifndef SOUNDEFFECT_H #define SOUNDEFFECT_H -#include "declarations.h" #include +#include +#include class SoundEffect final : public LuaObject { diff --git a/src/framework/sound/soundfile.cpp b/src/framework/sound/soundfile.cpp index 2c3cfb4cff..ea792786d7 100644 --- a/src/framework/sound/soundfile.cpp +++ b/src/framework/sound/soundfile.cpp @@ -24,8 +24,6 @@ #include "oggsoundfile.h" #include -#include "framework/stdext/time.h" - SoundFilePtr SoundFile::loadSoundFile(const std::string& filename) { const auto& file = g_resources.openFile(filename); diff --git a/src/framework/sound/soundmanager.cpp b/src/framework/sound/soundmanager.cpp index e94a92acbf..1535878163 100644 --- a/src/framework/sound/soundmanager.cpp +++ b/src/framework/sound/soundmanager.cpp @@ -21,18 +21,19 @@ */ #include "soundmanager.h" -#include "combinedsoundsource.h" #include "soundbuffer.h" #include "soundeffect.h" #include "soundfile.h" #include "streamsoundsource.h" +#include "combinedsoundsource.h" #include #include #include -#include #include +#include "soundchannel.h" + class StreamSoundSource; class CombinedSoundSource; class SoundFile; diff --git a/src/framework/sound/soundmanager.h b/src/framework/sound/soundmanager.h index 30eb949b1f..b08a5ea4ad 100644 --- a/src/framework/sound/soundmanager.h +++ b/src/framework/sound/soundmanager.h @@ -23,7 +23,6 @@ #pragma once #include "declarations.h" -#include "soundchannel.h" #include "soundsource.h" #include #include diff --git a/src/framework/stdext/math.cpp b/src/framework/stdext/math.cpp index c4e84aff32..6f5da884c5 100644 --- a/src/framework/stdext/math.cpp +++ b/src/framework/stdext/math.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #ifdef _MSC_VER diff --git a/src/framework/stdext/math.h b/src/framework/stdext/math.h index 9fdbebcf50..8954b9ac66 100644 --- a/src/framework/stdext/math.h +++ b/src/framework/stdext/math.h @@ -22,8 +22,6 @@ #pragma once -#include "types.h" - #include namespace stdext diff --git a/src/framework/stdext/string.h b/src/framework/stdext/string.h index 21a649d2ae..1cca5d1f22 100644 --- a/src/framework/stdext/string.h +++ b/src/framework/stdext/string.h @@ -26,7 +26,6 @@ #include #include "cast.h" -#include "types.h" namespace stdext { diff --git a/src/framework/stdext/thread.h b/src/framework/stdext/thread.h index 92cfc4d74e..3a66503a96 100644 --- a/src/framework/stdext/thread.h +++ b/src/framework/stdext/thread.h @@ -22,7 +22,6 @@ #pragma once -#include "types.h" #include namespace stdext diff --git a/src/framework/stdext/time.cpp b/src/framework/stdext/time.cpp index f9d042232c..7031d47593 100644 --- a/src/framework/stdext/time.cpp +++ b/src/framework/stdext/time.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include "types.h" diff --git a/src/framework/ui/uimanager.cpp b/src/framework/ui/uimanager.cpp index 6ad7c0374e..8afcd6557f 100644 --- a/src/framework/ui/uimanager.cpp +++ b/src/framework/ui/uimanager.cpp @@ -23,7 +23,6 @@ #include "uimanager.h" #include "ui.h" -#include #include #include #include @@ -31,7 +30,7 @@ #include #include -#include +#include "framework/graphics/graphics.h" UIManager g_ui; diff --git a/src/framework/ui/uiqrcode.h b/src/framework/ui/uiqrcode.h index ec230e405b..b51117859a 100644 --- a/src/framework/ui/uiqrcode.h +++ b/src/framework/ui/uiqrcode.h @@ -22,8 +22,6 @@ #pragma once -#include "declarations.h" - #include "uiwidget.h" // @bindclass diff --git a/src/framework/ui/uitextedit.cpp b/src/framework/ui/uitextedit.cpp index af0d4e2312..ecadb59e4c 100644 --- a/src/framework/ui/uitextedit.cpp +++ b/src/framework/ui/uitextedit.cpp @@ -21,7 +21,6 @@ */ #include "uitextedit.h" -#include #include #include #include diff --git a/src/framework/ui/uiwidget.cpp b/src/framework/ui/uiwidget.cpp index ea6a00b859..4362854e87 100644 --- a/src/framework/ui/uiwidget.cpp +++ b/src/framework/ui/uiwidget.cpp @@ -25,7 +25,6 @@ #include "uimanager.h" #include "uitranslator.h" -#include #include #include #include @@ -37,7 +36,6 @@ #include "framework/graphics/drawpoolmanager.h" #include "framework/graphics/shadermanager.h" -#include UIWidget::UIWidget() { diff --git a/src/framework/ui/uiwidgetbasestyle.cpp b/src/framework/ui/uiwidgetbasestyle.cpp index 6ffcb22cf6..130ad6ba1e 100644 --- a/src/framework/ui/uiwidgetbasestyle.cpp +++ b/src/framework/ui/uiwidgetbasestyle.cpp @@ -28,7 +28,6 @@ #include "uiwidget.h" #include -#include #include #include diff --git a/src/framework/ui/uiwidgetimage.cpp b/src/framework/ui/uiwidgetimage.cpp index d2d575ee83..9817e0f602 100644 --- a/src/framework/ui/uiwidgetimage.cpp +++ b/src/framework/ui/uiwidgetimage.cpp @@ -22,10 +22,7 @@ #include "framework/graphics/drawpoolmanager.h" #include "uiwidget.h" -#include #include -#include -#include #include #include #include diff --git a/src/framework/ui/uiwidgettext.cpp b/src/framework/ui/uiwidgettext.cpp index 0a19d17472..a6508ace0c 100644 --- a/src/framework/ui/uiwidgettext.cpp +++ b/src/framework/ui/uiwidgettext.cpp @@ -22,7 +22,6 @@ #include "uitranslator.h" #include "uiwidget.h" -#include #include #include #include diff --git a/src/framework/util/color.cpp b/src/framework/util/color.cpp index d16ba78278..1eae24b6d5 100644 --- a/src/framework/util/color.cpp +++ b/src/framework/util/color.cpp @@ -24,6 +24,8 @@ #include #include +#include "framework/stdext/string.h" + // NOTE: AABBGGRR order const Color Color::alpha = 0x00000000U; const Color Color::white = 0xffffffffU; diff --git a/src/framework/util/color.h b/src/framework/util/color.h index c866c8d4a1..3127e4fd55 100644 --- a/src/framework/util/color.h +++ b/src/framework/util/color.h @@ -23,7 +23,6 @@ #pragma once #include "../stdext/cast.h" -#include "../stdext/string.h" #include "../stdext/types.h" class Color diff --git a/src/framework/util/crypt.cpp b/src/framework/util/crypt.cpp index 3aded63600..9edbef1e52 100644 --- a/src/framework/util/crypt.cpp +++ b/src/framework/util/crypt.cpp @@ -36,6 +36,8 @@ #include +#include "framework/core/graphicalapplication.h" + static constexpr std::string_view base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static inline bool is_base64(const uint8_t c) { return (isalnum(c) || (c == '+') || (c == '/')); } diff --git a/src/framework/util/point.h b/src/framework/util/point.h index 3b7d20de6d..4869d0489a 100644 --- a/src/framework/util/point.h +++ b/src/framework/util/point.h @@ -22,8 +22,6 @@ #pragma once -#include "../stdext/types.h" -#include #include #include diff --git a/src/main.cpp b/src/main.cpp index 8f8d2b1f7d..1c2908208e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include