Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Nov 26, 2023
1 parent e8599dd commit ec6694d
Show file tree
Hide file tree
Showing 35 changed files with 3 additions and 140 deletions.
4 changes: 0 additions & 4 deletions src/application.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/application.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/application.hpp

File src/application.hpp does not conform to Custom style guidelines. (lines 13)
#ifndef _application_hpp
#define _application_hpp

#include "noncopyable.hpp"

Expand All @@ -13,5 +11,3 @@ class application : private noncopyable {
int run();

Check warning on line 11 in src/application.hpp

View workflow job for this annotation

GitHub Actions / lint

/src/application.hpp:11:7 [modernize-use-trailing-return-type]

use a trailing return type for this function
};
}

#endif
4 changes: 0 additions & 4 deletions src/audiodevice.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/audiodevice.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/audiodevice.hpp

File src/audiodevice.hpp does not conform to Custom style guidelines. (lines 16)
#ifndef _audiodevice_hpp
#define _audiodevice_hpp

#include "common.hpp"

Expand All @@ -16,5 +14,3 @@ class audiodevice {
uint32_t _id;
};
}

#endif
5 changes: 1 addition & 4 deletions src/constants.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef _constants_hpp
#define _constants_hpp
#pragma once

static constexpr auto DELAY_MS = 1000 / 60;

#endif
4 changes: 0 additions & 4 deletions src/delay.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#pragma once
#ifndef _delay_hpp
#define _delay_hpp

#include "common.hpp"

void sleep(uint32_t ms);

#endif
4 changes: 0 additions & 4 deletions src/deleters.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/deleters.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/deleters.hpp

File src/deleters.hpp does not conform to Custom style guidelines. (lines 6, 7, 10, 11, 14, 15, 18, 19, 22, 23)
#ifndef _deleters_hpp
#define _deleters_hpp

#include "common.hpp"

Expand All @@ -25,5 +23,3 @@ struct SDL_Deleter {
SDL_RWclose(ptr);
}
};

#endif
4 changes: 0 additions & 4 deletions src/engine.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/engine.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/engine.hpp

File src/engine.hpp does not conform to Custom style guidelines. (lines 26, 34, 75)
#ifndef _engine_hpp
#define _engine_hpp

#include "common.hpp"

Expand Down Expand Up @@ -75,5 +73,3 @@ class engine : public input::eventreceiver {
std::shared_ptr<framework::statemanager> _statemanager;
};
}

#endif
4 changes: 0 additions & 4 deletions src/enginefactory.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/enginefactory.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/enginefactory.hpp

File src/enginefactory.hpp does not conform to Custom style guidelines. (lines 28)
#ifndef _enginefactory_hpp
#define _enginefactory_hpp

#include "common.hpp"

Expand Down Expand Up @@ -28,5 +26,3 @@ class enginefactory {
bool _fullscreen;
};
}

#endif
4 changes: 0 additions & 4 deletions src/entity.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/entity.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/entity.hpp

File src/entity.hpp does not conform to Custom style guidelines. (lines 68)
#ifndef _entity_hpp
#define _entity_hpp

#include "common.hpp"

Expand Down Expand Up @@ -68,5 +66,3 @@ class entity : public std::enable_shared_from_this<entity> {
std::function<void(std::shared_ptr<entity>)> _fn;
};
}

#endif
4 changes: 0 additions & 4 deletions src/entitymanager.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/entitymanager.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/entitymanager.hpp

File src/entitymanager.hpp does not conform to Custom style guidelines. (lines 27)
#ifndef _entitymanager_hpp
#define _entitymanager_hpp

#include "common.hpp"

Expand All @@ -27,5 +25,3 @@ class entitymanager {
std::list<std::shared_ptr<entity>> _entities;
};
}

#endif
4 changes: 0 additions & 4 deletions src/event.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/event.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/event.hpp

File src/event.hpp does not conform to Custom style guidelines. (lines 17)
#ifndef _event_hpp
#define _event_hpp

#include "common.hpp"

Expand All @@ -17,5 +15,3 @@ enum class mouseevent : int32_t {};

enum class joysticevent {};
}

#endif
4 changes: 0 additions & 4 deletions src/eventmanager.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/eventmanager.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/eventmanager.hpp

File src/eventmanager.hpp does not conform to Custom style guidelines. (lines 22)
#ifndef _eventmanager_hpp_
#define _eventmanager_hpp_

#include "common.hpp"

Expand All @@ -22,5 +20,3 @@ class eventmanager : private noncopyable {
std::list<std::shared_ptr<eventreceiver>> _receivers;
};
}

#endif
4 changes: 0 additions & 4 deletions src/eventreceiver.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once

Check notice on line 1 in src/eventreceiver.hpp

View workflow job for this annotation

GitHub Actions / lint

Run clang-format on src/eventreceiver.hpp

File src/eventreceiver.hpp does not conform to Custom style guidelines. (lines 18)
#ifndef _eventreceiver_hpp
#define _eventreceiver_hpp

#include "common.hpp"

Expand All @@ -18,5 +16,3 @@ class eventreceiver {
virtual void on_keyup(const keyevent &event);
};
}

#endif
4 changes: 0 additions & 4 deletions src/filesystem.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _filesystem_hpp
#define _filesystem_hpp

#include "common.hpp"

Expand All @@ -14,5 +12,3 @@ class filesystem {
~filesystem() noexcept = default;
};
}

#endif
4 changes: 0 additions & 4 deletions src/framerate.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _frames_hpp
#define _frames_hpp

#include "common.hpp"

Expand All @@ -22,5 +20,3 @@ class framerate : public loopable {
uint32_t _start;
};
}

#endif
4 changes: 0 additions & 4 deletions src/helpers.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#pragma once
#ifndef _helpers_hpp
#define _helpers_hpp

#define UNUSED(x) (void)(x)

#endif
4 changes: 0 additions & 4 deletions src/io.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _io_hpp
#define _io_hpp

#include "common.hpp"

Expand All @@ -13,5 +11,3 @@ class io {
static const std::vector<uint8_t> read(std::string_view filename);
};
}

#endif
4 changes: 0 additions & 4 deletions src/loopable.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _loopable_hpp
#define _loopable_hpp

namespace framework {
class loopable {
Expand All @@ -10,5 +8,3 @@ class loopable {
virtual void loop(uint32_t delta) = 0;
};
}

#endif
4 changes: 0 additions & 4 deletions src/noncopyable.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _noncopyable_hpp_
#define _noncopyable_hpp_

class noncopyable {
public:
Expand All @@ -12,5 +10,3 @@ class noncopyable {
noncopyable(noncopyable &&) = default;
noncopyable &operator=(noncopyable &&) = default;
};

#endif
4 changes: 2 additions & 2 deletions src/pixmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pixmap::pixmap(const std::shared_ptr<renderer> renderer, std::string_view filena

std::unique_ptr<SDL_Surface, decltype(&SDL_FreeSurface)> surface{SDL_CreateRGBSurfaceWithFormat(0, decoder->image->width, decoder->image->height, 0, SDL_PIXELFORMAT_ARGB8888), SDL_FreeSurface};

if (surface == nullptr) {
if (!surface) {
throw std::runtime_error(fmt::format("[SDL_CreateRGBSurfaceWithFormat] error while creating surface with format: {}, error {}", filename, SDL_GetError()));
}

Expand All @@ -52,7 +52,7 @@ pixmap::pixmap(const std::shared_ptr<renderer> renderer, std::string_view filena

_texture = texture_ptr(SDL_CreateTextureFromSurface(*renderer, surface.get()), SDL_Deleter());

if (_texture == nullptr) {
if (!_texture) {
throw std::runtime_error(fmt::format("[SDL_CreateTextureFromSurface] error while creating texture from surface: {}", filename));
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/pixmap.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _pixmap_hpp
#define _pixmap_hpp

#include "common.hpp"

Expand Down Expand Up @@ -35,5 +33,3 @@ class pixmap {
texture_ptr _texture;
};
}

#endif
4 changes: 0 additions & 4 deletions src/pixmappool.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _pixmappool_hpp
#define _pixmappool_hpp

#include "common.hpp"

Expand All @@ -22,5 +20,3 @@ class pixmappool {
std::unordered_map<std::string, std::shared_ptr<pixmap>, std::hash<std::string>> _pool;
};
}

#endif
4 changes: 0 additions & 4 deletions src/point.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _point_hpp
#define _point_hpp

#include "common.hpp"

Expand All @@ -25,5 +23,3 @@ class point {
int32_t _y;
};
}

#endif
4 changes: 0 additions & 4 deletions src/rect.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _rect_hpp
#define _rect_hpp

#include "common.hpp"

Expand All @@ -25,5 +23,3 @@ class rect {
geometry::size _size;
};
}

#endif
4 changes: 0 additions & 4 deletions src/renderer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _renderer_hpp
#define _renderer_hpp

#include "common.hpp"

Expand All @@ -20,5 +18,3 @@ class renderer {
std::unique_ptr<SDL_Renderer, SDL_Deleter> _renderer;
};
}

#endif
4 changes: 0 additions & 4 deletions src/resourcemanager.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _resourcemanager_hpp
#define _resourcemanager_hpp

#include "common.hpp"

Expand All @@ -26,5 +24,3 @@ class resourcemanager {
std::shared_ptr<audio::soundmanager> _soundmanager;
};
}

#endif
4 changes: 0 additions & 4 deletions src/scriptengine.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _scriptengine_hpp
#define _scriptengine_hpp

#include "common.hpp"

Expand All @@ -13,5 +11,3 @@ class scriptengine : private noncopyable {
void run();
};
}

#endif
6 changes: 0 additions & 6 deletions src/singleton.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _singleton_hpp
#define _singleton_hpp

#include "common.hpp"

Expand All @@ -11,7 +9,3 @@ class singleton {

static std::shared_ptr<T> instance();
};

// #include "singleton.cpp"

#endif
4 changes: 0 additions & 4 deletions src/size.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _size_hpp
#define _size_hpp

#include "common.hpp"

Expand All @@ -26,5 +24,3 @@ class size {
uint32_t _height;
};
}

#endif
4 changes: 0 additions & 4 deletions src/soundfx.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#ifndef _soundfx_hpp
#define _soundfx_hpp

#include "common.hpp"

Expand All @@ -18,5 +16,3 @@ class soundfx {
std::shared_ptr<audiodevice> _audiodevice;
};
}

#endif

0 comments on commit ec6694d

Please sign in to comment.