Skip to content

Commit

Permalink
update code style
Browse files Browse the repository at this point in the history
 - update seperators, hopefully I should waste less time deciding where to put them now
 - remove copyright message from headers
  • Loading branch information
jagoly committed Mar 6, 2024
1 parent 180e9e3 commit 42e6cf5
Show file tree
Hide file tree
Showing 85 changed files with 512 additions and 780 deletions.
19 changes: 6 additions & 13 deletions include/sqee/app/Application.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
// Copyright(c) 2020 James Gangur
// Part of https://github.com/jagoly/sqee

#pragma once

#include <sqee/setup.hpp>

#include <sqee/core/TypeAliases.hpp>

namespace sq {

//============================================================================//
namespace sq { //###############################################################

/// The SQEE Application base class.
class SQEE_API Application
{
public: //====================================================//
public: //======================================================

Application() = default;

Expand All @@ -23,7 +18,7 @@ class SQEE_API Application

virtual ~Application() = default;

//--------------------------------------------------------//
//----------------------------------------------------------

/// Launch the main application loop.
int run(int argc, char** argv);
Expand All @@ -34,15 +29,15 @@ class SQEE_API Application
/// Reset timer for going into inactive mode.
void reset_inactivity() { mElapsedSinceActivity = 0.0; }

protected: //=================================================//
protected: //===================================================

/// Called once before the main loop starts.
virtual void initialise(std::vector<String> args) = 0;

/// Called continuously while running.
virtual void update(double elapsed) = 0;

//--------------------------------------------------------//
//----------------------------------------------------------

/// How long to go without user input before limiting update rate.
double mMaxInactivePeriod = INFINITY;
Expand All @@ -60,6 +55,4 @@ class SQEE_API Application
std::function<void()> mCallNextFrame = nullptr;
};

//============================================================================//

} // namespace sq
} // namespace sq ##############################################################
25 changes: 9 additions & 16 deletions include/sqee/app/AudioContext.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
// Copyright(c) 2020 James Gangur
// Part of https://github.com/jagoly/sqee

#pragma once

#include <sqee/setup.hpp>

namespace sq {

//====== Forward Declarations and Enums ======================================//
namespace sq { //###############################################################

class Sound;

Expand All @@ -32,12 +27,12 @@ struct SoundGroups
/// Bitwise OR operator for enum class type.
constexpr SoundGroups operator|(SoundGroup a, SoundGroup b) { return SoundGroups(uint8_t(a) | uint8_t(b)); }

//============================================================================//
//==============================================================================

/// Handles the initialisation and playback of audio.
class SQEE_API AudioContext
{
public: //====================================================//
public: //======================================================

AudioContext();

Expand All @@ -46,28 +41,28 @@ class SQEE_API AudioContext

~AudioContext();

//--------------------------------------------------------//
//----------------------------------------------------------

/// Play a sound using the next available id.
int32_t play_sound(const Sound& sound, SoundGroup group, float volume, bool loop);

//--------------------------------------------------------//
//----------------------------------------------------------

/// Pause or resume an individual sound.
void set_sound_paused(int32_t id, bool pause);

/// Remove an individual sound.
void stop_sound(int32_t id);

//--------------------------------------------------------//
//----------------------------------------------------------

/// Pause or resume zero or more sounds.
void set_sounds_paused(std::span<const int32_t> ids, bool pause);

/// Remove zero or more sounds.
void stop_sounds(std::span<const int32_t> ids);

//--------------------------------------------------------//
//----------------------------------------------------------

/// Do not start sounds from one or more groups.
void set_groups_ignored(SoundGroups groups, bool ignore);
Expand All @@ -78,7 +73,7 @@ class SQEE_API AudioContext
/// Remove all sounds in the specified groups.
void stop_groups(SoundGroups groups);

private: //===================================================//
private: //=====================================================

struct ActiveSound
{
Expand Down Expand Up @@ -107,6 +102,4 @@ class SQEE_API AudioContext
friend Sound;
};

//============================================================================//

} // namespace sq
} // namespace sq ##############################################################
15 changes: 4 additions & 11 deletions include/sqee/app/DebugOverlay.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright(c) 2020 James Gangur
// Part of https://github.com/jagoly/sqee

#pragma once

#include <sqee/setup.hpp>
Expand All @@ -9,14 +6,12 @@
#include <sqee/core/TypeAliases.hpp>
#include <sqee/vk/Vulkan.hpp>

namespace sq {

//============================================================================//
namespace sq { //###############################################################

/// The SQEE Debugging Overlay.
class SQEE_API DebugOverlay final : public Scene
{
public: //====================================================//
public: //======================================================

DebugOverlay();

Expand All @@ -34,7 +29,7 @@ class SQEE_API DebugOverlay final : public Scene
/// Check if the overlay is drawn.
bool check_active() const { return mActive; }

private: //===================================================//
private: //=====================================================

void update() override;

Expand Down Expand Up @@ -65,6 +60,4 @@ class SQEE_API DebugOverlay final : public Scene
String mFrameSubTimerTotalDisplay;
};

//============================================================================//

} // namespace sq
} // namespace sq ##############################################################
13 changes: 3 additions & 10 deletions include/sqee/app/Event.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright(c) 2020 James Gangur
// Part of https://github.com/jagoly/sqee

#pragma once

#include <sqee/setup.hpp>
Expand All @@ -9,9 +6,7 @@
#include <sqee/core/TypeAliases.hpp>
#include <sqee/maths/Vectors.hpp>

namespace sq {

//============================================================================//
namespace sq { //###############################################################

enum class Keyboard_Key : int8_t
{
Expand All @@ -36,7 +31,7 @@ enum class Mouse_Button : int8_t
ExtraA, ExtraB
};

//============================================================================//
//==============================================================================

struct Event final
{
Expand Down Expand Up @@ -69,9 +64,7 @@ struct Event final
Data data {};
};

//============================================================================//

} // namespace sq
} // namespace sq ##############################################################

SQEE_ENUM_HELPER
(
Expand Down
13 changes: 3 additions & 10 deletions include/sqee/app/Gamepad.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// Copyright(c) 2020 James Gangur
// Part of https://github.com/jagoly/sqee

#pragma once

#include <sqee/setup.hpp>

#include <sqee/core/EnumHelper.hpp>

namespace sq {

//============================================================================//
namespace sq { //###############################################################

enum class Gamepad_Button : int8_t
{
Expand All @@ -30,7 +25,7 @@ enum class Gamepad_Axis : int8_t
RightTrigger
};

//============================================================================//
//==============================================================================

/// The raw state of a gamepad.
struct GamepadState
Expand Down Expand Up @@ -78,9 +73,7 @@ struct Gamepad : public GamepadState
}
};

//============================================================================//

} // namespace sq
} // namespace sq ##############################################################

SQEE_ENUM_HELPER
(
Expand Down
27 changes: 10 additions & 17 deletions include/sqee/app/GuiSystem.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright(c) 2020 James Gangur
// Part of https://github.com/jagoly/sqee

#pragma once

#include <sqee/setup.hpp>
Expand All @@ -9,19 +6,17 @@
#include <sqee/vk/SwapBuffer.hpp>
#include <sqee/vk/Vulkan.hpp>

namespace sq {

//====== Forward Declarations ================================================//
namespace sq { //###############################################################

struct Event;
class InputDevices;
class Window;

//============================================================================//
//==============================================================================

class SQEE_API GuiSystem
{
public: //====================================================//
public: //======================================================

GuiSystem(Window& window, InputDevices& inputDevices);

Expand All @@ -30,7 +25,7 @@ class SQEE_API GuiSystem

~GuiSystem();

//--------------------------------------------------------//
//----------------------------------------------------------

void set_style_widgets_default();
void set_style_widgets_supertux();
Expand All @@ -40,7 +35,7 @@ class SQEE_API GuiSystem
void set_style_colours_light();
void set_style_colours_supertux();

//--------------------------------------------------------//
//----------------------------------------------------------

bool handle_event(Event event);

Expand All @@ -50,16 +45,16 @@ class SQEE_API GuiSystem

void render_gui(vk::CommandBuffer cmdbuf);

//--------------------------------------------------------//
//----------------------------------------------------------

/// Contains a single CombinedImageSampler.
vk::DescriptorSetLayout get_descriptor_set_layout() const { return mDescriptorSetLayout; }

//--------------------------------------------------------//
//----------------------------------------------------------

void show_imgui_demo();

private: //===================================================//
private: //=====================================================

void load_ubuntu_fonts();

Expand All @@ -69,7 +64,7 @@ class SQEE_API GuiSystem
Window& window;
InputDevices& input;

//--------------------------------------------------------//
//----------------------------------------------------------

Texture mFontTexture;
SwapBuffer mVertexBuffer;
Expand All @@ -82,6 +77,4 @@ class SQEE_API GuiSystem
vk::Pipeline mPipeline;
};

//============================================================================//

} // namespace sq
} // namespace sq ##############################################################
Loading

0 comments on commit 42e6cf5

Please sign in to comment.