diff --git a/Source/DiabloUI/art.cpp b/Source/DiabloUI/art.cpp index 3dad2117c..64b048e57 100644 --- a/Source/DiabloUI/art.cpp +++ b/Source/DiabloUI/art.cpp @@ -7,9 +7,9 @@ #include "engine/assets.hpp" #include "utils/display.h" #include "utils/log.hpp" +#include "utils/pcx.hpp" #include "utils/sdl_compat.h" #include "utils/sdl_wrap.h" -#include "utils/pcx.hpp" namespace devilution { namespace { diff --git a/Source/DiabloUI/art_draw.cpp b/Source/DiabloUI/art_draw.cpp index 3486e1619..a439eb89f 100644 --- a/Source/DiabloUI/art_draw.cpp +++ b/Source/DiabloUI/art_draw.cpp @@ -1,9 +1,9 @@ #include "DiabloUI/art_draw.h" #include "DiabloUI/diabloui.h" +#include "palette.h" #include "utils/display.h" #include "utils/sdl_compat.h" -#include "palette.h" namespace devilution { diff --git a/Source/DiabloUI/button.cpp b/Source/DiabloUI/button.cpp index 55c598785..847499c93 100644 --- a/Source/DiabloUI/button.cpp +++ b/Source/DiabloUI/button.cpp @@ -1,5 +1,5 @@ -#include "DiabloUI/art_draw.h" #include "DiabloUI/button.h" +#include "DiabloUI/art_draw.h" #include "DiabloUI/diabloui.h" #include "DiabloUI/errorart.h" #include "engine/render/text_render.hpp" diff --git a/Source/DiabloUI/diabloui.cpp b/Source/DiabloUI/diabloui.cpp index 00edc5a6e..d690bb0cd 100644 --- a/Source/DiabloUI/diabloui.cpp +++ b/Source/DiabloUI/diabloui.cpp @@ -3,9 +3,9 @@ #include #include #ifdef USE_SDL1 +#include #include #include -#include #endif #include "DiabloUI/art_draw.h" diff --git a/Source/DiabloUI/diabloui.h b/Source/DiabloUI/diabloui.h index 7f7d0430b..0e0d19538 100644 --- a/Source/DiabloUI/diabloui.h +++ b/Source/DiabloUI/diabloui.h @@ -1,9 +1,9 @@ #pragma once -#include +#include #include #include -#include +#include #include "DiabloUI/art.h" #include "DiabloUI/ui_item.h" diff --git a/Source/DiabloUI/mainmenu.cpp b/Source/DiabloUI/mainmenu.cpp index ca9398b4c..88001e8f1 100644 --- a/Source/DiabloUI/mainmenu.cpp +++ b/Source/DiabloUI/mainmenu.cpp @@ -1,12 +1,12 @@ -#include "control.h" #include "DiabloUI/diabloui.h" #include "DiabloUI/selok.h" +#include "control.h" #include "utils/language.h" namespace devilution { namespace { -int mainmenu_attract_time_out; //seconds +int mainmenu_attract_time_out; // seconds uint32_t dwAttractTicks; std::vector> vecMainMenuDialog; diff --git a/Source/DiabloUI/selok.cpp b/Source/DiabloUI/selok.cpp index e5444ecfe..ca27d9b27 100644 --- a/Source/DiabloUI/selok.cpp +++ b/Source/DiabloUI/selok.cpp @@ -2,8 +2,8 @@ #include "DiabloUI/diabloui.h" #include "control.h" -#include "utils/language.h" #include "engine/render/text_render.hpp" +#include "utils/language.h" namespace devilution { diff --git a/Source/DiabloUI/selstart.cpp b/Source/DiabloUI/selstart.cpp index 8c821425c..f9615c51f 100644 --- a/Source/DiabloUI/selstart.cpp +++ b/Source/DiabloUI/selstart.cpp @@ -1,7 +1,7 @@ #include "selstart.h" -#include "control.h" #include "DiabloUI/diabloui.h" +#include "control.h" #include "options.h" #include "utils/language.h" diff --git a/Source/DiabloUI/ui_item.h b/Source/DiabloUI/ui_item.h index 2df1d040f..c1f98f6d6 100644 --- a/Source/DiabloUI/ui_item.h +++ b/Source/DiabloUI/ui_item.h @@ -105,7 +105,7 @@ public: m_iFlags &= ~flag; } - //protected: + // protected: UiType m_type; SDL_Rect m_rect; UiFlags m_iFlags; @@ -125,7 +125,7 @@ public: ~UiImage() {}; - //private: + // private: Art *m_art; bool m_animated; int m_frame; @@ -201,7 +201,7 @@ public: { } - //private: + // private: Art *m_bg; Art *m_thumb; Art *m_arrow; @@ -218,7 +218,7 @@ public: { } - //private: + // private: const char *m_text; void (*m_action)(); }; @@ -236,7 +236,7 @@ public: { } - //private: + // private: const char *m_hint; char *m_value; std::size_t m_max_length; @@ -255,7 +255,7 @@ public: { } - //private: + // private: const char *m_text; }; @@ -279,7 +279,7 @@ public: PRESSED, }; - //private: + // private: Art *m_art; const char *m_text; @@ -302,7 +302,7 @@ public: ~UiListItem() {}; - //private: + // private: const char *m_text; int m_value; UiFlags uiFlags; @@ -355,7 +355,7 @@ public: return m_spacing; } - //private: + // private: Sint16 m_x, m_y; Uint16 m_width, m_height; std::vector m_vecItems; diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 736bf04a3..27e1db007 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -9,8 +9,8 @@ #include #include "diablo.h" -#include "storm/storm_net.hpp" #include "multi.h" +#include "storm/storm_net.hpp" #include "utils/language.h" #include "utils/sdl_thread.h" #include "utils/ui_fwd.h" diff --git a/Source/control.h b/Source/control.h index 009bb0b95..ec54cca07 100644 --- a/Source/control.h +++ b/Source/control.h @@ -133,7 +133,7 @@ void DoSpeedBook(); /** * Clears panel button flags. -*/ + */ void ClearPanBtn(); /** diff --git a/Source/controls/devices/game_controller.cpp b/Source/controls/devices/game_controller.cpp index ebe5a5bc2..3a4e5813d 100644 --- a/Source/controls/devices/game_controller.cpp +++ b/Source/controls/devices/game_controller.cpp @@ -7,8 +7,8 @@ #include "controls/controller_motion.h" #include "controls/devices/joystick.h" #include "utils/log.hpp" -#include "utils/sdl_ptrs.h" #include "utils/sdl2_backports.h" +#include "utils/sdl_ptrs.h" #include "utils/stubs.h" namespace devilution { diff --git a/Source/controls/devices/joystick.h b/Source/controls/devices/joystick.h index dc895c7a1..43038f359 100644 --- a/Source/controls/devices/joystick.h +++ b/Source/controls/devices/joystick.h @@ -9,8 +9,8 @@ #include "utils/sdl2_to_1_2_backports.h" #endif -#include "controls/controller_buttons.h" #include "controls/controller.h" +#include "controls/controller_buttons.h" namespace devilution { diff --git a/Source/controls/devices/kbcontroller.h b/Source/controls/devices/kbcontroller.h index 622bf0845..c7cdab1d4 100644 --- a/Source/controls/devices/kbcontroller.h +++ b/Source/controls/devices/kbcontroller.h @@ -6,8 +6,8 @@ #endif #if HAS_KBCTRL == 1 -#include #include "controls/controller_buttons.h" +#include namespace devilution { diff --git a/Source/controls/game_controls.cpp b/Source/controls/game_controls.cpp index 300f74ba1..313be2ca6 100644 --- a/Source/controls/game_controls.cpp +++ b/Source/controls/game_controls.cpp @@ -277,7 +277,7 @@ bool GetGameAction(const SDL_Event &event, ControllerButtonEvent ctrlEvent, Game CalcViewportGeometry(); } #else - // Not mapped. Reserved for future use. + /* Not mapped. Reserved for future use. */ #endif return true; case ControllerButton_BUTTON_B: // Right button diff --git a/Source/controls/game_controls.h b/Source/controls/game_controls.h index cf9d3d8f1..3d22e15cc 100644 --- a/Source/controls/game_controls.h +++ b/Source/controls/game_controls.h @@ -1,10 +1,10 @@ #pragma once -#include #include +#include -#include "controls/controller.h" #include "./axis_direction.h" +#include "controls/controller.h" namespace devilution { diff --git a/Source/controls/keymapper.hpp b/Source/controls/keymapper.hpp index 758228f44..8d1ae17ae 100644 --- a/Source/controls/keymapper.hpp +++ b/Source/controls/keymapper.hpp @@ -1,10 +1,10 @@ #pragma once #include -#include #include -#include +#include #include +#include namespace devilution { diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 8fff16a27..6bfada540 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -647,7 +647,7 @@ Size GetItemSizeOnSlot(int slot) /** * Search for the first slot occupied by an item in the inventory. -*/ + */ int FindFirstSlotOnItem(int8_t itemInvId) { if (itemInvId == 0) diff --git a/Source/controls/touch/renderers.cpp b/Source/controls/touch/renderers.cpp index b0ab95e8a..9f2119af9 100644 --- a/Source/controls/touch/renderers.cpp +++ b/Source/controls/touch/renderers.cpp @@ -1,5 +1,5 @@ -#include "control.h" #include "controls/touch/renderers.h" +#include "control.h" #include "cursor.h" #include "diablo.h" #include "doom.h" diff --git a/Source/dead.h b/Source/dead.h index 839e95593..123c1efb1 100644 --- a/Source/dead.h +++ b/Source/dead.h @@ -8,8 +8,8 @@ #include #include -#include "engine/point.hpp" #include "engine.h" +#include "engine/point.hpp" namespace devilution { diff --git a/Source/debug.cpp b/Source/debug.cpp index 20d678749..b17267c9b 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -20,11 +20,11 @@ #include "lighting.h" #include "monstdat.h" #include "monster.h" +#include "quests.h" #include "setmaps.h" #include "spells.h" #include "towners.h" #include "utils/language.h" -#include "quests.h" namespace devilution { @@ -57,7 +57,7 @@ enum class DebugGridTextItem : uint16_t { cursorcoords, objectindex, - //take dPiece as index + // take dPiece as index nBlockTable, nSolidTable, nTransTable, diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index a9c6d6ada..e632a8e4c 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -11,11 +11,11 @@ #include "diablo.h" #include "engine/load_file.hpp" #include "engine/random.hpp" +#include "engine/size.hpp" #include "gendung.h" #include "player.h" #include "quests.h" #include "setmaps.h" -#include "engine/size.hpp" namespace devilution { @@ -37,7 +37,7 @@ int Room_Min = 4; const int DirXadd[5] = { 0, 0, 1, 0, -1 }; const int DirYadd[5] = { 0, -1, 0, 1, 0 }; const ShadowStruct SPATSL2[2] = { { 6, 3, 0, 3, 48, 0, 50 }, { 9, 3, 0, 3, 48, 0, 50 } }; -//short word_48489A = 0; +// short word_48489A = 0; const BYTE BTYPESL2[161] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 17, 18, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; const BYTE BSTYPESL2[161] = { 0, 1, 2, 3, 0, 0, 6, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 6, 6, 6, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 2, 2, 0, 0, 0, 1, 1, 1, 1, 6, 2, 2, 2, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 2, 2, 3, 3, 3, 3, 1, 1, 2, 2, 3, 3, 3, 3, 1, 1, 3, 3, 2, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; diff --git a/Source/drlg_l4.cpp b/Source/drlg_l4.cpp index 9d02afd85..e31d9c00b 100644 --- a/Source/drlg_l4.cpp +++ b/Source/drlg_l4.cpp @@ -34,7 +34,7 @@ int SP4x2; int SP4y2; BYTE L4dungeon[80][80]; BYTE dung[20][20]; -//int dword_52A4DC; +// int dword_52A4DC; /** * A lookup table for the 16 possible patterns of a 2x2 area, diff --git a/Source/dthread.h b/Source/dthread.h index ec812f26b..a228dd763 100644 --- a/Source/dthread.h +++ b/Source/dthread.h @@ -6,6 +6,7 @@ #pragma once #include + #include "utils/stdcompat/cstddef.hpp" namespace devilution { diff --git a/Source/dvlnet/base_protocol.h b/Source/dvlnet/base_protocol.h index af0673817..d595dd64f 100644 --- a/Source/dvlnet/base_protocol.h +++ b/Source/dvlnet/base_protocol.h @@ -1,9 +1,9 @@ #pragma once -#include -#include #include #include +#include +#include #include "dvlnet/base.h" #include "dvlnet/packet.h" @@ -209,7 +209,7 @@ void base_protocol

::handle_join_request(packet &pkt, endpoint sender) } } if (i >= MAX_PLRS) { - //already full + // already full return; } for (plr_t j = 0; j < MAX_PLRS; ++j) { @@ -268,7 +268,7 @@ void base_protocol

::recv_ingame(packet &pkt, endpoint sender) connected_table[pkt.Source()] = true; peers[pkt.Source()] = sender; if (pkt.Destination() != plr_self && pkt.Destination() != PLR_BROADCAST) - return; //packet not for us, drop + return; // packet not for us, drop RecvLocal(pkt); } diff --git a/Source/dvlnet/frame_queue.h b/Source/dvlnet/frame_queue.h index df4002511..e2673fa41 100644 --- a/Source/dvlnet/frame_queue.h +++ b/Source/dvlnet/frame_queue.h @@ -1,9 +1,9 @@ #pragma once +#include #include #include #include -#include namespace devilution { namespace net { diff --git a/Source/dvlnet/packet.h b/Source/dvlnet/packet.h index 0aec0f0a7..84afd8ec5 100644 --- a/Source/dvlnet/packet.h +++ b/Source/dvlnet/packet.h @@ -1,10 +1,11 @@ #pragma once -#include -#include -#include #include +#include #include +#include +#include + #ifdef PACKET_ENCRYPTION #include #endif diff --git a/Source/dvlnet/protocol_zt.h b/Source/dvlnet/protocol_zt.h index b316246a7..b39dca978 100644 --- a/Source/dvlnet/protocol_zt.h +++ b/Source/dvlnet/protocol_zt.h @@ -1,13 +1,13 @@ #pragma once -#include -#include +#include +#include #include #include -#include #include -#include -#include +#include +#include +#include #include "dvlnet/frame_queue.h" diff --git a/Source/dvlnet/tcp_client.h b/Source/dvlnet/tcp_client.h index 35b9df0db..c358ec7ca 100644 --- a/Source/dvlnet/tcp_client.h +++ b/Source/dvlnet/tcp_client.h @@ -1,15 +1,16 @@ #pragma once -#include #include +#include + #include #include #include #include -#include "dvlnet/packet.h" -#include "dvlnet/frame_queue.h" #include "dvlnet/base.h" +#include "dvlnet/frame_queue.h" +#include "dvlnet/packet.h" #include "dvlnet/tcp_server.h" namespace devilution { diff --git a/Source/dvlnet/tcp_server.h b/Source/dvlnet/tcp_server.h index f37103c69..4bc1080c1 100644 --- a/Source/dvlnet/tcp_server.h +++ b/Source/dvlnet/tcp_server.h @@ -1,16 +1,17 @@ #pragma once -#include -#include #include +#include +#include + #include #include #include #include -#include "dvlnet/packet.h" #include "dvlnet/abstract_net.h" #include "dvlnet/frame_queue.h" +#include "dvlnet/packet.h" #include "multi.h" namespace devilution { @@ -76,5 +77,5 @@ private: void DropConnection(const scc &con); }; -} //namespace net -} //namespace devilution +} // namespace net +} // namespace devilution diff --git a/Source/dvlnet/zerotier_lwip.h b/Source/dvlnet/zerotier_lwip.h index d5361164b..81e75264c 100644 --- a/Source/dvlnet/zerotier_lwip.h +++ b/Source/dvlnet/zerotier_lwip.h @@ -1,3 +1,5 @@ +#pragma once + namespace devilution { namespace net { diff --git a/Source/dvlnet/zerotier_native.cpp b/Source/dvlnet/zerotier_native.cpp index ed0958c9e..80f121340 100644 --- a/Source/dvlnet/zerotier_native.cpp +++ b/Source/dvlnet/zerotier_native.cpp @@ -20,7 +20,7 @@ namespace devilution { namespace net { -//static constexpr uint64_t zt_earth = 0x8056c2e21c000001; +// static constexpr uint64_t zt_earth = 0x8056c2e21c000001; static constexpr uint64_t ZtNetwork = 0xa84ac5c10a7ebb5f; static std::atomic_bool zt_network_ready(false); @@ -29,7 +29,7 @@ static std::atomic_bool zt_joined(false); static void Callback(struct zts_callback_msg *msg) { - //printf("callback %i\n", msg->eventCode); + // printf("callback %i\n", msg->eventCode); if (msg->eventCode == ZTS_EVENT_NODE_ONLINE) { Log("ZeroTier: ZTS_EVENT_NODE_ONLINE, nodeId={:x}", (unsigned long long)msg->node->address); zt_node_online = true; diff --git a/Source/dx.cpp b/Source/dx.cpp index d498e24ec..446e55082 100644 --- a/Source/dx.cpp +++ b/Source/dx.cpp @@ -308,7 +308,7 @@ void RenderPresent() #ifndef USE_SDL1 if (renderer != nullptr) { - if (SDL_UpdateTexture(texture.get(), nullptr, surface->pixels, surface->pitch) <= -1) { //pitch is 2560 + if (SDL_UpdateTexture(texture.get(), nullptr, surface->pixels, surface->pitch) <= -1) { // pitch is 2560 ErrSdl(); } diff --git a/Source/encrypt.cpp b/Source/encrypt.cpp index 013c08fb3..dc550218c 100644 --- a/Source/encrypt.cpp +++ b/Source/encrypt.cpp @@ -4,9 +4,9 @@ * Implementation of functions for compression and decompressing MPQ data. */ #include +#include #include #include -#include #include "encrypt.h" #include "pkware.h" diff --git a/Source/engine/animationinfo.h b/Source/engine/animationinfo.h index 2dcd5cefb..b1f5ea288 100644 --- a/Source/engine/animationinfo.h +++ b/Source/engine/animationinfo.h @@ -69,7 +69,7 @@ public: /** * @brief Calculates the progress of the current animation as a fraction (0.0f to 1.0f) - */ + */ float GetAnimationProgress() const; /** diff --git a/Source/engine/demomode.cpp b/Source/engine/demomode.cpp index 36a50c22a..bb8b1e73b 100644 --- a/Source/engine/demomode.cpp +++ b/Source/engine/demomode.cpp @@ -6,16 +6,16 @@ #include #include -#include #include +#include #include "demomode.h" -#include "utils/display.h" -#include "utils/paths.h" #include "menu.h" -#include "options.h" #include "nthread.h" +#include "options.h" #include "pfile.h" +#include "utils/display.h" +#include "utils/paths.h" namespace devilution { diff --git a/Source/engine/direction.hpp b/Source/engine/direction.hpp index 80fa71e14..ea01953e0 100644 --- a/Source/engine/direction.hpp +++ b/Source/engine/direction.hpp @@ -19,21 +19,21 @@ enum class Direction : std::uint8_t { /** Maps from direction to a left turn from the direction. */ constexpr Direction Left(Direction facing) { - //Direction left[8] = { Direction::SouthEast, Direction::South, Direction::SouthWest, Direction::West, Direction::NorthWest, Direction::North, Direction::NorthEast, Direction::East }; + // Direction left[8] = { Direction::SouthEast, Direction::South, Direction::SouthWest, Direction::West, Direction::NorthWest, Direction::North, Direction::NorthEast, Direction::East }; return static_cast((static_cast>(facing) + 7) % 8); } /** Maps from direction to a right turn from the direction. */ constexpr Direction Right(Direction facing) { - //Direction right[8] = { Direction::SouthWest, Direction::West, Direction::NorthWest, Direction::North, Direction::NorthEast, Direction::East, Direction::SouthEast, Direction::South }; + // Direction right[8] = { Direction::SouthWest, Direction::West, Direction::NorthWest, Direction::North, Direction::NorthEast, Direction::East, Direction::SouthEast, Direction::South }; return static_cast((static_cast>(facing) + 1) % 8); } /** Maps from direction to the opposite direction. */ constexpr Direction Opposite(Direction facing) { - //Direction opposite[8] = { Direction::North, Direction::NorthEast, Direction::East, Direction::SouthEast, Direction::South, Direction::SouthWest, Direction::West, Direction::NorthWest }; + // Direction opposite[8] = { Direction::North, Direction::NorthEast, Direction::East, Direction::SouthEast, Direction::South, Direction::SouthWest, Direction::West, Direction::NorthWest }; return static_cast((static_cast>(facing) + 4) % 8); } diff --git a/Source/engine/point.hpp b/Source/engine/point.hpp index 234606b9b..47facd2cc 100644 --- a/Source/engine/point.hpp +++ b/Source/engine/point.hpp @@ -125,10 +125,10 @@ struct Point { * In practice it is likely that ApproxDistance gives the same result, especially for nearby points. * @param other Point to which we want the distance * @return Exact magnitude of vector this -> other - */ + */ int ExactDistance(Point other) const { - auto vector = *this - other; //No need to call abs() as we square the values anyway + auto vector = *this - other; // No need to call abs() as we square the values anyway // Casting multiplication operands to a wide type to address overflow warnings return static_cast(std::sqrt(static_cast(vector.deltaX) * vector.deltaX + static_cast(vector.deltaY) * vector.deltaY)); @@ -159,7 +159,7 @@ struct Point { * @param stream output stream, expected to have overloads for int and char* * @param point Object to display * @return the stream, to allow chaining - */ + */ friend std::ostream &operator<<(std::ostream &stream, const Point &point) { return stream << "(x: " << point.x << ", y: " << point.y << ")"; diff --git a/Source/engine/render/cel_render.hpp b/Source/engine/render/cel_render.hpp index a4b1966f5..1c2deb40e 100644 --- a/Source/engine/render/cel_render.hpp +++ b/Source/engine/render/cel_render.hpp @@ -8,9 +8,9 @@ #include #include "engine.h" -#include "items.h" #include "engine/cel_sprite.hpp" #include "engine/point.hpp" +#include "items.h" namespace devilution { diff --git a/Source/engine/render/common_impl.h b/Source/engine/render/common_impl.h index 8b5763efe..d5b20c6c6 100644 --- a/Source/engine/render/common_impl.h +++ b/Source/engine/render/common_impl.h @@ -5,8 +5,8 @@ */ #pragma once -#include #include +#include #include "engine.h" #include "lighting.h" diff --git a/Source/engine/surface.hpp b/Source/engine/surface.hpp index cdcd28bbb..b2943b89e 100644 --- a/Source/engine/surface.hpp +++ b/Source/engine/surface.hpp @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #include @@ -9,8 +9,8 @@ #include #include #else -#include #include "utils/sdl2_to_1_2_backports.h" +#include #endif #include "engine/point.hpp" diff --git a/Source/init.cpp b/Source/init.cpp index fa233295d..a3e4166bf 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -14,10 +14,10 @@ #include "DiabloUI/diabloui.h" #include "dx.h" -#include "options.h" -#include "pfile.h" #include "engine/assets.hpp" #include "mpq/mpq_reader.hpp" +#include "options.h" +#include "pfile.h" #include "utils/language.h" #include "utils/log.hpp" #include "utils/paths.h" diff --git a/Source/inv.cpp b/Source/inv.cpp index e69846342..f541461d9 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -1207,22 +1207,22 @@ void DrawInv(const Surface &out) CelDrawTo(out, GetPanelPosition(UiPanels::Inventory, { 0, 351 }), *pInvCels, 1); Size slotSize[] = { - { 2, 2 }, //head - { 1, 1 }, //left ring - { 1, 1 }, //right ring - { 1, 1 }, //amulet - { 2, 3 }, //left hand - { 2, 3 }, //right hand + { 2, 2 }, // head + { 1, 1 }, // left ring + { 1, 1 }, // right ring + { 1, 1 }, // amulet + { 2, 3 }, // left hand + { 2, 3 }, // right hand { 2, 3 }, // chest }; Point slotPos[] = { - { 133, 59 }, //head - { 48, 205 }, //left ring - { 249, 205 }, //right ring - { 205, 60 }, //amulet - { 17, 160 }, //left hand - { 248, 160 }, //right hand + { 133, 59 }, // head + { 48, 205 }, // left ring + { 249, 205 }, // right ring + { 205, 60 }, // amulet + { 17, 160 }, // left hand + { 248, 160 }, // right hand { 133, 160 }, // chest }; @@ -2084,7 +2084,7 @@ bool UseInvItem(int pnum, int cii) item = &player.SpdList[c]; speedlist = true; - //If selected speedlist item exists in InvList, use the InvList item. + // If selected speedlist item exists in InvList, use the InvList item. for (int i = 0; i < player._pNumInv && sgOptions.Gameplay.bAutoRefillBelt; i++) { if (player.InvList[i]._iMiscId == item->_iMiscId && player.InvList[i]._iSpell == item->_iSpell) { c = i; diff --git a/Source/inv.h b/Source/inv.h index 5bb3a2cbe..3776e3a0e 100644 --- a/Source/inv.h +++ b/Source/inv.h @@ -168,7 +168,7 @@ void AutoGetItem(int pnum, Item *item, int ii); * @param idx The overarching type of the target item * @param createInfo Flags used to describe the specific subtype of the target item * @return An index into ActiveItems or -1 if no matching item was found -*/ + */ int FindGetItem(int32_t iseed, _item_indexes idx, uint16_t ci); void SyncGetItem(Point position, int32_t iseed, _item_indexes idx, uint16_t ci); bool CanPut(Point position); diff --git a/Source/items.h b/Source/items.h index c40e19b0c..9087f309d 100644 --- a/Source/items.h +++ b/Source/items.h @@ -8,9 +8,9 @@ #include #include "DiabloUI/ui_item.h" +#include "engine.h" #include "engine/animationinfo.h" #include "engine/point.hpp" -#include "engine.h" #include "itemdat.h" #include "monster.h" #include "utils/stdcompat/optional.hpp" diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index fdf7bc1c7..eb6606114 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -23,9 +23,9 @@ #include "inv.h" #include "lighting.h" #include "missiles.h" +#include "mpq/mpq_writer.hpp" #include "pfile.h" #include "stores.h" -#include "mpq/mpq_writer.hpp" #include "utils/endian.hpp" #include "utils/language.h" @@ -890,7 +890,7 @@ void LoadMatchingItems(LoadHelper &file, const int n, Item *pItem) * @param file interface to the save file * @return a map converting from item indexes as recorded in the save file to the appropriate Items array index, used by LoadDroppedItemLocations * @see LoadDroppedItemLocations -*/ + */ std::unordered_map LoadDroppedItems(LoadHelper &file) { std::unordered_map itemIndexes = { { 0, 0 } }; @@ -915,7 +915,7 @@ std::unordered_map LoadDroppedItems(LoadHelper &file) * @brief Helper to initialise dItem based on runtime item indexes * @param file interface to the save file * @param indexMap a map converting from save file item indexes to the appropriate Items array index -*/ + */ void LoadDroppedItemLocations(LoadHelper &file, const std::unordered_map &indexMap) { for (int j = 0; j < MAXDUNY; j++) { @@ -1506,7 +1506,7 @@ void SavePortal(SaveHelper *file, int i) * @param file interface to the save file * @return a map converting from runtime item indexes to the relative position in the save file, used by SaveDroppedItemLocations * @see SaveDroppedItemLocations -*/ + */ std::unordered_map SaveDroppedItems(SaveHelper &file) { // Vanilla Diablo/Hellfire initialise the ActiveItems and AvailableItems arrays based on saved data, so write valid values for compatibility @@ -1527,7 +1527,7 @@ std::unordered_map SaveDroppedItems(SaveHelper &file) * @brief Saves the position of dropped items (in dItem) * @param file interface to the save file * @param indexMap a map converting from runtime item indexes to the relative position in the save file -*/ + */ void SaveDroppedItemLocations(SaveHelper &file, const std::unordered_map &itemIndexes) { for (int j = 0; j < MAXDUNY; j++) { diff --git a/Source/miniwin/miniwin.h b/Source/miniwin/miniwin.h index dc04b5e90..3089ddc0d 100644 --- a/Source/miniwin/miniwin.h +++ b/Source/miniwin/miniwin.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include #include diff --git a/Source/miniwin/misc_msg.cpp b/Source/miniwin/misc_msg.cpp index 3e6310696..bee77a729 100644 --- a/Source/miniwin/misc_msg.cpp +++ b/Source/miniwin/misc_msg.cpp @@ -3,9 +3,9 @@ #include #include #ifdef USE_SDL1 +#include #include #include -#include #endif #include "control.h" diff --git a/Source/misdat.cpp b/Source/misdat.cpp index 8c792ae4e..889e72e11 100644 --- a/Source/misdat.cpp +++ b/Source/misdat.cpp @@ -5,9 +5,9 @@ */ #include "misdat.h" -#include "missiles.h" -#include "engine/load_file.hpp" #include "engine/cel_header.hpp" +#include "engine/load_file.hpp" +#include "missiles.h" namespace devilution { diff --git a/Source/misdat.h b/Source/misdat.h index 456bb26dc..22b9e98d0 100644 --- a/Source/misdat.h +++ b/Source/misdat.h @@ -8,8 +8,8 @@ #include #include -#include "engine.h" #include "effects.h" +#include "engine.h" #include "utils/stdcompat/cstddef.hpp" namespace devilution { @@ -96,16 +96,16 @@ typedef enum missile_graphic_id : uint8_t { */ enum class MissileMovementDistrubution { /** - * @brief No movement distribution is calculated. Normally this means the missile doesn't move at all. - */ + * @brief No movement distribution is calculated. Normally this means the missile doesn't move at all. + */ Disabled, /** - * @brief The missile moves and if it hits a enemey it stops (for example firebolt) - */ + * @brief The missile moves and if it hits a enemey it stops (for example firebolt) + */ Blockable, /** - * @brief The missile moves and even it hits a enemy it keeps moving (for example flame wave) - */ + * @brief The missile moves and even it hits a enemy it keeps moving (for example flame wave) + */ Unblockable, }; diff --git a/Source/missiles.h b/Source/missiles.h index 8d1ebdfed..ef48baa57 100644 --- a/Source/missiles.h +++ b/Source/missiles.h @@ -7,9 +7,9 @@ #include -#include "miniwin/miniwin.h" #include "engine.h" #include "engine/point.hpp" +#include "miniwin/miniwin.h" #include "misdat.h" #include "monster.h" #include "spelldat.h" @@ -38,17 +38,17 @@ struct MissilePosition { Displacement traveled; /** - * @brief Specifies the location (tile) while rendering - */ + * @brief Specifies the location (tile) while rendering + */ Point tileForRendering; /** - * @brief Specifies the location (offset) while rendering - */ + * @brief Specifies the location (offset) while rendering + */ Displacement offsetForRendering; /** - * @brief Stops the missile (set velocity to zero and set offset to last renderer location; shouldn't matter cause the missile don't move anymore) - */ + * @brief Stops the missile (set velocity to zero and set offset to last renderer location; shouldn't matter cause the missile don't move anymore) + */ void StopMissile() { velocity = {}; @@ -130,8 +130,8 @@ struct Missile { int var7; bool limitReached; /** - * @brief For moving missiles lastCollisionTargetHash contains the last entity (player or monster) that was checked in CheckMissileCol (needed to avoid multiple hits for a entity at the same tile). - */ + * @brief For moving missiles lastCollisionTargetHash contains the last entity (player or monster) that was checked in CheckMissileCol (needed to avoid multiple hits for a entity at the same tile). + */ int16_t lastCollisionTargetHash; }; @@ -172,14 +172,14 @@ bool PlayerMHit(int pnum, Monster *monster, int dist, int mind, int maxd, missil * @brief Sets the missile sprite to the given sheet frame * @param missile this object * @param dir Sprite frame, typically representing a direction but there are some exceptions (arrows being 1 indexed, directionless spells) -*/ + */ void SetMissDir(Missile &missile, int dir); /** * @brief Sets the sprite for this missile so it matches the given Direction * @param missile this object * @param dir Desired facing -*/ + */ inline void SetMissDir(Missile &missile, Direction dir) { SetMissDir(missile, static_cast(dir)); @@ -189,7 +189,7 @@ inline void SetMissDir(Missile &missile, Direction dir) * @brief Sets the sprite for this missile so it matches the given Direction16 * @param missile this object * @param dir Desired facing at a 22.8125 degree resolution -*/ + */ inline void SetMissDir(Missile &missile, Direction16 dir) { SetMissDir(missile, static_cast(dir)); diff --git a/Source/monstdat.cpp b/Source/monstdat.cpp index 8d0916eea..00645ca23 100644 --- a/Source/monstdat.cpp +++ b/Source/monstdat.cpp @@ -3,8 +3,8 @@ * * Implementation of all monster data. */ -#include "items.h" #include "monstdat.h" +#include "items.h" #include "monster.h" #include "textdat.h" diff --git a/Source/monster.h b/Source/monster.h index b1e20bb61..87dc29de0 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -5,8 +5,8 @@ */ #pragma once -#include #include +#include #include #include "engine.h" @@ -15,11 +15,11 @@ #include "engine/cel_sprite.hpp" #include "engine/point.hpp" #include "miniwin/miniwin.h" -#include "utils/stdcompat/optional.hpp" #include "monstdat.h" #include "sound.h" #include "spelldat.h" #include "textdat.h" +#include "utils/stdcompat/optional.hpp" namespace devilution { @@ -224,7 +224,7 @@ struct Monster { // note: missing field _mAFNum * @brief Sets the current cell sprite to match the desired direction and animation sequence * @param graphic Animation sequence of interest * @param direction Desired direction the monster should be visually facing - */ + */ void ChangeAnimationData(MonsterGraphic graphic, Direction direction) { auto &animationData = this->MType->GetAnimData(graphic); @@ -237,7 +237,7 @@ struct Monster { // note: missing field _mAFNum /** * @brief Sets the current cell sprite to match the desired animation sequence using the direction the monster is currently facing * @param graphic Animation sequence of interest - */ + */ void ChangeAnimationData(MonsterGraphic graphic) { this->ChangeAnimationData(graphic, this->_mdir); diff --git a/Source/mpq/mpq_writer.hpp b/Source/mpq/mpq_writer.hpp index 876812008..14ac8c524 100644 --- a/Source/mpq/mpq_writer.hpp +++ b/Source/mpq/mpq_writer.hpp @@ -7,8 +7,8 @@ #include -#include "utils/stdcompat/cstddef.hpp" #include "utils/logged_fstream.hpp" +#include "utils/stdcompat/cstddef.hpp" namespace devilution { diff --git a/Source/msg.cpp b/Source/msg.cpp index a0adb21eb..5d61c9d32 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -28,9 +28,9 @@ #include "spells.h" #include "storm/storm_net.hpp" #include "sync.h" +#include "tmsg.h" #include "town.h" #include "towners.h" -#include "tmsg.h" #include "trigs.h" #include "utils/language.h" @@ -2170,7 +2170,7 @@ Point GetItemPosition(Point position) return position; } -} //namespace +} // namespace void DeltaLoadLevel() { diff --git a/Source/nthread.cpp b/Source/nthread.cpp index 742c67e89..2126ee94a 100644 --- a/Source/nthread.cpp +++ b/Source/nthread.cpp @@ -4,10 +4,10 @@ * Implementation of functions for managing game ticks. */ +#include "nthread.h" #include "diablo.h" #include "engine/demomode.h" #include "gmenu.h" -#include "nthread.h" #include "storm/storm_net.hpp" #include "utils/sdl_mutex.h" #include "utils/sdl_thread.h" diff --git a/Source/objects.cpp b/Source/objects.cpp index 273b51aee..b3415871b 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -443,7 +443,7 @@ void AddCandles() * * @param affectedArea The map region to be updated when this object is activated by the player. * @param msg The quest text to play when the player activates the book. -*/ + */ void AddBookLever(Rectangle affectedArea, _speech_id msg) { int cnt = 0; @@ -5396,9 +5396,9 @@ void GetObjectStr(const Object &object) case OBJ_BARREL: case OBJ_BARRELEX: if (currlevel >= 17 && currlevel <= 20) // for hive levels - strcpy(infostr, _("Pod")); //Then a barrel is called a pod + strcpy(infostr, _("Pod")); // Then a barrel is called a pod else if (currlevel >= 21 && currlevel <= 24) // for crypt levels - strcpy(infostr, _("Urn")); //Then a barrel is called an urn + strcpy(infostr, _("Urn")); // Then a barrel is called an urn else strcpy(infostr, _("Barrel")); break; diff --git a/Source/objects.h b/Source/objects.h index 5abd7e902..d7f73632a 100644 --- a/Source/objects.h +++ b/Source/objects.h @@ -98,7 +98,7 @@ struct Object { * initialized by IntializeQuestBook(). * * @param mapRange The region to be updated when this object is activated. - */ + */ constexpr void InitializeBook(Rectangle mapRange) { SetMapRange(mapRange); @@ -265,7 +265,7 @@ void SyncObjectAnim(Object &object); /** * @brief Updates the text drawn in the info box to describe the given object * @param object The currently highlighted object -*/ + */ void GetObjectStr(const Object &object); void OperateNakrulLever(); void SyncNakrulRoom(); diff --git a/Source/pack.h b/Source/pack.h index a2e187392..5faf3dc5a 100644 --- a/Source/pack.h +++ b/Source/pack.h @@ -7,9 +7,9 @@ #include -#include "player.h" #include "inv.h" #include "items.h" +#include "player.h" namespace devilution { diff --git a/Source/panels/charpanel.cpp b/Source/panels/charpanel.cpp index 2ceffcf69..b312bc672 100644 --- a/Source/panels/charpanel.cpp +++ b/Source/panels/charpanel.cpp @@ -7,10 +7,10 @@ #include "DiabloUI/art_draw.h" #include "control.h" -#include "player.h" -#include "utils/display.h" #include "engine/render/cel_render.hpp" #include "engine/render/text_render.hpp" +#include "player.h" +#include "utils/display.h" #include "utils/language.h" namespace devilution { diff --git a/Source/path.h b/Source/path.h index e0838fd1b..dee98d822 100644 --- a/Source/path.h +++ b/Source/path.h @@ -37,7 +37,7 @@ bool IsTileWalkable(Point position, bool ignoreDoors = false); /** * @brief Checks if the position contains an object, player, monster, or solid dungeon piece -*/ + */ bool IsTileOccupied(Point position); /** diff --git a/Source/pfile.h b/Source/pfile.h index 50c3fa3ce..be735d289 100644 --- a/Source/pfile.h +++ b/Source/pfile.h @@ -5,9 +5,9 @@ */ #pragma once +#include "DiabloUI/diabloui.h" #include "mpq/mpq_writer.hpp" #include "player.h" -#include "DiabloUI/diabloui.h" namespace devilution { diff --git a/Source/platform/ctr/asio/net/if.c b/Source/platform/ctr/asio/net/if.c index 910cb5577..e53dca8cc 100644 --- a/Source/platform/ctr/asio/net/if.c +++ b/Source/platform/ctr/asio/net/if.c @@ -1,6 +1,6 @@ -#include #include #include +#include unsigned int if_nametoindex(const char *__ifname) { diff --git a/Source/platform/ctr/asio/sys/socket.c b/Source/platform/ctr/asio/sys/socket.c index 30710ec66..d295ae98f 100644 --- a/Source/platform/ctr/asio/sys/socket.c +++ b/Source/platform/ctr/asio/sys/socket.c @@ -1,7 +1,7 @@ +#include #include #include #include -#include ssize_t stream_recvmsg(int socket, struct msghdr *message, int flags) { diff --git a/Source/platform/ctr/asio/sys/uio.c b/Source/platform/ctr/asio/sys/uio.c index 4d6b74a17..686e99d31 100644 --- a/Source/platform/ctr/asio/sys/uio.c +++ b/Source/platform/ctr/asio/sys/uio.c @@ -1,6 +1,6 @@ -#include -#include #include +#include +#include ssize_t readv(int __fd, const struct iovec *__iovec, int __count) { diff --git a/Source/platform/ctr/messagebox.cpp b/Source/platform/ctr/messagebox.cpp index 7124f9cbb..a0c2a84cc 100644 --- a/Source/platform/ctr/messagebox.cpp +++ b/Source/platform/ctr/messagebox.cpp @@ -1,29 +1,30 @@ -#include <3ds.h> -#include -#include -#include "utils/sdl2_to_1_2_backports.h" - -int SDL_ShowSimpleMessageBox(Uint32 flags, - const char *title, - const char *message, - SDL_Surface *window) -{ - if (SDL_ShowCursor(SDL_DISABLE) <= -1) - SDL_Log("%s", SDL_GetError()); - - bool init = !gspHasGpuRight(); - auto text = fmt::format("{}\n\n{}", title, message); - - if (init) - gfxInitDefault(); - - errorConf error; - errorInit(&error, ERROR_TEXT, CFG_LANGUAGE_EN); - errorText(&error, text.c_str()); - errorDisp(&error); - - if (init) - gfxExit(); - - return 0; -} +#include <3ds.h> +#include +#include + +#include "utils/sdl2_to_1_2_backports.h" + +int SDL_ShowSimpleMessageBox(Uint32 flags, + const char *title, + const char *message, + SDL_Surface *window) +{ + if (SDL_ShowCursor(SDL_DISABLE) <= -1) + SDL_Log("%s", SDL_GetError()); + + bool init = !gspHasGpuRight(); + auto text = fmt::format("{}\n\n{}", title, message); + + if (init) + gfxInitDefault(); + + errorConf error; + errorInit(&error, ERROR_TEXT, CFG_LANGUAGE_EN); + errorText(&error, text.c_str()); + errorDisp(&error); + + if (init) + gfxExit(); + + return 0; +} diff --git a/Source/platform/ctr/random.cpp b/Source/platform/ctr/random.cpp index c18bc79ec..6126a5051 100644 --- a/Source/platform/ctr/random.cpp +++ b/Source/platform/ctr/random.cpp @@ -1,6 +1,6 @@ -#include -#include #include <3ds.h> +#include +#include static const char *randombytes_ctrrandom_implementation_name() { diff --git a/Source/platform/ctr/sockets.cpp b/Source/platform/ctr/sockets.cpp index 2f63ac075..7140d1391 100644 --- a/Source/platform/ctr/sockets.cpp +++ b/Source/platform/ctr/sockets.cpp @@ -1,66 +1,70 @@ -#include -#include <3ds.h> -#include "utils/log.hpp" - -namespace devilution { - -constexpr auto SOC_ALIGN = 0x1000; -constexpr auto SOC_BUFFERSIZE = 0x100000; -static u32 *socBuffer; -static bool initialized; - -static bool waitForWifi() -{ - // 100 ms - constexpr s64 sleepNano = 100 * 1000 * 1000; - - // 5 sec - constexpr int loopCount = 5 * 1000 / 100; - - uint32_t wifi = 0; - for (int i = 0; i < loopCount; ++i) { - if (R_SUCCEEDED(ACU_GetWifiStatus(&wifi)) && wifi) - return true; - - svcSleepThread(sleepNano); - } - - return false; -} - -void n3ds_socExit() -{ - if (socBuffer == nullptr) - return; - - socExit(); - free(socBuffer); - socBuffer = nullptr; -} - -void n3ds_socInit() -{ - if (!waitForWifi()) { - LogError("n3ds_socInit: Wifi off"); - return; - } - - socBuffer = (u32 *)memalign(SOC_ALIGN, SOC_BUFFERSIZE); - if (socBuffer == nullptr) { - LogError("n3ds_socInit: memalign() failed"); - return; - } - - Result result = socInit(socBuffer, SOC_BUFFERSIZE); - if (!R_SUCCEEDED(result)) { - LogError("n3ds_socInit: socInit() failed"); - free(socBuffer); - return; - } - - if (!initialized) - atexit([]() { n3ds_socExit(); }); - initialized = true; -} - -} // namespace devilution +#include "platform/ctr/sockets.hpp" + +#include + +#include <3ds.h> + +#include "utils/log.hpp" + +namespace devilution { + +constexpr auto SOC_ALIGN = 0x1000; +constexpr auto SOC_BUFFERSIZE = 0x100000; +static u32 *socBuffer; +static bool initialized; + +static bool waitForWifi() +{ + // 100 ms + constexpr s64 sleepNano = 100 * 1000 * 1000; + + // 5 sec + constexpr int loopCount = 5 * 1000 / 100; + + uint32_t wifi = 0; + for (int i = 0; i < loopCount; ++i) { + if (R_SUCCEEDED(ACU_GetWifiStatus(&wifi)) && wifi) + return true; + + svcSleepThread(sleepNano); + } + + return false; +} + +void n3ds_socExit() +{ + if (socBuffer == nullptr) + return; + + socExit(); + free(socBuffer); + socBuffer = nullptr; +} + +void n3ds_socInit() +{ + if (!waitForWifi()) { + LogError("n3ds_socInit: Wifi off"); + return; + } + + socBuffer = (u32 *)memalign(SOC_ALIGN, SOC_BUFFERSIZE); + if (socBuffer == nullptr) { + LogError("n3ds_socInit: memalign() failed"); + return; + } + + Result result = socInit(socBuffer, SOC_BUFFERSIZE); + if (!R_SUCCEEDED(result)) { + LogError("n3ds_socInit: socInit() failed"); + free(socBuffer); + return; + } + + if (!initialized) + atexit([]() { n3ds_socExit(); }); + initialized = true; +} + +} // namespace devilution diff --git a/Source/platform/ctr/system.cpp b/Source/platform/ctr/system.cpp index a45fb614a..4a785dbeb 100644 --- a/Source/platform/ctr/system.cpp +++ b/Source/platform/ctr/system.cpp @@ -1,6 +1,6 @@ #include <3ds.h> -#include #include +#include #include "platform/ctr/cfgu_service.hpp" #include "platform/ctr/random.hpp" diff --git a/Source/platform/switch/asio/net/if.c b/Source/platform/switch/asio/net/if.c index 910cb5577..e53dca8cc 100644 --- a/Source/platform/switch/asio/net/if.c +++ b/Source/platform/switch/asio/net/if.c @@ -1,6 +1,6 @@ -#include #include #include +#include unsigned int if_nametoindex(const char *__ifname) { diff --git a/Source/platform/switch/asio/sys/signal.c b/Source/platform/switch/asio/sys/signal.c index 4b9c394d4..8a47977d5 100644 --- a/Source/platform/switch/asio/sys/signal.c +++ b/Source/platform/switch/asio/sys/signal.c @@ -1,5 +1,5 @@ -#include #include +#include int pthread_sigmask(int, const sigset_t *, sigset_t *) { diff --git a/Source/platform/switch/docking.cpp b/Source/platform/switch/docking.cpp index 6dce9d7a8..5c5900064 100644 --- a/Source/platform/switch/docking.cpp +++ b/Source/platform/switch/docking.cpp @@ -1,7 +1,7 @@ #include "platform/switch/docking.h" -#include #include +#include #include "diablo.h" #include "utils/display.h" diff --git a/Source/platform/switch/keyboard.cpp b/Source/platform/switch/keyboard.cpp index 1b9a3ec84..30b01e4ee 100644 --- a/Source/platform/switch/keyboard.cpp +++ b/Source/platform/switch/keyboard.cpp @@ -1,7 +1,10 @@ +#include "platform/switch/keyboard.h" + #include -#include + #include -#include "platform/switch/keyboard.h" +#include + #include "utils/utf8.hpp" static void switch_keyboard_get(const char *guide_text, char *initial_text, int max_len, int multiline, char *buf) diff --git a/Source/platform/switch/network.cpp b/Source/platform/switch/network.cpp index 4526f1a61..2c7d60aa8 100644 --- a/Source/platform/switch/network.cpp +++ b/Source/platform/switch/network.cpp @@ -1,7 +1,7 @@ +#include "platform/switch/network.h" #include -#include #include -#include "platform/switch/network.h" +#include static int nxlink_sock = -1; // for stdio on Switch diff --git a/Source/platform/switch/random.cpp b/Source/platform/switch/random.cpp index 6c16d228c..59c6d88ce 100644 --- a/Source/platform/switch/random.cpp +++ b/Source/platform/switch/random.cpp @@ -1,54 +1,57 @@ -#include -#include - -extern "C" { -#include -#include -} - -static const char *randombytes_switchrandom_implementation_name() -{ - return "switchrandom"; -} - -static bool randombytes_switchrandom_tryfill(void *const buf, const size_t size) -{ - Result res; - Service *csrngService = csrngGetServiceSession(); - if (!serviceIsActive(csrngService)) { - res = csrngInitialize(); - if (!R_SUCCEEDED(res)) - return false; - } - res = csrngGetRandomBytes(buf, size); - return R_SUCCEEDED(res); -} - -static uint32_t randombytes_switchrandom() -{ - uint32_t num; - if (!randombytes_switchrandom_tryfill(&num, sizeof(uint32_t))) - sodium_misuse(); - return num; -} - -static void randombytes_switchrandom_buf(void *const buf, const size_t size) -{ - if (!randombytes_switchrandom_tryfill(buf, size)) - sodium_misuse(); -} - -struct randombytes_implementation randombytes_switchrandom_implementation = { - randombytes_switchrandom_implementation_name, - randombytes_switchrandom, - nullptr, - nullptr, - randombytes_switchrandom_buf, - nullptr -}; - -void randombytes_switchrandom_init() -{ - randombytes_set_implementation(&randombytes_switchrandom_implementation); - atexit(csrngExit); -} +#include "platform/switch/random.hpp" + +#include + +#include + +extern "C" { +#include +#include +} + +static const char *randombytes_switchrandom_implementation_name() +{ + return "switchrandom"; +} + +static bool randombytes_switchrandom_tryfill(void *const buf, const size_t size) +{ + Result res; + Service *csrngService = csrngGetServiceSession(); + if (!serviceIsActive(csrngService)) { + res = csrngInitialize(); + if (!R_SUCCEEDED(res)) + return false; + } + res = csrngGetRandomBytes(buf, size); + return R_SUCCEEDED(res); +} + +static uint32_t randombytes_switchrandom() +{ + uint32_t num; + if (!randombytes_switchrandom_tryfill(&num, sizeof(uint32_t))) + sodium_misuse(); + return num; +} + +static void randombytes_switchrandom_buf(void *const buf, const size_t size) +{ + if (!randombytes_switchrandom_tryfill(buf, size)) + sodium_misuse(); +} + +struct randombytes_implementation randombytes_switchrandom_implementation = { + randombytes_switchrandom_implementation_name, + randombytes_switchrandom, + nullptr, + nullptr, + randombytes_switchrandom_buf, + nullptr +}; + +void randombytes_switchrandom_init() +{ + randombytes_set_implementation(&randombytes_switchrandom_implementation); + atexit(csrngExit); +} diff --git a/Source/platform/vita/keyboard.cpp b/Source/platform/vita/keyboard.cpp index 7299a4fe0..1ba7379d9 100644 --- a/Source/platform/vita/keyboard.cpp +++ b/Source/platform/vita/keyboard.cpp @@ -1,9 +1,10 @@ +#include "platform/vita/keyboard.h" + #include #include -#include #include -#include "platform/vita/keyboard.h" +#include static void utf16_to_utf8(const uint16_t *src, uint8_t *dst) { diff --git a/Source/platform/vita/network.cpp b/Source/platform/vita/network.cpp index c55788c1d..895315240 100644 --- a/Source/platform/vita/network.cpp +++ b/Source/platform/vita/network.cpp @@ -1,10 +1,12 @@ -#include +#include "platform/vita/network.h" + #include +#include #include -#include "platform/vita/network.h" -#include + #include #include +#include void vita_enable_network() { diff --git a/Source/platform/vita/random.cpp b/Source/platform/vita/random.cpp index 297959ed2..14dd879b1 100644 --- a/Source/platform/vita/random.cpp +++ b/Source/platform/vita/random.cpp @@ -1,6 +1,6 @@ -#include -#include #include +#include +#include static const char *randombytes_vitarandom_implementation_name() { diff --git a/Source/player.h b/Source/player.h index 8a1e1543f..41792d7d0 100644 --- a/Source/player.h +++ b/Source/player.h @@ -110,9 +110,9 @@ enum class PlayerWeaponGraphic : uint8_t { enum PLR_MODE : uint8_t { PM_STAND, - PM_WALK, //Movement towards N, NW, or NE - PM_WALK2, //Movement towards S, SW, or SE - PM_WALK3, //Movement towards W or E + PM_WALK, // Movement towards N, NW, or NE + PM_WALK2, // Movement towards S, SW, or SE + PM_WALK3, // Movement towards W or E PM_ATTACK, PM_RATTACK, PM_BLOCK, @@ -429,7 +429,7 @@ struct Player { int GetMeleePiercingToHit() const { int hper = GetMeleeToHit(); - //in hellfire armor piercing ignores % of enemy armor instead, no way to include it here + // in hellfire armor piercing ignores % of enemy armor instead, no way to include it here if (!gbIsHellfire) hper += _pIEnAc; return hper; @@ -451,7 +451,7 @@ struct Player { int GetRangedPiercingToHit() const { int hper = GetRangedToHit(); - //in hellfire armor piercing ignores % of enemy armor instead, no way to include it here + // in hellfire armor piercing ignores % of enemy armor instead, no way to include it here if (!gbIsHellfire) hper += _pIEnAc; return hper; @@ -514,7 +514,7 @@ struct Player { * The stored value is unused... * @see _pHPPer * @return The players current hit points as a percentage of their maximum (from 0 to 80%) - */ + */ int UpdateHitPointPercentage() { if (_pMaxHP <= 0) { // divide by zero guard diff --git a/Source/qol/autopickup.cpp b/Source/qol/autopickup.cpp index 1137fb102..225f09255 100644 --- a/Source/qol/autopickup.cpp +++ b/Source/qol/autopickup.cpp @@ -1,8 +1,8 @@ /** -* @file autopickup.cpp -* -* QoL feature for automatically picking up gold -*/ + * @file autopickup.cpp + * + * QoL feature for automatically picking up gold + */ #include "options.h" #include "player.h" diff --git a/Source/qol/autopickup.h b/Source/qol/autopickup.h index 7806c2d58..f9be9e6a9 100644 --- a/Source/qol/autopickup.h +++ b/Source/qol/autopickup.h @@ -1,8 +1,8 @@ /** -* @file autopickup.h -* -* QoL feature for automatically picking up gold -*/ + * @file autopickup.h + * + * QoL feature for automatically picking up gold + */ #pragma once diff --git a/Source/qol/common.cpp b/Source/qol/common.cpp index 93e178802..e05abd137 100644 --- a/Source/qol/common.cpp +++ b/Source/qol/common.cpp @@ -1,8 +1,8 @@ /** -* @file common.h -* -* Common functions for QoL features -*/ + * @file common.h + * + * Common functions for QoL features + */ #include diff --git a/Source/qol/common.h b/Source/qol/common.h index 3d455d45c..89957df61 100644 --- a/Source/qol/common.h +++ b/Source/qol/common.h @@ -1,8 +1,8 @@ /** -* @file common.h -* -* Common functions for QoL features -*/ + * @file common.h + * + * Common functions for QoL features + */ #pragma once #include diff --git a/Source/qol/itemlabels.h b/Source/qol/itemlabels.h index 04b8821bd..b4e57cb22 100644 --- a/Source/qol/itemlabels.h +++ b/Source/qol/itemlabels.h @@ -1,8 +1,8 @@ /** -* @file itemlabels.h -* -* Adds item labels QoL feature -*/ + * @file itemlabels.h + * + * Adds item labels QoL feature + */ #pragma once #include "engine.h" diff --git a/Source/qol/monhealthbar.cpp b/Source/qol/monhealthbar.cpp index a18bcafcb..50d251994 100644 --- a/Source/qol/monhealthbar.cpp +++ b/Source/qol/monhealthbar.cpp @@ -1,8 +1,8 @@ /** -* @file monhealthbar.cpp -* -* Adds monster health bar QoL feature -*/ + * @file monhealthbar.cpp + * + * Adds monster health bar QoL feature + */ #include "DiabloUI/art_draw.h" #include "control.h" diff --git a/Source/qol/monhealthbar.h b/Source/qol/monhealthbar.h index f988c612c..fed64fa49 100644 --- a/Source/qol/monhealthbar.h +++ b/Source/qol/monhealthbar.h @@ -1,8 +1,8 @@ /** -* @file monhealthbar.h -* -* Adds monster health bar QoL feature -*/ + * @file monhealthbar.h + * + * Adds monster health bar QoL feature + */ #pragma once namespace devilution { diff --git a/Source/qol/xpbar.cpp b/Source/qol/xpbar.cpp index 9ce0007e5..4c1dba694 100644 --- a/Source/qol/xpbar.cpp +++ b/Source/qol/xpbar.cpp @@ -1,8 +1,8 @@ /** -* @file xpbar.cpp -* -* Adds XP bar QoL feature -*/ + * @file xpbar.cpp + * + * Adds XP bar QoL feature + */ #include "xpbar.h" #include diff --git a/Source/qol/xpbar.h b/Source/qol/xpbar.h index 2502f6297..50b7ab5ac 100644 --- a/Source/qol/xpbar.h +++ b/Source/qol/xpbar.h @@ -1,8 +1,8 @@ /** -* @file xpbar.h -* -* Adds XP bar QoL feature -*/ + * @file xpbar.h + * + * Adds XP bar QoL feature + */ #pragma once namespace devilution { diff --git a/Source/quests.h b/Source/quests.h index acec3bf0f..1e8548445 100644 --- a/Source/quests.h +++ b/Source/quests.h @@ -84,7 +84,7 @@ void InitQuests(); * @brief Deactivates quests from each quest pool at random to provide variety for single player games * @param seed The seed used to control which quests are deactivated * @param quests The available quest list, this function will make some of them inactive by the time it returns -*/ + */ void InitialiseQuestPools(uint32_t seed, Quest quests[]); void CheckQuests(); bool ForceQuests(); diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index d0a3677d8..aad2487ea 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -14,7 +14,6 @@ #include "engine/render/cl2_render.hpp" #include "engine/render/dun_render.hpp" #include "engine/render/text_render.hpp" -#include "panels/charpanel.hpp" #include "error.h" #include "gmenu.h" #include "help.h" @@ -25,6 +24,7 @@ #include "minitext.h" #include "missiles.h" #include "nthread.h" +#include "panels/charpanel.hpp" #include "plrmsg.h" #include "qol/itemlabels.h" #include "qol/monhealthbar.h" diff --git a/Source/sha.cpp b/Source/sha.cpp index 53ec126ce..7717a6f2a 100644 --- a/Source/sha.cpp +++ b/Source/sha.cpp @@ -6,6 +6,7 @@ #include "sha.h" #include + #include #include "appfat.h" diff --git a/Source/sound.cpp b/Source/sound.cpp index a9c87f3dd..fe20b684c 100644 --- a/Source/sound.cpp +++ b/Source/sound.cpp @@ -16,9 +16,9 @@ #include #include +#include "engine/assets.hpp" #include "init.h" #include "options.h" -#include "engine/assets.hpp" #include "utils/log.hpp" #include "utils/math.h" #include "utils/sdl_mutex.h" diff --git a/Source/sound.h b/Source/sound.h index c5cd786b5..5ede4fb2d 100644 --- a/Source/sound.h +++ b/Source/sound.h @@ -6,8 +6,8 @@ #pragma once #include -#include #include +#include #include "miniwin/miniwin.h" diff --git a/Source/storm/storm_net.hpp b/Source/storm/storm_net.hpp index ebf2e2c07..7625cc6d2 100644 --- a/Source/storm/storm_net.hpp +++ b/Source/storm/storm_net.hpp @@ -2,8 +2,8 @@ #include #include -#include #include +#include namespace devilution { diff --git a/Source/storm/storm_svid.cpp b/Source/storm/storm_svid.cpp index 4394776d6..1273e5952 100644 --- a/Source/storm/storm_svid.cpp +++ b/Source/storm/storm_svid.cpp @@ -14,9 +14,9 @@ #endif #include "dx.h" +#include "engine/assets.hpp" #include "options.h" #include "palette.h" -#include "engine/assets.hpp" #include "utils/display.h" #include "utils/log.hpp" #include "utils/sdl_compat.h" @@ -146,12 +146,12 @@ bool SVidPlayBegin(const char *filename, int flags) SVidLoop = false; if ((flags & 0x40000) != 0) SVidLoop = true; - //0x8 // Non-interlaced - //0x200, 0x800 // Upscale video - //0x80000 // Center horizontally - //0x100000 // Disable video - //0x800000 // Edge detection - //0x200800 // Clear FB + // 0x8 // Non-interlaced + // 0x200, 0x800 // Upscale video + // 0x80000 // Center horizontally + // 0x100000 // Disable video + // 0x800000 // Edge detection + // 0x200800 // Clear FB SDL_RWops *videoStream = OpenAsset(filename); SVidHandle = Smacker_Open(videoStream); diff --git a/Source/town.h b/Source/town.h index 688e91a2d..1a40c6b87 100644 --- a/Source/town.h +++ b/Source/town.h @@ -14,14 +14,14 @@ namespace devilution { * @brief Check if hive can be opened by dropping rune bomb on a tile * @param position The position of the tile * @return True if the bomb would open hive -*/ + */ bool OpensHive(Point position); /** * @brief Check if grave can be opened by dropping cathedral map on a tile * @param position The position of the tile * @return True if the map would open the grave -*/ + */ bool OpensGrave(Point position); /** @@ -29,7 +29,7 @@ bool OpensGrave(Point position); */ void TownOpenHive(); -/** +/** * @brief Update the map to show the open grave */ void TownOpenGrave(); diff --git a/Source/towners.h b/Source/towners.h index 9d56c67b5..cb8aac527 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -5,9 +5,9 @@ */ #pragma once +#include "utils/stdcompat/string_view.hpp" #include #include -#include "utils/stdcompat/string_view.hpp" #include "items.h" #include "player.h" diff --git a/Source/utils/file_util.cpp b/Source/utils/file_util.cpp index 7a4ce20d7..218022397 100644 --- a/Source/utils/file_util.cpp +++ b/Source/utils/file_util.cpp @@ -17,8 +17,8 @@ // Suppress definitions of `min` and `max` macros by : #define NOMINMAX 1 #define WIN32_LEAN_AND_MEAN -#include #include +#include #include "utils/log.hpp" #endif diff --git a/Source/utils/file_util.h b/Source/utils/file_util.h index 177adb1fb..303ff4d1a 100644 --- a/Source/utils/file_util.h +++ b/Source/utils/file_util.h @@ -5,8 +5,8 @@ #include #include -#include "utils/stdcompat/string_view.hpp" #include "utils/stdcompat/optional.hpp" +#include "utils/stdcompat/string_view.hpp" namespace devilution { diff --git a/Source/utils/language.cpp b/Source/utils/language.cpp index 899e362db..794a1a4cb 100644 --- a/Source/utils/language.cpp +++ b/Source/utils/language.cpp @@ -5,8 +5,8 @@ #include #include -#include "options.h" #include "engine/assets.hpp" +#include "options.h" #include "utils/file_util.h" #include "utils/paths.h" #include "utils/stdcompat/string_view.hpp" diff --git a/Source/utils/math.h b/Source/utils/math.h index 513d9e427..970e7e153 100644 --- a/Source/utils/math.h +++ b/Source/utils/math.h @@ -1,8 +1,8 @@ /** -* @file math.h -* -* Math utility functions -*/ + * @file math.h + * + * Math utility functions + */ #pragma once namespace devilution { diff --git a/Source/utils/png.h b/Source/utils/png.h index a48374a69..78dcb191f 100644 --- a/Source/utils/png.h +++ b/Source/utils/png.h @@ -2,8 +2,8 @@ #include -#include "miniwin/miniwin.h" #include "engine/assets.hpp" +#include "miniwin/miniwin.h" #ifdef __cplusplus extern "C" { diff --git a/Source/utils/sdl2_to_1_2_backports.cpp b/Source/utils/sdl2_to_1_2_backports.cpp index 832acbbca..59c5f547c 100644 --- a/Source/utils/sdl2_to_1_2_backports.cpp +++ b/Source/utils/sdl2_to_1_2_backports.cpp @@ -1,7 +1,7 @@ #include "./sdl2_to_1_2_backports.h" -#include #include +#include #include "./console.h" @@ -610,12 +610,12 @@ char *SDL_GetPrefPath(const char *org, const char *app) // From sdl2-2.0.9/src/filesystem/windows/SDL_sysfilesystem.c /* - * Vista and later has a new API for this, but SHGetFolderPath works there, - * and apparently just wraps the new API. This is the new way to do it: - * - * SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE, - * NULL, &wszPath); - */ + * Vista and later has a new API for this, but SHGetFolderPath works there, + * and apparently just wraps the new API. This is the new way to do it: + * + * SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE, + * NULL, &wszPath); + */ WCHAR path[MAX_PATH]; char *retval = NULL; @@ -784,8 +784,8 @@ char *SDL_GetBasePath() /* is a Linux-style /proc filesystem available? */ if (!retval && (access("/proc", F_OK) == 0)) { /* !!! FIXME: after 2.0.6 ships, let's delete this code and just - use the /proc/%llu version. There's no reason to have - two copies of this plus all the #ifdefs. --ryan. */ + use the /proc/%llu version. There's no reason to have + two copies of this plus all the #ifdefs. --ryan. */ #if defined(__FREEBSD__) retval = readSymLink("/proc/curproc/file"); #elif defined(__NETBSD__) @@ -808,7 +808,7 @@ char *SDL_GetBasePath() } /* If we had access to argv[0] here, we could check it for a path, - or troll through $PATH looking for it, too. */ + or troll through $PATH looking for it, too. */ if (retval != NULL) { /* chop off filename. */ char *ptr = SDL_strrchr(retval, '/'); @@ -834,12 +834,12 @@ char *SDL_GetPrefPath(const char *org, const char *app) { // From sdl2-2.0.9/src/filesystem/unix/SDL_sysfilesystem.c /* - * We use XDG's base directory spec, even if you're not on Linux. - * This isn't strictly correct, but the results are relatively sane - * in any case. - * - * https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html - */ + * We use XDG's base directory spec, even if you're not on Linux. + * This isn't strictly correct, but the results are relatively sane + * in any case. + * + * https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html + */ const char *envr = SDL_getenv("XDG_DATA_HOME"); const char *append; char *retval = NULL; diff --git a/Source/utils/sdl2_to_1_2_backports.h b/Source/utils/sdl2_to_1_2_backports.h index 1552939aa..48e82d542 100644 --- a/Source/utils/sdl2_to_1_2_backports.h +++ b/Source/utils/sdl2_to_1_2_backports.h @@ -1,12 +1,13 @@ #pragma once -#include #include +#include +#include #include #include #include -#include -#include + +#include #include "utils/attributes.h" #include "utils/console.h" diff --git a/Source/utils/sdl_cond.h b/Source/utils/sdl_cond.h index 4b1994832..ec7046621 100644 --- a/Source/utils/sdl_cond.h +++ b/Source/utils/sdl_cond.h @@ -1,48 +1,49 @@ -#pragma once - -#include -#include "sdl_mutex.h" - -namespace devilution { - -/* - * RAII wrapper for SDL_cond. - */ -class SdlCond final { -public: - SdlCond() - : cond(SDL_CreateCond()) - { - if (cond == nullptr) - ErrSdl(); - } - - ~SdlCond() - { - SDL_DestroyCond(cond); - } - - SdlCond(const SdlCond &) = delete; - SdlCond(SdlCond &&) = delete; - SdlCond &operator=(const SdlCond &) = delete; - SdlCond &operator=(SdlCond &&) = delete; - - void signal() - { - int err = SDL_CondSignal(cond); - if (err < 0) - ErrSdl(); - } - - void wait(SdlMutex &mutex) - { - int err = SDL_CondWait(cond, mutex.get()); - if (err < 0) - ErrSdl(); - } - -private: - SDL_cond *cond; -}; - -} // namespace devilution +#pragma once + +#include + +#include "sdl_mutex.h" + +namespace devilution { + +/** + * RAII wrapper for SDL_cond. + */ +class SdlCond final { +public: + SdlCond() + : cond(SDL_CreateCond()) + { + if (cond == nullptr) + ErrSdl(); + } + + ~SdlCond() + { + SDL_DestroyCond(cond); + } + + SdlCond(const SdlCond &) = delete; + SdlCond(SdlCond &&) = delete; + SdlCond &operator=(const SdlCond &) = delete; + SdlCond &operator=(SdlCond &&) = delete; + + void signal() + { + int err = SDL_CondSignal(cond); + if (err < 0) + ErrSdl(); + } + + void wait(SdlMutex &mutex) + { + int err = SDL_CondWait(cond, mutex.get()); + if (err < 0) + ErrSdl(); + } + +private: + SDL_cond *cond; +}; + +} // namespace devilution diff --git a/Source/utils/sdl_thread.cpp b/Source/utils/sdl_thread.cpp index 168dd25f3..5aa7ad014 100644 --- a/Source/utils/sdl_thread.cpp +++ b/Source/utils/sdl_thread.cpp @@ -17,4 +17,4 @@ void SdlThread::ThreadDeleter(SDL_Thread *thread) app_fatal("Joinable thread destroyed"); } -} //namespace devilution +} // namespace devilution diff --git a/Source/utils/sdl_thread.h b/Source/utils/sdl_thread.h index 079ff6ee2..10fae419e 100644 --- a/Source/utils/sdl_thread.h +++ b/Source/utils/sdl_thread.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #ifdef USE_SDL1 #include "utils/sdl2_to_1_2_backports.h" #endif @@ -14,7 +14,7 @@ inline SDL_threadID get_id() { return SDL_GetThreadID(nullptr); } -} //namespace this_sdl_thread +} // namespace this_sdl_thread class SdlThread final { static int SDLCALL ThreadTranslate(void *ptr); diff --git a/Source/utils/sdl_wrap.h b/Source/utils/sdl_wrap.h index 77f9ea8d1..505fe7a16 100644 --- a/Source/utils/sdl_wrap.h +++ b/Source/utils/sdl_wrap.h @@ -65,6 +65,6 @@ inline SDLPaletteUniquePtr AllocPalette(int ncolors = 256) return SDLPaletteUniquePtr { NonNull(SDL_AllocPalette(ncolors)) }; } -} //namespace SDLWrap +} // namespace SDLWrap -} //namespace devilution +} // namespace devilution diff --git a/Source/utils/soundsample.cpp b/Source/utils/soundsample.cpp index 347b4adcc..034b88f45 100644 --- a/Source/utils/soundsample.cpp +++ b/Source/utils/soundsample.cpp @@ -13,8 +13,8 @@ #include "utils/sdl2_backports.h" #endif -#include "options.h" #include "engine/assets.hpp" +#include "options.h" #include "utils/log.hpp" #include "utils/math.h" #include "utils/stubs.h" diff --git a/test/animationinfo_test.cpp b/test/animationinfo_test.cpp index c152aacb7..6c59264b6 100644 --- a/test/animationinfo_test.cpp +++ b/test/animationinfo_test.cpp @@ -49,9 +49,9 @@ struct GameTickData : TestData { * This happens directly after the game_logic (_fProgressToNextGameTick = 0) or if no GameTick is due between two GameTicks (_fProgressToNextGameTick != 0). */ struct RenderingData : TestData { - /* - * @brief the progress as a fraction (0.0f to 1.0f) in time to the next game tick - */ + /** + * @brief the progress as a fraction (0.0f to 1.0f) in time to the next game tick + */ float _fProgressToNextGameTick; int _ExpectedRenderingFrame; RenderingData(float fProgressToNextGameTick, int expectedRenderingFrame) @@ -61,12 +61,12 @@ struct RenderingData : TestData { } }; -/* -* @brief -* This UnitTest tries to simulate the GameLoop (GameTickData) and the Rendering that can happen (RenderingData). -* Rendering can happen more often than GameTicks and at any time between two GameTicks. -* The Animation Distribution Logic must adjust to the Rendering that happens at any give point in time. -*/ +/** + * @brief + * This UnitTest tries to simulate the GameLoop (GameTickData) and the Rendering that can happen (RenderingData). + * Rendering can happen more often than GameTicks and at any time between two GameTicks. + * The Animation Distribution Logic must adjust to the Rendering that happens at any give point in time. + */ void RunAnimationTest(const std::vector &vecTestData) { AnimationInfo animInfo = {}; @@ -218,9 +218,9 @@ TEST(AnimationInfo, AttackSwordWarriorWithFastestAttack) // Skipped frames and P }); } -/* -* @brief The Warrior make two attacks. The second queued attack cancels the first after the Hit Frame. -*/ +/** + * @brief The Warrior make two attacks. The second queued attack cancels the first after the Hit Frame. + */ TEST(AnimationInfo, AttackSwordWarriorRepeated) { RunAnimationTest( diff --git a/test/path_test.cpp b/test/path_test.cpp index eccf46935..7901d9009 100644 --- a/test/path_test.cpp +++ b/test/path_test.cpp @@ -115,10 +115,10 @@ void CheckPath(Point startPosition, Point destinationPosition, std::vector