Skip to content
Snippets Groups Projects
Commit 8ece3bb6 authored by deuce's avatar deuce
Browse files

Sync with ciolib

parent d8f66267
No related branches found
No related tags found
No related merge requests found
......@@ -89,6 +89,7 @@ int load_sdl_funcs(struct sdlfuncs *sdlf)
sdlf->LockYUVOverlay=SDL_LockYUVOverlay;
sdlf->UnlockYUVOverlay=SDL_UnlockYUVOverlay;
sdlf->GetVideoInfo=SDL_GetVideoInfo;
sdlf->Linked_Version=SDL_Linked_Version;
sdlf->gotfuncs=1;
sdl_funcs_loaded=1;
return(0);
......@@ -320,6 +321,10 @@ int load_sdl_funcs(struct sdlfuncs *sdlf)
FreeLibrary(sdl_dll);
return(-1);
}
if((sdlf->Linked_Version=(void *)GetProcAddress(sdl_dll, "SDL_Linked_Version"))==NULL) {
FreeLibrary(sdl_dll);
return(-1);
}
sdlf->gotfuncs=1;
sdl_funcs_loaded=1;
......@@ -546,6 +551,10 @@ int load_sdl_funcs(struct sdlfuncs *sdlf)
dlclose(sdl_dll);
return(-1);
}
if((sdlf->Linked_Version=dlsym(sdl_dll, "SDL_Linked_Version"))==NULL) {
dlclose(sdl_dll);
return(-1);
}
sdlf->gotfuncs=1;
sdl_funcs_loaded=1;
return(0);
......@@ -615,6 +624,7 @@ int SDL_main_env(int argc, char **argv, char **env)
SDL_Thread *main_thread;
int main_ret;
int use_sdl_video=FALSE;
char *driver_env=NULL;
ma.argc=argc;
ma.argv=argv;
......@@ -629,7 +639,8 @@ int SDL_main_env(int argc, char **argv, char **env)
#ifdef _WIN32
/* Fail to windib (ie: No mouse attached) */
if(sdl.Init(SDL_INIT_VIDEO)) {
if(getenv("SDL_VIDEODRIVER")==NULL) {
driver_env=getenv("SDL_VIDEODRIVER");
if(driver_env==NULL || strcmp(driver_env,"windib")) {
putenv("SDL_VIDEODRIVER=windib");
WinExec(GetCommandLine(), SW_SHOWDEFAULT);
return(0);
......
......@@ -63,6 +63,7 @@ struct sdlfuncs {
int (*LockYUVOverlay) (SDL_Overlay *overlay);
void (*UnlockYUVOverlay) (SDL_Overlay *overlay);
const SDL_VideoInfo *(*GetVideoInfo)(void);
const SDL_version *(*Linked_Version)(void);
SDL_VideoInfo initial_videoinfo;
int gotfuncs;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment