// Copyright (C) 2019 Arno Ansems
// 
// This program is free software: you can redistribute it and/or modify 
// it under the terms of the GNU General Public License as published by 
// the Free Software Foundation, either version 3 of the License, or 
// (at your option) any later version. 
// 
// This program is distributed in the hope that it will be useful, 
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
// GNU General Public License for more details. 
// 
// You should have received a copy of the GNU General Public License 
// along with this program.  If not, see http://www.gnu.org/licenses/ 

//
// AudioRepositoryCatacomb3D
//
// Data structures required for reading the Catacomb 3-D audio repository.
//
#pragma once

#include "../Engine/AudioRepository.h"
#include <vector>

const huffmanTable audioDictionaryCatacomb3D =
{
    { 171, 173 },
    { 256, 175 },
    { 257, 185 },
    { 258, 187 },
    { 259, 206 },
    { 260, 213 },
    { 261, 215 },
    { 262, 217 },
    { 263, 220 },
    { 264, 222 },
    { 265, 231 },
    { 266, 238 },
    { 267, 248 },
    { 268, 252 },
    { 269, 254 },
    { 270, 189 },
    { 271, 192 },
    { 201, 219 },
    { 224, 227 },
    { 229, 230 },
    { 234, 89 },
    { 110, 126 },
    { 272, 176 },
    { 194, 199 },
    { 273, 208 },
    { 274, 275 },
    { 250, 93 },
    { 99, 101 },
    { 102, 121 },
    { 152, 172 },
    { 174, 210 },
    { 216, 221 },
    { 223, 233 },
    { 276, 236 },
    { 243, 253 },
    { 82, 86 },
    { 87, 94 },
    { 277, 120 },
    { 134, 143 },
    { 145, 157 },
    { 169, 278 },
    { 188, 279 },
    { 280, 203 },
    { 281, 225 },
    { 237, 239 },
    { 246, 61 },
    { 78, 95 },
    { 96, 106 },
    { 108, 123 },
    { 140, 151 },
    { 154, 159 },
    { 166, 170 },
    { 191, 232 },
    { 282, 70 },
    { 283, 100 },
    { 284, 107 },
    { 113, 124 },
    { 138, 144 },
    { 285, 161 },
    { 286, 287 },
    { 218, 288 },
    { 289, 235 },
    { 290, 247 },
    { 249, 90 },
    { 91, 104 },
    { 115, 127 },
    { 131, 133 },
    { 209, 226 },
    { 12, 29 },
    { 32, 57 },
    { 291, 292 },
    { 109, 293 },
    { 114, 119 },
    { 129, 130 },
    { 294, 137 },
    { 295, 146 },
    { 296, 297 },
    { 197, 298 },
    { 204, 299 },
    { 300, 244 },
    { 26, 28 },
    { 69, 71 },
    { 92, 98 },
    { 111, 156 },
    { 164, 195 },
    { 301, 27 },
    { 34, 58 },
    { 60, 65 },
    { 66, 302 },
    { 303, 304 },
    { 305, 147 },
    { 149, 153 },
    { 306, 307 },
    { 308, 202 },
    { 214, 241 },
    { 20, 68 },
    { 88, 141 },
    { 168, 193 },
    { 196, 205 },
    { 309, 64 },
    { 310, 311 },
    { 312, 313 },
    { 148, 314 },
    { 315, 177 },
    { 316, 317 },
    { 318, 13 },
    { 118, 165 },
    { 167, 200 },
    { 319, 62 },
    { 320, 321 },
    { 322, 323 },
    { 212, 19 },
    { 36, 59 },
    { 125, 132 },
    { 198, 255 },
    { 324, 325 },
    { 41, 56 },
    { 72, 75 },
    { 326, 327 },
    { 328, 329 },
    { 330, 135 },
    { 331, 158 },
    { 332, 333 },
    { 334, 335 },
    { 245, 7 },
    { 25, 35 },
    { 45, 73 },
    { 80, 128 },
    { 136, 162 },
    { 8, 18 },
    { 336, 37 },
    { 44, 337 },
    { 338, 339 },
    { 112, 160 },
    { 340, 251 },
    { 116, 341 },
    { 342, 39 },
    { 55, 343 },
    { 344, 345 },
    { 346, 347 },
    { 348, 349 },
    { 350, 23 },
    { 51, 76 },
    { 351, 21 },
    { 38, 74 },
    { 352, 353 },
    { 180, 354 },
    { 211, 33 },
    { 77, 103 },
    { 117, 355 },
    { 24, 356 },
    { 357, 142 },
    { 358, 359 },
    { 360, 81 },
    { 84, 181 },
    { 207, 361 },
    { 9, 83 },
    { 362, 363 },
    { 186, 49 },
    { 53, 364 },
    { 63, 365 },
    { 97, 366 },
    { 139, 2 },
    { 367, 368 },
    { 369, 370 },
    { 47, 48 },
    { 79, 85 },
    { 105, 150 },
    { 155, 242 },
    { 371, 16 },
    { 22, 372 },
    { 54, 373 },
    { 374, 375 },
    { 376, 377 },
    { 378, 379 },
    { 182, 380 },
    { 381, 382 },
    { 383, 384 },
    { 31, 228 },
    { 385, 386 },
    { 387, 388 },
    { 389, 390 },
    { 17, 11 },
    { 14, 391 },
    { 190, 240 },
    { 392, 46 },
    { 393, 394 },
    { 395, 396 },
    { 397, 398 },
    { 399, 400 },
    { 401, 402 },
    { 403, 6 },
    { 15, 50 },
    { 404, 405 },
    { 406, 40 },
    { 43, 407 },
    { 408, 163 },
    { 409, 410 },
    { 411, 412 },
    { 413, 414 },
    { 415, 30 },
    { 178, 5 },
    { 416, 417 },
    { 418, 419 },
    { 420, 421 },
    { 422, 423 },
    { 424, 425 },
    { 426, 427 },
    { 428, 122 },
    { 429, 430 },
    { 4, 431 },
    { 432, 433 },
    { 434, 3 },
    { 435, 436 },
    { 437, 183 },
    { 438, 439 },
    { 67, 52 },
    { 440, 184 },
    { 441, 442 },
    { 443, 444 },
    { 445, 446 },
    { 1, 447 },
    { 448, 449 },
    { 450, 451 },
    { 452, 179 },
    { 453, 454 },
    { 455, 456 },
    { 10, 457 },
    { 458, 459 },
    { 460, 461 },
    { 462, 463 },
    { 464, 465 },
    { 466, 467 },
    { 468, 469 },
    { 470, 42 },
    { 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 },
    { 0, 509 },
    { 0, 0 }
};

const std::vector<int32_t> audioRepositoryOffsetsCatacomb3D =
{
    0,
    16,
    137,
    234,
    284,
    331,
    379,
    432,
    491,
    502,
    538,
    588,
    638,
    715,
    749,
    758,
    767,
    838,
    865,
    1033,
    1063,
    1113,
    1149,
    1195,
    1237,
    1246,
    1295,
    1340,
    1351,
    1360,
    1395,
    1421,
    1552,
    1657,
    1725,
    1787,
    1852,
    1925,
    2001,
    2031,
    2079,
    2174,
    2239,
    2413,
    2463,
    2482,
    2501,
    2553,
    2590,
    2780,
    2820,
    2880,
    2924,
    2985,
    3041,
    3065,
    3137,
    3198,
    3222,
    3246,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    4284,
    3300,
    5062
};

typedef enum {
    HITWALLSND,              // 0
    WARPUPSND,               // 1
    WARPDOWNSND,             // 2
    GETBOLTSND,              // 3
    GETNUKESND,              // 4
    GETPOTIONSND,            // 5
    GETKEYSND,               // 6
    GETSCROLLSND,            // 7
    GETPOINTSSND,            // 8
    USEBOLTSND,              // 9
    USENUKESND,              // 10
    USEPOTIONSND,            // 11
    USEKEYSND,               // 12
    NOITEMSND,               // 13
    WALK1SND,                // 14
    WALK2SND,                // 15
    TAKEDAMAGESND,           // 16
    MONSTERMISSSND,          // 17
    GAMEOVERSND,             // 18
    SHOOTSND,                // 19
    BIGSHOOTSND,             // 20
    SHOOTWALLSND,            // 21
    SHOOTMONSTERSND,         // 22
    TAKEDMGHURTSND,          // 23
    BALLBOUNCESND,           // 24
    COMPSCOREDSND,           // 25
    KEENSCOREDSND,           // 26
    COMPPADDLESND,           // 27
    KEENPADDLESND,           // 28
    NOWAYSND,                // 29
    LASTSOUND
} audioCatacomb3D;

const audioRepositoryStaticData audioRepositoryCatacomb3D =
{
    "AUDIO.C3D",
    audioRepositoryOffsetsCatacomb3D,
    audioDictionaryCatacomb3D,
    LASTSOUND,
    false
};


