Added a config parameter to save VfW compressor choice for Qt GUI.

This commit is contained in:
mjbudd77 2021-08-30 18:21:45 -04:00
parent 21cc75eb45
commit 15c4a729b9
2 changed files with 22 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <string>
#ifdef WIN32
#include <windows.h>
@ -326,17 +327,33 @@ static LPVOID outBuf = NULL;
static int chooseConfig(int width, int height)
{
bool ret;
char fccHandler[8];
std::string fccHandlerString;
if ( cmpSet )
{
ICCompressorFree( &cmpvars );
cmpSet = false;
}
memset( fccHandler, 0, sizeof(fccHandler));
memset( &cmpvars, 0, sizeof(COMPVARS));
cmpvars.cbSize = sizeof(COMPVARS);
g_config->getOption("SDL.AviVfwFccHandler", &fccHandlerString);
if ( fccHandlerString.size() > 0 )
{
strcpy( fccHandler, fccHandlerString.c_str() );
memcpy( &cmpvars.fccHandler, fccHandler, 4 );
cmpvars.dwFlags = ICMF_COMPVARS_VALID;
}
ret = ICCompressorChoose( HWND(consoleWindow->winId()), ICMF_CHOOSE_ALLCOMPRESSORS,
0, NULL, &cmpvars, 0);
memcpy( fccHandler, &cmpvars.fccHandler, 4 );
fccHandler[4] = 0;
printf("FCC:%08X %c%c%c%c \n", cmpvars.fccHandler,
(cmpvars.fccHandler & 0x000000FF) ,
(cmpvars.fccHandler & 0x0000FF00) >> 8,
@ -345,6 +362,7 @@ static int chooseConfig(int width, int height)
if ( ret )
{
g_config->setOption("SDL.AviVfwFccHandler", fccHandler);
cmpSet = true;
}
return (cmpSet == false) ? -1 : 0;

View File

@ -603,6 +603,10 @@ InitConfig()
config->addOption("SDL.AviVideoFormat", AVI_RGB24);
#endif
#ifdef WIN32
config->addOption("SDL.AviVfwFccHandler", "");
#endif
// Cheat Options
config->addOption("SDL.CheatsDisabled", 0);
config->addOption("SDL.CheatsDisableAutoLS", 0);