Fixed windows SDL2 build, finished removing fmod dependency
This commit is contained in:
@@ -76,6 +76,10 @@ set(JGE_ios_src
|
||||
src/iOS/EAGLViewController.m
|
||||
src/iOS/JSfx.cpp)
|
||||
|
||||
set(JGE_windows_src
|
||||
src/JNetwork.cpp
|
||||
src/pc/JSocket.cpp
|
||||
src/windows/JSfx.cpp)
|
||||
|
||||
set(JGE_INCLUDE_DIRS include include/hge)
|
||||
set(EXTRA_INCLUDE_DIR ../projects/mtg/extra)
|
||||
@@ -128,7 +132,7 @@ if(backend_sdl)
|
||||
elseif(WIN32)
|
||||
set(JGE_INTERNAL_INCLUDE_DIRS ${EXTRA_INCLUDE_DIR} ${TINYXML_INCLUDE_DIR} ${ZIPFS_INCLUDE_DIR} ${SDL2_INCLUDE_DIR}
|
||||
${UNZIP_INCLUDE_DIR} ${PNG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/thirdparty/binary/win/include)
|
||||
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_linux_src} ${JGE_hge_src})
|
||||
set(JGE_SOURCES ${JGE_generic_src} ${JGE_graphics_src} ${JGE_windows_src} ${JGE_hge_src})
|
||||
set(JGE_LINK_LIBRARIES ${ZIPFS_LIBRARY} ${UNZIP_LIRARY} ${JPEG_LIBRARY} ${PNG_LIBRARIES})
|
||||
set(JGE_LINK_DIRECTORIES ${Boost_LIBRARY_DIR})
|
||||
endif()
|
||||
|
||||
@@ -18,20 +18,20 @@
|
||||
|
||||
#include "JTypes.h"
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <SLES/OpenSLES.h>
|
||||
#include "SLES/OpenSLES_Android.h"
|
||||
|
||||
#elif defined USE_PHONON
|
||||
#elif defined(USE_PHONON)
|
||||
#include <phonon/AudioOutput>
|
||||
#include <phonon/MediaObject>
|
||||
#elif (defined QT_CONFIG)
|
||||
#elif defined (QT_CONFIG)
|
||||
#include "QMediaPlayer"
|
||||
#include "QMediaPlaylist"
|
||||
#include "QSoundEffect"
|
||||
#elif defined WIN32
|
||||
#elif defined(WIN32)
|
||||
#include <windows.h>
|
||||
#define WITH_FMOD
|
||||
//#define WITH_FMOD
|
||||
#elif defined (PSP)
|
||||
#include <pspgu.h>
|
||||
#include <pspkernel.h>
|
||||
@@ -90,9 +90,11 @@ public slots:
|
||||
QMediaPlaylist* playlist;
|
||||
QMediaPlayer* player;
|
||||
string fullpath;
|
||||
#else
|
||||
#elif (defined WIN32)
|
||||
std::string filename;
|
||||
#endif
|
||||
void* mTrack;
|
||||
#endif //WITH_FMOD
|
||||
//#endif //WITH_FMOD
|
||||
|
||||
};
|
||||
|
||||
@@ -107,29 +109,23 @@ public:
|
||||
unsigned long fileSize();
|
||||
#if (defined QT_CONFIG) && (!defined USE_PHONON)
|
||||
QMediaPlayer* effect;
|
||||
void* mSample;
|
||||
#elif defined (PSP)
|
||||
WAVDATA *mSample;
|
||||
#elif defined (IOS)
|
||||
std::string filename;
|
||||
std::string key;
|
||||
std::string ext;
|
||||
|
||||
void* mSample;
|
||||
#elif defined (WITH_FMOD)
|
||||
FSOUND_SAMPLE *mSample;
|
||||
#elif defined (USE_PHONON)
|
||||
Phonon::AudioOutput* mOutput;
|
||||
Phonon::MediaObject* mMediaObject;
|
||||
void* mSample;
|
||||
#elif defined ANDROID
|
||||
SLObjectItf playerObject;
|
||||
SLPlayItf playInterface;
|
||||
SLVolumeItf sampleVolumeInterface;
|
||||
void* mSample;
|
||||
#else
|
||||
void* mSample;
|
||||
#elif (defined WIN32)
|
||||
std::string filename;
|
||||
#endif
|
||||
void* mSample;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ artifacts:
|
||||
# scripts to run before deployment
|
||||
before_deploy:
|
||||
- cd projects/mtg/bin
|
||||
- "C:/Python27/python.exe createWindowsZip.py"
|
||||
- "C:/Python27/python.exe createWindowsZip.py -b ../../../build"
|
||||
- cd ../../..
|
||||
|
||||
# scripts to run after deployment
|
||||
|
||||
@@ -4,15 +4,14 @@ import zipfile
|
||||
from pyjavaproperties import Properties
|
||||
from optparse import OptionParser
|
||||
|
||||
def createWindowsZipFile(filename):
|
||||
def createWindowsZipFile(filename, buildpath):
|
||||
utilities = ZipUtilities()
|
||||
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
|
||||
zip_file.write('../../../LICENSE')
|
||||
zip_file.write('libpng13.dll')
|
||||
zip_file.write('SDL.dll')
|
||||
zip_file.write('fmod.dll')
|
||||
zip_file.write('zlib1.dll')
|
||||
zip_file.write('Wagic.exe')
|
||||
zip_file.write(buildpath + 'lib/Release/SDL2.dll')
|
||||
zip_file.write(buildpath + 'lib/Release/zlib.dll')
|
||||
zip_file.write(buildpath + 'bin/Release/Wagic.exe')
|
||||
zip_file.write('Res/' + getFilename('core') + '.zip')
|
||||
zip_file.close()
|
||||
|
||||
@@ -25,7 +24,7 @@ def getFilename(filename):
|
||||
filename = filename + '-' + major + minor + point
|
||||
return filename
|
||||
|
||||
def createStandardResFile():
|
||||
def createStandardResFile(buildpath):
|
||||
print "Creating Resource File"
|
||||
cmd = 'python createResourceZip.py -n ' + getFilename('core') + '.zip'
|
||||
os.chdir("Res")
|
||||
@@ -33,7 +32,7 @@ def createStandardResFile():
|
||||
os.chdir("..")
|
||||
print "Creating Windows Package File"
|
||||
filename = 'Wagic-windows.zip'
|
||||
createWindowsZipFile( filename )
|
||||
createWindowsZipFile( filename, buildpath )
|
||||
print >> sys.stderr, 'Created Windows Package: {0}'.format( filename)
|
||||
|
||||
class ZipUtilities:
|
||||
@@ -63,11 +62,11 @@ def main():
|
||||
## using optparse instead of argParse for now since python 2.7 may not be installed.
|
||||
|
||||
parser = OptionParser()
|
||||
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
|
||||
parser.add_option("-b", "--build", help="BUILD: specify the build directory", metavar="BUILD", dest="build")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
createStandardResFile()
|
||||
createStandardResFile(options.build)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#define SDL_MAIN_HANDLED
|
||||
#include <SDL.h>
|
||||
#if (defined ANDROID)
|
||||
#include <SDL_opengles.h>
|
||||
@@ -762,7 +763,7 @@ bool SdlApp::OnInit()
|
||||
return true;
|
||||
};
|
||||
|
||||
#if (defined ANDROID) || (defined WIN32)
|
||||
#if (defined ANDROID)
|
||||
int SDL_main(int argc, char * argv[])
|
||||
#else
|
||||
int main(int argc, char* argv[])
|
||||
|
||||
Reference in New Issue
Block a user