Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
9ee9b19c
Commit
9ee9b19c
authored
May 31, 2007
by
deuce
Browse files
SDL back where it belongs...
parent
f389631e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
9 deletions
+105
-9
src/conio/Common.gmake
src/conio/Common.gmake
+79
-1
src/conio/GNUmakefile
src/conio/GNUmakefile
+10
-1
src/conio/ciolib.c
src/conio/ciolib.c
+4
-4
src/conio/ciolib.h
src/conio/ciolib.h
+9
-0
src/conio/sdlfuncs.c
src/conio/sdlfuncs.c
+3
-3
No files found.
src/conio/Common.gmake
View file @
9ee9b19c
...
...
@@ -27,6 +27,84 @@ endif
ifdef NO_X
ifndef WITH_SDL
CIOLIB-MT_CFLAGS += -DNO_FONTS
CIOLIB-CFLAGS += -DNO_FONTS
CIOLIB_CFLAGS += -DNO_FONTS
endif
endif
# Find SDL headers!
ifdef USE_SDL
ifndef WITH_SDL_AUDIO
ifdef SDL_CONFIG
ifeq ($(shell ${SDL_CONFIG} --cflags > /dev/null 2>&1 && echo YES),YES)
WITH_SDL := 1
endif
else
ifeq ($(os),darwin)
ifeq ($(shell if [ -d /Library/Frameworks/SDL.framework ] ; then echo YES ; fi),YES)
WITH_SDL := 1
endif
else
ifeq ($(shell sdl-config --cflags > /dev/null 2>&1 && echo YES),YES)
SDL_CONFIG := sdl-config
WITH_SDL := 1
else
ifeq ($(shell sdl13-config --cflags > /dev/null 2>&1 && echo YES),YES)
SDL_CONFIG := sdl13-config
WITH_SDL := 1
else
ifeq ($(shell sdl12-config --cflags > /dev/null 2>&1 && echo YES),YES)
SDL_CONFIG := sdl12-config
WITH_SDL := 1
else
ifeq ($(shell sdl11-config --cflags > /dev/null 2>&1 && echo YES),YES)
SDL_CONFIG := sdl11-config
WITH_SDL := 1
endif
endif
endif
endif
endif
endif
endif
endif
ifdef WITH_SDL
ifndef WITH_SDL_AUDIO
ifdef SDL_CONFIG
ifeq ($(shell ${SDL_CONFIG} --cflags > /dev/null 2>&1 && echo YES),YES)
CIOLIB-MT_CFLAGS += -DWITH_SDL
CIOLIB-MT_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
CIOLIB_CFLAGS += -DWITH_SDL
CIOLIB_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
ifdef STATIC_SDL
CIOLIB-MT_LIBS += $(shell $(SDL_CONFIG) --static-libs)
CIOLIB-MT_CFLAGS += -DSTATIC_SDL
CIOLIB-LIBS += $(shell $(SDL_CONFIG) --static-libs)
CIOLIB-CFLAGS += -DSTATIC_SDL
else
ifeq ($(os),darwin)
CIOLIB-MT_LIBS += $(UL_PRE)dl$(UL_SUF)
CIOLIB_LIBS += $(UL_PRE)dl$(UL_SUF)
endif
ifeq ($(os),linux)
CIOLIB-MT_LIBS += $(UL_PRE)dl$(UL_SUF)
CIOLIB_LIBS += $(UL_PRE)dl$(UL_SUF)
endif
ifeq ($(os),sunos)
CIOLIB-MT_LIBS += $(UL_PRE)dl$(UL_SUF)
CIOLIB_LIBS += $(UL_PRE)dl$(UL_SUF)
endif
endif
endif
else
ifeq ($(os),darwin)
CIOLIB-MT_CFLAGS += -DWITH_SDL -DSTATIC_SDL
CIOLIB-MT_CFLAGS += -I/Library/Frameworks/SDL.framework/Headers
CIOLIB-MT_LIBS += -framework SDL -framework Cocoa -framework Carbon -I/Library/Frameworks/SDL.framework/Headers
CIOLIB_CFLAGS += -DWITH_SDL -DSTATIC_SDL
CIOLIB_CFLAGS += -I/Library/Frameworks/SDL.framework/Headers
CIOLIB_LIBS += -framework SDL -framework Cocoa -framework Carbon -I/Library/Frameworks/SDL.framework/Headers
endif
endif
endif
endif
src/conio/GNUmakefile
View file @
9ee9b19c
...
...
@@ -12,8 +12,17 @@ else
$(MTOBJODIR)$(DIRSEP)
x_cio
$(OFILE)
endif
ifdef
WITH_SDL
ifdef
WITH_SDL
_AUDIO
OBJS
+=
$(MTOBJODIR)$(DIRSEP)
sdl_con
$(OFILE)
else
ifdef
WITH_SDL
OBJS
+=
$(MTOBJODIR)$(DIRSEP)
sdl_con
$(OFILE)
OBJS
+=
$(MTOBJODIR)$(DIRSEP)
sdlfuncs
$(OFILE)
ifeq
($(os),darwin)
MTOBJS
+=
$(MTOBJODIR)$(DIRSEP)
SDLMain
$(OFILE)
OBJS
+=
$(OBJODIR)$(DIRSEP)
SDLMain
$(OFILE)
endif
endif
endif
ifeq
($(os),netbsd)
...
...
src/conio/ciolib.c
View file @
9ee9b19c
...
...
@@ -48,7 +48,7 @@
#define CIOLIB_NO_MACROS
#include "ciolib.h"
#ifdef
WITH_SDL
#if
def
ined(WITH_SDL) || defined(
WITH_SDL
_AUDIO)
#include "sdl_con.h"
#endif
#ifdef _WIN32
...
...
@@ -111,7 +111,7 @@ CIOLIBEXPORT char * CIOLIBCALL ciolib_getcliptext(void);
#define CIOLIB_INIT() { if(initialized != 1) initciolib(CIOLIB_MODE_AUTO); }
#ifdef
WITH_SDL
#if
def
ined(WITH_SDL) || defined(
WITH_SDL
_AUDIO)
int
try_sdl_init
(
int
mode
)
{
if
(
!
sdl_initciolib
(
mode
))
{
...
...
@@ -304,7 +304,7 @@ CIOLIBEXPORT int CIOLIBCALL initciolib(int mode)
switch
(
mode
)
{
case
CIOLIB_MODE_AUTO
:
#ifdef
WITH_SDL
#if
def
ined(WITH_SDL) || defined(
WITH_SDL
_AUDIO)
if
(
!
try_sdl_init
(
mode
))
#endif
#ifdef _WIN32
...
...
@@ -337,7 +337,7 @@ CIOLIBEXPORT int CIOLIBCALL initciolib(int mode)
try_ansi_init
(
mode
);
break
;
#ifdef
WITH_SDL
#if
def
ined(WITH_SDL) || defined(
WITH_SDL
_AUDIO)
case
CIOLIB_MODE_SDL
:
case
CIOLIB_MODE_SDL_FULLSCREEN
:
try_sdl_init
(
mode
);
...
...
src/conio/ciolib.h
View file @
9ee9b19c
...
...
@@ -361,4 +361,13 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_loadfont(char *filename);
#define loadfont(a) ciolib_loadfont(a)
#endif
#ifdef WITH_SDL
#include <SDL.h>
#ifdef main
#undef main
#endif
#define main CIOLIB_main
#endif
#endif
/* Do not add anything after this line */
src/conio/sdlfuncs.c
View file @
9ee9b19c
...
...
@@ -28,7 +28,7 @@ static int main_returned=0;
static
SDL_sem
*
sdl_main_sem
;
SDL_sem
*
sdl_exit_sem
;
int
XPDEV
_main
(
int
argc
,
char
**
argv
,
char
**
enviro
);
int
CIOLIB
_main
(
int
argc
,
char
**
argv
,
char
**
enviro
);
#ifdef STATIC_SDL
int
load_sdl_funcs
(
struct
sdlfuncs
*
sdlf
)
...
...
@@ -479,7 +479,7 @@ static int sdl_run_main(void *data)
int
ret
;
args
=
data
;
ret
=
XPDEV
_main
(
args
->
argc
,
args
->
argv
,
args
->
enviro
);
ret
=
CIOLIB
_main
(
args
->
argc
,
args
->
argv
,
args
->
enviro
);
main_returned
=
1
;
sdl
.
SemPost
(
sdl_main_sem
);
if
(
sdl_exit_drawing_thread
!=
NULL
)
...
...
@@ -589,6 +589,6 @@ int SDL_main_env(int argc, char **argv, char **env)
sdl
.
WaitThread
(
main_thread
,
&
main_ret
);
}
else
main_ret
=
XPDEV
_main
(
argc
,
argv
,
env
);
main_ret
=
CIOLIB
_main
(
argc
,
argv
,
env
);
return
(
main_ret
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment