Skip to content

Commit

Permalink
Add SDL files as submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Jun 4, 2024
1 parent cd9fb09 commit a580905
Show file tree
Hide file tree
Showing 16 changed files with 2,502 additions and 13 deletions.
11 changes: 11 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,14 @@
[submodule "project/toolkit/freetype/freetype"]
path = project/toolkit/freetype/freetype
url = https://github.com/freetype/freetype.git
[submodule "project/toolkit/sdl/SDL"]
path = project/toolkit/sdl/SDL
url = https://github.com/libsdl-org/SDL.git
branch = SDL2
[submodule "project/toolkit/sdl-mixer/SDL_mixer"]
path = project/toolkit/sdl-mixer/SDL_mixer
url = https://github.com/libsdl-org/SDL_mixer.git
branch = SDL2
[submodule "project/toolkit/modplug/libmodplug"]
path = project/toolkit/modplug/libmodplug
url = https://github.com/Konstanty/libmodplug.git
38 changes: 25 additions & 13 deletions project/ToolkitBuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
<set name="NME_SIMD_D" value="-DNME_SIMD_X86_64" />
<set name="NME_SIMD_X86_64" value="1" />
</section>


<!-- Where to find static libraries/includes -->
<set name="NATIVE_TOOLKIT_PATH" value="${haxelib:nme-toolkit}" unless="NATIVE_TOOLKIT_PATH" />
<section if="HXCPP_M32 windows" unless="NME_SIMD_D">
<set name="NME_SIMD_D" value="-DNME_SIMD_X86" />
<set name="NME_SIMD_X86" value="1" />
</section>


<!--
Expand Down Expand Up @@ -140,8 +140,15 @@
<include name="toolkit/ogg/files.xml" />
<include name="toolkit/vorbis/files.xml" />
<include name="toolkit/freetype/files.xml" />
<include name="toolkit/sdl/files.xml" />
<include name="toolkit/modplug/files.xml" if="modplug" />
<include name="toolkit/sdl-mixer/files.xml" if="NME_MIXER" />
</section>


<!-- Where to find static libraries/includes -->
<set name="NATIVE_TOOLKIT_PATH" value="${haxelib:nme-toolkit}" unless="NATIVE_TOOLKIT_PATH" />

<section unless="NME_LOCAL_TOOLKIT">
<set name="NME_ZLIB" value="${NATIVE_TOOLKIT_PATH}/zlib/" />
<include name="${NME_ZLIB}/files.xml" />
Expand All @@ -155,13 +162,17 @@
<include name="${NME_VORBIS}/files.xml" />
<set name="NME_FREETYPE" value="${NATIVE_TOOLKIT_PATH}/freetype/" />
<include name="${NME_FREETYPE}files.xml" />
<set name="NME_LIBSDL" value="${NATIVE_TOOLKIT_PATH}/sdl/" />
<include name="${NME_LIBSDL}files.xml" />
<set name="NME_MODPLUG" value="${NATIVE_TOOLKIT_PATH}/modplug/" />
<include name="${NME_MODPLUG}/files.xml" if="modplug" />
<set name="NME_LIBSDL_MIXER" value="${NATIVE_TOOLKIT_PATH}/sdl-mixer/" />
<include name="${NME_LIBSDL_MIXER}files.xml" if="NME_MIXER" />
</section>


<include name="${NATIVE_TOOLKIT_PATH}/curl/files.xml" />
<include name="${NATIVE_TOOLKIT_PATH}/sdl/files.xml" />
<include name="${NATIVE_TOOLKIT_PATH}/modplug/files.xml" if="modplug" />
<include name="${NATIVE_TOOLKIT_PATH}/sdl-mixer/files.xml" if="NME_MIXER" />

<include name="${NATIVE_TOOLKIT_PATH}/curl/files.xml" if="NME_CURL" />

<include name="${NATIVE_TOOLKIT_PATH}/angle/files.xml" if="NME_ANGLE" unless="ANGLE_DIR" />
<include name="${ANGLE_DIR}/files.xml" if="NME_ANGLE ANGLE_DIR" />
Expand Down Expand Up @@ -352,7 +363,7 @@
<compilerflag value="-I${NME_FREETYPE}freetype/include/freetype"/>
<compilerflag value="-I${NME_FREETYPE}include/freetype"/>

<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/modplug" if="modplug" />
<compilerflag value="-I${NME_MODPLUG}" if="modplug" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/curl/include" if="NME_CURL" />

<depend files="native-toolkit-freetype-depends" />
Expand All @@ -376,9 +387,10 @@
<file name="${SRC_DIR}/audio/SDLSound.cpp" if="NME_MIXER"/>
<file name="${SRC_DIR}/sdl2/SDL2Stage.cpp"/>
<section unless="NME_NATIVE_SDL_SYSTEM" >
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl-mixer" if="NME_MIXER" />
<compilerflag value="-I${SDL_CONFIG_PATH}" if="SDL_CONFIG_PATH" />
<compilerflag value="-I${NME_LIBSDL}include" />
<compilerflag value="-I${NME_LIBSDL_MIXER}" if="NME_MIXER" />
<compilerflag value="-I${NME_LIBSDL_MIXER}/include" if="NME_MIXER" />
</section>
<section if="gcw0" >
<compilerflag value="-I${GCW0_SDK}/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/SDL2" />
Expand Down Expand Up @@ -708,7 +720,7 @@
<depend name="${HXCPP}/include/hx/HxcppMain.h"/>
<file name="${this_dir}/src/winrt/Main.cpp" />
<compilerflag value="-Iinclude" />
<compilerflag value="-I${NATIVE_TOOLKIT_PATH}/sdl/include" />
<compilerflag value="-I${NME_LIBSDL}include" />
<compilerflag value="-I${SDL_CONFIG_PATH}" if="SDL_CONFIG_PATH" />
<cache value="1" />
</files>
Expand Down Expand Up @@ -757,7 +769,7 @@
<section if="NME_METAL">
<compilerflag value="-DSDL_VIDEO_METAL=1" />
<compilerflag value="-DSDL_VIDEO_RENDER_METAL=1" />
<file name="${NATIVE_TOOLKIT_PATH}/sdl/src/render/metal/SDL_render_metal.m" />
<file name="${NME_LIBSDL}/src/render/metal/SDL_render_metal.m" />
</section>

<section if="NME_MIXER linux" >
Expand Down
1 change: 1 addition & 0 deletions project/src/audio/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <vorbis/vorbisfile.h>

#ifdef NME_MODPLUG
#define MODPLUG_STATIC
#include <modplug.h>
#endif

Expand Down
140 changes: 140 additions & 0 deletions project/toolkit/modplug/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/* src/config.h. Generated from config.h.in by configure. */
/* src/config.h.in. Generated from configure.in by autoheader. */

/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */

/* Define to 1 if you have the <dlfcn.h> header file. */
#ifndef HX_WINDOWS
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
#endif

/* Define to 1 if you have the <malloc.h> header file. */
#ifdef HX_LINUX
#define HAVE_MALLOC_H 1
#endif

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `setenv' function. */
#ifndef HX_WINDOWS
#define HAVE_SETENV 1
#endif

/* Define to 1 if you have the `sinf' function. */
#define HAVE_SINF 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"

/* Name of package */
#define PACKAGE "libmodplug"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME ""

/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION ""

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "0.8.8.4"

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif

/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */

/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT64_T */

/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT8_T */

/* Define to the type of a signed integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
/* #undef int16_t */

/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef int32_t */

/* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
/* #undef int64_t */

/* Define to the type of a signed integer type of width exactly 8 bits if such
a type exists and the standard includes do not define it. */
/* #undef int8_t */

/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint16_t */

/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint32_t */

/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint64_t */

/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint8_t */
68 changes: 68 additions & 0 deletions project/toolkit/modplug/files.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<xml>

<set name="NME_MODPLUG" value="${this_dir}/libmodplug/src/" />

<include name="${HXCPP}/build-tool/BuildCommon.xml" unless="build_common_included" />


<files id="native-toolkit-modplug-depends" >
<depend name="${NME_MODPLUG}modplug.h"/>
<depend name="${NME_MODPLUG}/../../config.h"/>
</files>

<files id="native-toolkit-modplug" tags="" >
<cache value="1" />
<tag value="${NATIVE_TOOLKIT_OPTIM_TAG}" if="NATIVE_TOOLKIT_OPTIM_TAG" />
<depend files="native-toolkit-modplug-depends" />

<depend name="${NME_MODPLUG}libmodplug/sndfile.h"/>
<depend name="${NME_MODPLUG}libmodplug/stdafx.h"/>
<depend name="${NME_MODPLUG}libmodplug/it_defs.h"/>
<depend name="${NME_MODPLUG}tables.h"/>
<depend name="${NME_MODPLUG}load_pat.h"/>

<compilerflag value="-I${NME_MODPLUG}libmodplug" />
<compilerflag value="-I${NME_MODPLUG}" />
<compilerflag value="-I${NME_MODPLUG}/../.." />
<compilerflag value="-DMODPLUG_STATIC" />
<compilerflag value="-DHAVE_CONFIG_H" />

<cache value="1" />

<file name="${NME_MODPLUG}modplug.cpp" />
<file name="${NME_MODPLUG}sndmix.cpp" />
<file name="${NME_MODPLUG}load_med.cpp" />
<file name="${NME_MODPLUG}load_mdl.cpp" />
<file name="${NME_MODPLUG}load_dmf.cpp" />
<file name="${NME_MODPLUG}load_it.cpp" />
<file name="${NME_MODPLUG}load_ams.cpp" />
<file name="${NME_MODPLUG}load_abc.cpp" />
<file name="${NME_MODPLUG}load_s3m.cpp" />
<file name="${NME_MODPLUG}sndfile.cpp" />
<file name="${NME_MODPLUG}load_669.cpp" />
<file name="${NME_MODPLUG}load_dsm.cpp" />
<file name="${NME_MODPLUG}load_okt.cpp" />
<file name="${NME_MODPLUG}load_mtm.cpp" />
<file name="${NME_MODPLUG}load_far.cpp" />
<file name="${NME_MODPLUG}load_amf.cpp" />
<file name="${NME_MODPLUG}load_mt2.cpp" />
<file name="${NME_MODPLUG}load_umx.cpp" />
<file name="${NME_MODPLUG}mmcmp.cpp" />
<file name="${NME_MODPLUG}snd_fx.cpp" />
<file name="${NME_MODPLUG}load_stm.cpp" />
<file name="${NME_MODPLUG}load_mid.cpp" />
<file name="${NME_MODPLUG}fastmix.cpp" />
<file name="${NME_MODPLUG}load_dbm.cpp" />
<file name="${NME_MODPLUG}load_ptm.cpp" />
<file name="${NME_MODPLUG}load_xm.cpp" />
<file name="${NME_MODPLUG}load_wav.cpp" />
<file name="${NME_MODPLUG}load_ult.cpp" />
<file name="${NME_MODPLUG}load_pat.cpp" />
<file name="${NME_MODPLUG}load_psm.cpp" />
<file name="${NME_MODPLUG}snd_flt.cpp" />
<file name="${NME_MODPLUG}load_mod.cpp" />
<file name="${NME_MODPLUG}snd_dsp.cpp" />
</files>

</xml>

1 change: 1 addition & 0 deletions project/toolkit/modplug/libmodplug
Submodule libmodplug added at d1b97e
1 change: 1 addition & 0 deletions project/toolkit/sdl-mixer/SDL_mixer
Submodule SDL_mixer added at 59caf9
Loading

0 comments on commit a580905

Please sign in to comment.