Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Srb František
Cpp-Game
Commits
9a3a3445
Commit
9a3a3445
authored
Sep 08, 2021
by
Srb František
Browse files
Fix Compiler warnings
fix 3 compiler warnings and a typo in highscore save prompt
parent
b1c2935a
Changes
3
Hide whitespace changes
Inline
Side-by-side
CppGame/HighscoreModule.h
View file @
9a3a3445
...
@@ -10,7 +10,7 @@ public:
...
@@ -10,7 +10,7 @@ public:
private:
private:
std
::
string
path
;
std
::
string
path
;
int
entries_count
;
int
entries_count
;
typedef
struct
entry_st
{
struct
entry_st
{
std
::
string
name
;
std
::
string
name
;
long
time
;
long
time
;
int
level_count
;
int
level_count
;
...
...
CppGame/highscore.txt
View file @
9a3a3445
86 3 Any%Speedruner
86 3 Any%Speedruner
18 2 BetterBen
18 2 BetterBen
21 2 AvarageJohny
21 2 AvarageJohny
16 1 test123
2 0 quickEnder123
2 0 quickEnder123
\ No newline at end of file
CppGame/main.cpp
View file @
9a3a3445
...
@@ -37,7 +37,7 @@ const char* fragmentShaderSource = "#version 330 core\n"
...
@@ -37,7 +37,7 @@ const char* fragmentShaderSource = "#version 330 core\n"
void
showHighscoreTable
(
long
player_time
,
int
player_level
)
{
void
showHighscoreTable
(
long
player_time
,
int
player_level
)
{
auto
highscore_module
=
HighscoreModule
(
"highscore.txt"
);
auto
highscore_module
=
HighscoreModule
(
"highscore.txt"
);
highscore_module
.
Show
();
highscore_module
.
Show
();
std
::
cout
<<
"You finished at level "
<<
player_
time
<<
" in "
<<
player_
level
<<
" seconds! Enter your name: "
;
std
::
cout
<<
"You finished at level "
<<
player_
level
<<
" in "
<<
player_
time
<<
" seconds! Enter your name: "
;
std
::
string
name
;
std
::
string
name
;
std
::
cin
>>
name
;
std
::
cin
>>
name
;
highscore_module
.
Store
(
player_time
,
player_level
,
name
);
highscore_module
.
Store
(
player_time
,
player_level
,
name
);
...
@@ -66,6 +66,7 @@ GLFWwindow* createWindow()
...
@@ -66,6 +66,7 @@ GLFWwindow* createWindow()
if
(
!
gladLoadGLLoader
((
GLADloadproc
)
glfwGetProcAddress
))
{
if
(
!
gladLoadGLLoader
((
GLADloadproc
)
glfwGetProcAddress
))
{
std
::
cout
<<
"Failed to initialise GLAD"
<<
std
::
endl
;
std
::
cout
<<
"Failed to initialise GLAD"
<<
std
::
endl
;
}
}
return
window
;
}
}
unsigned
int
createShaderProgram
()
{
unsigned
int
createShaderProgram
()
{
...
@@ -178,7 +179,7 @@ int main()
...
@@ -178,7 +179,7 @@ int main()
else
{
else
{
// gameplay loop
// gameplay loop
display
.
CleanWindow
();
display
.
CleanWindow
();
game_over
=
level
.
update
(
delta_time
);
game_over
=
level
.
update
(
(
float
)
delta_time
);
level
.
render_scene
(
display
);
level
.
render_scene
(
display
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment