home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
de5e703
)
Use pointers instead of putting the whole struct on the stack.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 12 May 2013 22:00:27 +0000
(
00:00
+0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 12 May 2013 22:00:27 +0000
(
00:00
+0200)
roguelike.c
patch
|
blob
|
history
diff --git
a/roguelike.c
b/roguelike.c
index 4bc6f74f6ef2ada3da10759d5361502128fd81b3..44082d2270f146867e9107aff2e5e04b6e10cb89 100644
(file)
--- a/
roguelike.c
+++ b/
roguelike.c
@@
-106,8
+106,8
@@
void draw_text_from_bottom (struct Win * win, char * text) {
void draw_log (struct Win * win) {
// Draw log text from world struct in win->data from bottom to top.
void draw_log (struct Win * win) {
// Draw log text from world struct in win->data from bottom to top.
- struct World
world = *
(struct World *) win->data;
- draw_text_from_bottom(win, world
.
log); }
+ struct World
* world =
(struct World *) win->data;
+ draw_text_from_bottom(win, world
->
log); }
void draw_map (struct Win * win) {
// Draw map determined by win->data Map struct into window. Respect offset.
void draw_map (struct Win * win) {
// Draw map determined by win->data Map struct into window. Respect offset.
@@
-130,8
+130,8
@@
void draw_map (struct Win * win) {
void draw_info (struct Win * win) {
// Draw info window by appending win->data integer value to "Turn: " display.
void draw_info (struct Win * win) {
// Draw info window by appending win->data integer value to "Turn: " display.
- struct World
world = *
(struct World *) win->data;
- int count = world
.
turn;
+ struct World
* world =
(struct World *) win->data;
+ int count = world
->
turn;
char text[100];
snprintf(text, 100, "Turn: %d", count);
draw_with_linebreaks(win, text, 0); }
char text[100];
snprintf(text, 100, "Turn: %d", count);
draw_with_linebreaks(win, text, 0); }