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
cb3416a3
Commit
cb3416a3
authored
1 year ago
by
phamthit
Browse files
Options
Downloads
Patches
Plain Diff
Change the colour of objects
parent
598b9e33
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/draw.c
+2
-2
2 additions, 2 deletions
main/draw.c
main/draw.h
+1
-0
1 addition, 0 deletions
main/draw.h
with
3 additions
and
2 deletions
main/draw.c
+
2
−
2
View file @
cb3416a3
...
...
@@ -161,7 +161,7 @@ int16_t draw_plane(struct frame_buffer* self, const int x, const int y) {
uint32_t
col
=
i
%
pic_size
;
uint32_t
row
=
i
/
pic_size
;
int
fb_index
=
((
y
+
row
)
*
self
->
width
)
+
(
x
+
col
);
self
->
buffer
[
fb_index
]
=
picture
[
i
]
!=
0
?
FB_
BLUE
:
(
FBUF_DTYPE
)
self
->
background_color
;
self
->
buffer
[
fb_index
]
=
picture
[
i
]
!=
0
?
FB_
GREEN
:
(
FBUF_DTYPE
)
self
->
background_color
;
}
return
ret
;
...
...
@@ -214,7 +214,7 @@ int16_t draw_enemy(struct frame_buffer* self, const int x, const int y){
uint32_t
col
=
i
%
pic_size
;
uint32_t
row
=
i
/
pic_size
;
int
fb_index
=
((
y
+
row
)
*
self
->
width
)
+
(
x
+
col
);
self
->
buffer
[
fb_index
]
=
picture
[
i
]
!=
0
?
FB_
BLUE
:
(
FBUF_DTYPE
)
self
->
background_color
;
self
->
buffer
[
fb_index
]
=
picture
[
i
]
!=
0
?
FB_
RED
:
(
FBUF_DTYPE
)
self
->
background_color
;
}
return
ret
;
...
...
This diff is collapsed.
Click to expand it.
main/draw.h
+
1
−
0
View file @
cb3416a3
...
...
@@ -54,6 +54,7 @@ enum {ERROR_BUF_INIT = 201,ERROR_INVALID_VALUES};
#define FB_GREEN (RGB(0, FB_GREEN_MAX, 0))
#define FB_RED (RGB(FB_RED_MAX, 0, 0))
#define FB_BLACK (RGB(0,0,0))
#define FB_WHITE (RGB(FB_RED_MAX, FB_GREEN_MAX, FB_BLUE_MAX)
#define DEFAULT_PICTURE_SIZE 16
...
...
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