projects
/
csrpg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f28d70
)
fixed incorrect size being malloc'd for tiles
author
matthew
<matthew@owens.tech>
Sat, 4 Aug 2018 11:55:56 +0000
(12:55 +0100)
committer
matthew
<matthew@owens.tech>
Sat, 4 Aug 2018 11:55:56 +0000
(12:55 +0100)
common/board.c
patch
|
blob
|
history
diff --git
a/common/board.c
b/common/board.c
index
31c178d
..
08214c4
100644
(file)
--- a/
common/board.c
+++ b/
common/board.c
@@
-21,15
+21,13
@@
Board *board_init(Point2i size)
b->dimensions.x = size.x;
b->dimensions.y = size.y;
- b->tiles = malloc(size
.x * size.y * sizeof(Tile)
);
+ b->tiles = malloc(size
of(Tile *) * size.x * size.y
);
for(int y = 0; y < size.y; ++y){
for(int x = 0; x < size.x; ++x){
itr = flatten(point2i(x, y), size);
- printf("%d\t", itr);
b->tiles[itr] = tile_init(point3i(x, y, itr), PLAIN);
}
- printf("\n");
}
ret = (Board *) b;