-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
237 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
add_library(smackw32 STATIC) | ||
|
||
target_include_directories(smackw32 | ||
PUBLIC | ||
include | ||
PRIVATE | ||
${CMAKE_SOURCE_DIR} | ||
) | ||
|
||
target_link_libraries(smackw32 PRIVATE harness brender libsmacker compile_with_werror) | ||
|
||
if(NOT MSVC) | ||
|
||
else() | ||
target_compile_definitions(smackw32 PRIVATE -D_CRT_SECURE_NO_WARNINGS) | ||
target_compile_options(smackw32 PRIVATE | ||
/wd4101 | ||
/wd4996 | ||
) | ||
endif() | ||
|
||
target_sources(smackw32 PRIVATE | ||
smackw32.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# smackw32 | ||
|
||
Implementation of a minimal form of the Smacker API used by dethrace. | ||
|
||
See: | ||
- https://wiki.multimedia.cx/index.php/RAD_Game_Tools_Smacker_API | ||
- https://github.com/OpenSourcedGames/Aliens-vs-Predator/blob/master/source/AvP_vc/3dc/win95/SMACK.H | ||
|
||
|
||
Backed by http://libsmacker.sourceforge.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
#define SMACKTRACK1 0x02000 // Play audio track 1 | ||
#define SMACKTRACK2 0x04000 // Play audio track 2 | ||
#define SMACKTRACK3 0x08000 // Play audio track 3 | ||
#define SMACKTRACK4 0x10000 // Play audio track 4 | ||
#define SMACKTRACK5 0x20000 // Play audio track 5 | ||
#define SMACKTRACK6 0x40000 // Play audio track 6 | ||
#define SMACKTRACK7 0x80000 // Play audio track 7 | ||
#define SMACKTRACKS (SMACKTRACK1 | SMACKTRACK2 | SMACKTRACK3 | SMACKTRACK4 | SMACKTRACK5 | SMACKTRACK6 | SMACKTRACK7) | ||
#define SMACKAUTOEXTRA 0xffffffff | ||
|
||
typedef struct SmackTag { | ||
unsigned long Version; | ||
unsigned long Width; | ||
unsigned long Height; | ||
unsigned long Frames; | ||
unsigned long MSPerFrame; | ||
unsigned long SmackerType; | ||
unsigned long LargestInTrack[7]; | ||
unsigned long tablesize; | ||
unsigned long codesize; | ||
unsigned long absize; | ||
unsigned long detailsize; | ||
unsigned long typesize; | ||
unsigned long TrackType[7]; | ||
unsigned long extra; | ||
unsigned long NewPalette; | ||
unsigned char Palette[772]; | ||
unsigned long PalType; | ||
unsigned long FrameNum; | ||
unsigned long FrameSize; | ||
unsigned long SndSize; | ||
unsigned long LastRectx; | ||
unsigned long LastRecty; | ||
unsigned long LastRectw; | ||
unsigned long LastRecth; | ||
unsigned long OpenFlags; | ||
unsigned long LeftOfs; | ||
unsigned long TopOfs; | ||
unsigned long ReadError; | ||
unsigned long addr32; | ||
|
||
// added by dethrace | ||
void* smk_handle; | ||
} Smack; | ||
|
||
Smack* SmackOpen(const char* name, uint32_t flags, uint32_t extrabuf); | ||
int SmackSoundUseDirectSound(void* dd); // NULL mean create instance (apparently) | ||
void SmackToBuffer(Smack* smack, uint32_t left, uint32_t top, uint32_t pitch, uint32_t destheight, void* buf, uint32_t flags); | ||
uint32_t SmackDoFrame(Smack* smack); | ||
void SmackNextFrame(Smack* smack); | ||
uint32_t SmackWait(Smack* smack); | ||
void SmackClose(Smack* smack); |
Oops, something went wrong.