summaryrefslogtreecommitdiff
path: root/table
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-16 12:01:46 +0000
committertron <tron@openttd.org>2005-11-16 12:01:46 +0000
commitce9cbb9c47beb6d17a8bf7743a8c25c1989b6ece (patch)
tree57ab7d946f33a83ab3919738a96d2b38bf80b427 /table
parent8d57bfc921c2aa3acbbbb0330ae699032c51afd4 (diff)
downloadopenttd-ce9cbb9c47beb6d17a8bf7743a8c25c1989b6ece.tar.xz
(svn r3196) Use structs instead of magic offsets into arrays
Diffstat (limited to 'table')
-rw-r--r--table/tree_land.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/table/tree_land.h b/table/tree_land.h
index 1dd1409d8..d94ef1be4 100644
--- a/table/tree_land.h
+++ b/table/tree_land.h
@@ -13,11 +13,16 @@ static const SpriteID _tree_sprites_1[4] = {
static const byte _tree_base_by_landscape[4] = {0, 12, 20, 32};
static const byte _tree_count_by_landscape[4] = {12, 8, 12, 9};
-static const byte _tree_layout_xy[4][8] = {
-{9, 3, 1, 8, 0, 0, 8, 9},
-{4, 4, 9, 1, 6, 9, 0, 9},
-{9, 1, 0, 9, 6, 6, 3, 0},
-{3, 9, 8, 2, 9, 9, 1, 5},
+typedef struct TreePos {
+ uint8 x;
+ uint8 y;
+} TreePos;
+
+static const TreePos _tree_layout_xy[][4] = {
+ { { 9, 3 }, { 1, 8 }, { 0, 0 }, { 8, 9 } },
+ { { 4, 4 }, { 9, 1 }, { 6, 9 }, { 0, 9 } },
+ { { 9, 1 }, { 0, 9 }, { 6, 6 }, { 3, 0 } },
+ { { 3, 9 }, { 8, 2 }, { 9, 9 }, { 1, 5 } }
};
static const PalSpriteID _tree_layout_sprite[164+(79-48+1)][4] = {