1 //-------------------------------------------------------------------------
2 /*
3 Copyright (C) 2010-2019 EDuke32 developers and contributors
4 Copyright (C) 2019 Nuke.YKT
5 
6 This file is part of NBlood.
7 
8 NBlood is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License version 2
10 as published by the Free Software Foundation.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 
16 See the GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 */
22 //-------------------------------------------------------------------------
23 #pragma once
24 #include "build.h"
25 #include "common_game.h"
26 #include "blood.h"
27 
28 #define kQavOrientationLeft 4096
29 
30 #pragma pack(push, 1)
31 
32 // by NoOne: add sound flags
33 enum
34 {
35     kFlagSoundKill = 0x01, // mute QAV sounds of same priority
36     kFlagSoundKillAll = 0x02, //  mute all QAV sounds
37 
38 };
39 
40 struct TILE_FRAME
41 {
42     int picnum;
43     int x;
44     int y;
45     int z;
46     int stat;
47     signed char shade;
48     char palnum;
49     unsigned short angle;
50 };
51 
52 struct SOUNDINFO
53 {
54     int sound;
55     unsigned char priority;
56     unsigned char sndFlags; // (by NoOne) Various sound flags
57     unsigned char sndRange; // (by NoOne) Random sound range
58     char reserved[1];
59 };
60 
61 struct FRAMEINFO
62 {
63     int nCallbackId; // 0
64     SOUNDINFO sound; // 4
65     TILE_FRAME tiles[8]; // 12
66 };
67 
68 struct QAV
69 {
70     char pad1[8]; // 0
71     int nFrames; // 8
72     int ticksPerFrame; // C
73     int at10; // 10
74     int x; // 14
75     int y; // 18
76     int nSprite; // 1c
77     //SPRITE *pSprite; // 1c
78     char pad3[4]; // 20
79     FRAMEINFO frames[1]; // 24
80     void Draw(int ticks, int stat, int shade, int palnum);
81     void Play(int, int, int, void *);
82     void Preload(void);
83     void Precache(void);
84 
85     void PlaySound(int nSound);
86     void PlaySound3D(spritetype *pSprite, int nSound, int a3, int a4);
87 };
88 
89 #pragma pack(pop)
90 
91 int qavRegisterClient(void(*pClient)(int, void *));
92