Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | pmbaty | 1 | #include <stddef.h> |
2 | #include <stdint.h> |
||
3 | |||
4 | #define SMACKTRACK1 0x02000 // Play audio track 1 |
||
5 | #define SMACKTRACK2 0x04000 // Play audio track 2 |
||
6 | #define SMACKTRACK3 0x08000 // Play audio track 3 |
||
7 | #define SMACKTRACK4 0x10000 // Play audio track 4 |
||
8 | #define SMACKTRACK5 0x20000 // Play audio track 5 |
||
9 | #define SMACKTRACK6 0x40000 // Play audio track 6 |
||
10 | #define SMACKTRACK7 0x80000 // Play audio track 7 |
||
11 | #define SMACKTRACKS (SMACKTRACK1 | SMACKTRACK2 | SMACKTRACK3 | SMACKTRACK4 | SMACKTRACK5 | SMACKTRACK6 | SMACKTRACK7) |
||
12 | #define SMACKAUTOEXTRA 0xffffffff |
||
13 | |||
14 | typedef struct SmackTag { |
||
15 | unsigned long Version; |
||
16 | unsigned long Width; |
||
17 | unsigned long Height; |
||
18 | unsigned long Frames; |
||
19 | unsigned long MSPerFrame; |
||
20 | unsigned long SmackerType; |
||
21 | unsigned long LargestInTrack[7]; |
||
22 | unsigned long tablesize; |
||
23 | unsigned long codesize; |
||
24 | unsigned long absize; |
||
25 | unsigned long detailsize; |
||
26 | unsigned long typesize; |
||
27 | unsigned long TrackType[7]; |
||
28 | unsigned long extra; |
||
29 | unsigned long NewPalette; |
||
30 | unsigned char Palette[772]; |
||
31 | unsigned long PalType; |
||
32 | unsigned long FrameNum; |
||
33 | unsigned long FrameSize; |
||
34 | unsigned long SndSize; |
||
35 | unsigned long LastRectx; |
||
36 | unsigned long LastRecty; |
||
37 | unsigned long LastRectw; |
||
38 | unsigned long LastRecth; |
||
39 | unsigned long OpenFlags; |
||
40 | unsigned long LeftOfs; |
||
41 | unsigned long TopOfs; |
||
42 | unsigned long ReadError; |
||
43 | unsigned long addr32; |
||
44 | |||
45 | // added by dethrace |
||
46 | void* smk_handle; // opaque pointer to the libsmacker instance |
||
47 | int audio_sample_rate; |
||
48 | int audio_frame_size_in_bytes; // TODO: consider using SndSize for storage instead? |
||
49 | void* audio_paged_buffer; // opaque pointer to a miniaudio ma_paged_audio_buffer struct |
||
50 | int audio_pages_accumulated_cnt; |
||
51 | int audio_pages_accumulated_max; |
||
52 | void* audio_paged_buffer_data; // opaque pointer to a miniaudio ma_paged_audio_buffer_data struct |
||
53 | void* audio_converter; // opaque pointerto a miniaudio ma_data_converter struct |
||
54 | void* audio_track; // opaque pointer to a miniaudio ma_sound struct |
||
55 | } Smack; |
||
56 | |||
57 | Smack* SmackOpen(const char* name, uint32_t flags, uint32_t extrabuf); |
||
58 | int SmackSoundUseDirectSound(void* dd); // NULL mean create instance (apparently) |
||
59 | void SmackToBuffer(Smack* smack, uint32_t left, uint32_t top, uint32_t pitch, uint32_t destheight, void* buf, uint32_t flags); |
||
60 | uint32_t SmackDoFrame(Smack* smack); |
||
61 | void SmackNextFrame(Smack* smack); |
||
62 | uint32_t SmackWait(Smack* smack); |
||
63 | void SmackClose(Smack* smack); |