From ee5d47e1c5c61a37003f2d4fa8bb3f94ed886e97 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Tue, 3 Dec 2019 13:09:40 -0500 Subject: [PATCH] move SDL sources to their own folder --- CMakeLists.txt | 14 +++++++++----- source/{ => sdl}/cd_sdl.c | 0 source/sdl/endian_sdl.h | 36 ++++++++++++++++++++++++++++++++++++ source/{ => sdl}/gl_vidsdl.c | 0 source/{ => sdl}/in_sdl.c | 0 source/{ => sdl}/main_sdl.c | 0 source/{ => sdl}/snd_sdl.c | 0 7 files changed, 45 insertions(+), 5 deletions(-) rename source/{ => sdl}/cd_sdl.c (100%) create mode 100644 source/sdl/endian_sdl.h rename source/{ => sdl}/gl_vidsdl.c (100%) rename source/{ => sdl}/in_sdl.c (100%) rename source/{ => sdl}/main_sdl.c (100%) rename source/{ => sdl}/snd_sdl.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 126614f..5a39687 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ set(srcs source/bgmusic.c source/bgmusic.h source/bspfile.h - source/cd_sdl.c source/cdaudio.h source/cfgfile.c source/cfgfile.h @@ -63,7 +62,6 @@ set(srcs source/gl_sky.c source/gl_texmgr.c source/gl_texmgr.h - source/gl_vidsdl.c source/gl_warp.c source/gl_warp_sin.h source/glquake.h @@ -71,12 +69,10 @@ set(srcs source/host_cmd.c source/image.c source/image.h - source/in_sdl.c source/input.h source/keys.c source/keys.h source/lodepng.h - source/main_sdl.c source/mathlib.c source/mathlib.h source/menu.c @@ -129,7 +125,6 @@ set(srcs source/snd_mpg123.c source/snd_opus.c source/snd_opus.h - source/snd_sdl.c source/snd_umx.c source/snd_umx.h source/snd_vorbis.c @@ -178,6 +173,15 @@ set(srcs_windows source/windows/sys_sdl_win.c source/windows/wsaerror.h) +set(srcs_sdl + source/sdl/cd_sdl.c + source/sdl/gl_vidsdl.c + source/sdl/in_sdl.c + source/sdl/main_sdl.c + source/sdl/snd_sdl.c) + +list(APPEND srcs ${srcs_sdl}) + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") list(APPEND srcs ${srcs_windows}) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") diff --git a/source/cd_sdl.c b/source/sdl/cd_sdl.c similarity index 100% rename from source/cd_sdl.c rename to source/sdl/cd_sdl.c diff --git a/source/sdl/endian_sdl.h b/source/sdl/endian_sdl.h new file mode 100644 index 0000000..b449a26 --- /dev/null +++ b/source/sdl/endian_sdl.h @@ -0,0 +1,36 @@ +/* +Copyright (C) 2019 Alison G. Watson + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifndef spingle__endian_sdl_h +#define spingle__endian_sdl_h + +#include + +#define HOST_BIGENDIAN (SDL_BYTEORDER == SDL_BIG_ENDIAN) + +#define BigShort SDL_SwapBE16 +#define BigLong SDL_SwapBE32 +#define BigFloat SDL_SwapFloatBE + +#define LittleShort SDL_SwapLE16 +#define LittleLong SDL_SwapLE32 +#define LittleFloat SDL_SwapFloatLE + +#endif diff --git a/source/gl_vidsdl.c b/source/sdl/gl_vidsdl.c similarity index 100% rename from source/gl_vidsdl.c rename to source/sdl/gl_vidsdl.c diff --git a/source/in_sdl.c b/source/sdl/in_sdl.c similarity index 100% rename from source/in_sdl.c rename to source/sdl/in_sdl.c diff --git a/source/main_sdl.c b/source/sdl/main_sdl.c similarity index 100% rename from source/main_sdl.c rename to source/sdl/main_sdl.c diff --git a/source/snd_sdl.c b/source/sdl/snd_sdl.c similarity index 100% rename from source/snd_sdl.c rename to source/sdl/snd_sdl.c