diff --git a/source/build/src/sdlayer.cpp b/source/build/src/sdlayer.cpp index 19db4bb73..19cc7cc49 100644 --- a/source/build/src/sdlayer.cpp +++ b/source/build/src/sdlayer.cpp @@ -366,6 +366,10 @@ namespace Blood { extern GameInterface Interface; } +namespace ShadowWarrior +{ + extern GameInterface Interface; +} GameInterface *CheckFrontend() { @@ -384,7 +388,11 @@ GameInterface *CheckFrontend() return &Redneck::Interface; } else + { + f = fopen("sw.grp", "rb"); + if (f) return &ShadowWarrior::Interface; return &Duke::Interface; + } } } diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 4bf81c887..543806fb0 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -5996,5 +5996,27 @@ saveable_module saveable_build = NUM_SAVEABLE_ITEMS(saveable_build_data) }; +extern void faketimerhandler(); +extern int app_main(int argc, char const* const* argv); +extern void app_crashhandler(void); +extern int32_t startwin_open(void); +extern int32_t startwin_close(void); +extern int32_t startwin_puts(const char*); +extern int32_t startwin_settitle(const char*); +extern int32_t startwin_idle(void*); +extern int32_t startwin_run(void); + +GameInterface Interface = { + faketimerhandler, + app_main, + app_crashhandler, + startwin_open, + startwin_close, + startwin_puts, + startwin_settitle, + startwin_idle, + startwin_run +}; + // vim:ts=4:sw=4:expandtab: END_SW_NS diff --git a/source/sw/src/startwin.game.cpp b/source/sw/src/startwin.game.cpp index e785e7a5e..639842fac 100644 --- a/source/sw/src/startwin.game.cpp +++ b/source/sw/src/startwin.game.cpp @@ -51,6 +51,9 @@ static int done = -1, mode = TAB_CONFIG; #define POPULATE_VIDEO 1 #define POPULATE_CONFIG 2 #define POPULATE_GAME 4 +// Thanks, Microsoft for not providing alternatives for the dialog control macros. :( +#undef SNDMSG +#define SNDMSG ::SendMessageA static int addSoundQualityItem(struct soundQuality_t *q, HWND hwnd) {