From 8e8dc89068d9df1fa2095063f4fb700f5a0a1aae Mon Sep 17 00:00:00 2001 From: Jeroen D Stout Date: Wed, 4 Oct 2017 00:41:48 +0200 Subject: [PATCH] Improve floor visuals with glassy transparent surface --- resources/g2/sprites.json | 6 ++++++ resources/g2/surface/blank_recolourable.png | Bin 0 -> 1161 bytes resources/g2/surface/glassy_recolourable.png | Bin 0 -> 283 bytes src/openrct2/paint/tile_element/virtual_floor.c | 10 ++++++++-- src/openrct2/sprites.h | 10 ++++++---- 5 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 resources/g2/surface/blank_recolourable.png create mode 100644 resources/g2/surface/glassy_recolourable.png diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index 0b8b758ee1..26588a6d9c 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -354,6 +354,12 @@ { "path": "icons/search.png" }, + { + "path": "surface/glassy_recolourable.png", + "x_offset": -32, + "y_offset": -1, + "palette": "keep" + }, { "path": "surface/selection_edge_nw.png", "x_offset": -32, diff --git a/resources/g2/surface/blank_recolourable.png b/resources/g2/surface/blank_recolourable.png new file mode 100644 index 0000000000000000000000000000000000000000..cb59b4bc4a745c74714d9a1d1cfb9f55fc0de159 GIT binary patch literal 1161 zcmaJ>@sHDV6n}s^ybDfPU>p;AWWjTFIKfssId!Nty<$Zp5 zFYl#+{=lq`1swn|t8e|<4K}Z~6Pr21u3KdK9KZ}1xNp#JxBnAvuh&bGK9*$!fs>?= zqR8=hJe|(w^M!JG!m^sJ7U=_q2A=B-g0l)~ zy#PFb=y1qRr|R)&IIh$57|)M~!&OzC%w|!kLBH@H+$ z&?{oW3S*SV7x2;o!AVp|X5|E*$cov5TrkzLl`n>7oC+QdY&*+k%x0Z%)~oRckjgbER^v59&}Z$yhtZK9QLOjX;clW;mI zw>yA&1;QuMw8HTT(H<7dCsX6Oyj3<^H3me^p$JY@#Iy*Ji7`e(C}zUrhFUFU8r5>E zHHjF2AbgBl0$}lg1VFMIB}t_7s1QMw1hRDa zckvW(EChK+L~^T9BBcd#x>PL2P19&JOk{g`!a&A48O_b>m{`DNi`JSUqZKW-)0L@0 z4ON@C3nGfO$}AfVtBhJTisMiLkOc^V?PUYk5}tU>7E~r} zBU7&{m5MFcP)LYGq*zQQeR0Z{W=Ml2OPp_lCmKO75;3IWC_|zGgG|o8{I6>l-?wSn zQycmPSpDnwkK3B+Tf1iP&R5?XOwK8H&oqV*s-%X@jgf`X$@BD_>1*$k-+XP=mNX@;@>&+c`{CNAH9(fP}Y&ZAG>Kpfn4*URB6E4KaI|4!Fe z&n&0EJN#(7cM);ibLf-Qr7u@@`j;#+=BIWIy?AhC$ER0!o`3DLZ9DeGf9%;l`p6w$ zym4UD-_?!#V?t*1>F2fWv;CWEdq%PPTQ`fXIe)z%y?gD@?@g|EWdApnVe9CnMyl)C zt{qEmIdkuGfvu}5XIDHh_uIV(PJJ-4=7hNH;pFiLugyNPbLmN8D}KQF(}L?AXqva*(cb&<;{X0hpTB?Yk$bib{{ul+ B{O|w( literal 0 HcmV?d00001 diff --git a/resources/g2/surface/glassy_recolourable.png b/resources/g2/surface/glassy_recolourable.png new file mode 100644 index 0000000000000000000000000000000000000000..27583b820944e8f021715f3c4530093d689496fc GIT binary patch literal 283 zcmeAS@N?(olHy`uVBq!ia0vp^4nQo=!VDyr&cAjZNbv{wgt!7}Q3eJ_28I#_h6M}^ z(bFp?0fiV#g8YIR9G=}s19EnGx;TbNNY)-~Y-~2*VL6!n@CxH=z6;YQ{L8MoS;!%f z;HJL7{X!6bj{Ab>c_oKga~6BoEY&MmAb%ljmrA&Ux|u{olPCKsp^#5>aWBY|+uzWZ!l4pxWvC-beEfPLS?mv#!YY zREwV_GiT@JwzH3f9xRgW+jP0n`@_{B^%C9FUd!cYdV21<(t0MxXV;OGl4j5CGTpLO f4i}X#T(tk*>%97f*K=8*FBm*s{an^LB{Ts5XCrKg literal 0 HcmV?d00001 diff --git a/src/openrct2/paint/tile_element/virtual_floor.c b/src/openrct2/paint/tile_element/virtual_floor.c index 109b788b61..1aa8719e31 100644 --- a/src/openrct2/paint/tile_element/virtual_floor.c +++ b/src/openrct2/paint/tile_element/virtual_floor.c @@ -271,7 +271,7 @@ void virtual_floor_paint(paint_session * session) if (paintEdges & 0x8) { sub_98197C(session, SPR_G2_SELECTION_EDGE_NW | (!(occupiedEdges & 0x8)? ((litEdges & 0x8)? remap_lit : remap_base) : remap_edge), - 0, 0, 1, 1, 1, gMapVirtualFloorHeight, 5, 5, gMapVirtualFloorHeight + ((dullEdges & 0x8)? -2 : 0), get_current_rotation()); + 0, 0, 0, 0, 1, gMapVirtualFloorHeight, 5, 5, gMapVirtualFloorHeight + ((dullEdges & 0x8)? -2 : 0), get_current_rotation()); } if (paintEdges & 0x4) { @@ -281,11 +281,17 @@ void virtual_floor_paint(paint_session * session) if (paintEdges & 0x1) { sub_98197C(session, SPR_G2_SELECTION_EDGE_NE | (!(occupiedEdges & 0x1)? ((litEdges & 0x1)? remap_lit : remap_base) : remap_edge), - 0, 0, 1, 1, 1, gMapVirtualFloorHeight, 5, 5, gMapVirtualFloorHeight + ((dullEdges & 0x1)? -2 : 0), get_current_rotation()); + 0, 0, 0, 0, 1, gMapVirtualFloorHeight, 5, 5, gMapVirtualFloorHeight + ((dullEdges & 0x1)? -2 : 0), get_current_rotation()); } if (paintEdges & 0x2) { sub_98197C(session, SPR_G2_SELECTION_EDGE_SE | (!(occupiedEdges & 0x2)? ((litEdges & 0x2)? remap_lit : remap_base) : remap_edge), 0, 0, 1, 1, 1, gMapVirtualFloorHeight, 16, 27, gMapVirtualFloorHeight + ((dullEdges & 0x2)? -2 : 0), get_current_rotation()); } + + if (!weAreOccupied && !weAreLit) + { + sint32 imageColourFlats = SPR_G2_SURFACE_GLASSY_RECOLOURABLE | IMAGE_TYPE_REMAP | IMAGE_TYPE_TRANSPARENT | PALETTE_WATER << 19; + sub_98197C(session, imageColourFlats, 0, 0, 30, 30, 0, gMapVirtualFloorHeight, 2, 2, gMapVirtualFloorHeight - 3, get_current_rotation()); + } } diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index db6b553d5f..52a10fa4d9 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -824,10 +824,12 @@ enum { SPR_G2_SEARCH = SPR_G2_BEGIN + 106, - SPR_G2_SELECTION_EDGE_NW = SPR_G2_BEGIN + 107, - SPR_G2_SELECTION_EDGE_NE = SPR_G2_BEGIN + 108, - SPR_G2_SELECTION_EDGE_SW = SPR_G2_BEGIN + 109, - SPR_G2_SELECTION_EDGE_SE = SPR_G2_BEGIN + 110, + SPR_G2_SURFACE_GLASSY_RECOLOURABLE = SPR_G2_BEGIN + 107, + + SPR_G2_SELECTION_EDGE_NW = SPR_G2_BEGIN + 108, + SPR_G2_SELECTION_EDGE_NE = SPR_G2_BEGIN + 109, + SPR_G2_SELECTION_EDGE_SW = SPR_G2_BEGIN + 110, + SPR_G2_SELECTION_EDGE_SE = SPR_G2_BEGIN + 111, // 0x60000, chosen because it's a round hex number // of the last possible range of image ID values that is large enough to fit all csg1 sprites.