-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
469 lines (416 loc) · 22 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
cmake_minimum_required(VERSION 3.14.0)
project(slipgates)
if(NOT AMIGA)
message(SEND_ERROR "This project only compiles for Amiga")
endif()
set(CMAKE_C_STANDARD 11)
# ACE
set(ACE_BOB_WRAP_Y OFF)
add_subdirectory(deps/ace ace)
set(AUDIO_MIXER_WORD_SIZED OFF)
set(AUDIO_MIXER_HW_CHANNEL_MODE SINGLE)
set(AUDIO_MIXER_HW_CHANNELS 3)
set(AUDIO_MIXER_SW_CHANNEL_COUNT 2)
set(AUDIO_MIXER_PERIOD 161)
add_subdirectory(deps/ace_audio_mixer ace_audio_mixer)
file(GLOB_RECURSE GAME_src src/*.c src/*.h)
set(GAME_EXECUTABLE_STEM slipgates)
if(ELF2HUNK)
set(GAME_EXECUTABLE ${GAME_EXECUTABLE_STEM}.elf)
set(GAME_OUTPUT_EXECUTABLE ${GAME_EXECUTABLE_STEM}.exe)
add_executable(${GAME_EXECUTABLE} ${GAME_src})
target_link_options(
${GAME_EXECUTABLE} PUBLIC -Wno-attributes
-Wl,-Map=${GAME_EXECUTABLE_STEM}.map
)
add_custom_command(
TARGET ${GAME_EXECUTABLE} POST_BUILD
COMMAND ${ELF2HUNK} ${GAME_EXECUTABLE} ${GAME_OUTPUT_EXECUTABLE}
)
add_custom_command(
TARGET ${GAME_EXECUTABLE} POST_BUILD
COMMAND ${OBJDUMP} --disassemble -S ${GAME_EXECUTABLE} > ${GAME_EXECUTABLE_STEM}.s
)
else()
SET(GAME_EXECUTABLE ${GAME_EXECUTABLE_STEM})
SET(GAME_OUTPUT_EXECUTABLE ${GAME_EXECUTABLE_STEM})
add_executable(${GAME_EXECUTABLE} ${GAME_src})
endif()
target_include_directories(${GAME_EXECUTABLE} PRIVATE ${PROJECT_SOURCE_DIR}/src)
target_compile_options(${GAME_EXECUTABLE} PUBLIC -Wall -Wextra -Wimplicit-fallthrough=2)
target_compile_options(${GAME_EXECUTABLE} PRIVATE -Werror -Wno-error=unused-parameter -Wimplicit-fallthrough=2)
target_link_libraries(${GAME_EXECUTABLE} ace_audio_mixer ace)
if(GAME_DEBUG)
target_compile_definitions(${GAME_EXECUTABLE} PRIVATE GAME_DEBUG)
endif()
set(RES_DIR ${CMAKE_CURRENT_LIST_DIR}/_res)
set(DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}/data)
set(GEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated)
file(MAKE_DIRECTORY ${DATA_DIR})
file(MAKE_DIRECTORY ${DATA_DIR}/logo)
file(MAKE_DIRECTORY ${GEN_DIR})
file(MAKE_DIRECTORY ${GEN_DIR}/tiles)
file(MAKE_DIRECTORY ${GEN_DIR}/arm_right)
file(MAKE_DIRECTORY ${GEN_DIR}/arm)
file(GLOB COPY_FILES ${RES_DIR}/copied/*)
file(COPY ${COPY_FILES} DESTINATION ${DATA_DIR})
file(COPY ${RES_DIR}/music/slip2.mod DESTINATION ${DATA_DIR})
# Palette
file(GLOB palette_menu_plt ${RES_DIR}/menu.plt)
file(GLOB palette_slipgates_gpl ${RES_DIR}/slipgates.gpl)
file(GLOB palette_sprite_gpl ${RES_DIR}/sprite_export.gpl)
set(palette_slipgates "${DATA_DIR}/slipgates.plt")
convertPalette(${GAME_EXECUTABLE} ${palette_slipgates_gpl} ${palette_slipgates})
set(transparency_hex "#993399")
extractBitmaps(
TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/tiles_mockup.png
GENERATED_FILE_LIST TILES_FILES
DESTINATIONS
${GEN_DIR}/tiles/0.png 56 184 8 8 # VIS_TILE_BG_1
${GEN_DIR}/tiles/1.png 88 184 8 8 # VIS_TILE_BG_CONVEX_N
${GEN_DIR}/tiles/2.png 104 184 8 8 # VIS_TILE_BG_CONVEX_NE
${GEN_DIR}/tiles/3.png 104 200 8 8 # VIS_TILE_BG_CONVEX_E
${GEN_DIR}/tiles/4.png 104 216 8 8 # VIS_TILE_BG_CONVEX_SE
${GEN_DIR}/tiles/5.png 88 216 8 8 # VIS_TILE_BG_CONVEX_S
${GEN_DIR}/tiles/6.png 72 216 8 8 # VIS_TILE_BG_CONVEX_SW
${GEN_DIR}/tiles/7.png 72 200 8 8 # VIS_TILE_BG_CONVEX_W
${GEN_DIR}/tiles/8.png 72 184 8 8 # VIS_TILE_BG_CONVEX_NW
${GEN_DIR}/tiles/9.png 128 192 8 8 # VIS_TILE_BG_CONCAVE_NE
${GEN_DIR}/tiles/10.png 128 200 8 8 # VIS_TILE_BG_CONCAVE_SE
${GEN_DIR}/tiles/11.png 120 200 8 8 # VIS_TILE_BG_CONCAVE_SW
${GEN_DIR}/tiles/12.png 120 192 8 8 # VIS_TILE_BG_CONCAVE_NW
${GEN_DIR}/tiles/13.png 232 136 8 8 # VIS_TILE_BG_PIPE_N
${GEN_DIR}/tiles/14.png 248 152 8 8 # VIS_TILE_BG_PIPE_E
${GEN_DIR}/tiles/15.png 232 176 8 8 # VIS_TILE_BG_PIPE_S
${GEN_DIR}/tiles/16.png 208 152 8 8 # VIS_TILE_BG_PIPE_W
${GEN_DIR}/tiles/17.png 88 200 8 8 # VIS_TILE_WALL_1
${GEN_DIR}/tiles/18.png 88 192 8 8 # VIS_TILE_WALL_CONVEX_N
${GEN_DIR}/tiles/19.png 96 192 8 8 # VIS_TILE_WALL_CONVEX_NE
${GEN_DIR}/tiles/20.png 96 200 8 8 # VIS_TILE_WALL_CONVEX_E
${GEN_DIR}/tiles/21.png 96 208 8 8 # VIS_TILE_WALL_CONVEX_SE
${GEN_DIR}/tiles/22.png 88 208 8 8 # VIS_TILE_WALL_CONVEX_S
${GEN_DIR}/tiles/23.png 80 208 8 8 # VIS_TILE_WALL_CONVEX_SW
${GEN_DIR}/tiles/24.png 80 200 8 8 # VIS_TILE_WALL_CONVEX_W
${GEN_DIR}/tiles/25.png 80 192 8 8 # VIS_TILE_WALL_CONVEX_NW
${GEN_DIR}/tiles/26.png 128 184 8 8 # VIS_TILE_WALL_CONCAVE_N
${GEN_DIR}/tiles/27.png 136 184 8 8 # VIS_TILE_WALL_CONCAVE_NE
${GEN_DIR}/tiles/28.png 136 200 8 8 # VIS_TILE_WALL_CONCAVE_E
${GEN_DIR}/tiles/29.png 136 208 8 8 # VIS_TILE_WALL_CONCAVE_SE
${GEN_DIR}/tiles/30.png 120 208 8 8 # VIS_TILE_WALL_CONCAVE_S
${GEN_DIR}/tiles/31.png 112 208 8 8 # VIS_TILE_WALL_CONCAVE_SW
${GEN_DIR}/tiles/32.png 112 192 8 8 # VIS_TILE_WALL_CONCAVE_W
${GEN_DIR}/tiles/33.png 112 184 8 8 # VIS_TILE_WALL_CONCAVE_NW
${GEN_DIR}/tiles/34.png 232 144 8 8 # VIS_TILE_WALL_PIPE_N
${GEN_DIR}/tiles/35.png 240 152 8 8 # VIS_TILE_WALL_PIPE_E
${GEN_DIR}/tiles/36.png 232 168 8 8 # VIS_TILE_WALL_PIPE_S
${GEN_DIR}/tiles/37.png 216 152 8 8 # VIS_TILE_WALL_PIPE_W
${GEN_DIR}/tiles/38.png 168 184 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_N
${GEN_DIR}/tiles/39.png 184 184 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_NE
${GEN_DIR}/tiles/40.png 184 200 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_E
${GEN_DIR}/tiles/41.png 184 216 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_SE
${GEN_DIR}/tiles/42.png 168 216 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_S
${GEN_DIR}/tiles/43.png 152 216 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_SW
${GEN_DIR}/tiles/44.png 152 200 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_W
${GEN_DIR}/tiles/45.png 152 184 8 8 # VIS_TILE_BLOCKED_BG_CONVEX_NW
${GEN_DIR}/tiles/46.png 208 192 8 8 # VIS_TILE_BLOCKED_BG_CONCAVE_NE
${GEN_DIR}/tiles/47.png 208 200 8 8 # VIS_TILE_BLOCKED_BG_CONCAVE_SE
${GEN_DIR}/tiles/48.png 200 200 8 8 # VIS_TILE_BLOCKED_BG_CONCAVE_SW
${GEN_DIR}/tiles/49.png 200 192 8 8 # VIS_TILE_BLOCKED_BG_CONCAVE_NW
${GEN_DIR}/tiles/50.png 232 88 8 8 # VIS_TILE_BLOCKED_BG_PIPE_N
${GEN_DIR}/tiles/51.png 248 104 8 8 # VIS_TILE_BLOCKED_BG_PIPE_E
${GEN_DIR}/tiles/52.png 232 128 8 8 # VIS_TILE_BLOCKED_BG_PIPE_S
${GEN_DIR}/tiles/53.png 208 104 8 8 # VIS_TILE_BLOCKED_BG_PIPE_W
${GEN_DIR}/tiles/54.png 168 192 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_N
${GEN_DIR}/tiles/55.png 176 192 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_NE
${GEN_DIR}/tiles/56.png 176 200 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_E
${GEN_DIR}/tiles/57.png 176 208 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_SE
${GEN_DIR}/tiles/58.png 168 208 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_S
${GEN_DIR}/tiles/59.png 160 208 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_SW
${GEN_DIR}/tiles/60.png 160 200 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_W
${GEN_DIR}/tiles/61.png 160 192 8 8 # VIS_TILE_BLOCKED_WALL_CONVEX_NW
${GEN_DIR}/tiles/62.png 208 184 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_N
${GEN_DIR}/tiles/63.png 216 184 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_NE
${GEN_DIR}/tiles/64.png 216 200 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_E
${GEN_DIR}/tiles/65.png 216 208 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_SE
${GEN_DIR}/tiles/66.png 200 208 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_S
${GEN_DIR}/tiles/67.png 192 208 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_SW
${GEN_DIR}/tiles/68.png 192 192 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_W
${GEN_DIR}/tiles/69.png 192 184 8 8 # VIS_TILE_BLOCKED_WALL_CONCAVE_NW
${GEN_DIR}/tiles/70.png 232 96 8 8 # VIS_TILE_BLOCKED_WALL_PIPE_N
${GEN_DIR}/tiles/71.png 240 104 8 8 # VIS_TILE_BLOCKED_WALL_PIPE_E
${GEN_DIR}/tiles/72.png 232 120 8 8 # VIS_TILE_BLOCKED_WALL_PIPE_S
${GEN_DIR}/tiles/73.png 216 104 8 8 # VIS_TILE_BLOCKED_WALL_PIPE_W
${GEN_DIR}/tiles/74.png 232 160 8 8 # VIS_TILE_PIPE_NS
${GEN_DIR}/tiles/75.png 224 152 8 8 # VIS_TILE_PIPE_EW
${GEN_DIR}/tiles/76.png 232 152 8 8 # VIS_TILE_PIPE_NESW
${GEN_DIR}/tiles/77.png 16 168 8 8 # VIS_TILE_EXIT_BG_LEFT_TOP
${GEN_DIR}/tiles/78.png 16 176 8 8 # VIS_TILE_EXIT_BG_LEFT_MID
${GEN_DIR}/tiles/79.png 16 184 8 8 # VIS_TILE_EXIT_BG_LEFT_BOTTOM
${GEN_DIR}/tiles/80.png 8 168 8 8 # VIS_TILE_EXIT_WALL_LEFT_TOP
${GEN_DIR}/tiles/81.png 8 176 8 8 # VIS_TILE_EXIT_WALL_LEFT_MID
${GEN_DIR}/tiles/82.png 8 184 8 8 # VIS_TILE_EXIT_WALL_LEFT_BOTTOM
${GEN_DIR}/tiles/83.png 296 168 8 8 # VIS_TILE_EXIT_BG_RIGHT_TOP
${GEN_DIR}/tiles/84.png 296 176 8 8 # VIS_TILE_EXIT_BG_RIGHT_MID
${GEN_DIR}/tiles/85.png 296 184 8 8 # VIS_TILE_EXIT_BG_RIGHT_BOTTOM
${GEN_DIR}/tiles/86.png 304 168 8 8 # VIS_TILE_EXIT_WALL_RIGHT_TOP
${GEN_DIR}/tiles/87.png 304 176 8 8 # VIS_TILE_EXIT_WALL_RIGHT_MID
${GEN_DIR}/tiles/88.png 304 184 8 8 # VIS_TILE_EXIT_WALL_RIGHT_BOTTOM
${GEN_DIR}/tiles/89.png 104 232 8 8 # VIS_TILE_BUTTON_BG_LEFT_1
${GEN_DIR}/tiles/90.png 112 232 8 8 # VIS_TILE_BUTTON_BG_LEFT_2
${GEN_DIR}/tiles/91.png 104 240 8 8 # VIS_TILE_BUTTON_WALL_LEFT_1
${GEN_DIR}/tiles/92.png 112 240 8 8 # VIS_TILE_BUTTON_WALL_LEFT_2
${GEN_DIR}/tiles/93.png 168 232 8 8 # VIS_TILE_BUTTON_BG_RIGHT_1
${GEN_DIR}/tiles/94.png 176 232 8 8 # VIS_TILE_BUTTON_BG_RIGHT_2
${GEN_DIR}/tiles/95.png 168 240 8 8 # VIS_TILE_BUTTON_WALL_RIGHT_1
${GEN_DIR}/tiles/96.png 176 240 8 8 # VIS_TILE_BUTTON_WALL_RIGHT_2
${GEN_DIR}/tiles/97.png 32 152 8 8 # VIS_TILE_DOOR_LEFT_CLOSED_WALL_TOP
${GEN_DIR}/tiles/98.png 32 192 8 8 # VIS_TILE_DOOR_LEFT_CLOSED_WALL_BOTTOM
${GEN_DIR}/tiles/99.png 32 160 8 8 # VIS_TILE_DOOR_LEFT_CLOSED_TOP
${GEN_DIR}/tiles/100.png 32 168 8 8 # VIS_TILE_DOOR_LEFT_CLOSED_MID
${GEN_DIR}/tiles/101.png 32 184 8 8 # VIS_TILE_DOOR_LEFT_CLOSED_BOTTOM
${GEN_DIR}/tiles/102.png 280 152 8 8 # VIS_TILE_DOOR_RIGHT_CLOSED_WALL_TOP
${GEN_DIR}/tiles/103.png 280 192 8 8 # VIS_TILE_DOOR_RIGHT_CLOSED_WALL_BOTTOM
${GEN_DIR}/tiles/104.png 280 160 8 8 # VIS_TILE_DOOR_RIGHT_CLOSED_TOP
${GEN_DIR}/tiles/105.png 280 168 8 8 # VIS_TILE_DOOR_RIGHT_CLOSED_MID
${GEN_DIR}/tiles/106.png 280 184 8 8 # VIS_TILE_DOOR_RIGHT_CLOSED_BOTTOM
${GEN_DIR}/tiles/107.png 120 96 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_WALL_LEFT
${GEN_DIR}/tiles/108.png 152 96 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_WALL_RIGHT
${GEN_DIR}/tiles/109.png 128 88 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_TOP_LEFT
${GEN_DIR}/tiles/110.png 136 88 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_TOP_MID
${GEN_DIR}/tiles/111.png 144 88 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_TOP_RIGHT
${GEN_DIR}/tiles/112.png 128 96 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_BOTTOM_LEFT
${GEN_DIR}/tiles/113.png 136 96 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_BOTTOM_MID
${GEN_DIR}/tiles/114.png 144 96 8 8 # VIS_TILE_DOOR_DOWN_CLOSED_BOTTOM_RIGHT
${GEN_DIR}/tiles/115.png 32 104 8 8 # VIS_TILE_DOOR_LEFT_OPEN_WALL_TOP
${GEN_DIR}/tiles/116.png 32 144 8 8 # VIS_TILE_DOOR_LEFT_OPEN_WALL_BOTTOM
${GEN_DIR}/tiles/117.png 32 112 8 8 # VIS_TILE_DOOR_LEFT_OPEN_TOP
${GEN_DIR}/tiles/118.png 32 120 8 8 # VIS_TILE_DOOR_LEFT_OPEN_MID
${GEN_DIR}/tiles/119.png 32 136 8 8 # VIS_TILE_DOOR_LEFT_OPEN_BOTTOM
${GEN_DIR}/tiles/120.png 280 104 8 8 # VIS_TILE_DOOR_RIGHT_OPEN_WALL_TOP
${GEN_DIR}/tiles/121.png 280 144 8 8 # VIS_TILE_DOOR_RIGHT_OPEN_WALL_BOTTOM
${GEN_DIR}/tiles/122.png 280 112 8 8 # VIS_TILE_DOOR_RIGHT_OPEN_TOP
${GEN_DIR}/tiles/123.png 280 120 8 8 # VIS_TILE_DOOR_RIGHT_OPEN_MID
${GEN_DIR}/tiles/124.png 280 136 8 8 # VIS_TILE_DOOR_RIGHT_OPEN_BOTTOM
${GEN_DIR}/tiles/125.png 120 112 8 8 # VIS_TILE_DOOR_DOWN_OPEN_WALL_LEFT
${GEN_DIR}/tiles/126.png 152 112 8 8 # VIS_TILE_DOOR_DOWN_OPEN_WALL_RIGHT
${GEN_DIR}/tiles/127.png 128 104 8 8 # VIS_TILE_DOOR_DOWN_OPEN_TOP_LEFT
${GEN_DIR}/tiles/128.png 136 104 8 8 # VIS_TILE_DOOR_DOWN_OPEN_TOP_MID
${GEN_DIR}/tiles/129.png 144 104 8 8 # VIS_TILE_DOOR_DOWN_OPEN_TOP_RIGHT
${GEN_DIR}/tiles/130.png 128 112 8 8 # VIS_TILE_DOOR_DOWN_OPEN_BOTTOM_LEFT
${GEN_DIR}/tiles/131.png 136 112 8 8 # VIS_TILE_DOOR_DOWN_OPEN_BOTTOM_MID
${GEN_DIR}/tiles/132.png 144 112 8 8 # VIS_TILE_DOOR_DOWN_OPEN_BOTTOM_RIGHT
${GEN_DIR}/tiles/133.png 32 56 8 8 # VIS_TILE_GRATE_LEFT_WALL_TOP
${GEN_DIR}/tiles/134.png 32 96 8 8 # VIS_TILE_GRATE_LEFT_WALL_BOTTOM
${GEN_DIR}/tiles/135.png 32 64 8 8 # VIS_TILE_GRATE_LEFT_TOP
${GEN_DIR}/tiles/136.png 32 72 8 8 # VIS_TILE_GRATE_LEFT_MID
${GEN_DIR}/tiles/137.png 32 88 8 8 # VIS_TILE_GRATE_LEFT_BOTTOM
${GEN_DIR}/tiles/138.png 280 56 8 8 # VIS_TILE_GRATE_RIGHT_WALL_TOP
${GEN_DIR}/tiles/139.png 280 96 8 8 # VIS_TILE_GRATE_RIGHT_WALL_BOTTOM
${GEN_DIR}/tiles/140.png 280 64 8 8 # VIS_TILE_GRATE_RIGHT_TOP
${GEN_DIR}/tiles/141.png 280 72 8 8 # VIS_TILE_GRATE_RIGHT_MID
${GEN_DIR}/tiles/142.png 280 88 8 8 # VIS_TILE_GRATE_RIGHT_BOTTOM
${GEN_DIR}/tiles/143.png 120 128 8 8 # VIS_TILE_GRATE_DOWN_WALL_LEFT
${GEN_DIR}/tiles/144.png 152 128 8 8 # VIS_TILE_GRATE_DOWN_WALL_RIGHT
${GEN_DIR}/tiles/145.png 128 120 8 8 # VIS_TILE_GRATE_DOWN_TOP_LEFT
${GEN_DIR}/tiles/146.png 136 120 8 8 # VIS_TILE_GRATE_DOWN_TOP_MID
${GEN_DIR}/tiles/147.png 144 120 8 8 # VIS_TILE_GRATE_DOWN_TOP_RIGHT
${GEN_DIR}/tiles/148.png 128 128 8 8 # VIS_TILE_GRATE_DOWN_BOTTOM_LEFT
${GEN_DIR}/tiles/149.png 136 128 8 8 # VIS_TILE_GRATE_DOWN_BOTTOM_MID
${GEN_DIR}/tiles/150.png 144 128 8 8 # VIS_TILE_GRATE_DOWN_BOTTOM_RIGHT
${GEN_DIR}/tiles/151.png 112 56 8 8 # VIS_TILE_DEATH_FIELD_LEFT_WALL_TOP
${GEN_DIR}/tiles/152.png 112 88 8 8 # VIS_TILE_DEATH_FIELD_LEFT_WALL_BOTTOM
${GEN_DIR}/tiles/153.png 112 64 8 8 # VIS_TILE_DEATH_FIELD_LEFT_TOP
${GEN_DIR}/tiles/154.png 112 72 8 8 # VIS_TILE_DEATH_FIELD_LEFT_MID
${GEN_DIR}/tiles/155.png 112 80 8 8 # VIS_TILE_DEATH_FIELD_LEFT_BOTTOM
${GEN_DIR}/tiles/156.png 176 56 8 8 # VIS_TILE_DEATH_FIELD_RIGHT_WALL_TOP
${GEN_DIR}/tiles/157.png 176 88 8 8 # VIS_TILE_DEATH_FIELD_RIGHT_WALL_BOTTOM
${GEN_DIR}/tiles/158.png 176 64 8 8 # VIS_TILE_DEATH_FIELD_RIGHT_TOP
${GEN_DIR}/tiles/159.png 176 72 8 8 # VIS_TILE_DEATH_FIELD_RIGHT_MID
${GEN_DIR}/tiles/160.png 176 80 8 8 # VIS_TILE_DEATH_FIELD_RIGHT_BOTTOM
${GEN_DIR}/tiles/161.png 120 144 8 8 # VIS_TILE_DEATH_FIELD_DOWN_WALL_LEFT
${GEN_DIR}/tiles/162.png 152 144 8 8 # VIS_TILE_DEATH_FIELD_DOWN_WALL_RIGHT
${GEN_DIR}/tiles/163.png 128 136 8 8 # VIS_TILE_DEATH_FIELD_DOWN_TOP_LEFT
${GEN_DIR}/tiles/164.png 136 136 8 8 # VIS_TILE_DEATH_FIELD_DOWN_TOP_MID
${GEN_DIR}/tiles/165.png 144 136 8 8 # VIS_TILE_DEATH_FIELD_DOWN_TOP_RIGHT
${GEN_DIR}/tiles/166.png 128 144 8 8 # VIS_TILE_DEATH_FIELD_DOWN_BOTTOM_LEFT
${GEN_DIR}/tiles/167.png 136 144 8 8 # VIS_TILE_DEATH_FIELD_DOWN_BOTTOM_MID
${GEN_DIR}/tiles/168.png 144 144 8 8 # VIS_TILE_DEATH_FIELD_DOWN_BOTTOM_RIGHT
${GEN_DIR}/tiles/169.png 168 80 8 8 # VIS_TILE_RECEIVER_BG_UP
${GEN_DIR}/tiles/170.png 168 88 8 8 # VIS_TILE_RECEIVER_WALL_UP
${GEN_DIR}/tiles/171.png 168 160 8 8 # VIS_TILE_RECEIVER_BG_DOWN
${GEN_DIR}/tiles/172.png 168 152 8 8 # VIS_TILE_RECEIVER_WALL_DOWN
${GEN_DIR}/tiles/173.png 96 104 8 8 # VIS_TILE_RECEIVER_BG_LEFT
${GEN_DIR}/tiles/174.png 104 104 8 8 # VIS_TILE_RECEIVER_WALL_LEFT
${GEN_DIR}/tiles/175.png 192 104 8 8 # VIS_TILE_RECEIVER_BG_RIGHT
${GEN_DIR}/tiles/176.png 184 104 8 8 # VIS_TILE_RECEIVER_WALL_RIGHT
${GEN_DIR}/tiles/177.png 160 80 8 8 # VIS_TILE_BOUNCER_SPAWNER_BG_UP
${GEN_DIR}/tiles/178.png 160 88 8 8 # VIS_TILE_BOUNCER_SPAWNER_WALL_UP
${GEN_DIR}/tiles/179.png 160 160 8 8 # VIS_TILE_BOUNCER_SPAWNER_BG_DOWN
${GEN_DIR}/tiles/180.png 160 152 8 8 # VIS_TILE_BOUNCER_SPAWNER_WALL_DOWN
${GEN_DIR}/tiles/181.png 96 96 8 8 # VIS_TILE_BOUNCER_SPAWNER_BG_LEFT
${GEN_DIR}/tiles/182.png 104 96 8 8 # VIS_TILE_BOUNCER_SPAWNER_WALL_LEFT
${GEN_DIR}/tiles/183.png 192 96 8 8 # VIS_TILE_BOUNCER_SPAWNER_BG_RIGHT
${GEN_DIR}/tiles/184.png 184 96 8 8 # VIS_TILE_BOUNCER_SPAWNER_WALL_RIGHT
${GEN_DIR}/tiles/187.png 224 240 8 8 # VIS_TILE_SPIKES_OFF_FLOOR_1
${GEN_DIR}/tiles/188.png 232 240 8 8 # VIS_TILE_SPIKES_ON_FLOOR_1
${GEN_DIR}/tiles/189.png 224 232 8 8 # VIS_TILE_SPIKES_OFF_BG_1
${GEN_DIR}/tiles/190.png 232 232 8 8 # VIS_TILE_SPIKES_ON_BG_1
${GEN_DIR}/tiles/191.png 272 224 8 8 # VIS_TILE_TURRET_ACTIVE_LEFT
${GEN_DIR}/tiles/192.png 240 224 8 8 # VIS_TILE_TURRET_INACTIVE_LEFT
${GEN_DIR}/tiles/193.png 240 208 8 8 # VIS_TILE_TURRET_SHOOTING_LEFT
${GEN_DIR}/tiles/194.png 72 48 8 8 # VIS_TILE_BG_DECOR_CREATURE_1
${GEN_DIR}/tiles/195.png 80 48 8 8 # VIS_TILE_BG_DECOR_CREATURE_2
${GEN_DIR}/tiles/196.png 72 56 8 8 # VIS_TILE_BG_DECOR_CREATURE_3
${GEN_DIR}/tiles/197.png 80 56 8 8 # VIS_TILE_BG_DECOR_CREATURE_4
${GEN_DIR}/tiles/198.png 72 64 8 8 # VIS_TILE_BG_DECOR_CREATURE_5
${GEN_DIR}/tiles/199.png 80 64 8 8 # VIS_TILE_BG_DECOR_CREATURE_6
${GEN_DIR}/tiles/200.png 72 80 8 8 # VIS_TILE_BG_DECOR_BRICK_1
${GEN_DIR}/tiles/201.png 80 80 8 8 # VIS_TILE_BG_DECOR_BRICK_2
${GEN_DIR}/tiles/202.png 72 88 8 8 # VIS_TILE_BG_DECOR_BRICK_3
${GEN_DIR}/tiles/203.png 72 96 8 8 # VIS_TILE_BG_DECOR_BRICK_4
${GEN_DIR}/tiles/204.png 80 96 8 8 # VIS_TILE_BG_DECOR_BRICK_5
${GEN_DIR}/tiles/205.png 72 104 8 8 # VIS_TILE_BG_DECOR_BRICK_6
${GEN_DIR}/tiles/206.png 80 104 8 8 # VIS_TILE_BG_DECOR_BRICK_7
${GEN_DIR}/tiles/207.png 72 112 8 8 # VIS_TILE_BG_DECOR_BRICK_8
${GEN_DIR}/tiles/208.png 80 112 8 8 # VIS_TILE_BG_DECOR_BRICK_9
${GEN_DIR}/tiles/209.png 56 120 8 8 # VIS_TILE_BG_DECOR_TUT_MOUSE_L1
${GEN_DIR}/tiles/210.png 56 128 8 8 # VIS_TILE_BG_DECOR_TUT_MOUSE_L2
${GEN_DIR}/tiles/211.png 56 136 8 8 # VIS_TILE_BG_DECOR_TUT_MOUSE_BOTTOM
${GEN_DIR}/tiles/212.png 64 120 8 8 # VIS_TILE_BG_DECOR_TUT_MOUSE_R1
${GEN_DIR}/tiles/213.png 64 128 8 8 # VIS_TILE_BG_DECOR_TUT_MOUSE_R2
${GEN_DIR}/tiles/214.png 72 120 8 8 # VIS_TILE_BG_DECOR_TUT_PERSON_1
${GEN_DIR}/tiles/215.png 72 128 8 8 # VIS_TILE_BG_DECOR_TUT_PERSON_2
${GEN_DIR}/tiles/216.png 80 120 8 8 # VIS_TILE_BG_DECOR_TUT_RARR_1
${GEN_DIR}/tiles/217.png 80 128 8 8 # VIS_TILE_BG_DECOR_TUT_RARR_2
${GEN_DIR}/tiles/218.png 88 120 8 8 # VIS_TILE_BG_DECOR_TUT_SLIP_1
${GEN_DIR}/tiles/219.png 88 128 8 8 # VIS_TILE_BG_DECOR_TUT_SLIP_2
)
convertTileset(
TARGET ${GAME_EXECUTABLE}
SOURCE ${GEN_DIR}/tiles DESTINATION ${GEN_DIR}/tiles.png SIZE 8
COLUMN_WIDTH 16
TILE_PATHS ${TILES_FILES}
)
set(image_name arm)
set(decimals 3)
set(angles 32)
math(EXPR decimals_add "${decimals} - 1")
set(angle_span 360)
foreach(i RANGE ${decimals_add})
set(angle_span "${angle_span}0")
endforeach()
foreach(frame RANGE ${angles})
if(frame EQUAL angles)
break()
endif()
math(EXPR deg "((${angle_span} * (${frame})) / ${angles})")
string(LENGTH ${deg} deg_length)
math(EXPR deg_length "${deg_length}-${decimals}")
if(deg_length GREATER_EQUAL 0)
string(SUBSTRING "${deg}" 0 ${deg_length} integral)
string(SUBSTRING ${deg} ${deg_length} ${decimals} decimal)
set(deg "${integral}.${decimal}")
endif()
set(rotated_paths ${rotated_paths}; ${GEN_DIR}/${image_name}/${frame}.png)
transformBitmap(
TARGET ${GAME_EXECUTABLE}
SOURCE ${RES_DIR}/${image_name}.png
DESTINATION ${GEN_DIR}/${image_name}/${frame}.png
TRANSFORM -rotate ${deg} ${transparency_hex} 7 7
)
endforeach()
convertTileset(
TARGET ${GAME_EXECUTABLE}
SOURCE ${GEN_DIR}/${image_name} DESTINATION ${GEN_DIR}/${image_name}.png SIZE 16
COLUMN_WIDTH 16
TILE_PATHS ${rotated_paths}
)
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${palette_slipgates_gpl} MASK_COLOR ${transparency_hex}
INTERLEAVED SOURCES
${RES_DIR}/player.png ${RES_DIR}/box.png ${RES_DIR}/bouncer.png
${RES_DIR}/slipgates_a.png ${RES_DIR}/slipgates_b.png ${RES_DIR}/aim.png
${GEN_DIR}/arm.png ${RES_DIR}/slip_vfx.png
DESTINATIONS
${DATA_DIR}/player.bm ${DATA_DIR}/box.bm ${DATA_DIR}/bouncer.bm
${DATA_DIR}/slipgate_a.bm ${DATA_DIR}/slipgate_b.bm ${DATA_DIR}/aim.bm
${DATA_DIR}/arm.bm ${DATA_DIR}/slip_vfx.bm
MASKS
${DATA_DIR}/player_mask.bm ${DATA_DIR}/box_mask.bm ${DATA_DIR}/bouncer_mask.bm
${DATA_DIR}/slipgates_mask.bm NONE ${DATA_DIR}/aim_mask.bm
${DATA_DIR}/arm_mask.bm ${DATA_DIR}/slip_vfx_mask.bm
)
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${palette_menu_plt}
INTERLEAVED SOURCES
${RES_DIR}/menu_bg.png
DESTINATIONS
${DATA_DIR}/menu_bg.bm
)
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${palette_slipgates_gpl}
INTERLEAVED SOURCES
${GEN_DIR}/tiles.png
DESTINATIONS
${DATA_DIR}/tiles.bm
)
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${palette_sprite_gpl}
INTERLEAVED SOURCES
${RES_DIR}/cursor.png
DESTINATIONS
${DATA_DIR}/cursor.bm
)
convertFont(
TARGET ${GAME_EXECUTABLE} FIRST_CHAR 32
SOURCE ${RES_DIR}/uni54.png DESTINATION ${DATA_DIR}/uni54.fnt
)
# Logo assets
set(LMC_PLT_PATH ${DATA_DIR}/logo/lmc.plt)
convertPalette(${GAME_EXECUTABLE} ${RES_DIR}/logo/lmc.gpl ${LMC_PLT_PATH})
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${LMC_PLT_PATH}
INTERLEAVED SOURCES ${RES_DIR}/logo/lmc.png DESTINATIONS ${DATA_DIR}/logo/lmc.bm
)
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${RES_DIR}/logo/ace.gpl
INTERLEAVED SOURCES ${RES_DIR}/logo/ace.png DESTINATIONS ${DATA_DIR}/logo/ace.bm
)
convertAudio(
TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/logo/ace.wav
DESTINATION ${DATA_DIR}/logo/ace.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/logo/lmc.wav
STRICT DESTINATION ${DATA_DIR}/logo/lmc.sfx
)
# Version stuff
string(TIMESTAMP YEAR "%y")
string(TIMESTAMP DAY "%d")
string(TIMESTAMP MONTH "%m")
MATH(EXPR VER_MAJOR "0 + ${YEAR}")
MATH(EXPR VER_MINOR "0 + ${MONTH}")
MATH(EXPR VER_FIX "0 + ${DAY}")
set(VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_FIX}")
target_compile_definitions(${GAME_EXECUTABLE} PRIVATE GAME_VERSION="${VERSION}")
# Generating ZIP
set(GAME_PACKAGE_NAME "${CMAKE_PROJECT_NAME}_${VER_MAJOR}_${VER_MINOR}_${VER_FIX}")
add_custom_target(generateZip COMMAND
${CMAKE_COMMAND} -E tar "cf" "${GAME_PACKAGE_NAME}.zip" --format=zip
"${CMAKE_CURRENT_BINARY_DIR}/${GAME_OUTPUT_EXECUTABLE}"
"${DATA_DIR}"
COMMENT "Generating ZIP file ${GAME_PACKAGE_NAME}.zip"
)
# Generating ADF
set(ADF_DIR "${CMAKE_CURRENT_BINARY_DIR}/adf")
add_custom_target(generateAdf
COMMAND ${CMAKE_COMMAND} -E make_directory "${ADF_DIR}/s"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${GAME_OUTPUT_EXECUTABLE}" "${ADF_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${GAME_OUTPUT_EXECUTABLE}.info" "${ADF_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${DATA_DIR}" "${ADF_DIR}/data"
# COMMAND ${CMAKE_COMMAND} -E echo "c:add21k" > "${ADF_DIR}/s/startup-sequence"
COMMAND ${CMAKE_COMMAND} -E echo "${GAME_OUTPUT_EXECUTABLE}" > "${ADF_DIR}/s/startup-sequence"
COMMAND exe2adf -l ${CMAKE_PROJECT_NAME} -a "${GAME_PACKAGE_NAME}.adf" -d ${ADF_DIR}
COMMAND ${CMAKE_COMMAND} -E rm -rf "${ADF_DIR}"
COMMENT "Generating ADF file ${GAME_PACKAGE_NAME}.adf"
)