more windows Makefile tinkering

It looks like the Windows API call for PlaySound using SND_RESOURCE, from a
mingw32 built program, cannot find the resources that are
embeded into the .exe by the mingw32 resource compiler. That works fine
from visual studio.

For now, fall back to not using the SND_RESOURCE flag, use an ordinary
wav file name in the filesystem. Makefile.mingw32 has been modified
to copy the wav files to the binary directory along with the exe.

This probably won't be the final approach, but it will get things
working for now.
This commit is contained in:
nhmall
2023-01-31 00:45:27 -05:00
parent a7b8099ecb
commit ce0a4f60ca
5 changed files with 127 additions and 31 deletions

View File

@@ -1056,10 +1056,12 @@ void freefakeconsole(void)
}
#endif
static boolean path_buffer_set = FALSE;
static char path_buffer[MAX_PATH];
char *
get_executable_path(void)
{
static char path_buffer[MAX_PATH];
#ifdef UNICODE
{
@@ -1077,9 +1079,22 @@ get_executable_path(void)
if (seperator)
*seperator = '\0';
path_buffer_set = TRUE;
return path_buffer;
}
#ifdef __MINGW32__
char *
exepath(void)
{
char *p = (char *) 0;
if (path_buffer_set)
p = path_buffer;
return p;
}
#endif
char *
translate_path_variables(const char* str, char* buf)
{