src/SDL.c
changeset 7139 dd722e7460c5
parent 7110 2a98852fd58d
child 7191 75360622e65f
equal deleted inserted replaced
7138:52ba4fa156c7 7139:dd722e7460c5
    30 #include "haptic/SDL_haptic_c.h"
    30 #include "haptic/SDL_haptic_c.h"
    31 #include "joystick/SDL_joystick_c.h"
    31 #include "joystick/SDL_joystick_c.h"
    32 
    32 
    33 /* Initialization/Cleanup routines */
    33 /* Initialization/Cleanup routines */
    34 #if !SDL_TIMERS_DISABLED
    34 #if !SDL_TIMERS_DISABLED
    35 extern void SDL_StartTicks(void);
       
    36 extern int SDL_TimerInit(void);
    35 extern int SDL_TimerInit(void);
    37 extern void SDL_TimerQuit(void);
    36 extern void SDL_TimerQuit(void);
       
    37 extern void SDL_InitTicks(void);
    38 #endif
    38 #endif
    39 #if SDL_VIDEO_DRIVER_WINDOWS
    39 #if SDL_VIDEO_DRIVER_WINDOWS
    40 extern int SDL_HelperWindowCreate(void);
    40 extern int SDL_HelperWindowCreate(void);
    41 extern int SDL_HelperWindowDestroy(void);
    41 extern int SDL_HelperWindowDestroy(void);
    42 #endif
    42 #endif
    43 
    43 
    44 
    44 
    45 /* The initialized subsystems */
    45 /* The initialized subsystems */
    46 static Uint32 ticks_started = 0;
       
    47 static SDL_bool SDL_bInMainQuit = SDL_FALSE;
    46 static SDL_bool SDL_bInMainQuit = SDL_FALSE;
    48 static Uint8 SDL_SubsystemRefCount[ 32 ];
    47 static Uint8 SDL_SubsystemRefCount[ 32 ];
    49 
    48 
    50 /* Private helper to increment a subsystem's ref counter. */
    49 /* Private helper to increment a subsystem's ref counter. */
    51 static void
    50 static void
    91 
    90 
    92 int
    91 int
    93 SDL_InitSubSystem(Uint32 flags)
    92 SDL_InitSubSystem(Uint32 flags)
    94 {
    93 {
    95 #if !SDL_TIMERS_DISABLED
    94 #if !SDL_TIMERS_DISABLED
    96     if (!ticks_started) {
    95     SDL_InitTicks();
    97         SDL_StartTicks();
       
    98         ticks_started = 1;
       
    99     }
       
   100 #endif
    96 #endif
   101 
    97 
   102     /* Initialize the timer subsystem */
    98     /* Initialize the timer subsystem */
   103     if ((flags & SDL_INIT_TIMER) ){
    99     if ((flags & SDL_INIT_TIMER) ){
   104 #if !SDL_TIMERS_DISABLED
   100 #if !SDL_TIMERS_DISABLED