Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cpp-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
cpp-project
Commits
2edfb685
Commit
2edfb685
authored
7 months ago
by
David Maul
Browse files
Options
Downloads
Patches
Plain Diff
temporary fix for event handlers
parent
fd94bc7a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/level.cpp
+3
-2
3 additions, 2 deletions
src/level.cpp
src/level.hpp
+2
-0
2 additions, 0 deletions
src/level.hpp
src/main.cpp
+1
-1
1 addition, 1 deletion
src/main.cpp
with
6 additions
and
3 deletions
src/level.cpp
+
3
−
2
View file @
2edfb685
...
...
@@ -201,8 +201,9 @@ void Level::render(Engine* engine)
// Iterate over all events
while
(
!
engine
->
events
().
empty
())
{
// handleEvent(engine, engine->events().at(0));
handleEvent
(
*
engine
,
engine
->
events
().
at
(
0
));
handleEvent2
(
engine
,
engine
->
events
().
at
(
0
));
engine
->
events
().
pop_front
();
}
...
...
@@ -250,7 +251,7 @@ void Level::render(Engine* engine)
}
}
void
Level
::
handleEvent
(
Engine
*
engine
,
SDL_Event
&
event
)
void
Level
::
handleEvent
2
(
Engine
*
engine
,
SDL_Event
&
event
)
{
// Handle events for the level
if
(
event
.
type
==
SDL_KEYDOWN
)
...
...
This diff is collapsed.
Click to expand it.
src/level.hpp
+
2
−
0
View file @
2edfb685
...
...
@@ -29,6 +29,8 @@ class Level : public Scene
void
handleEvent
(
Engine
*
engine
,
SDL_Event
&
event
);
void
handleEvent2
(
Engine
*
engine
,
SDL_Event
&
event
);
int
add_building
(
Building
building
);
Building
remove_building
(
int
id
);
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
1
−
1
View file @
2edfb685
...
...
@@ -30,7 +30,7 @@ int main()
Engine
engine
(
window
);
Spritesheet
spritesheet
(
"
/media/data/rust/sprite-extractor
/spritesheet.h5"
,
engine
);
Spritesheet
spritesheet
(
"
.
/spritesheet.h5"
,
engine
);
engine
.
set_spritesheet
(
spritesheet
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment