Multiple audio track support added to command line and games.dat.
This commit is contained in:
parent
b0a66bf4a4
commit
edbad04ca6
6 changed files with 56 additions and 27 deletions
|
@ -16,6 +16,10 @@ New Features
|
|||
|
||||
- Optional sprite anti-aliasing.
|
||||
|
||||
- Multiple audio track support for videos. New command line options to select
|
||||
which default audio track you want (-o or --audio). For games with multiple
|
||||
languages, you can specify AUDIO_TRACK in the games.dat as well.
|
||||
|
||||
- SINGE_DEAD_ZONE global variable now available based on the DEAD_ZONE
|
||||
controller configuration option.
|
||||
|
||||
|
@ -55,6 +59,9 @@ Fixes
|
|||
- Framework.singe was missing keyboard mode constants. MODE_NORMAL and
|
||||
MODE_FULL are now included.
|
||||
|
||||
- SINGE 2.00 added two new input events but never had them in the framework.
|
||||
SWITCH_BUTTON4 and SWITCH_TILT are now available.
|
||||
|
||||
- Taking screenshots could sometimes crash Singe.
|
||||
|
||||
- PNG files no longer generate warnings on the console.
|
||||
|
@ -65,4 +72,4 @@ Fixes
|
|||
|
||||
- Building Singe depended on a lot of undocumented software cobbled together
|
||||
from other projects. This has been vastly improved and should be usable by
|
||||
actual humans now.
|
||||
actual humans now. Humans running Linux anyway.
|
||||
|
|
39
INSTALL.txt
39
INSTALL.txt
|
@ -45,22 +45,23 @@ COMMAND LINE
|
|||
|
||||
Usage: Singe-v2.10-Windows-x86_64.exe [OPTIONS] scriptName{.singe}
|
||||
|
||||
-a, --aspect=N:D force aspect ratio
|
||||
-c, --showcalculated show calculated framefile values for debugging
|
||||
-d, --datadir=PATHNAME alternate location for written files
|
||||
-e, --volume_nonvldp=PERCENT specify sound effects volume in percent
|
||||
-f, --fullscreen run in full screen mode
|
||||
-h, --help this display
|
||||
-k, --nologos kill the splash screens
|
||||
-l, --volume_vldp=PERCENT specify laserdisc volume in percent
|
||||
-m, --nomouse disable mouse
|
||||
-n, --nocrosshair request game not display gun crosshairs
|
||||
-p, --program trace Singe execution to screen and file
|
||||
-s, --nosound, --mutesound mutes all sound
|
||||
-t, --trace trace script execution to screen and file
|
||||
-u, --stretch use ugly stretched video
|
||||
-v, --framefile=FILENAME use an alternate video file
|
||||
-w, --fullscreen_window run in windowed full screen mode
|
||||
-x, --xresolution=VALUE specify horizontal resolution
|
||||
-y, --yresolution=VALUE specify vertical resolution
|
||||
-z, --noconsole zero console output
|
||||
-a, --aspect=N:D force aspect ratio
|
||||
-c, --showcalculated show calculated framefile values for debugging
|
||||
-d, --datadir=PATHNAME alternate location for written files
|
||||
-e, --volume_nonvldp=PERCENT specify sound effects volume in percent
|
||||
-f, --fullscreen run in full screen mode
|
||||
-h, --help this display
|
||||
-k, --nologos kill the splash screens
|
||||
-l, --volume_vldp=PERCENT specify laserdisc volume in percent
|
||||
-m, --nomouse disable mouse
|
||||
-n, --nocrosshair request game not display gun crosshairs
|
||||
-o, --audio=TRACK select default track for audio output
|
||||
-p, --program trace Singe execution to screen and file
|
||||
-s, --nosound, --mutesound mutes all sound
|
||||
-t, --trace trace script execution to screen and file
|
||||
-u, --stretch use ugly stretched video
|
||||
-v, --framefile=FILENAME use an alternate video file
|
||||
-w, --fullscreen_window run in windowed full screen mode
|
||||
-x, --xresolution=VALUE specify horizontal resolution
|
||||
-y, --yresolution=VALUE specify vertical resolution
|
||||
-z, --noconsole zero console output
|
||||
|
|
|
@ -429,8 +429,8 @@ SWITCH_GRAB = 23
|
|||
MOUSE_SINGLE = 100
|
||||
MOUSE_MANY = 200
|
||||
|
||||
SPRITE_SMOOTH = 1
|
||||
SPRITE_PIXELATED = 0
|
||||
RENDER_SMOOTH = 1
|
||||
RENDER_PIXELATED = 0
|
||||
|
||||
|
||||
-- Singe 1.xx Features -------------------------------------------------------
|
||||
|
@ -460,6 +460,8 @@ SWITCH_SCREENSHOT = 17
|
|||
SWITCH_QUIT = 18
|
||||
SWITCH_PAUSE = 19
|
||||
SWITCH_CONSOLE = 20
|
||||
SWITCH_BUTTON4 = 21 -- Added in Singe 2.00
|
||||
SWITCH_TILT = 22 -- Added in Singe 2.00
|
||||
|
||||
FONT_QUALITY_SOLID = 1
|
||||
FONT_QUALITY_SHADED = 2
|
||||
|
|
16
src/main.c
16
src/main.c
|
@ -171,6 +171,7 @@ ConfigT *createConf(char *exeName, int argc, char *argv[]) {
|
|||
struct Arg_parser parser;
|
||||
static struct ap_Option options[] = {
|
||||
{ 'a', "aspect", ap_yes },
|
||||
// { 'b', "scalefactor", ap_yes },
|
||||
{ 'c', "showcalculated", ap_no },
|
||||
{ 'd', "datadir", ap_yes },
|
||||
{ 'e', "volume_nonlvdp", ap_yes },
|
||||
|
@ -181,7 +182,7 @@ ConfigT *createConf(char *exeName, int argc, char *argv[]) {
|
|||
{ 'l', "volume_vldp", ap_yes },
|
||||
{ 'm', "nomouse", ap_no },
|
||||
{ 'n', "nocrosshair", ap_no },
|
||||
// { 'o', "scalefactor", ap_yes },
|
||||
{ 'o', "audio", ap_yes },
|
||||
{ 'p', "program", ap_no },
|
||||
{ 's', "nosound", ap_no },
|
||||
{ 't', "trace", ap_no },
|
||||
|
@ -229,6 +230,12 @@ ConfigT *createConf(char *exeName, int argc, char *argv[]) {
|
|||
argCount++;
|
||||
break;
|
||||
|
||||
// Overscan Zoom
|
||||
case 'b':
|
||||
conf->scaleFactor = atoi(arg);
|
||||
argCount++;
|
||||
break;
|
||||
|
||||
// Show Calculated Frame File Values
|
||||
case 'c':
|
||||
conf->showCalculated = true;
|
||||
|
@ -285,9 +292,9 @@ ConfigT *createConf(char *exeName, int argc, char *argv[]) {
|
|||
conf->noCrosshair = true;
|
||||
break;
|
||||
|
||||
// Overscan Zoom
|
||||
// Audio Track Output
|
||||
case 'o':
|
||||
conf->scaleFactor = atoi(arg);
|
||||
conf->audioOutputTrack = atoi(arg);
|
||||
argCount++;
|
||||
break;
|
||||
|
||||
|
@ -733,6 +740,7 @@ void showUsage(char *name, char *message) {
|
|||
utilSay("Usage: %s [OPTIONS] scriptName{.singe}", utilGetLastPathComponent(name));
|
||||
utilSay("");
|
||||
utilSay(" -a, --aspect=N:D force aspect ratio");
|
||||
// utilSay(" -b, --scalefactor=PERCENT reduce screen size for overscan compensation");
|
||||
utilSay(" -c, --showcalculated show calculated framefile values for debugging");
|
||||
utilSay(" -d, --datadir=PATHNAME alternate location for written files");
|
||||
utilSay(" -e, --volume_nonvldp=PERCENT specify sound effects volume in percent");
|
||||
|
@ -743,7 +751,7 @@ void showUsage(char *name, char *message) {
|
|||
utilSay(" -l, --volume_vldp=PERCENT specify laserdisc volume in percent");
|
||||
utilSay(" -m, --nomouse disable mouse");
|
||||
utilSay(" -n, --nocrosshair request game not display gun crosshairs");
|
||||
// utilSay(" -o, --scalefactor=PERCENT reduce screen size for overscan compensation");
|
||||
utilSay(" -o, --audio=TRACK select default track for audio output");
|
||||
utilSay(" -p, --program trace Singe execution to screen and file");
|
||||
utilSay(" -s, --nosound, --mutesound mutes all sound");
|
||||
utilSay(" -t, --trace trace script execution to screen and file");
|
||||
|
|
10
src/singe.c
10
src/singe.c
|
@ -2607,6 +2607,10 @@ int32_t apiVideoLoad(lua_State *L) {
|
|||
video->lastFrame = -1;
|
||||
result = _global.nextVideoId++;
|
||||
HASH_ADD_INT(_global.videoList, id, video);
|
||||
// Select desired default audio track
|
||||
if (_global.conf->audioOutputTrack < videoGetAudioTracks(video->id)) {
|
||||
videoSetAudioTrack(video->id, _global.conf->audioOutputTrack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3336,6 +3340,8 @@ ConfigT *buildConfFromTable(lua_State *L) {
|
|||
sindenString = strdup(valueString);
|
||||
if (!parseSindenString(&sindenString, c)) c->sindenArgc = 0;
|
||||
free(sindenString);
|
||||
} else if (strcmp(confKey, "AUDIO_TRACK") == 0) {
|
||||
c->audioOutputTrack = valueNumber;
|
||||
}
|
||||
|
||||
// Clean up for next pair
|
||||
|
@ -4429,6 +4435,10 @@ void singe(SDL_Window *window, SDL_Renderer *renderer, ConfigT *conf) {
|
|||
progTrace("Starting laserdisc video in stopped state");
|
||||
videoPlay(_global.videoHandle);
|
||||
_global.discStopped = false;
|
||||
// Select desired default audio track
|
||||
if (_global.conf->audioOutputTrack < videoGetAudioTracks(_global.videoHandle)) {
|
||||
videoSetAudioTrack(_global.videoHandle, _global.conf->audioOutputTrack);
|
||||
}
|
||||
|
||||
// Start script
|
||||
progTrace("Compiling %s", _global.conf->scriptFile);
|
||||
|
|
|
@ -71,6 +71,7 @@ typedef struct ConfigS {
|
|||
int32_t yResolution;
|
||||
int32_t sindenArgc;
|
||||
int32_t sindenArgv[SINDEN_OPTION_COUNT];
|
||||
int32_t audioOutputTrack;
|
||||
} ConfigT;
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue