diff --git a/grf/alpine/corner-groud-composition.txt b/grf/alpine/corner-groud-composition.txt new file mode 100644 index 0000000000..4ed2873d74 --- /dev/null +++ b/grf/alpine/corner-groud-composition.txt @@ -0,0 +1,153 @@ +# Failed experiment of compossing ground sprites from 4 parts, turned out too fiddly and impractical as seemingly same parts may have different inclanation visually and so different graphics. + + +spriteset (meadow_groundsprites, "gfx/meadow_grid_temperate.png") { tmpl_groundsprites(1, 1) } + + +template tmpl_corner_ground(x, y, h, dy) { + [ x + 64 * 0, y, 32, h, -31, dy] + [ x + 64 * 1, y, 32, h, -31, dy] + [ x + 64 * 2, y, 32, h, -31, dy] + [ x + 64 * 3, y, 32, h, -31, dy] + [ x + 64 * 4, y, 32, h, -31, dy] + [ x + 64 * 5, y, 32, h, -31, dy] + [ x + 64 * 6, y, 32, h, -31, dy] + [ x + 64 * 7, y, 32, h, -31, dy] + [ x + 64 * 0 + 32, y , 32, h, 1, dy] + [ x + 64 * 1 + 32, y , 32, h, 1, dy] + [ x + 64 * 2 + 32, y , 32, h, 1, dy] + [ x + 64 * 3 + 32, y , 32, h, 1, dy] + [ x + 64 * 4 + 32, y , 32, h, 1, dy] + [ x + 64 * 5 + 32, y , 32, h, 1, dy] + [ x + 64 * 6 + 32, y , 32, h, 1, dy] + [ x + 64 * 7 + 32, y , 32, h, 1, dy] + [ x + 64 * 0, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 1, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 2, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 3, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 4, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 5, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 6, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 7, y + h, 32, h + 1, -31, h + dy] + [ x + 64 * 0 + 32, y + h , 32, h + 1, 1, h + dy] + [ x + 64 * 1 + 32, y + h , 32, h + 1, 1, h + dy] + [ x + 64 * 2 + 32, y + h , 32, h + 1, 1, h + dy] + [ x + 64 * 3 + 32, y + h , 32, h + 1, 1, h + dy] + [ x + 64 * 4 + 32, y + h , 32, h + 1, 1, h + dy] + [ x + 64 * 5 + 32, y + h , 32, h + 1, 1, h + dy] + [ x + 64 * 6 + 32, y + h , 32, h + 1, 1, h + dy] + [ x + 64 * 7 + 32, y + h , 32, h + 1, 1, h + dy] +} + +spriteset (meadow_transitions, "gfx/meadow_transitions.png") { + tmpl_corner_ground(0, 0, 15, -16) + tmpl_corner_ground(0, 64, 23, -16) + tmpl_corner_ground(0, 128, 7, 0) +} + +spritelayout meadow_groundsprites_default { + ground { + sprite: GROUNDSPRITE_NORMAL + slope_to_sprite_offset(tile_slope); + } + childsprite { + sprite: meadow_transitions(0 + // + ((tile_slope & bitmask(CORNER_N)) && !(tile_slope & bitmask(CORNER_W)) || (tile_slope & bitmask(IS_STEEP_SLOPE)) ? 32 : 0) + // + ((tile_slope & bitmask(CORNER_N)) && !(tile_slope & bitmask(CORNER_W)) || (tile_slope & bitmask(IS_STEEP_SLOPE)) ? 32 : 0) + + ((tile_slope & bitmask(CORNER_W)) && !(tile_slope & bitmask(CORNER_N)) ? 64 : 0) + // + (nearby_tile_object_type(1, -1) != test_tree || nearby_tile_object_type(1, 0) != test_tree || nearby_tile_object_type(0, -1) != test_tree) + // + (nearby_tile_object_type(0, -1) != test_tree) * 2 + // + (nearby_tile_object_type(-1, -1) != test_tree || nearby_tile_object_type(-1, 0) != test_tree || nearby_tile_object_type(0, -1) != test_tree) * 4 + ); + //yoffset: (tile_slope & bitmask(CORNER_N) ? 0 : 8) + (tile_slope == SLOPE_STEEP_N ? 0 : 8); + yoffset: 0; + } + childsprite { + sprite: meadow_transitions(8 + + ((tile_slope & bitmask(CORNER_N)) && !(tile_slope & bitmask(CORNER_E)) || (tile_slope & bitmask(IS_STEEP_SLOPE)) ? 32 : 0) + + ((tile_slope & bitmask(CORNER_E)) && !(tile_slope & bitmask(CORNER_N)) ? 64 : 0) + // + (nearby_tile_object_type(-1, 1) != test_tree || nearby_tile_object_type(0, 1) != test_tree || nearby_tile_object_type(-1, 0) != test_tree) + // + (nearby_tile_object_type(-1, 0) != test_tree) * 2 + // + (nearby_tile_object_type(-1, -1) != test_tree || nearby_tile_object_type(0, -1) != test_tree || nearby_tile_object_type(-1, 0) != test_tree) * 4 + ); + yoffset: (tile_slope & bitmask(CORNER_N) ? 0 : 8) + (tile_slope == SLOPE_STEEP_N ? 0 : 8); + // yoffset: 8 * (tile_slope & bitmask(CORNER_N) ? 1 : 0); + // yoffset: -8 * ((tile_slope & bitmask(CORNER_N) ? 1 : 0) + (tile_slope == SLOPE_STEEP_N ? 1 : 0)); + } + childsprite { + sprite: meadow_transitions(16 + // + (nearby_tile_object_type(1, -1) != test_tree || nearby_tile_object_type(0, -1) != test_tree || nearby_tile_object_type(1, 0) != test_tree) + // + (nearby_tile_object_type(1, 0) != test_tree) * 2 + // + (nearby_tile_object_type(1, 1) != test_tree || nearby_tile_object_type(0, 1) != test_tree || nearby_tile_object_type(1, 0) != test_tree) * 4 + ); + yoffset: 16; + } + childsprite { + sprite: meadow_transitions(24 + // + (nearby_tile_object_type(-1, 1) != test_tree || nearby_tile_object_type(-1, 0) != test_tree || nearby_tile_object_type(0, 1) != test_tree) + // + (nearby_tile_object_type(0, 1) != test_tree) * 2 + // + (nearby_tile_object_type(1, 1) != test_tree || nearby_tile_object_type(1, 0) != test_tree || nearby_tile_object_type(0, 1) != test_tree) * 4 + ); + yoffset: 16; + } +} + +spritelayout meadow_groundsprites_purchase { + ground { + sprite: meadow_groundsprites; + } +} + + +switch (FEAT_OBJECTS, SELF, switch_meadow_groundsprites_default, [ + STORE_TEMP(slope_to_sprite_offset(tile_slope), 0) + ]) { + meadow_groundsprites_default; +} + + +item (FEAT_OBJECTS, test_tree) { + property { + class: "FLMA"; + classname: string(STR_FLMA); + name: string(STR_TEST_OBJECT); + climates_available: ALL_CLIMATES; + end_of_life_date: 0xFFFFFFFF; + object_flags:bitmask(OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_NO_FOUNDATIONS); + size: [1,1]; + } + graphics { + default: meadow_groundsprites_default; + purchase: meadow_groundsprites_purchase; + tile_check: CB_RESULT_LOCATION_ALLOW; + } +} + + + +# Generate meadow transition tiles +im = Image.open(os.path.join(SOURCE_DIR, "grass_grid_temperate.gimp.png")) +din = np.array(im) + +# dout = np.zeros((64 * 8, 31 + 47 + 15), dtype=np.uint8) +# dout = np.zeros((31 + 47 + 15, 64 * 8), dtype=np.uint8) +dout = np.zeros((64 * 3, 64 * 8), dtype=np.uint8) +for j, (h, ox) in enumerate(((31, 1), (47, 1197), (15, 1277))): + hh = (h - 1) / 2. + for i in range (8): + ut, uc, ub = i & 1, (i & 2) / 2, (i & 4) / 4 + for y in range(0, h): + for x in range(0, 64): + c = din[y + 1, x + ox] + if not c: continue + dx, dy = abs(31.5 - x) / 31.5, abs(hh - y) / hh + a = abs(4 * math.atan2(dy, dx) / math.pi - 1.) + f = (uc * (1. - a) + a * (ut if dy < dx else ub)) * (dx + dy) + f = min(1, 1 - f) + bc = spectra.rgb(f, 1, 0) + c = colors[c][1].blend(bc, ratio=0.2 + 0.5 * f) + # bc = spectra.rgb(0.7 + 0.3 * f, 1, 0) + # c = colors[c][1].blend(bc, ratio=0.2 + 0.1 * f) + dout[y + 64 * j, x + 64 * i] = find_best_color(c) +im2 = Image.fromarray(dout) +im2.putpalette(im.getpalette()) +im2.save(os.path.join(DEST_DIR, "meadow_transitions.png")) diff --git a/grf/trees/lang/english.lng b/grf/trees/lang/english.lng new file mode 100644 index 0000000000..ecc908f309 --- /dev/null +++ b/grf/trees/lang/english.lng @@ -0,0 +1,3 @@ +##grflangid 0x01 +STR_GRF_NAME :CityMania Trees +STR_GRF_DESCRIPTION :In dire need of a better tree sprites diff --git a/grf/trees/trees.nml b/grf/trees/trees.nml new file mode 100644 index 0000000000..5c2307698a --- /dev/null +++ b/grf/trees/trees.nml @@ -0,0 +1,21 @@ +grf { + grfid: "CMTR"; + name: string(STR_GRF_NAME); + desc: string(STR_GRF_DESCRIPTION); + version: 1; + min_compatible_version: 1; +} + +template tmpl_tree_wide(x, y) { + [ 0 + x, y, 45, 80, -24, -73] + [ 50 + x, y, 45, 80, -24, -73] + [100 + x, y, 45, 80, -24, -73] + [150 + x, y, 45, 80, -24, -73] + [200 + x, y, 45, 80, -24, -73] + [250 + x, y, 45, 80, -24, -73] + [300 + x, y, 45, 80, -24, -73] +} + +// base_graphics spr1688(1688, "trees.png") { tmpl_tree_wide(0, 0) } +replace (1688, "trees.png") { tmpl_tree_wide(0, 0) } +replace (1716, "trees.png") { tmpl_tree_wide(0, 0) } diff --git a/grf/trees/trees.png b/grf/trees/trees.png new file mode 100644 index 0000000000..1eebad8fa4 Binary files /dev/null and b/grf/trees/trees.png differ diff --git a/grf/trees/ttd-newgrf-dos.gpl b/grf/trees/ttd-newgrf-dos.gpl new file mode 100644 index 0000000000..3e52d9cf4d --- /dev/null +++ b/grf/trees/ttd-newgrf-dos.gpl @@ -0,0 +1,260 @@ +GIMP Palette +Name: ttd-newgrf-dos +Columns: 16 +# +0 0 255 Index 0 +16 16 16 Index 1 +32 32 32 Index 2 +48 48 48 Index 3 +64 64 64 Index 4 +80 80 80 Index 5 +100 100 100 Index 6 +116 116 116 Index 7 +132 132 132 Index 8 +148 148 148 Index 9 +168 168 168 Index 10 +184 184 184 Index 11 +200 200 200 Index 12 +216 216 216 Index 13 +232 232 232 Index 14 +252 252 252 Index 15 +52 60 72 Index 16 +68 76 92 Index 17 +88 96 112 Index 18 +108 116 132 Index 19 +132 140 152 Index 20 +156 160 172 Index 21 +176 184 196 Index 22 +204 208 220 Index 23 +48 44 4 Index 24 +64 60 12 Index 25 +80 76 20 Index 26 +96 92 28 Index 27 +120 120 64 Index 28 +148 148 100 Index 29 +176 176 132 Index 30 +204 204 168 Index 31 +72 44 4 Index 32 +88 60 20 Index 33 +104 80 44 Index 34 +124 104 72 Index 35 +152 132 92 Index 36 +184 160 120 Index 37 +212 188 148 Index 38 +244 220 176 Index 39 +64 0 4 Index 40 +88 4 16 Index 41 +112 16 32 Index 42 +136 32 52 Index 43 +160 56 76 Index 44 +188 84 108 Index 45 +204 104 124 Index 46 +220 132 144 Index 47 +236 156 164 Index 48 +252 188 192 Index 49 +252 208 0 Index 50 +252 232 60 Index 51 +252 252 128 Index 52 +76 40 0 Index 53 +96 60 8 Index 54 +116 88 28 Index 55 +136 116 56 Index 56 +156 136 80 Index 57 +176 156 108 Index 58 +196 180 136 Index 59 +68 24 0 Index 60 +96 44 4 Index 61 +128 68 8 Index 62 +156 96 16 Index 63 +184 120 24 Index 64 +212 156 32 Index 65 +232 184 16 Index 66 +252 212 0 Index 67 +252 248 128 Index 68 +252 252 192 Index 69 +32 4 0 Index 70 +64 20 8 Index 71 +84 28 16 Index 72 +108 44 28 Index 73 +128 56 40 Index 74 +148 72 56 Index 75 +168 92 76 Index 76 +184 108 88 Index 77 +196 128 108 Index 78 +212 148 128 Index 79 +8 52 0 Index 80 +16 64 0 Index 81 +32 80 4 Index 82 +48 96 4 Index 83 +64 112 12 Index 84 +84 132 20 Index 85 +104 148 28 Index 86 +128 168 44 Index 87 +28 52 24 Index 88 +44 68 32 Index 89 +60 88 48 Index 90 +80 104 60 Index 91 +104 124 76 Index 92 +128 148 92 Index 93 +152 176 108 Index 94 +180 204 124 Index 95 +16 52 24 Index 96 +32 72 44 Index 97 +56 96 72 Index 98 +76 116 88 Index 99 +96 136 108 Index 100 +120 164 136 Index 101 +152 192 168 Index 102 +184 220 200 Index 103 +32 24 0 Index 104 +56 28 0 Index 105 +72 40 4 Index 106 +88 52 12 Index 107 +104 64 24 Index 108 +124 84 44 Index 109 +140 108 64 Index 110 +160 128 88 Index 111 +76 40 16 Index 112 +96 52 24 Index 113 +116 68 40 Index 114 +136 84 56 Index 115 +164 96 64 Index 116 +184 112 80 Index 117 +204 128 96 Index 118 +212 148 112 Index 119 +224 168 128 Index 120 +236 188 148 Index 121 +80 28 4 Index 122 +100 40 20 Index 123 +120 56 40 Index 124 +140 76 64 Index 125 +160 100 96 Index 126 +184 136 136 Index 127 +36 40 68 Index 128 +48 52 84 Index 129 +64 64 100 Index 130 +80 80 116 Index 131 +100 100 136 Index 132 +132 132 164 Index 133 +172 172 192 Index 134 +212 212 224 Index 135 +40 20 112 Index 136 +64 44 144 Index 137 +88 64 172 Index 138 +104 76 196 Index 139 +120 88 224 Index 140 +140 104 252 Index 141 +160 136 252 Index 142 +188 168 252 Index 143 +0 24 108 Index 144 +0 36 132 Index 145 +0 52 160 Index 146 +0 72 184 Index 147 +0 96 212 Index 148 +24 120 220 Index 149 +56 144 232 Index 150 +88 168 240 Index 151 +128 196 252 Index 152 +188 224 252 Index 153 +16 64 96 Index 154 +24 80 108 Index 155 +40 96 120 Index 156 +52 112 132 Index 157 +80 140 160 Index 158 +116 172 192 Index 159 +156 204 220 Index 160 +204 240 252 Index 161 +172 52 52 Index 162 +212 52 52 Index 163 +252 52 52 Index 164 +252 100 88 Index 165 +252 144 124 Index 166 +252 184 160 Index 167 +252 216 200 Index 168 +252 244 236 Index 169 +72 20 112 Index 170 +92 44 140 Index 171 +112 68 168 Index 172 +140 100 196 Index 173 +168 136 224 Index 174 +200 176 248 Index 175 +208 184 255 Index 176 +232 208 252 Index 177 +60 0 0 Index 178 +92 0 0 Index 179 +128 0 0 Index 180 +160 0 0 Index 181 +196 0 0 Index 182 +224 0 0 Index 183 +252 0 0 Index 184 +252 80 0 Index 185 +252 108 0 Index 186 +252 136 0 Index 187 +252 164 0 Index 188 +252 192 0 Index 189 +252 220 0 Index 190 +252 252 0 Index 191 +204 136 8 Index 192 +228 144 4 Index 193 +252 156 0 Index 194 +252 176 48 Index 195 +252 196 100 Index 196 +252 216 152 Index 197 +8 24 88 Index 198 +12 36 104 Index 199 +20 52 124 Index 200 +28 68 140 Index 201 +40 92 164 Index 202 +56 120 188 Index 203 +72 152 216 Index 204 +100 172 224 Index 205 +92 156 52 Index 206 +108 176 64 Index 207 +124 200 76 Index 208 +144 224 92 Index 209 +224 244 252 Index 210 +200 236 248 Index 211 +180 220 236 Index 212 +132 188 216 Index 213 +88 152 172 Index 214 +244 0 244 Index 215 +245 0 245 Index 216 +246 0 246 Index 217 +247 0 247 Index 218 +248 0 248 Index 219 +249 0 249 Index 220 +250 0 250 Index 221 +251 0 251 Index 222 +252 0 252 Index 223 +253 0 253 Index 224 +254 0 254 Index 225 +255 0 255 Index 226 +76 24 8 Index 227 +108 44 24 Index 228 +144 72 52 Index 229 +176 108 84 Index 230 +210 146 126 Index 231 +252 60 0 Index 232 +252 84 0 Index 233 +252 104 0 Index 234 +252 124 0 Index 235 +252 148 0 Index 236 +252 172 0 Index 237 +252 196 0 Index 238 +64 0 0 Index 239 +255 0 0 Index 240 +48 48 0 Index 241 +64 64 0 Index 242 +80 80 0 Index 243 +255 255 0 Index 244 +32 68 112 Index 245 +36 72 116 Index 246 +40 76 120 Index 247 +44 80 124 Index 248 +48 84 128 Index 249 +72 100 144 Index 250 +100 132 168 Index 251 +216 244 252 Index 252 +96 128 164 Index 253 +68 96 140 Index 254 +255 255 255 Index 255 diff --git a/grf/trollsig/lang/english.lng b/grf/trollsig/lang/english.lng new file mode 100644 index 0000000000..a69aad5943 --- /dev/null +++ b/grf/trollsig/lang/english.lng @@ -0,0 +1,3 @@ +##grflangid 0x01 +STR_GRF_NAME :Trollface signals +STR_GRF_DESCRIPTION :More accurate graphics for signals diff --git a/grf/trollsig/trollsig.nml b/grf/trollsig/trollsig.nml new file mode 100644 index 0000000000..f295b94363 --- /dev/null +++ b/grf/trollsig/trollsig.nml @@ -0,0 +1,15 @@ +grf { + grfid: "CMTS"; + name: string(STR_GRF_NAME); + desc: string(STR_GRF_DESCRIPTION); + version: 1; + min_compatible_version: 1; +} + +// 5212 +// 5227 + +replacenew(PRE_SIGNAL_SEMAPHORE_PBS, "trollsig.png", 124) { [ 16, 0, 16, 14, 0, -14 ] } +replacenew(PRE_SIGNAL_SEMAPHORE_PBS, "trollsig.png", 141) { [ 0, 0, 16, 14, 0, -14 ] } +replacenew(PRE_SIGNAL_SEMAPHORE_PBS, "trollsig.png", 188) { [ 0, 0, 16, 14, 0, -14 ] } +replacenew(PRE_SIGNAL_SEMAPHORE_PBS, "trollsig.png", 204) { [ 16, 0, 16, 14, 0, -14 ] } diff --git a/grf/trollsig/trollsig.png b/grf/trollsig/trollsig.png new file mode 100644 index 0000000000..7eb09dc0f8 Binary files /dev/null and b/grf/trollsig/trollsig.png differ