Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Oct 30, 2023
1 parent 1d39cca commit 50ecf5f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 66 deletions.
61 changes: 0 additions & 61 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,4 @@
{
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 2, TabWidth: 2, BreakBeforeBraces: Attach, AllowShortIfStatementsOnASingleLine: true, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -2 }",
"files.associations": {
"__bit_reference": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__verbose_abort": "cpp",
"array": "cpp",
"atomic": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"exception": "cpp",
"forward_list": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"locale": "cpp",
"mutex": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"variant": "cpp",
"vector": "cpp",
"algorithm": "cpp",
"list": "cpp"
}
}
5 changes: 2 additions & 3 deletions src/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ void engine::run() {

SDL_Event event;

Check warning on line 20 in src/engine.cpp

View workflow job for this annotation

GitHub Actions / lint

/src/engine.cpp:20:13 [cppcoreguidelines-init-variables]

variable 'event' is not initialized
while (_running) {
_time = SDL_GetTicks();

const auto now = SDL_GetTicks();
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
_running = false;
Expand All @@ -33,7 +32,7 @@ void engine::run() {

_renderer->end_draw();

const auto delta = SDL_GetTicks() - _time;
const auto delta = SDL_GetTicks() - now;
if (delta < DELAY_MS) {
SDL_Delay(DELAY_MS - delta);
}
Expand Down
2 changes: 0 additions & 2 deletions src/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class engine : private noncopyable {
private:
bool _running;

uint32_t _time;

std::list<std::shared_ptr<loopable>> _loopables;
std::shared_ptr<window> _window;
std::shared_ptr<renderer> _renderer;
Expand Down

0 comments on commit 50ecf5f

Please sign in to comment.