Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
APO_sem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pelech, Ondřej
APO_sem
Commits
91cebbda
Commit
91cebbda
authored
1 year ago
by
Pham, Thi Thien Trang
Browse files
Options
Downloads
Patches
Plain Diff
Add free text
parent
d86b9412
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main/main.c
+18
-16
18 additions, 16 deletions
main/main.c
main/text.c
+1
-0
1 addition, 0 deletions
main/text.c
with
19 additions
and
16 deletions
main/main.c
+
18
−
16
View file @
91cebbda
...
...
@@ -233,21 +233,20 @@ int main(int argc, char *argv[]) {
end_game_text
->
draw
(
end_game_text
,
frame_buffer
,
80
,
130
);
frame_buffer
->
draw
(
frame_buffer
);
// FREE OBJECTS
info
(
"free"
);
debug
(
"free projectiles"
);
for
(
int
i
=
0
;
i
<
max_projectiles
;
i
++
)
{
if
(
projectiles
[
i
]
!=
NULL
)
projectiles
[
i
]
->
free
(
projectiles
[
i
]);
}
free
(
projectiles
);
debug
(
"free enemies"
);
for
(
int
i
=
0
;
i
<
num_enemy
;
i
++
)
{
printf
(
"%d
\n
"
,
i
);
if
(
enemies
[
i
]
!=
NULL
)
enemies
[
i
]
->
free
(
enemies
[
i
]);
}
free
(
enemies
);
// FREE OBJECTS
info
(
"free"
);
debug
(
"free projectiles"
);
for
(
int
i
=
0
;
i
<
max_projectiles
;
i
++
)
{
if
(
projectiles
[
i
]
!=
NULL
)
projectiles
[
i
]
->
free
(
projectiles
[
i
]);
}
free
(
projectiles
);
debug
(
"free enemies"
);
for
(
int
i
=
0
;
i
<
num_enemy
;
i
++
)
{
if
(
enemies
[
i
]
!=
NULL
)
enemies
[
i
]
->
free
(
enemies
[
i
]);
}
free
(
enemies
);
debug
(
"free obstacles"
);
for
(
int
i
=
0
;
i
<
max_obstacles
;
i
++
)
{
...
...
@@ -260,7 +259,10 @@ int main(int argc, char *argv[]) {
debug
(
"free buffer"
);
frame_buffer
->
free
(
frame_buffer
);
printf
(
"Goodbye world
\n
"
);
welcome_text
->
free
(
welcome_text
);
end_game_text
->
free
(
end_game_text
);
printf
(
"Goodbye world
\n
"
);
serialize_unlock
();
...
...
This diff is collapsed.
Click to expand it.
main/text.c
+
1
−
0
View file @
91cebbda
...
...
@@ -47,5 +47,6 @@ int16_t text_draw(struct text* self,struct frame_buffer* buffer, int16_t x, int1
void
free_text
(
struct
text
*
self
){
free
(
self
->
text
);
free
(
self
);
}
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