More removal of SDL

This commit is contained in:
Simon 2020-03-06 18:35:34 +00:00
parent 5f41c55468
commit 092bf5ce29
10 changed files with 5 additions and 339 deletions

View file

@ -1,13 +1,7 @@
include $(GL4ES_PATH)/Android.mk
include $(SUPPORT_LIBS)/SDL2/SDL2/Android.mk
include $(SUPPORT_LIBS)/SDL2/SDL2_mixer/Android.mk
include $(SUPPORT_LIBS)/SDL2/SDL2_net/Android.mk
include $(SUPPORT_LIBS)/jpeg8d/Android.mk
include $(SUPPORT_LIBS)/libzip/Android.mk
include $(SUPPORT_LIBS)/libpng/Android.mk
include $(SUPPORT_LIBS)/sigc++/Android.mk
include $(SUPPORT_LIBS)/fluidsynth-lite/src/Android.mk
include $(SUPPORT_LIBS)/openal/Android.mk
include $(SUPPORT_LIBS)/libmpg123/Android.mk

View file

@ -12,14 +12,13 @@ APPLICATIONMK_PATH = $(call my-dir)
TOP_DIR := $(APPLICATIONMK_PATH)
SUPPORT_LIBS := $(APPLICATIONMK_PATH)/SupportLibs
GL4ES_PATH := $(SUPPORT_LIBS)/gl4es
GZDOOM_TOP_PATH := $(APPLICATIONMK_PATH)/gzdoom-g3.3mgw_mobile
APP_ALLOW_MISSING_DEPS=true
APP_SHORT_COMMANDS :=true
APP_MODULES := gl4es qzdoom
APP_MODULES := qzdoom
APP_STL := c++_shared

View file

@ -37,12 +37,6 @@ Copyright : Copyright 2015 Oculus VR, LLC. All Rights reserved.
#include "VrApi_SystemUtils.h"
#include "VrApi_Input.h"
#include "VrApi_Types.h"
//#include <src/gl/loader.h>
//#include <SDL2/SDL.h>
//#include <SDL2/SDL_main.h>
#include "VrCompositor.h"
#include "VrInput.h"

View file

@ -624,7 +624,6 @@ LOCAL_SRC_FILES = \
p_acs.cpp_CFLAGS := -O1
LOCAL_LDLIBS := -ldl -llog -lOpenSLES -landroid
#LOCAL_LDLIBS +=-lGLESv1_CM
LOCAL_LDLIBS += -lGLESv3
LOCAL_LDLIBS += -lEGL

View file

@ -3,7 +3,7 @@
#include "hardware.h"
#include "v_video.h"
#include <SDL.h>
#include "gl/system/gl_system.h"
EXTERN_CVAR (Float, dimamount)
@ -18,7 +18,7 @@ class NoSDLGLVideo : public IVideo
NoSDLGLVideo (int parm);
~NoSDLGLVideo ();
EDisplayType GetDisplayType () { return DISPLAY_Both; }
EDisplayType GetDisplayType () { return DISPLAY_FullscreenOnly; }
void SetWindowedScale (float scale);
DFrameBuffer *CreateFrameBuffer (int width, int height, bool bgra, bool fs, DFrameBuffer *old);
@ -72,8 +72,6 @@ public:
virtual void ScaleCoordsFromWindow(int16_t &x, int16_t &y);
// SDL_Window *GetSDLWindow() override { return Screen; }
virtual int GetTrueHeight() { return GetClientHeight(); }
protected:
void SetGammaTable(uint16_t *tbl);
@ -91,7 +89,6 @@ protected:
void UpdateColors ();
int m_Lock;
Uint16 m_origGamma[3][256];
bool m_supportsGamma;
};
#endif

View file

@ -33,14 +33,14 @@
#include <string.h>
//#include <SDL.h>
#include "bitmap.h"
#include "v_palette.h"
#include "textures.h"
bool I_SetCursor(FTexture *cursorpic)
{
//Do I need to put something else in here?, it does get called...
/* static SDL_Cursor *cursor;
static SDL_Surface *cursorSurface;

View file

@ -1,294 +0,0 @@
/*
** i_main.cpp
** System-specific startup code. Eventually calls D_DoomMain.
**
**---------------------------------------------------------------------------
** Copyright 1998-2007 Randy Heit
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** 3. The name of the author may not be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**---------------------------------------------------------------------------
**
*/
// HEADER FILES ------------------------------------------------------------
//#include <SDL.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <new>
#include <sys/param.h>
#include <locale.h>
#include "doomerrors.h"
#include "m_argv.h"
#include "d_main.h"
#include "i_system.h"
#include "i_video.h"
#include "c_console.h"
#include "errors.h"
#include "version.h"
#include "w_wad.h"
#include "g_level.h"
#include "g_levellocals.h"
#include "r_state.h"
#include "cmdlib.h"
#include "r_utility.h"
#include "doomstat.h"
#include "vm.h"
#include "atterm.h"
// MACROS ------------------------------------------------------------------
// The maximum number of functions that can be registered with atterm.
#define MAX_TERMS 64
// TYPES -------------------------------------------------------------------
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
extern "C" int cc_install_handlers(int, char**, int, int*, const char*, int(*)(char*, char*));
#ifdef __APPLE__
void Mac_I_FatalError(const char* errortext);
#endif
#ifdef __linux__
void Linux_I_FatalError(const char* errortext);
#endif
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
extern volatile int game_running;
// PUBLIC DATA DEFINITIONS -------------------------------------------------
// The command line arguments.
FArgs *Args;
// PRIVATE DATA DEFINITIONS ------------------------------------------------
// CODE --------------------------------------------------------------------
void exit_handler(int dummy) {
game_running = 0;
}
static void NewFailure ()
{
I_FatalError ("Failed to allocate memory from system heap");
}
static int DoomSpecificInfo (char *buffer, char *end)
{
const char *arg;
int size = end-buffer-2;
int i, p;
p = 0;
p += snprintf (buffer+p, size-p, GAMENAME" version %s (%s)\n", GetVersionString(), GetGitHash());
#ifdef __VERSION__
p += snprintf (buffer+p, size-p, "Compiler version: %s\n", __VERSION__);
#endif
p += snprintf (buffer+p, size-p, "\nCommand line:");
for (i = 0; i < Args->NumArgs(); ++i)
{
p += snprintf (buffer+p, size-p, " %s", Args->GetArg(i));
}
p += snprintf (buffer+p, size-p, "\n");
for (i = 0; (arg = Wads.GetWadName (i)) != NULL; ++i)
{
p += snprintf (buffer+p, size-p, "\nWad %d: %s", i, arg);
}
if (gamestate != GS_LEVEL && gamestate != GS_TITLELEVEL)
{
p += snprintf (buffer+p, size-p, "\n\nNot in a level.");
}
else
{
p += snprintf (buffer+p, size-p, "\n\nCurrent map: %s", level.MapName.GetChars());
if (!viewactive)
{
p += snprintf (buffer+p, size-p, "\n\nView not active.");
}
else
{
p += snprintf (buffer+p, size-p, "\n\nviewx = %f", r_viewpoint.Pos.X);
p += snprintf (buffer+p, size-p, "\nviewy = %f", r_viewpoint.Pos.Y);
p += snprintf (buffer+p, size-p, "\nviewz = %f", r_viewpoint.Pos.Z);
p += snprintf (buffer+p, size-p, "\nviewangle = %f", r_viewpoint.Angles.Yaw.Degrees);
}
}
buffer[p++] = '\n';
buffer[p++] = '\0';
return p;
}
void I_StartupJoysticks();
void I_ShutdownJoysticks();
#ifdef __ANDROID__
#include <android/log.h>
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO,"JNITouchControlsUtils", __VA_ARGS__))
int main_android (int argc, char **argv)
{
#else
int main (int argc, char **argv)
{
#endif
#if !defined (__APPLE__) && !defined (__ANDROID__)
{
int s[4] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS };
cc_install_handlers(argc, argv, 4, s, GAMENAMELOWERCASE "-crash.log", DoomSpecificInfo);
}
#endif // !__APPLE__
printf(GAMENAME" %s - %s - SDL version\nCompiled on %s\n",
GetVersionString(), GetGitTime(), __DATE__);
seteuid (getuid ());
std::set_new_handler (NewFailure);
// Set LC_NUMERIC environment variable in case some library decides to
// clear the setlocale call at least this will be correct.
// Note that the LANG environment variable is overridden by LC_*
setenv ("LC_NUMERIC", "C", 1);
setlocale (LC_ALL, "C");
if (SDL_Init (0) < 0)
{
fprintf (stderr, "Could not initialize SDL:\n%s\n", SDL_GetError());
return -1;
}
atterm (SDL_Quit);
printf("\n");
try
{
Args = new FArgs(argc, argv);
/*
killough 1/98:
This fixes some problems with exit handling
during abnormal situations.
The old code called I_Quit() to end program,
while now I_Quit() is installed as an exit
handler and exit() is called to exit, either
normally or abnormally. Seg faults are caught
and the error handler is used, to prevent
being left in graphics mode or having very
loud SFX noise because the sound card is
left in an unstable state.
*/
atexit (call_terms);
atterm (I_Quit);
/*
Register signal handlers to interrupt D_DoomMain and D_DoomLoop, allowing
call_terms() to be invoked at the conclusion of the main thread/quit menu
rather than at exit. The atexit() call can remain to handle edge cases
where a signal cannot be intercepted, such as Alt+F4 or closing the window
via the GUI.
Fixes segmentation fault on exit when using the KMSDRM SDL video driver.
*/
signal(SIGINT, exit_handler);
signal(SIGTERM, exit_handler);
// Should we even be doing anything with progdir on Unix systems?
char program[PATH_MAX];
if (realpath (argv[0], program) == NULL)
strcpy (program, argv[0]);
char *slash = strrchr (program, '/');
if (slash != NULL)
{
*(slash + 1) = '\0';
progdir = program;
}
else
{
progdir = "./";
}
I_StartupJoysticks();
C_InitConsole (80*8, 25*8, false);
D_DoomMain ();
}
catch (std::exception &error)
{
I_ShutdownJoysticks();
const char *const message = error.what();
if (strcmp(message, "NoRunExit"))
{
if (CVMAbortException::stacktrace.IsNotEmpty())
{
Printf("%s", CVMAbortException::stacktrace.GetChars());
}
#ifdef __ANDROID__
LOGI("FATAL ERROR: %s", message);
#endif
if (batchrun)
{
Printf("%s\n", message);
}
else
{
#ifdef __APPLE__
Mac_I_FatalError(message);
#endif // __APPLE__
#ifdef __linux__
Linux_I_FatalError(message);
#endif // __linux__
}
}
exit (-1);
}
catch (...)
{
call_terms ();
throw;
}
call_terms();
return 0;
}

View file

@ -34,8 +34,6 @@
#include <fcntl.h>
#include <signal.h>
//#include <SDL.h>
#include "doomerrors.h"
#include <math.h>

View file

@ -1,19 +0,0 @@
#include <CoreFoundation/CoreFoundation.h>
#include "SDL.h"
void Mac_I_FatalError(const char* errortext)
{
// Close window or exit fullscreen and release mouse capture
SDL_Quit();
const CFStringRef errorString = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault,
errortext, kCFStringEncodingASCII, kCFAllocatorNull );
if ( NULL != errorString )
{
CFOptionFlags dummy;
CFUserNotificationDisplayAlert( 0, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL,
CFSTR( "Fatal Error" ), errorString, CFSTR( "Exit" ), NULL, NULL, &dummy );
CFRelease( errorString );
}
}

View file

@ -47,8 +47,6 @@
#include "version.h"
#include <QzDoom/VrCommon.h>
#include <SDL.h>
// MACROS ------------------------------------------------------------------