From 66b7d8b38b4f3331e701e59d49b5a5a308c2127b Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Sun, 27 Oct 2019 19:25:57 -0500 Subject: [PATCH] Adding JoeyLib logo to repo. --- .gitignore | 5 +++++ assets/JoeyLib Logo.xcf | 3 +++ joeylib/joeylib.pro | 7 ++++++- joeylib/src/jSDL12.c | 44 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 assets/JoeyLib Logo.xcf diff --git a/.gitignore b/.gitignore index d195269..8b2958e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,8 @@ joeylib/src/music joeylib/src/music.w joeylib/src/*.dis joeylib/src/*.map +build-*/ +notes.txt +assets/JoeyLib Logo - 320x200.png +assets/JoeyLib Logo.jpg +assets/JoeyLib Logo.png diff --git a/assets/JoeyLib Logo.xcf b/assets/JoeyLib Logo.xcf new file mode 100644 index 0000000..4f59288 --- /dev/null +++ b/assets/JoeyLib Logo.xcf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c65971e58bbabe61c80147525c0aca3218afc3798fa881fae830c2b8be769979 +size 939165 diff --git a/joeylib/joeylib.pro b/joeylib/joeylib.pro index 46b884e..947a018 100644 --- a/joeylib/joeylib.pro +++ b/joeylib/joeylib.pro @@ -22,19 +22,24 @@ SOURCES += \ src/test.c SDL12 { + INCLUDEPATH += $$JOEY/sdks/linux/x64/include + SOURCES += src/jSDL12.c LIBS += \ -L$$JOEY/sdks/linux/x64/lib \ - -lSDL \ + -Wl,-rpath,$$JOEY/sdks/linux/x64/lib \ -lSDL_mixer \ -lmikmod \ + -lSDL \ -lm \ -ldl \ -lsndio } SDL2 { + INCLUDEPATH += $$JOEY/sdks/linux/x64/include + SOURCES += src/jSDL2.c LIBS += \ diff --git a/joeylib/src/jSDL12.c b/joeylib/src/jSDL12.c index 660c454..5c32e2d 100644 --- a/joeylib/src/jSDL12.c +++ b/joeylib/src/jSDL12.c @@ -20,9 +20,15 @@ */ +#include "SDL/SDL.h" +#include "SDL/SDL_mixer.h" + #include "joey.h" +static SDL_Surface *_jlScreen = NULL; + + void jlDisplayPresent(void) { } @@ -42,6 +48,7 @@ void jlDrawBlit8x8a(jlSurfaceT source, jint16 cx1, jint16 cy1, jint16 cx2, jint1 (void)cy1; (void)cx2; (void)cy2; + (void)offset; } @@ -201,12 +208,49 @@ void jlUtilNibbleSwap(byte *mem, jint16 count, byte old, byte new) { void jlUtilShutdown(void) { + SDL_FreeSurface(_jlScreen); + jlSoundMusicStop(); + Mix_CloseAudio(); + Mix_Quit(); + SDL_Quit(); jlUtilDie("Clean Exit."); } void jlUtilStartup(char *appTitle) { + + Uint32 vflags; + int mflags; + int result; + (void)appTitle; + + // Start low-level tools + if (SDL_Init(SDL_INIT_EVERYTHING) == -1) { + jlUtilDie(SDL_GetError()); + } + + // Start audio mixer & music system. + mflags = MIX_INIT_MOD; + result = Mix_Init(mflags); + if ((result & mflags) != mflags) { + jlUtilDie(Mix_GetError()); + } + if (Mix_OpenAudio(11025, AUDIO_U8, 1, 1024) == -1) { + jlUtilDie(Mix_GetError()); + } + + // Set up video + vflags = SDL_HWSURFACE; +#ifdef JOEY_LINUX + SDL_WM_SetCaption(appTitle, NULL); +#else + vflags |= SDL_FULLSCREEN; +#endif + _jlScreen = SDL_SetVideoMode(320, 200, 16, vflags); + if (!_jlScreen) { + jlUtilDie(SDL_GetError()); + } }