-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
537 lines (476 loc) · 18.1 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
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
cmake_minimum_required(VERSION 3.14.0)
project(aminer)
if(NOT AMIGA)
message(SEND_ERROR "This project only compiles for Amiga")
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 23)
# ACE
set(AUDIO_MIXER_HW_CHANNEL_MODE "SINGLE")
set(AUDIO_MIXER_WORD_SIZED ON)
set(AUDIO_MIXER_ROUND_TO_32 ON)
set(AUDIO_MIXER_PROFILER OFF)
set(AUDIO_MIXER_HW_CHANNELS 3)
set(AUDIO_MIXER_SW_CHANNEL_COUNT 3)
set(AUDIO_MIXER_PERIOD 161)
add_subdirectory(deps/ace ace)
add_subdirectory(deps/ace_audio_mixer ace_audio_mixer)
file(GLOB_RECURSE GAME_src src/*.c src/*.cpp src/*.h)
set(GAME_EXECUTABLE_STEM Aminer)
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)
target_link_libraries(${GAME_EXECUTABLE} -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 ${GEN_DIR})
# Copy already processed files
file(GLOB COPY_FILES ${RES_DIR}/copied/*)
file(COPY ${COPY_FILES} DESTINATION ${DATA_DIR})
set(GAME_INFO_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${GAME_OUTPUT_EXECUTABLE}.info")
add_custom_command(
TARGET ${GAME_EXECUTABLE} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${RES_DIR}/aminer.info ${GAME_INFO_DESTINATION}
)
# Palette
set(palette_aminer_unique "${RES_DIR}/palettes/aminer_editing.gpl")
file(GLOB palette_aminer_gpl ${RES_DIR}/palettes/aminer.gpl)
set(palette_aminer "${DATA_DIR}/aminer.plt")
convertPalette(${GAME_EXECUTABLE} ${palette_aminer_gpl} ${palette_aminer})
set(transparency_hex "#993399")
#-------------------------------------------------------------------------- BODY
file(MAKE_DIRECTORY ${GEN_DIR}/drill)
file(MAKE_DIRECTORY ${GEN_DIR}/drill_2)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/krtk.png
GENERATED_FILE_LIST "FRAMES_DRILL_P1"
DESTINATIONS
${GEN_DIR}/drill/0.png 0 76 32 20
${GEN_DIR}/drill/1.png 0 44 32 20
${GEN_DIR}/drill/2.png 0 12 32 20
${GEN_DIR}/drill/3.png 159 12 32 20
${GEN_DIR}/drill/4.png 96 76 32 20
${GEN_DIR}/drill/5.png 96 44 32 20
${GEN_DIR}/drill/6.png 96 12 32 20
${GEN_DIR}/drill/7.png 192 12 32 20
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 32 HEIGHT 20
SOURCE ${GEN_DIR}/drill DESTINATION ${GEN_DIR}/drill.png
TILE_PATHS ${FRAMES_DRILL_P1}
)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/krtk.png
GENERATED_FILE_LIST "FRAMES_DRILL_P2"
DESTINATIONS
${GEN_DIR}/drill_2/0.png 0 236 32 20
${GEN_DIR}/drill_2/1.png 0 204 32 20
${GEN_DIR}/drill_2/2.png 0 172 32 20
${GEN_DIR}/drill_2/3.png 255 12 32 20
${GEN_DIR}/drill_2/4.png 96 236 32 20
${GEN_DIR}/drill_2/5.png 96 204 32 20
${GEN_DIR}/drill_2/6.png 96 172 32 20
${GEN_DIR}/drill_2/7.png 288 12 32 20
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 32 HEIGHT 20
SOURCE ${GEN_DIR}/drill_2 DESTINATION ${GEN_DIR}/drill_2.png
TILE_PATHS ${FRAMES_DRILL_P2}
)
#------------------------------------------------------------------------- WRECK
file(MAKE_DIRECTORY ${GEN_DIR}/wreck)
file(MAKE_DIRECTORY ${GEN_DIR}/wreck_2)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/krtk.png
GENERATED_FILE_LIST "FRAMES_WRECK_P1"
DESTINATIONS
${GEN_DIR}/wreck/0.png 0 109 48 21
${GEN_DIR}/wreck/1.png 86 109 48 21
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 48 HEIGHT 21
SOURCE ${GEN_DIR}/wreck DESTINATION ${GEN_DIR}/wreck.png
TILE_PATHS ${FRAMES_WRECK_P1}
)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/krtk.png
GENERATED_FILE_LIST "FRAMES_WRECK_P2"
DESTINATIONS
${GEN_DIR}/wreck_2/0.png 0 269 48 21
${GEN_DIR}/wreck_2/1.png 86 269 48 21
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 48 HEIGHT 21
SOURCE ${GEN_DIR}/wreck_2 DESTINATION ${GEN_DIR}/wreck_2.png
TILE_PATHS ${FRAMES_WRECK_P2}
)
#-------------------------------------------------------------------------- TOOL
file(MAKE_DIRECTORY ${GEN_DIR}/tool)
file(MAKE_DIRECTORY ${GEN_DIR}/tool_2)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/krtk.png
GENERATED_FILE_LIST "FRAMES_TOOL_P1"
DESTINATIONS
# right
${GEN_DIR}/tool/0.png 33 64 16 16
${GEN_DIR}/tool/1.png 33 80 16 16
${GEN_DIR}/tool/2.png 33 32 16 16
${GEN_DIR}/tool/3.png 33 48 16 16
${GEN_DIR}/tool/4.png 33 0 16 16
${GEN_DIR}/tool/5.png 33 16 16 16
${GEN_DIR}/tool/6.png 160 96 16 16
${GEN_DIR}/tool/7.png 160 112 16 16
# left
${GEN_DIR}/tool/8.png 79 64 16 16
${GEN_DIR}/tool/9.png 79 80 16 16
${GEN_DIR}/tool/10.png 79 32 16 16
${GEN_DIR}/tool/11.png 79 48 16 16
${GEN_DIR}/tool/12.png 79 0 16 16
${GEN_DIR}/tool/13.png 79 16 16 16
${GEN_DIR}/tool/14.png 208 96 16 16
${GEN_DIR}/tool/15.png 208 112 16 16
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 16
SOURCE ${GEN_DIR}/tool DESTINATION ${GEN_DIR}/tool.png
TILE_PATHS ${FRAMES_TOOL_P1}
)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/krtk.png
GENERATED_FILE_LIST "FRAMES_TOOL_P2"
DESTINATIONS
# right
${GEN_DIR}/tool_2/0.png 33 224 16 16
${GEN_DIR}/tool_2/1.png 33 240 16 16
${GEN_DIR}/tool_2/2.png 33 192 16 16
${GEN_DIR}/tool_2/3.png 33 208 16 16
${GEN_DIR}/tool_2/4.png 33 160 16 16
${GEN_DIR}/tool_2/5.png 33 176 16 16
${GEN_DIR}/tool_2/6.png 256 96 16 16
${GEN_DIR}/tool_2/7.png 256 112 16 16
# left
${GEN_DIR}/tool_2/8.png 79 224 16 16
${GEN_DIR}/tool_2/9.png 79 240 16 16
${GEN_DIR}/tool_2/10.png 79 192 16 16
${GEN_DIR}/tool_2/11.png 79 208 16 16
${GEN_DIR}/tool_2/12.png 79 160 16 16
${GEN_DIR}/tool_2/13.png 79 176 16 16
${GEN_DIR}/tool_2/14.png 304 96 16 16
${GEN_DIR}/tool_2/15.png 304 112 16 16
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 16
SOURCE ${GEN_DIR}/tool_2 DESTINATION ${GEN_DIR}/tool_2.png
TILE_PATHS ${FRAMES_TOOL_P2}
)
#------------------------------------------------------------------------- TRACK
file(MAKE_DIRECTORY ${GEN_DIR}/track)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/krtk.png
GENERATED_FILE_LIST "FRAMES_TRACK"
DESTINATIONS
# right
${GEN_DIR}/track/0.png 159 34 32 7
${GEN_DIR}/track/1.png 159 41 32 7
${GEN_DIR}/track/2.png 159 48 32 7
${GEN_DIR}/track/3.png 159 55 32 7
${GEN_DIR}/track/4.png 159 79 32 7
${GEN_DIR}/track/5.png 159 61 32 7
${GEN_DIR}/track/6.png 159 69 32 8
)
convertTileset(
TARGET ${GAME_EXECUTABLE} VARIABLE_HEIGHT SIZE 32
SOURCE ${GEN_DIR}/track DESTINATION ${GEN_DIR}/track.png
TILE_PATHS ${FRAMES_TRACK}
)
#------------------------------------------------------------------------- BONES
file(MAKE_DIRECTORY ${GEN_DIR}/bones)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/minerals.png
GENERATED_FILE_LIST "DINO_FRAGS"
DESTINATIONS
${GEN_DIR}/bones/0.png 0 384 80 22 # true width: 32
${GEN_DIR}/bones/1.png 0 408 80 10 # true width: 32
${GEN_DIR}/bones/2.png 0 419 80 15 # true width: 32
${GEN_DIR}/bones/3.png 0 435 80 24 # true width: 32
${GEN_DIR}/bones/4.png 0 460 80 44 # true width: 48
${GEN_DIR}/bones/5.png 0 505 80 29 # true width: 48
${GEN_DIR}/bones/6.png 0 535 80 45 # true width: 16
${GEN_DIR}/bones/7.png 0 581 80 45 # true width: 32
${GEN_DIR}/bones/8.png 0 627 80 22 # true width: 80
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 80 VARIABLE_HEIGHT PALETTE ${palette_aminer_unique}
INTERLEAVED SOURCE ${GEN_DIR}/bones DESTINATION ${GEN_DIR}/bones.png
TILE_PATHS ${DINO_FRAGS}
)
#-------------------------------------------------------------------------- GATE
file(MAKE_DIRECTORY ${GEN_DIR}/gate)
extractBitmaps(TARGET ${GAME_EXECUTABLE} SOURCE ${RES_DIR}/minerals.png
GENERATED_FILE_LIST "GATE_FRAGS"
DESTINATIONS
${GEN_DIR}/gate/0.png 0 768 32 12
${GEN_DIR}/gate/1.png 0 800 32 18
${GEN_DIR}/gate/2.png 0 832 32 19
${GEN_DIR}/gate/3.png 0 864 32 18
${GEN_DIR}/gate/4.png 0 896 32 17
${GEN_DIR}/gate/5.png 0 928 32 20
${GEN_DIR}/gate/6.png 0 960 32 18
${GEN_DIR}/gate/7.png 0 992 32 14
${GEN_DIR}/gate/8.png 0 1024 32 14
${GEN_DIR}/gate/9.png 0 1056 32 18
${GEN_DIR}/gate/10.png 0 1088 32 19
${GEN_DIR}/gate/11.png 0 1120 32 18
${GEN_DIR}/gate/12.png 0 1152 32 18
${GEN_DIR}/gate/13.png 0 1184 32 19
${GEN_DIR}/gate/14.png 0 1216 32 18
${GEN_DIR}/gate/15.png 0 1248 32 11
)
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 32 VARIABLE_HEIGHT PALETTE ${palette_aminer_unique}
INTERLEAVED SOURCE ${GEN_DIR}/gate DESTINATION ${GEN_DIR}/gate.png
TILE_PATHS ${GATE_FRAGS}
)
#---------------------------------------------------------------------- TILESETS
include("base0.cmake")
include("base1.cmake")
include("base2.cmake")
include("base3.cmake")
include("tiles.cmake")
include("checkpoint.cmake")
convertTileset(
TARGET ${GAME_EXECUTABLE} SIZE 16 HEIGHT 20
INTERLEAVED SOURCE ${RES_DIR}/bg_anim/factory_drip
DESTINATION ${GEN_DIR}/bg_factory_drip.png
TILE_PATHS
${RES_DIR}/bg_anim/factory_drip/0.png
${RES_DIR}/bg_anim/factory_drip/1.png
${RES_DIR}/bg_anim/factory_drip/2.png
${RES_DIR}/bg_anim/factory_drip/3.png
${RES_DIR}/bg_anim/factory_drip/4.png
${RES_DIR}/bg_anim/factory_drip/5.png
${RES_DIR}/bg_anim/factory_drip/6.png
${RES_DIR}/bg_anim/factory_drip/7.png
${RES_DIR}/bg_anim/factory_drip/8.png
${RES_DIR}/bg_anim/factory_drip/9.png
${RES_DIR}/bg_anim/factory_drip/10.png
)
#------------------------------------------------------------------- LOGO ASSETS
# 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
)
#-------------------------------------------------------- CONVERT TO ACE FORMATS
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${palette_aminer_unique}
INTERLEAVED SOURCES
${RES_DIR}/commrade/bg.png ${RES_DIR}/commrade/buttons.png ${RES_DIR}/commrade/faces_hud.png
${RES_DIR}/hud.png ${RES_DIR}/logo.png ${RES_DIR}/lang_select.png
${RES_DIR}/commrade/faces_office.png ${RES_DIR}/commrade/office_selection.png ${RES_DIR}/commrade/news.png
${RES_DIR}/commrade/soko.png ${GEN_DIR}/bg_factory_drip.png ${RES_DIR}/mode_icons.png
DESTINATIONS
${DATA_DIR}/comm_bg.bm ${DATA_DIR}/comm_buttons.bm ${DATA_DIR}/comm_faces.bm
${DATA_DIR}/hud.bm ${DATA_DIR}/logo.bm ${DATA_DIR}/lang_select.bm
${DATA_DIR}/comm_faces_office.bm ${DATA_DIR}/comm_office_selection.bm ${DATA_DIR}/comm_news.bm
${DATA_DIR}/soko.bm ${DATA_DIR}/bg_factory_drip.bm ${DATA_DIR}/mode_icons.bm
)
convertBitmaps(
TARGET ${GAME_EXECUTABLE} PALETTE ${palette_aminer_unique} MASK_COLOR ${transparency_hex}
INTERLEAVED SOURCES
${GEN_DIR}/drill.png ${GEN_DIR}/tool.png ${GEN_DIR}/wreck.png
${GEN_DIR}/drill_2.png ${GEN_DIR}/tool_2.png ${GEN_DIR}/wreck_2.png
${GEN_DIR}/track.png ${RES_DIR}/jet.png ${GEN_DIR}/bones.png
${GEN_DIR}/gate.png ${RES_DIR}/smoke.png ${RES_DIR}/mode_icon_mask.png
${RES_DIR}/explosion.png ${RES_DIR}/teleport.png
${RES_DIR}/bomb_marker.png ${RES_DIR}/player_markers.png
${RES_DIR}/commrade/edges.png ${RES_DIR}/gate_eye_mask.png
DESTINATIONS
${DATA_DIR}/drill.bm ${DATA_DIR}/tool.bm ${DATA_DIR}/wreck.bm
${DATA_DIR}/drill_2.bm ${DATA_DIR}/tool_2.bm ${DATA_DIR}/wreck_2.bm
${DATA_DIR}/track.bm ${DATA_DIR}/jet.bm ${DATA_DIR}/bones.bm
${DATA_DIR}/gate.bm ${DATA_DIR}/smoke.bm NONE
${DATA_DIR}/explosion.bm ${DATA_DIR}/teleport.bm
${DATA_DIR}/bomb_marker.bm ${DATA_DIR}/player_markers.bm
NONE NONE
MASKS
${DATA_DIR}/drill_mask.bm ${DATA_DIR}/tool_mask.bm ${DATA_DIR}/wreck_mask.bm
NONE NONE NONE
${DATA_DIR}/track_mask.bm ${DATA_DIR}/jet_mask.bm ${DATA_DIR}/bones_mask.bm
${DATA_DIR}/gate_mask.bm ${DATA_DIR}/smoke_mask.bm ${DATA_DIR}/mode_icon_mask.bm
${DATA_DIR}/explosion_mask.bm ${DATA_DIR}/teleport_mask.bm
${DATA_DIR}/bomb_marker_mask.bm ${DATA_DIR}/player_marker_mask.bm
${DATA_DIR}/comm_edges_mask.bm ${DATA_DIR}/gate_eye_mask.bm
)
convertFont(
TARGET ${GAME_EXECUTABLE}
SOURCE ${RES_DIR}/uni54 DESTINATION ${DATA_DIR}/uni54.fnt
)
#--------------------------------------------------------------------------- SFX
file(MAKE_DIRECTORY ${DATA_DIR}/sfx ${DATA_DIR}/logo)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/fly_loop.wav
DESTINATION ${DATA_DIR}/sfx/fly_loop.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/atari.wav
DESTINATION ${DATA_DIR}/sfx/atari.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/drill1.wav
DESTINATION ${DATA_DIR}/sfx/drill1.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/ore2.wav
DESTINATION ${DATA_DIR}/sfx/ore2.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/penalty.wav
DESTINATION ${DATA_DIR}/sfx/penalty.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/explosion.wav
DESTINATION ${DATA_DIR}/sfx/explosion.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/teleport.wav
DESTINATION ${DATA_DIR}/sfx/teleport.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_press_0.wav
DESTINATION ${DATA_DIR}/sfx/key_press_0.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_press_1.wav
DESTINATION ${DATA_DIR}/sfx/key_press_1.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_press_2.wav
DESTINATION ${DATA_DIR}/sfx/key_press_2.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_press_3.wav
DESTINATION ${DATA_DIR}/sfx/key_press_3.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_release_0.wav
DESTINATION ${DATA_DIR}/sfx/key_release_0.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_release_1.wav
DESTINATION ${DATA_DIR}/sfx/key_release_1.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_release_2.wav
DESTINATION ${DATA_DIR}/sfx/key_release_2.sfx
)
convertAudio(
TARGET ${GAME_EXECUTABLE}
STRICT NORMALIZE PAD 2 DIVIDE_AMPLITUDE 3 SOURCE ${RES_DIR}/audio/key_release_3.wav
DESTINATION ${DATA_DIR}/sfx/key_release_3.sfx
)
#------------------------------------------------------------------------- MUSIC
file(MAKE_DIRECTORY ${DATA_DIR}/music)
mergeMods(
TARGET ${GAME_EXECUTABLE}
SOURCES
${RES_DIR}/music/czolowka.mod
${RES_DIR}/music/coal-prelude.mod
${RES_DIR}/music/dumka.mod
${RES_DIR}/music/inzynier.mod
${RES_DIR}/music/piesnoatari.mod
${RES_DIR}/music/popescu.mod
${RES_DIR}/music/roboczy.mod
${RES_DIR}/music/tancjor1.mod
${RES_DIR}/music/tancjordrugoj.mod
${RES_DIR}/music/wintowka.mod
${RES_DIR}/music/zima.mod
DESTINATIONS
${DATA_DIR}/music/menu.mod
${DATA_DIR}/music/game0.mod
${DATA_DIR}/music/game1.mod
${DATA_DIR}/music/game2.mod
${DATA_DIR}/music/game3.mod
${DATA_DIR}/music/game4.mod
${DATA_DIR}/music/game5.mod
${DATA_DIR}/music/game6.mod
${DATA_DIR}/music/game7.mod
${DATA_DIR}/music/game8.mod
${DATA_DIR}/music/game9.mod
SAMPLE_PACK ${DATA_DIR}/music/samples.samplepack
)
# 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}"
"${CMAKE_CURRENT_BINARY_DIR}/${GAME_OUTPUT_EXECUTABLE}.info"
"${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"
)