added a switch to windowed mode in E_Exit
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@257
This commit is contained in:
parent
33c702a8e4
commit
b5d4c88ad7
3 changed files with 31 additions and 19 deletions
|
@ -18,7 +18,8 @@
|
|||
|
||||
#ifndef __VIDEO_H
|
||||
#define __VIDEO_H
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <SDL/SDL_thread.h>
|
||||
typedef void (GFX_DrawHandler)(Bit8u * vidstart);
|
||||
/* Used to reply to the renderer what size to set */
|
||||
typedef void (GFX_ResizeHandler)(Bitu * width,Bitu * height);
|
||||
|
@ -34,8 +35,27 @@ struct GFX_Info {
|
|||
Bitu width,height,bpp,pitch;
|
||||
};
|
||||
|
||||
|
||||
extern GFX_Info gfx_info;
|
||||
|
||||
struct SDL_Block {
|
||||
bool active; //If this isn't set don't draw
|
||||
Bitu width;
|
||||
Bitu height;
|
||||
Bitu bpp;
|
||||
GFX_DrawHandler * draw;
|
||||
GFX_ResizeHandler * resize;
|
||||
bool mouse_grabbed;
|
||||
bool full_screen;
|
||||
SDL_Thread * thread;
|
||||
SDL_mutex * mutex;
|
||||
SDL_Surface * surface;
|
||||
SDL_Joystick * joy;
|
||||
SDL_Color pal[256];
|
||||
};
|
||||
|
||||
extern SDL_Block sdl;
|
||||
|
||||
void GFX_Events(void);
|
||||
void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries);
|
||||
void GFX_SetDrawHandler(GFX_DrawHandler * handler);
|
||||
|
|
|
@ -32,23 +32,7 @@
|
|||
//#define DISABLE_JOYSTICK
|
||||
|
||||
|
||||
struct SDL_Block {
|
||||
bool active; //If this isn't set don't draw
|
||||
Bitu width;
|
||||
Bitu height;
|
||||
Bitu bpp;
|
||||
GFX_DrawHandler * draw;
|
||||
GFX_ResizeHandler * resize;
|
||||
bool mouse_grabbed;
|
||||
bool full_screen;
|
||||
SDL_Thread * thread;
|
||||
SDL_mutex * mutex;
|
||||
SDL_Surface * surface;
|
||||
SDL_Joystick * joy;
|
||||
SDL_Color pal[256];
|
||||
};
|
||||
|
||||
static SDL_Block sdl;
|
||||
SDL_Block sdl;
|
||||
|
||||
GFX_Info gfx_info;
|
||||
|
||||
|
@ -120,6 +104,10 @@ static void SwitchFullScreen(void) {
|
|||
ResetScreen();
|
||||
GFX_Start();
|
||||
}
|
||||
//only prototype existed
|
||||
void GFX_SwitchFullScreen(void) {
|
||||
SwitchFullScreen();
|
||||
}
|
||||
|
||||
static void GFX_Redraw() {
|
||||
#if C_THREADED
|
||||
|
|
|
@ -216,6 +216,10 @@ void S_Warn(char * format,...) {
|
|||
}
|
||||
|
||||
void E_Exit(char * format,...) {
|
||||
|
||||
if (sdl.full_screen) {
|
||||
GFX_SwitchFullScreen();
|
||||
}
|
||||
|
||||
char buf[1024];
|
||||
|
||||
|
@ -225,7 +229,7 @@ void E_Exit(char * format,...) {
|
|||
va_start(msg,format);
|
||||
vsprintf(buf+strlen(buf),format,msg);
|
||||
va_end(msg);
|
||||
|
||||
|
||||
strcat(buf,"\n");
|
||||
printf(buf);
|
||||
printf("Press ENTER to stop\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue