summaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-20 20:06:55 +0000
committerrubidium <rubidium@openttd.org>2007-10-20 20:06:55 +0000
commit5718567d1ee860ca01fc927ca3cbb1c8c37d84d0 (patch)
tree5d2ab777da0af72af2a6805d4bac7c1927e89b34 /src/table
parent4e32964c18084280162d609bbda71eb3d53f0a38 (diff)
downloadopenttd-5718567d1ee860ca01fc927ca3cbb1c8c37d84d0.tar.xz
(svn r11316) -Codechange: add support for the half-tile (selection) graphics.
Diffstat (limited to 'src/table')
-rw-r--r--src/table/files.h2
-rw-r--r--src/table/landscape_sprite.h40
-rw-r--r--src/table/sprites.h17
3 files changed, 52 insertions, 7 deletions
diff --git a/src/table/files.h b/src/table/files.h
index 98888c8d3..3deba561a 100644
--- a/src/table/files.h
+++ b/src/table/files.h
@@ -65,5 +65,7 @@ static MD5File files_openttd[] = {
{ "group.grf", { 0xe8, 0x52, 0x5f, 0x1c, 0x3e, 0xf9, 0x91, 0x9d, 0x0f, 0x70, 0x8c, 0x8a, 0x21, 0xa4, 0xc7, 0x02 } },
{ "tramtrkw.grf", { 0x83, 0x0a, 0xf4, 0x9f, 0x29, 0x10, 0x48, 0xfd, 0x76, 0xe9, 0xda, 0xac, 0x5d, 0xa2, 0x30, 0x45 } },
{ "oneway.grf", { 0xbb, 0xc6, 0xa3, 0xb2, 0xb3, 0xa0, 0xc9, 0x3c, 0xc9, 0xee, 0x24, 0x7c, 0xb6, 0x51, 0x74, 0x63 } },
+ { "halffndw.grf", { 0xf2, 0x10, 0xe0, 0xc1, 0xa1, 0xdc, 0xb3, 0x6e, 0x3f, 0xce, 0xb8, 0x98, 0x1a, 0x08, 0xb0, 0x67 } },
+ { "halfselw.grf", { 0xf2, 0x12, 0x2e, 0x88, 0x58, 0x08, 0xc4, 0xa5, 0xbd, 0x91, 0xb3, 0xc2, 0x5b, 0x5a, 0xb9, 0xf4 } },
{ "flags.grf", { 0xa1, 0xd7, 0x72, 0x75, 0x0e, 0x81, 0x86, 0x0e, 0xc9, 0xcd, 0xc2, 0x57, 0xb2, 0x19, 0xe1, 0x0c } },
};
diff --git a/src/table/landscape_sprite.h b/src/table/landscape_sprite.h
index 88f5f48b1..49b650e47 100644
--- a/src/table/landscape_sprite.h
+++ b/src/table/landscape_sprite.h
@@ -1,5 +1,10 @@
/* $Id$ */
+enum {
+ SKIP = 0xFFFE,
+ END = 0xFFFF
+};
+
static const SpriteID _landscape_spriteindexes_1[] = {
0xF67, 0xF9F,
0xAAD, 0xAB0,
@@ -138,7 +143,7 @@ END
Skip first 3 sprites and only load the proper set */
static const SpriteID _slopes_spriteindexes_0[] = {
SKIP, 3,
- SPR_SLOPES_BASE, SPR_SLOPES_BASE + 73,
+ SPR_SLOPES_VIRTUAL_BASE + 15, SPR_SLOPES_VIRTUAL_BASE + 4 * SPR_TRKFOUND_BLOCK_SIZE,
END
};
@@ -146,7 +151,7 @@ static const SpriteID _slopes_spriteindexes_0[] = {
Skip first 79 sprites and only load the proper set */
static const SpriteID _slopes_spriteindexes_1[] = {
SKIP, 79,
- SPR_SLOPES_BASE, SPR_SLOPES_BASE + 73,
+ SPR_SLOPES_VIRTUAL_BASE + 15, SPR_SLOPES_VIRTUAL_BASE + 4 * SPR_TRKFOUND_BLOCK_SIZE,
END
};
@@ -154,7 +159,7 @@ static const SpriteID _slopes_spriteindexes_1[] = {
Skip first 155 sprites and only load the proper set */
static const SpriteID _slopes_spriteindexes_2[] = {
SKIP, 155,
- SPR_SLOPES_BASE, SPR_SLOPES_BASE + 73,
+ SPR_SLOPES_VIRTUAL_BASE + 15, SPR_SLOPES_VIRTUAL_BASE + 4 * SPR_TRKFOUND_BLOCK_SIZE,
END
};
@@ -162,6 +167,33 @@ static const SpriteID _slopes_spriteindexes_2[] = {
Skip first 231 sprites and only load the proper set */
static const SpriteID _slopes_spriteindexes_3[] = {
SKIP, 231,
- SPR_SLOPES_BASE, SPR_SLOPES_BASE + 73,
+ SPR_SLOPES_VIRTUAL_BASE + 15, SPR_SLOPES_VIRTUAL_BASE + 4 * SPR_TRKFOUND_BLOCK_SIZE,
+ END
+};
+
+/* Halftile foundation indexes for temperate climate */
+static const SpriteID _halftile_foundation_spriteindexes_0[] = {
+ SPR_HALFTILE_FOUNDATION_BASE, SPR_HALFTILE_FOUNDATION_BASE + 4 * SPR_HALFTILE_BLOCK_SIZE - 1,
+ END
+};
+
+/* Halftile foundation indexes for arctic climate */
+static const SpriteID _halftile_foundation_spriteindexes_1[] = {
+ SKIP, 16,
+ SPR_HALFTILE_FOUNDATION_BASE, SPR_HALFTILE_FOUNDATION_BASE + 4 * SPR_HALFTILE_BLOCK_SIZE - 1,
+ END
+};
+
+/* Halftile foundation indexes for tropic climate */
+static const SpriteID _halftile_foundation_spriteindexes_2[] = {
+ SKIP, 32,
+ SPR_HALFTILE_FOUNDATION_BASE, SPR_HALFTILE_FOUNDATION_BASE + 4 * SPR_HALFTILE_BLOCK_SIZE - 1,
+ END
+};
+
+/* Halftile foundation indexes for toyland climate */
+static const SpriteID _halftile_foundation_spriteindexes_3[] = {
+ SKIP, 48,
+ SPR_HALFTILE_FOUNDATION_BASE, SPR_HALFTILE_FOUNDATION_BASE + 4 * SPR_HALFTILE_BLOCK_SIZE - 1,
END
};
diff --git a/src/table/sprites.h b/src/table/sprites.h
index 787edccd7..ee9b6fa3f 100644
--- a/src/table/sprites.h
+++ b/src/table/sprites.h
@@ -54,8 +54,9 @@ enum Sprites {
SPR_SLOPES_BASE = SPR_CANALS_BASE + 70,
SPR_SLOPES_INCLINED_OFFSET = 15,
SPR_SLOPES_VIRTUAL_BASE = SPR_SLOPES_BASE - SPR_SLOPES_INCLINED_OFFSET, // The original foundations (see SPR_FOUNDATION_BASE below) are mapped before the additional foundations.
- SPR_SLOPES_NO_FOUNDATION_NW_OFFSET = 22, // no wall on the NW edge of the tile.
- SPR_SLOPES_NO_FOUNDATION_NE_OFFSET = 44, // no wall on the NE edge of the tile.
+ SPR_TRKFOUND_BLOCK_SIZE = 22, // The sprites in trkfoundw.grf are organized in blocks of 22.
+
+ /* between slopes and autorail are 4 unused sprites */
SPR_AUTORAIL_BASE = SPR_SLOPES_BASE + 78,
SPR_ELRAIL_BASE = SPR_AUTORAIL_BASE + 55,
@@ -179,8 +180,18 @@ enum Sprites {
/* Not really a sprite, but an empty bounding box. Used to construct bounding boxes, that help sorting the sprites, but do not have a sprite associated. */
SPR_EMPTY_BOUNDING_BOX = SPR_ONEWAY_BASE + 6,
+ /* Halftile foundations */
+ SPR_HALFTILE_FOUNDATION_BASE = SPR_EMPTY_BOUNDING_BOX + 1,
+ SPR_HALFTILE_BLOCK_SIZE = 4, // The sprites in halffndw.grf are organized in blocks of 4.
+
+ /* Halftile-selection sprites */
+ SPR_HALFTILE_SELECTION_BASE = SPR_HALFTILE_FOUNDATION_BASE + 4 * SPR_HALFTILE_BLOCK_SIZE,
+ SPR_HALFTILE_SELECTION_FLAT = SPR_HALFTILE_SELECTION_BASE,
+ SPR_HALFTILE_SELECTION_DOWN = SPR_HALFTILE_SELECTION_BASE + 4,
+ SPR_HALFTILE_SELECTION_UP = SPR_HALFTILE_SELECTION_BASE + 8,
+
/* Flags sprites (in same order as enum NetworkLanguage) */
- SPR_FLAGS_BASE = SPR_EMPTY_BOUNDING_BOX + 1,
+ SPR_FLAGS_BASE = SPR_HALFTILE_SELECTION_BASE + 12,
/* Manager face sprites */
SPR_GRADIENT = 874, // background gradient behind manager face