Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
97f829d3
Commit
97f829d3
authored
4 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Update to new mutex function names.
Win32 can no longer exit() and WinExec() itself with impunity.
parent
a1105c48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/conio/sdl_con.c
+37
-38
37 additions, 38 deletions
src/conio/sdl_con.c
src/conio/sdlfuncs.c
+2
-12
2 additions, 12 deletions
src/conio/sdlfuncs.c
src/conio/sdlfuncs.h
+2
-2
2 additions, 2 deletions
src/conio/sdlfuncs.h
with
41 additions
and
52 deletions
src/conio/sdl_con.c
+
37
−
38
View file @
97f829d3
...
@@ -487,14 +487,14 @@ static void sdl_user_func(int func, ...)
...
@@ -487,14 +487,14 @@ static void sdl_user_func(int func, ...)
ev
.
user
.
data1
=
NULL
;
ev
.
user
.
data1
=
NULL
;
ev
.
user
.
data2
=
NULL
;
ev
.
user
.
data2
=
NULL
;
ev
.
user
.
code
=
func
;
ev
.
user
.
code
=
func
;
sdl
.
m
utex
P
(
sdl_ufunc_mtx
);
sdl
.
LockM
utex
(
sdl_ufunc_mtx
);
while
(
1
)
{
while
(
1
)
{
va_start
(
argptr
,
func
);
va_start
(
argptr
,
func
);
switch
(
func
)
{
switch
(
func
)
{
case
SDL_USEREVENT_SETICON
:
case
SDL_USEREVENT_SETICON
:
ev
.
user
.
data1
=
va_arg
(
argptr
,
void
*
);
ev
.
user
.
data1
=
va_arg
(
argptr
,
void
*
);
if
((
ev
.
user
.
data2
=
(
unsigned
long
*
)
malloc
(
sizeof
(
unsigned
long
)))
==
NULL
)
{
if
((
ev
.
user
.
data2
=
(
unsigned
long
*
)
malloc
(
sizeof
(
unsigned
long
)))
==
NULL
)
{
sdl
.
m
utex
V
(
sdl_ufunc_mtx
);
sdl
.
UnlockM
utex
(
sdl_ufunc_mtx
);
va_end
(
argptr
);
va_end
(
argptr
);
return
;
return
;
}
}
...
@@ -503,7 +503,7 @@ static void sdl_user_func(int func, ...)
...
@@ -503,7 +503,7 @@ static void sdl_user_func(int func, ...)
case
SDL_USEREVENT_SETNAME
:
case
SDL_USEREVENT_SETNAME
:
case
SDL_USEREVENT_SETTITLE
:
case
SDL_USEREVENT_SETTITLE
:
if
((
ev
.
user
.
data1
=
strdup
(
va_arg
(
argptr
,
char
*
)))
==
NULL
)
{
if
((
ev
.
user
.
data1
=
strdup
(
va_arg
(
argptr
,
char
*
)))
==
NULL
)
{
sdl
.
m
utex
V
(
sdl_ufunc_mtx
);
sdl
.
UnlockM
utex
(
sdl_ufunc_mtx
);
va_end
(
argptr
);
va_end
(
argptr
);
return
;
return
;
}
}
...
@@ -521,7 +521,7 @@ static void sdl_user_func(int func, ...)
...
@@ -521,7 +521,7 @@ static void sdl_user_func(int func, ...)
YIELD
();
YIELD
();
break
;
break
;
}
}
sdl
.
m
utex
V
(
sdl_ufunc_mtx
);
sdl
.
UnlockM
utex
(
sdl_ufunc_mtx
);
}
}
/* Called from main thread only */
/* Called from main thread only */
...
@@ -536,7 +536,7 @@ static int sdl_user_func_ret(int func, ...)
...
@@ -536,7 +536,7 @@ static int sdl_user_func_ret(int func, ...)
ev
.
user
.
data2
=
NULL
;
ev
.
user
.
data2
=
NULL
;
ev
.
user
.
code
=
func
;
ev
.
user
.
code
=
func
;
va_start
(
argptr
,
func
);
va_start
(
argptr
,
func
);
sdl
.
m
utex
P
(
sdl_ufunc_mtx
);
sdl
.
LockM
utex
(
sdl_ufunc_mtx
);
/* Drain the swamp */
/* Drain the swamp */
while
(
1
)
{
while
(
1
)
{
switch
(
func
)
{
switch
(
func
)
{
...
@@ -547,7 +547,7 @@ static int sdl_user_func_ret(int func, ...)
...
@@ -547,7 +547,7 @@ static int sdl_user_func_ret(int func, ...)
YIELD
();
YIELD
();
break
;
break
;
default:
default:
sdl
.
m
utex
V
(
sdl_ufunc_mtx
);
sdl
.
UnlockM
utex
(
sdl_ufunc_mtx
);
va_end
(
argptr
);
va_end
(
argptr
);
return
-
1
;
return
-
1
;
}
}
...
@@ -555,7 +555,7 @@ static int sdl_user_func_ret(int func, ...)
...
@@ -555,7 +555,7 @@ static int sdl_user_func_ret(int func, ...)
if
(
rv
==
0
)
if
(
rv
==
0
)
break
;
break
;
}
}
sdl
.
m
utex
V
(
sdl_ufunc_mtx
);
sdl
.
UnlockM
utex
(
sdl_ufunc_mtx
);
va_end
(
argptr
);
va_end
(
argptr
);
return
(
sdl_ufunc_retval
);
return
(
sdl_ufunc_retval
);
}
}
...
@@ -588,14 +588,14 @@ void sdl_drawrect(struct rectlist *data)
...
@@ -588,14 +588,14 @@ void sdl_drawrect(struct rectlist *data)
{
{
if
(
sdl_init_good
)
{
if
(
sdl_init_good
)
{
data
->
next
=
NULL
;
data
->
next
=
NULL
;
sdl
.
m
utex
P
(
sdl_headlock
);
sdl
.
LockM
utex
(
sdl_headlock
);
if
(
update_list
==
NULL
)
if
(
update_list
==
NULL
)
update_list
=
update_list_tail
=
data
;
update_list
=
update_list_tail
=
data
;
else
{
else
{
update_list_tail
->
next
=
data
;
update_list_tail
->
next
=
data
;
update_list_tail
=
data
;
update_list_tail
=
data
;
}
}
sdl
.
m
utex
V
(
sdl_headlock
);
sdl
.
UnlockM
utex
(
sdl_headlock
);
}
}
else
else
bitmap_drv_free_rect
(
data
);
bitmap_drv_free_rect
(
data
);
...
@@ -634,7 +634,6 @@ static int sdl_init_mode(int mode)
...
@@ -634,7 +634,6 @@ static int sdl_init_mode(int mode)
if
(
vstat
.
cols
==
40
)
if
(
vstat
.
cols
==
40
)
vstat
.
winwidth
*=
2
;
vstat
.
winwidth
*=
2
;
}
}
// TODO: Integer scale the window?
if
(
vstat
.
winwidth
<
vstat
.
charwidth
*
vstat
.
cols
)
if
(
vstat
.
winwidth
<
vstat
.
charwidth
*
vstat
.
cols
)
vstat
.
winwidth
=
vstat
.
charwidth
*
vstat
.
cols
;
vstat
.
winwidth
=
vstat
.
charwidth
*
vstat
.
cols
;
if
(
vstat
.
winheight
<
vstat
.
charheight
*
vstat
.
rows
)
if
(
vstat
.
winheight
<
vstat
.
charheight
*
vstat
.
rows
)
...
@@ -707,9 +706,9 @@ void sdl_setwinsize(int w, int h)
...
@@ -707,9 +706,9 @@ void sdl_setwinsize(int w, int h)
void
sdl_setwinposition
(
int
x
,
int
y
)
void
sdl_setwinposition
(
int
x
,
int
y
)
{
{
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
sdl
.
SetWindowPosition
(
win
,
x
,
y
);
sdl
.
SetWindowPosition
(
win
,
x
,
y
);
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
}
}
void
sdl_getwinsize_locked
(
int
*
w
,
int
*
h
)
void
sdl_getwinsize_locked
(
int
*
w
,
int
*
h
)
...
@@ -732,9 +731,9 @@ int sdl_kbhit(void)
...
@@ -732,9 +731,9 @@ int sdl_kbhit(void)
{
{
int
ret
;
int
ret
;
sdl
.
m
utex
P
(
sdl_keylock
);
sdl
.
LockM
utex
(
sdl_keylock
);
ret
=
(
sdl_key
!=
sdl_keynext
);
ret
=
(
sdl_key
!=
sdl_keynext
);
sdl
.
m
utex
V
(
sdl_keylock
);
sdl
.
UnlockM
utex
(
sdl_keylock
);
return
(
ret
);
return
(
ret
);
}
}
...
@@ -744,7 +743,7 @@ int sdl_getch(void)
...
@@ -744,7 +743,7 @@ int sdl_getch(void)
int
ch
;
int
ch
;
sdl
.
SemWait
(
sdl_key_pending
);
sdl
.
SemWait
(
sdl_key_pending
);
sdl
.
m
utex
P
(
sdl_keylock
);
sdl
.
LockM
utex
(
sdl_keylock
);
/* This always frees up space in keybuf for one more char */
/* This always frees up space in keybuf for one more char */
ch
=
sdl_keybuf
[
sdl_key
++
];
ch
=
sdl_keybuf
[
sdl_key
++
];
...
@@ -757,7 +756,7 @@ int sdl_getch(void)
...
@@ -757,7 +756,7 @@ int sdl_getch(void)
sdl
.
SemPost
(
sdl_key_pending
);
sdl
.
SemPost
(
sdl_key_pending
);
sdl_pending_mousekeys
--
;
sdl_pending_mousekeys
--
;
}
}
sdl
.
m
utex
V
(
sdl_keylock
);
sdl
.
UnlockM
utex
(
sdl_keylock
);
return
(
ch
);
return
(
ch
);
}
}
...
@@ -805,13 +804,13 @@ int sdl_get_window_info(int *width, int *height, int *xpos, int *ypos)
...
@@ -805,13 +804,13 @@ int sdl_get_window_info(int *width, int *height, int *xpos, int *ypos)
int
wx
,
wy
;
int
wx
,
wy
;
if
(
xpos
||
ypos
)
{
if
(
xpos
||
ypos
)
{
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
sdl
.
GetWindowPosition
(
win
,
&
wx
,
&
wy
);
sdl
.
GetWindowPosition
(
win
,
&
wx
,
&
wy
);
if
(
xpos
)
if
(
xpos
)
*
xpos
=
wx
;
*
xpos
=
wx
;
if
(
ypos
)
if
(
ypos
)
*
ypos
=
wy
;
*
ypos
=
wy
;
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
}
}
if
(
width
||
height
)
{
if
(
width
||
height
)
{
...
@@ -837,7 +836,7 @@ static void setup_surfaces_locked(void)
...
@@ -837,7 +836,7 @@ static void setup_surfaces_locked(void)
else
else
flags
|=
SDL_WINDOW_RESIZABLE
;
flags
|=
SDL_WINDOW_RESIZABLE
;
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
charwidth
=
cvstat
.
charwidth
;
charwidth
=
cvstat
.
charwidth
;
charheight
=
cvstat
.
charheight
;
charheight
=
cvstat
.
charheight
;
cols
=
cvstat
.
cols
;
cols
=
cvstat
.
cols
;
...
@@ -869,7 +868,7 @@ static void setup_surfaces_locked(void)
...
@@ -869,7 +868,7 @@ static void setup_surfaces_locked(void)
sdl_exitcode
=
1
;
sdl_exitcode
=
1
;
sdl
.
PeepEvents
(
&
ev
,
1
,
SDL_ADDEVENT
,
SDL_FIRSTEVENT
,
SDL_LASTEVENT
);
sdl
.
PeepEvents
(
&
ev
,
1
,
SDL_ADDEVENT
,
SDL_FIRSTEVENT
,
SDL_LASTEVENT
);
}
}
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
}
}
static
void
setup_surfaces
(
void
)
static
void
setup_surfaces
(
void
)
...
@@ -890,10 +889,10 @@ static void sdl_add_key(unsigned int keyval)
...
@@ -890,10 +889,10 @@ static void sdl_add_key(unsigned int keyval)
return
;
return
;
}
}
if
(
keyval
<=
0xffff
)
{
if
(
keyval
<=
0xffff
)
{
sdl
.
m
utex
P
(
sdl_keylock
);
sdl
.
LockM
utex
(
sdl_keylock
);
if
(
sdl_keynext
+
1
==
sdl_key
)
{
if
(
sdl_keynext
+
1
==
sdl_key
)
{
beep
();
beep
();
sdl
.
m
utex
V
(
sdl_keylock
);
sdl
.
UnlockM
utex
(
sdl_keylock
);
return
;
return
;
}
}
if
((
sdl_keynext
+
2
==
sdl_key
)
&&
keyval
>
0xff
)
{
if
((
sdl_keynext
+
2
==
sdl_key
)
&&
keyval
>
0xff
)
{
...
@@ -901,7 +900,7 @@ static void sdl_add_key(unsigned int keyval)
...
@@ -901,7 +900,7 @@ static void sdl_add_key(unsigned int keyval)
sdl_pending_mousekeys
+=
2
;
sdl_pending_mousekeys
+=
2
;
else
else
beep
();
beep
();
sdl
.
m
utex
V
(
sdl_keylock
);
sdl
.
UnlockM
utex
(
sdl_keylock
);
return
;
return
;
}
}
sdl_keybuf
[
sdl_keynext
++
]
=
keyval
&
0xff
;
sdl_keybuf
[
sdl_keynext
++
]
=
keyval
&
0xff
;
...
@@ -910,7 +909,7 @@ static void sdl_add_key(unsigned int keyval)
...
@@ -910,7 +909,7 @@ static void sdl_add_key(unsigned int keyval)
sdl_keybuf
[
sdl_keynext
++
]
=
keyval
>>
8
;
sdl_keybuf
[
sdl_keynext
++
]
=
keyval
>>
8
;
sdl
.
SemPost
(
sdl_key_pending
);
sdl
.
SemPost
(
sdl_key_pending
);
}
}
sdl
.
m
utex
V
(
sdl_keylock
);
sdl
.
UnlockM
utex
(
sdl_keylock
);
}
}
}
}
...
@@ -1520,7 +1519,7 @@ static void sdl_video_event_thread(void *data)
...
@@ -1520,7 +1519,7 @@ static void sdl_video_event_thread(void *data)
newh
=
"2"
;
newh
=
"2"
;
else
else
newh
=
"0"
;
newh
=
"0"
;
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
if
(
ev
.
window
.
event
==
SDL_WINDOWEVENT_RESIZED
)
if
(
ev
.
window
.
event
==
SDL_WINDOWEVENT_RESIZED
)
sdl
.
GetWindowSize
(
win
,
&
cvstat
.
winwidth
,
&
cvstat
.
winheight
);
sdl
.
GetWindowSize
(
win
,
&
cvstat
.
winwidth
,
&
cvstat
.
winheight
);
if
(
strcmp
(
newh
,
sdl
.
GetHint
(
SDL_HINT_RENDER_SCALE_QUALITY
)))
{
if
(
strcmp
(
newh
,
sdl
.
GetHint
(
SDL_HINT_RENDER_SCALE_QUALITY
)))
{
...
@@ -1529,7 +1528,7 @@ static void sdl_video_event_thread(void *data)
...
@@ -1529,7 +1528,7 @@ static void sdl_video_event_thread(void *data)
texture
=
sdl
.
CreateTexture
(
renderer
,
SDL_PIXELFORMAT_ARGB8888
,
SDL_TEXTUREACCESS_STREAMING
,
cvstat
.
charwidth
*
cvstat
.
cols
,
cvstat
.
charheight
*
cvstat
.
rows
);
texture
=
sdl
.
CreateTexture
(
renderer
,
SDL_PIXELFORMAT_ARGB8888
,
SDL_TEXTUREACCESS_STREAMING
,
cvstat
.
charwidth
*
cvstat
.
cols
,
cvstat
.
charheight
*
cvstat
.
rows
);
bitmap_drv_request_pixels
();
bitmap_drv_request_pixels
();
}
}
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
pthread_mutex_unlock
(
&
vstatlock
);
pthread_mutex_unlock
(
&
vstatlock
);
break
;
break
;
}
}
...
@@ -1549,12 +1548,12 @@ static void sdl_video_event_thread(void *data)
...
@@ -1549,12 +1548,12 @@ static void sdl_video_event_thread(void *data)
sdl
.
SemPost
(
sdl_ufunc_ret
);
sdl
.
SemPost
(
sdl_ufunc_ret
);
return
;
return
;
case
SDL_USEREVENT_FLUSH
:
case
SDL_USEREVENT_FLUSH
:
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
if
(
win
!=
NULL
)
{
if
(
win
!=
NULL
)
{
sdl
.
m
utex
P
(
sdl_headlock
);
sdl
.
LockM
utex
(
sdl_headlock
);
list
=
update_list
;
list
=
update_list
;
update_list
=
update_list_tail
=
NULL
;
update_list
=
update_list_tail
=
NULL
;
sdl
.
m
utex
V
(
sdl_headlock
);
sdl
.
UnlockM
utex
(
sdl_headlock
);
for
(;
list
;
list
=
old_next
)
{
for
(;
list
;
list
=
old_next
)
{
SDL_Rect
src
;
SDL_Rect
src
;
...
@@ -1590,12 +1589,12 @@ static void sdl_video_event_thread(void *data)
...
@@ -1590,12 +1589,12 @@ static void sdl_video_event_thread(void *data)
}
}
sdl
.
RenderPresent
(
renderer
);
sdl
.
RenderPresent
(
renderer
);
}
}
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
break
;
break
;
case
SDL_USEREVENT_SETNAME
:
case
SDL_USEREVENT_SETNAME
:
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
sdl
.
SetWindowTitle
(
win
,
(
char
*
)
ev
.
user
.
data1
);
sdl
.
SetWindowTitle
(
win
,
(
char
*
)
ev
.
user
.
data1
);
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
free
(
ev
.
user
.
data1
);
free
(
ev
.
user
.
data1
);
break
;
break
;
case
SDL_USEREVENT_SETICON
:
case
SDL_USEREVENT_SETICON
:
...
@@ -1611,15 +1610,15 @@ static void sdl_video_event_thread(void *data)
...
@@ -1611,15 +1610,15 @@ static void sdl_video_event_thread(void *data)
,
*
(
DWORD
*
)
"
\0\0\377\0
"
,
*
(
DWORD
*
)
"
\0\0\377\0
"
,
*
(
DWORD
*
)
"
\0\0\0\377
"
,
*
(
DWORD
*
)
"
\0\0\0\377
"
);
);
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
sdl
.
SetWindowIcon
(
win
,
sdl_icon
);
sdl
.
SetWindowIcon
(
win
,
sdl_icon
);
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
free
(
ev
.
user
.
data2
);
free
(
ev
.
user
.
data2
);
break
;
break
;
case
SDL_USEREVENT_SETTITLE
:
case
SDL_USEREVENT_SETTITLE
:
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
sdl
.
SetWindowTitle
(
win
,
(
char
*
)
ev
.
user
.
data1
);
sdl
.
SetWindowTitle
(
win
,
(
char
*
)
ev
.
user
.
data1
);
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
free
(
ev
.
user
.
data1
);
free
(
ev
.
user
.
data1
);
break
;
break
;
case
SDL_USEREVENT_SETVIDMODE
:
case
SDL_USEREVENT_SETVIDMODE
:
...
@@ -1640,10 +1639,10 @@ static void sdl_video_event_thread(void *data)
...
@@ -1640,10 +1639,10 @@ static void sdl_video_event_thread(void *data)
case
SDL_USEREVENT_INIT
:
case
SDL_USEREVENT_INIT
:
if
(
!
sdl_init_good
)
{
if
(
!
sdl_init_good
)
{
if
(
sdl
.
WasInit
(
SDL_INIT_VIDEO
)
==
SDL_INIT_VIDEO
)
{
if
(
sdl
.
WasInit
(
SDL_INIT_VIDEO
)
==
SDL_INIT_VIDEO
)
{
sdl
.
m
utex
P
(
win_mutex
);
sdl
.
LockM
utex
(
win_mutex
);
_beginthread
(
sdl_mouse_thread
,
0
,
NULL
);
_beginthread
(
sdl_mouse_thread
,
0
,
NULL
);
sdl_init_good
=
1
;
sdl_init_good
=
1
;
sdl
.
m
utex
V
(
win_mutex
);
sdl
.
UnlockM
utex
(
win_mutex
);
}
}
}
}
sdl_ufunc_retval
=
0
;
sdl_ufunc_retval
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/conio/sdlfuncs.c
+
2
−
12
View file @
97f829d3
...
@@ -41,12 +41,11 @@ int load_sdl_funcs(struct sdlfuncs *sdlf)
...
@@ -41,12 +41,11 @@ int load_sdl_funcs(struct sdlfuncs *sdlf)
xp_dlclose
(
sdl_dll
);
xp_dlclose
(
sdl_dll
);
return
(
-
1
);
return
(
-
1
);
}
}
// SDL2: Rename from mutexP/mutexV to LockMutex/UnlockMutex
if
((
sdlf
->
LockMutex
=
xp_dlsym
(
sdl_dll
,
SDL_LockMutex
))
==
NULL
)
{
if
((
sdlf
->
mutexP
=
xp_dlsym
(
sdl_dll
,
SDL_LockMutex
))
==
NULL
)
{
xp_dlclose
(
sdl_dll
);
xp_dlclose
(
sdl_dll
);
return
(
-
1
);
return
(
-
1
);
}
}
if
((
sdlf
->
m
utex
V
=
xp_dlsym
(
sdl_dll
,
SDL_UnlockMutex
))
==
NULL
)
{
if
((
sdlf
->
UnlockM
utex
=
xp_dlsym
(
sdl_dll
,
SDL_UnlockMutex
))
==
NULL
)
{
xp_dlclose
(
sdl_dll
);
xp_dlclose
(
sdl_dll
);
return
(
-
1
);
return
(
-
1
);
}
}
...
@@ -277,14 +276,6 @@ int init_sdl_video(void)
...
@@ -277,14 +276,6 @@ int init_sdl_video(void)
#ifdef _WIN32
#ifdef _WIN32
/* Fail to windib (ie: No mouse attached) */
/* Fail to windib (ie: No mouse attached) */
if
(
sdl
.
Init
(
SDL_INIT_VIDEO
))
{
if
(
sdl
.
Init
(
SDL_INIT_VIDEO
))
{
// SDL2: We can likely do better now...
driver_env
=
getenv
(
"SDL_VIDEODRIVER"
);
if
(
driver_env
==
NULL
||
strcmp
(
driver_env
,
"windib"
))
{
putenv
(
"SDL_VIDEODRIVER=windib"
);
WinExec
(
GetCommandLine
(),
SW_SHOWDEFAULT
);
return
(
0
);
}
/* Sure ,we can't use video, but audio is still valid! */
if
(
sdl
.
Init
(
0
)
==
0
)
if
(
sdl
.
Init
(
0
)
==
0
)
sdl_initialized
=
TRUE
;
sdl_initialized
=
TRUE
;
}
}
...
@@ -330,7 +321,6 @@ int init_sdl_video(void)
...
@@ -330,7 +321,6 @@ int init_sdl_video(void)
}
}
if
(
sdl_video_initialized
)
{
if
(
sdl_video_initialized
)
{
SetThreadName
(
"SDL Main"
);
atexit
(
QuitWrap
);
atexit
(
QuitWrap
);
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/conio/sdlfuncs.h
+
2
−
2
View file @
97f829d3
...
@@ -14,8 +14,8 @@
...
@@ -14,8 +14,8 @@
struct
sdlfuncs
{
struct
sdlfuncs
{
int
(
HACK_HACK_HACK
*
Init
)
(
Uint32
flags
);
int
(
HACK_HACK_HACK
*
Init
)
(
Uint32
flags
);
void
(
HACK_HACK_HACK
*
Quit
)
(
void
);
void
(
HACK_HACK_HACK
*
Quit
)
(
void
);
int
(
HACK_HACK_HACK
*
m
utex
P
)
(
SDL_mutex
*
mutex
);
int
(
HACK_HACK_HACK
*
LockM
utex
)
(
SDL_mutex
*
mutex
);
int
(
HACK_HACK_HACK
*
m
utex
V
)
(
SDL_mutex
*
mutex
);
int
(
HACK_HACK_HACK
*
UnlockM
utex
)
(
SDL_mutex
*
mutex
);
int
(
HACK_HACK_HACK
*
PeepEvents
)
(
SDL_Event
*
events
,
int
numevents
,
int
(
HACK_HACK_HACK
*
PeepEvents
)
(
SDL_Event
*
events
,
int
numevents
,
SDL_eventaction
action
,
Uint32
minType
,
Uint32
maxType
);
SDL_eventaction
action
,
Uint32
minType
,
Uint32
maxType
);
char
*
(
HACK_HACK_HACK
*
GetCurrentVideoDriver
)
(
void
);
char
*
(
HACK_HACK_HACK
*
GetCurrentVideoDriver
)
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment