Removed the frame limiter code based on SDL semaphore that
was commented and unused.
This commit is contained in:
parent
a6f99da9cf
commit
3dd0ee91d0
|
@ -131,17 +131,8 @@ static void Draw()
|
||||||
|
|
||||||
gboolean EmuLoop(gpointer data)
|
gboolean EmuLoop(gpointer data)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
int i;
|
|
||||||
if (!noticed_3D) {
|
|
||||||
GtkWidget * dlg = glade_xml_get_widget(xml, "w3Dop");
|
|
||||||
gtk_widget_show(dlg);
|
|
||||||
noticed_3D=TRUE;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(desmume_running()) /* Si on est en train d'executer le programme ... */
|
if(desmume_running()) /* Si on est en train d'executer le programme ... */
|
||||||
{
|
{
|
||||||
// static int limiter_frame_counter = 0;
|
|
||||||
if(Frameskip == 0)
|
if(Frameskip == 0)
|
||||||
NDS_SkipFrame(false);
|
NDS_SkipFrame(false);
|
||||||
else
|
else
|
||||||
|
@ -182,16 +173,6 @@ gboolean EmuLoop(gpointer data)
|
||||||
|
|
||||||
ticksPrevFrame = SDL_GetTicks();
|
ticksPrevFrame = SDL_GetTicks();
|
||||||
|
|
||||||
/* if ( !glade_fps_limiter_disabled) {
|
|
||||||
limiter_frame_counter += 1;
|
|
||||||
if ( limiter_frame_counter >= FPS_LIMITER_FRAME_PERIOD) {
|
|
||||||
limiter_frame_counter = 0;
|
|
||||||
|
|
||||||
/* wait for the timer to expire *-/
|
|
||||||
SDL_SemWait( glade_fps_limiter_semaphore);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
gtk_widget_queue_draw(pDrawingArea);
|
gtk_widget_queue_draw(pDrawingArea);
|
||||||
|
|
|
@ -38,10 +38,6 @@
|
||||||
#include "gdk_3Demu.h"
|
#include "gdk_3Demu.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* The frame limiter semaphore
|
|
||||||
*/
|
|
||||||
//SDL_sem *glade_fps_limiter_semaphore;
|
|
||||||
int glade_fps_limiter_disabled = 0;
|
int glade_fps_limiter_disabled = 0;
|
||||||
|
|
||||||
GtkWidget * pWindow;
|
GtkWidget * pWindow;
|
||||||
|
@ -426,28 +422,6 @@ joinThread_gdb( void *thread_handle) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A SDL timer callback function. Signals the supplied SDL semaphore
|
|
||||||
* if its value is small.
|
|
||||||
*
|
|
||||||
* @param interval The interval since the last call (in ms)
|
|
||||||
* @param param The pointer to the semaphore.
|
|
||||||
*
|
|
||||||
* @return The interval to the next call (required by SDL)
|
|
||||||
*/
|
|
||||||
/*static Uint32
|
|
||||||
glade_fps_limiter_fn( Uint32 interval, void *param) {
|
|
||||||
SDL_sem *sdl_semaphore = (SDL_sem *)param;
|
|
||||||
|
|
||||||
/* signal the semaphore if it is getting low *-/
|
|
||||||
if ( SDL_SemValue( sdl_semaphore) < 4) {
|
|
||||||
SDL_SemPost( sdl_semaphore);
|
|
||||||
}
|
|
||||||
|
|
||||||
return interval;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* ***** ***** MAIN ***** ***** */
|
/* ***** ***** MAIN ***** ***** */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -606,33 +580,10 @@ common_gtk_glade_main( struct configured_features *my_config) {
|
||||||
/* setup the frame limiter and indicate if it is disabled */
|
/* setup the frame limiter and indicate if it is disabled */
|
||||||
glade_fps_limiter_disabled = my_config->disable_limiter;
|
glade_fps_limiter_disabled = my_config->disable_limiter;
|
||||||
|
|
||||||
/* if ( !glade_fps_limiter_disabled) {
|
|
||||||
/* create the semaphore used for fps limiting *-/
|
|
||||||
glade_fps_limiter_semaphore = SDL_CreateSemaphore( 1);
|
|
||||||
|
|
||||||
/* start a SDL timer for every FPS_LIMITER_FRAME_PERIOD
|
|
||||||
* frames to keep us at 60 fps *-/
|
|
||||||
limiter_timer = SDL_AddTimer( 16 * FPS_LIMITER_FRAME_PERIOD,
|
|
||||||
glade_fps_limiter_fn,
|
|
||||||
glade_fps_limiter_semaphore);
|
|
||||||
if ( limiter_timer == NULL) {
|
|
||||||
fprintf( stderr, _("Error trying to start FPS limiter timer: %s\n"),
|
|
||||||
SDL_GetError());
|
|
||||||
SDL_DestroySemaphore( glade_fps_limiter_semaphore);
|
|
||||||
glade_fps_limiter_disabled = 1;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* start event loop */
|
/* start event loop */
|
||||||
gtk_main();
|
gtk_main();
|
||||||
desmume_free();
|
desmume_free();
|
||||||
|
|
||||||
/* if ( !glade_fps_limiter_disabled) {
|
|
||||||
/* tidy up the FPS limiter timer and semaphore *-/
|
|
||||||
SDL_RemoveTimer( limiter_timer);
|
|
||||||
SDL_DestroySemaphore( glade_fps_limiter_semaphore);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* Unload joystick */
|
/* Unload joystick */
|
||||||
uninit_joy();
|
uninit_joy();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue