mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-08 14:56:12 -04:00
DOS: Launcher shows Exit button now
This commit is contained in:
parent
ac5a185d1b
commit
1eb1af9389
@ -37,7 +37,7 @@ const cc_result ReturnCode_SocketDropped = WSAECONNRESET;
|
||||
|
||||
const char* Platform_AppNameSuffix = "";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
cc_bool Platform_SingleProcess = true;
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS;
|
||||
#define UWP_STRING(str) ((wchar_t*)(str)->uni)
|
||||
|
||||
/*########################################################################################################################*
|
||||
@ -550,7 +550,8 @@ cc_result Process_StartGame2(const cc_string* args, int numArgs) {
|
||||
cc_result res;
|
||||
int len, i;
|
||||
|
||||
if (Platform_SingleProcess) return SetGameArgs(args, numArgs);
|
||||
if (Platform_IsSingleProcess()) return SetGameArgs(args, numArgs);
|
||||
|
||||
if ((res = Process_RawGetExePath(&path, &len))) return res;
|
||||
si.wide.cb = sizeof(STARTUPINFOW);
|
||||
|
||||
|
@ -839,11 +839,9 @@ static void MainScreen_ApplyUpdateLabel(struct MainScreen* s) {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined CC_BUILD_CONSOLE || defined CC_BUILD_SYMBIAN
|
||||
static void MainScreen_ExitApp(void* w) {
|
||||
Window_Main.Exists = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void MainScreen_Activated(struct LScreen* s_) {
|
||||
struct MainScreen* s = (struct MainScreen*)s_;
|
||||
@ -880,18 +878,18 @@ static void MainScreen_Activated(struct LScreen* s_) {
|
||||
LButton_Add(s, &s->btnOptions, 100, 35, "Options",
|
||||
SwitchToSettings, main_btnOptions);
|
||||
|
||||
#if defined CC_BUILD_CONSOLE || defined CC_BUILD_SYMBIAN
|
||||
LLabel_Add(s, &s->lblUpdate, "&eChecking..", main_lblUpdate_N);
|
||||
LButton_Add(s, &s->btnUpdates, 100, 35, "Exit",
|
||||
MainScreen_ExitApp, main_btnUpdates);
|
||||
#else
|
||||
LLabel_Add(s, &s->lblUpdate, "&eChecking..",
|
||||
Updater_Supported ? main_lblUpdate_N : main_lblUpdate_H);
|
||||
if (Updater_Supported) {
|
||||
LButton_Add(s, &s->btnUpdates, 100, 35, "Updates",
|
||||
SwitchToUpdates, main_btnUpdates);
|
||||
if (Platform_Flags & PLAT_FLAG_APP_EXIT) {
|
||||
LLabel_Add(s, &s->lblUpdate, "&eChecking..", main_lblUpdate_N);
|
||||
LButton_Add(s, &s->btnUpdates, 100, 35, "Exit",
|
||||
MainScreen_ExitApp, main_btnUpdates);
|
||||
} else {
|
||||
LLabel_Add(s, &s->lblUpdate, "&eChecking..",
|
||||
Updater_Supported ? main_lblUpdate_N : main_lblUpdate_H);
|
||||
if (Updater_Supported) {
|
||||
LButton_Add(s, &s->btnUpdates, 100, 35, "Updates",
|
||||
SwitchToUpdates, main_btnUpdates);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CC_BUILD_NETWORKING
|
||||
s->btnResume.OnHover = MainScreen_ResumeHover;
|
||||
|
@ -66,6 +66,9 @@ cc_result Platform_GetEntropy(void* data, int len);
|
||||
/* Whether the launcher and game must both be run in the same process */
|
||||
/* (e.g. can't start a separate process on Mobile or Consoles) */
|
||||
#define PLAT_FLAG_SINGLE_PROCESS 0x01
|
||||
/* Whether button in the launcher should be available to exit the app */
|
||||
/* (e.g. necessary in MS DOS, game consoles ) */
|
||||
#define PLAT_FLAG_APP_EXIT 0x02
|
||||
|
||||
/* Platform specific runtime behaviour flags (See PLAT_FLAG members) */
|
||||
extern cc_uint8 Platform_Flags;
|
||||
|
@ -236,7 +236,7 @@ static int VMUFile_Do(cc_file* file, int mode) {
|
||||
data = Mem_Alloc(len, 1, "VMU data");
|
||||
fs_read(fd, data, len);
|
||||
|
||||
err = vmu_pkg_parse(data, len, &pkg);
|
||||
err = vmu_pkg_parse(data, &pkg);
|
||||
fs_close(fd);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ const cc_result ReturnCode_SocketWouldBlock = -10002;
|
||||
const cc_result ReturnCode_SocketDropped = -10002;
|
||||
|
||||
const char* Platform_AppNameSuffix = " DOS";
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS;
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT;
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
||||
/*########################################################################################################################*
|
||||
|
@ -34,6 +34,7 @@ const char* Platform_AppNameSuffix = " MAC 68k";
|
||||
#else
|
||||
const char* Platform_AppNameSuffix = " MAC PPC";
|
||||
#endif
|
||||
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS;
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
||||
|
@ -52,7 +52,7 @@ const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
#define SUPPORTS_GETADDRINFO 1
|
||||
|
||||
const char* Platform_AppNameSuffix = "";
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS;
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT;
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
||||
|
||||
|
@ -192,7 +192,15 @@ void Window_Init(void) {
|
||||
Mouse_Init();
|
||||
}
|
||||
|
||||
void Window_Free(void) { }
|
||||
void Window_Free(void) {
|
||||
if (__djgpp_nearptr_enable() == 0) return;
|
||||
|
||||
char* screen = (char*)0xa0000 + __djgpp_conventional_base;
|
||||
Mem_Set(screen, 0, DISP_WIDTH * DISP_HEIGHT);
|
||||
|
||||
__djgpp_nearptr_disable();
|
||||
// TODO restore VGA mode and palette?
|
||||
}
|
||||
|
||||
static void DoCreateWindow(int width, int height) {
|
||||
Window_Main.Width = 320;
|
||||
|
@ -1,4 +1,4 @@
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS;
|
||||
cc_uint8 Platform_Flags = PLAT_FLAG_SINGLE_PROCESS | PLAT_FLAG_APP_EXIT;
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
|
Loading…
x
Reference in New Issue
Block a user