Mercurial > hg > openttd
changeset 7767:33f9ed104293 draft
(svn r11316) -Codechange: add support for the half-tile (selection) graphics.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 20 Oct 2007 20:06:55 +0000 |
parents | f0585ed32dd3 |
children | 529cd49be451 |
files | bin/data/halffndw.grf bin/data/halfselw.grf src/gfxinit.cpp src/landscape.cpp src/table/files.h src/table/landscape_sprite.h src/table/sprites.h |
diffstat | 7 files changed, 86 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8fe4ad447aa25c5acba4a18e7bfb31d92763298f GIT binary patch literal 21613 zc%1E<e{dURddJ`Q-Capu$%^7Qv69HE_3mPXV=~4VR~Tc0FFzz%jxzi{eqAo*mqNfx z3=}6pM6w-ANr3QUxE$?JAG9SmWvDycwC0btnqJF^w!`d|_Ox)<&YK=>A2HYVZjQa1 z=}d<{D?4BycRj$S&`O!t>$Rk4_j#Y^^L?J@ef1n|ifti3dG|lw{mL$K6}f@zAz5OQ z-yk_MO^%Z%$kXH-<P`Y>@<-%PNSVAs{)W6xzE6Hgenfso2=&u8s?#1iMAP&JdIue+ z57Hy_Vfq9;NehZ%vWR2mqYB&LDBR1!3Is)mt<xarcUY_9<fA5Q(ZMS?EW~yE8RQW` zVFBv`ChKsSs575}2a|amyNim}Rh03yqQ;2HZ-8qBN_DuCQ30;TUks|jUO|vdexalY zUd7=1B+;knCfw)Iq$aa!+V@D3KdU>uBp99m$W-S$eU7);)Xl2SXT6Shm7dicJK#}# zp{iy;(0<v|w7Oc=OxVu<K43Jhag1tJajJ>|KVfn!WTmX0#anwuh#p%DK0#5cph${R zYBS(=zg9IAr5LW7Sp&`!l$rIgpPH~{)$~Tg)D34UVq~kvWIH@xqi@rujxFT$yZ`#` z_F=M>Y$pklB5AUd>>^j-v|K~3BiEA~$<1Upd6xVRd4bH63i$zfhlJ4hSJC_Flk^2z zrWSpZa(b8?CR{B0PK3N=V(6O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e16@2@jpyu$jls4#u*d-}@Lh+)wcf zT)<nngucxCn*)BsW}hsyVXxuQow{2ba4RmjjDW@TIHRS;%1qY%uuFf^&(VzC5nC+s zDe=YFD&c^>FL7ta;Vw0gk@jg{61FUTBpKwC^C)6vGuK?DBmH`OstsJq&WY@J7#>DH zL+P7ni9d@%r5;7fark1djrWXh7JFxn=8OK4lojELCnpY0y7KvHOm!iur8=r-SdFxt zn&`#}Ea?o{c;c?(LLX*S|0}?J-A1$Jh6D?j%lIl&iLaD{@>|JRyop;Vwp;tT7zrxn zT7c{9DE}{2%5^E2@R?|<_6%c>c;nw=D@0xu{j*c+|1=G0%|}7HOxGwIg*<j@(1cq# zIiKMwdW6k(5KnV{PT>sB;Ua#AzPXc-Cg-Kg$i=Xhn{=_6jae`gUcHPj-OI+(=PSjk zAHk?UUMC{e(yz9O;ksB`qD#nS+LmOu=)1`n)OI19E{W%%L4QgOU}-GCaSEU=77*cD zr3E$med;EJlnPGXeVo7wR4VQ1EAelmBG%3k)nmz*QKozjrTUv=4{PPvJNmFN`$zX9 zoZ5vw6GyjAw{T}Wckm`|-EO}A2t7{E^Rzunzo9?yyv;!|g51HY`QZ10gNRpQ6Ss&~ zv0Ai=wW3{gh;?GU*dR8FO`=n55g7;cPmLs=zy|+n;PNuE^?ZwI^J{ZN|9s6WY(CYE z1xz)oNUsv%GA+an7~%#D!K*eS!0Qa&3u>M4sGV5Ia;slJC9f{ttI`IMrw*c;<x~$L z#A`0^)oKZ3s|hS-IaC#OyxMuMUb}=W^%9n{tm^w{;MKx=jbnas5~(^&TP;#C*2Pv! gZ6CjXYMe(xJSI5ZyX8K4SRP03yG>ITrOCg40u2w(`~Uy|
--- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -28,11 +28,6 @@ MD5File landscape[3]; ///< landscape specific grf files }; -enum { - SKIP = 0xFFFE, - END = 0xFFFF -}; - #include "table/files.h" #include "table/landscape_sprite.h" @@ -49,6 +44,13 @@ _slopes_spriteindexes_3, }; +static const SpriteID * const _halftile_foundation_spriteindexes[] = { + _halftile_foundation_spriteindexes_0, + _halftile_foundation_spriteindexes_1, + _halftile_foundation_spriteindexes_2, + _halftile_foundation_spriteindexes_3, +}; + static uint LoadGrfFile(const char* filename, uint load_index, int file_index) { @@ -386,6 +388,12 @@ load_index++; // SPR_EMPTY_BOUNDING_BOX + assert(load_index == SPR_HALFTILE_FOUNDATION_BASE); + LoadGrfIndexed("halffndw.grf", _halftile_foundation_spriteindexes[_opt.landscape], i++); + + load_index = SPR_HALFTILE_SELECTION_BASE; + load_index += LoadGrfFile("halfselw.grf", load_index, i++); + assert(load_index == SPR_FLAGS_BASE); load_index += LoadGrfFile("flags.grf", load_index, i++);
--- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -308,23 +308,28 @@ { if (!IsFoundation(f)) return; - SpriteID sprite_base = SPR_SLOPES_VIRTUAL_BASE; + uint sprite_block = 0; uint z; Slope slope = GetFoundationSlope(ti->tile, &z); - if (!HasFoundationNW(ti->tile, slope, z)) sprite_base += SPR_SLOPES_NO_FOUNDATION_NW_OFFSET; - if (!HasFoundationNE(ti->tile, slope, z)) sprite_base += SPR_SLOPES_NO_FOUNDATION_NE_OFFSET; + /* Select the needed block of foundations sprites + * Block 0: Walls at NW and NE edge + * Block 1: Wall at NE edge + * Block 2: Wall at NW edge + * Block 3: No walls at NW or NE edge + */ + if (!HasFoundationNW(ti->tile, slope, z)) sprite_block += 1; + if (!HasFoundationNE(ti->tile, slope, z)) sprite_block += 2; + + /* Use the original slope sprites if NW and NE borders should be visible */ + SpriteID leveled_base = (sprite_block == 0 ? (int)SPR_FOUNDATION_BASE : (SPR_SLOPES_VIRTUAL_BASE + sprite_block * SPR_TRKFOUND_BLOCK_SIZE)); + SpriteID inclined_base = SPR_SLOPES_VIRTUAL_BASE + SPR_SLOPES_INCLINED_OFFSET + sprite_block * SPR_TRKFOUND_BLOCK_SIZE; + //SpriteID halftile_base = SPR_HALFTILE_FOUNDATION_BASE + sprite_block * SPR_HALFTILE_BLOCK_SIZE; if (IsSteepSlope(ti->tileh)) { - SpriteID lower_base; - - /* Lower part of foundation - * Use the original slope sprites if NW and NE borders should be visible - */ - lower_base = sprite_base; - if (lower_base == SPR_SLOPES_VIRTUAL_BASE) lower_base = SPR_FOUNDATION_BASE; + /* Lower part of foundation */ AddSortableSpriteToDraw( - lower_base + (ti->tileh & ~SLOPE_STEEP), PAL_NONE, ti->x, ti->y, 16, 16, 7, ti->z + leveled_base + (ti->tileh & ~SLOPE_STEEP), PAL_NONE, ti->x, ti->y, 16, 16, 7, ti->z ); Corner highest_corner = GetHighestSlopeCorner(ti->tileh); @@ -334,13 +339,13 @@ /* inclined foundation */ byte inclined = highest_corner * 2 + (f == FOUNDATION_INCLINED_Y ? 1 : 0); - AddSortableSpriteToDraw(sprite_base + SPR_SLOPES_INCLINED_OFFSET + inclined, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z); + AddSortableSpriteToDraw(inclined_base + inclined, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z); OffsetGroundSprite(31, 9); } else if (f >= FOUNDATION_STEEP_HIGHER) { /* three corners raised: * Draw inclined foundations for both axes, that results in the needed image. */ - SpriteID upper = sprite_base + SPR_SLOPES_INCLINED_OFFSET + highest_corner * 2; + SpriteID upper = inclined_base + highest_corner * 2; AddSortableSpriteToDraw(upper, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z); AddChildSpriteScreen(upper + 1, PAL_NONE, 31, 9); @@ -351,18 +356,14 @@ } } else { if (IsLeveledFoundation(f)) { - /* leveled foundation - * Use the original slope sprites if NW and NE borders should be visible - */ - if (sprite_base == SPR_SLOPES_VIRTUAL_BASE) sprite_base = SPR_FOUNDATION_BASE; - - AddSortableSpriteToDraw(sprite_base + ti->tileh, PAL_NONE, ti->x, ti->y, 16, 16, 7, ti->z); + /* leveled foundation */ + AddSortableSpriteToDraw(leveled_base + ti->tileh, PAL_NONE, ti->x, ti->y, 16, 16, 7, ti->z); OffsetGroundSprite(31, 1); } else { /* inclined foundation */ byte inclined = GetHighestSlopeCorner(ti->tileh) * 2 + (f == FOUNDATION_INCLINED_Y ? 1 : 0); - AddSortableSpriteToDraw(sprite_base + SPR_SLOPES_INCLINED_OFFSET + inclined, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z); + AddSortableSpriteToDraw(inclined_base + inclined, PAL_NONE, ti->x, ti->y, 16, 16, 1, ti->z); OffsetGroundSprite(31, 9); } ti->z += ApplyFoundationToSlope(f, &ti->tileh);
--- a/src/table/files.h +++ b/src/table/files.h @@ -65,5 +65,7 @@ { "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 } }, };
--- 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 @@ 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 @@ 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 @@ 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 @@ 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 +};
--- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -54,8 +54,9 @@ 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 @@ /* 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