-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SmackerLib API #303
Merged
Merged
SmackerLib API #303
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
10565de
adds better smack support
dethrace-labs d8046f2
tidy
dethrace-labs afebf1d
remove random file
dethrace-labs 08f1770
more docs
dethrace-labs 4c11d7e
tidy
dethrace-labs 785ed42
adds missing call to SmackSoundUseDirectSound
dethrace-labs 3a7fa45
adds missing magic constants
dethrace-labs 512a84d
void cat
dethrace-labs 9732baf
i need a linux box to test
dethrace-labs 91e5abe
duplicate global var
dethrace-labs 4059fc2
fix cmake
dethrace-labs 760e79d
Merge branch 'main' into smackw32
dethrace-labs 01f698a
fix compile, merge upstream
dethrace-labs f3dcc0d
free smack object
dethrace-labs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I was able to reverse the logic for carmageddon 2: https://github.com/madebr/rec2/blob/master/src/carma2/common/cutscene.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome. So much similarity. I'm sad they got rid of the
fuck_off
variable :PThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind, I forgot you have to make up your own names. Well, probably what you have as
keyPressed
is really stillfuck_off
in the OG code! :)