SDL2 Initializes

This commit is contained in:
Steam Deck User 2023-03-13 13:37:00 -04:00
parent bee7aefe49
commit c2ee802677
3 changed files with 25 additions and 12 deletions

View file

@ -109,16 +109,14 @@ HARDWARE_VIDEO_ONLY_FLAGS = -DPSP_HARDWARE_VIDEO
OBJS = $(COMMON_OBJS) $(HARDWARE_VIDEO_ONLY_OBJS)
#LIBS = -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lpsppower -lpspwlan -lstdc++ -lm
SDL_LIBS = -lSDL2_mixer -lSDL2 -lvorbisfile -lvorbis -logg -lGL -lGLU -lglut
GU_LIBS = -lpspgum_vfpu -lpspvfpu -lpspgu -lpspvram
AUDIO_LIBS = -lpspaudiolib -lpspaudio -lpspmp3 -lSDL2_mixer -lSDL2 source/psp/m33libs/libpspaudiocodec.a source/psp/m33libs/libpspkubridge.a
AUDIO_LIBS = -lpspaudiolib -lpspaudio -lpspmp3 source/psp/m33libs/libpspaudiocodec.a source/psp/m33libs/libpspkubridge.a
MISC_LIBS = -lpsprtc -lpspmath -lpsppower -lpsphprm -ljpeg -lpng source/psp/m33libs/libz.a
MISC_LIBS = -lpsprtc -lpsppower -lpspmath -lpsphprm -ljpeg -lpng source/psp/m33libs/libz.a
NET_LIBS = -lpspwlan -lpspnet_adhoc -lpspnet_adhocctl
STD_LIBS = -lstdc++ -lm -lc
LIBS = $(GPROF_LIBS) $(GU_LIBS) $(AUDIO_LIBS) $(MISC_LIBS) $(STD_LIBS) $(NET_LIBS)
LIBS = $(GPROF_LIBS) $(SDL_LIBS) $(GU_LIBS) $(AUDIO_LIBS) $(MISC_LIBS) $(STD_LIBS) $(NET_LIBS)
CFLAGS = -ffast-math -O3 -G0 -Wall $(GPROF_FLAGS) -Did386="0" -DPSP $(MODE) $(HARDWARE_VIDEO_ONLY_FLAGS) -DSWIZZLE32 -DPSP_MP3_HWDECODE -DFULLBRIGHT -DHL_RENDER -Wno-strict-aliasing -DPSP_VFPU
CXXFLAGS = -fno-rtti -Wcast-qual -Wno-write-strings -Wno-sign-compare -Wno-strict-aliasing

View file

@ -110,16 +110,14 @@ HARDWARE_VIDEO_ONLY_FLAGS = -DPSP_HARDWARE_VIDEO
OBJS = $(COMMON_OBJS) $(HARDWARE_VIDEO_ONLY_OBJS)
#LIBS = -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lpsppower -lpspwlan -lstdc++ -lm
SDL_LIBS = -lSDL2_mixer -lSDL2 -lvorbisfile -lvorbis -logg -lGL -lGLU -lglut
GU_LIBS = -lpspgum_vfpu -lpspvfpu -lpspgu -lpspvram
AUDIO_LIBS = -lpspaudiolib -lpspaudio -lpspmp3 -lSDL2_mixer -lSDL2 source/psp/m33libs/libpspaudiocodec.a source/psp/m33libs/libpspkubridge.a
AUDIO_LIBS = -lpspaudiolib -lpspaudio -lpspmp3 source/psp/m33libs/libpspaudiocodec.a source/psp/m33libs/libpspkubridge.a
MISC_LIBS = -lpsprtc -lpsppower -lpspmath -lpsphprm -ljpeg -lpng source/psp/m33libs/libz.a
NET_LIBS = -lpspwlan -lpspnet_adhoc -lpspnet_adhocctl
STD_LIBS = -lstdc++ -lm -lc
LIBS = $(GPROF_LIBS) $(GU_LIBS) $(AUDIO_LIBS) $(MISC_LIBS) $(STD_LIBS) $(NET_LIBS)
LIBS = $(GPROF_LIBS) $(SDL_LIBS) $(GU_LIBS) $(AUDIO_LIBS) $(MISC_LIBS) $(STD_LIBS) $(NET_LIBS)
CFLAGS = -ffast-math -O3 -G0 -Wall $(GPROF_FLAGS) -Did386="0" -DPSP $(MODE) $(HARDWARE_VIDEO_ONLY_FLAGS) -DSWIZZLE32 -DSLIM -DPSP_MP3_HWDECODE -DFULLBRIGHT -DHL_RENDER -Wno-strict-aliasing -DPSP_VFPU
CXXFLAGS = -fno-rtti -Wcast-qual -Wno-write-strings -Wno-sign-compare -Wno-strict-aliasing

View file

@ -36,6 +36,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <pspge.h>
#include <pspsysevent.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
extern "C"
{
#include "../quakedef.h"
@ -528,9 +531,23 @@ int user_main(SceSize argc, void* argp)
// operations.
disableFloatingPointExceptions();
// Initialise the Common module.
// Initialize the Common module.
InitExtModules ();
// Initialize SDL
if (SDL_Init(SDL_INIT_AUDIO) < 0)
{
Sys_Error("SDL2: Could not initialize!\n");
return 0;
}
// Initialize SDL2_mixer
if (Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096) == -1)
{
Sys_Error("SDL2_mixer: Could not initialize!\n");
return 0;
}
// Get the current working dir.
char currentDirectory[1024];
char gameDirectory[1024];