Added title support
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1274
This commit is contained in:
parent
e088330dea
commit
d079c8388a
3 changed files with 25 additions and 2 deletions
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: render.cpp,v 1.16 2003-09-29 21:05:05 qbix79 Exp $ */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
|
@ -357,14 +359,17 @@ normalop:
|
|||
GFX_Start();
|
||||
}
|
||||
|
||||
extern void GFX_SetTitle(Bits cycles, Bits frameskip);
|
||||
static void IncreaseFrameSkip(void) {
|
||||
if (render.frameskip.max<10) render.frameskip.max++;
|
||||
LOG_MSG("Frame Skip at %d",render.frameskip.max);
|
||||
GFX_SetTitle(-1,render.frameskip.max);
|
||||
}
|
||||
|
||||
static void DecreaseFrameSkip(void) {
|
||||
if (render.frameskip.max>0) render.frameskip.max--;
|
||||
LOG_MSG("Frame Skip at %d",render.frameskip.max);
|
||||
GFX_SetTitle(-1,render.frameskip.max);
|
||||
}
|
||||
|
||||
void RENDER_Init(Section * sec) {
|
||||
|
@ -394,5 +399,6 @@ void RENDER_Init(Section * sec) {
|
|||
}
|
||||
KEYBOARD_AddEvent(KBD_f7,KBD_MOD_CTRL,DecreaseFrameSkip);
|
||||
KEYBOARD_AddEvent(KBD_f8,KBD_MOD_CTRL,IncreaseFrameSkip);
|
||||
GFX_SetTitle(-1,render.frameskip.max);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: sdlmain.cpp,v 1.43 2003-09-29 21:04:31 qbix79 Exp $ */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
@ -78,6 +81,16 @@ struct SDL_Block {
|
|||
static SDL_Block sdl;
|
||||
static void CaptureMouse(void);
|
||||
|
||||
void GFX_SetTitle(Bits cycles,Bits frameskip){
|
||||
char title[200]={0};
|
||||
static internal_cycles=0;
|
||||
static internal_frameskip=0;
|
||||
if(cycles != -1) internal_cycles = cycles;
|
||||
if(frameskip != -1) internal_frameskip = frameskip;
|
||||
sprintf(title,"Cpu Cycles: %8d, Frameskip %2d",internal_cycles,internal_frameskip);
|
||||
SDL_WM_SetCaption(title,VERSION);
|
||||
}
|
||||
|
||||
/* Reset the screen with current values in the sdl structure */
|
||||
static void ResetScreen(void) {
|
||||
GFX_Stop();
|
||||
|
@ -102,7 +115,7 @@ static void ResetScreen(void) {
|
|||
);
|
||||
|
||||
|
||||
SDL_WM_SetCaption(VERSION,VERSION);
|
||||
GFX_SetTitle(-1,-1);
|
||||
|
||||
Bitu flags=MODE_SET;
|
||||
if (sdl.full_screen) flags|=MODE_FULLSCREEN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue