Initial iOS implementation.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2015-02-20 00:21:21 -04:00
parent 24c7539182
commit 85de3c41fb
47 changed files with 5206 additions and 2405 deletions
+5
View File
@@ -37,8 +37,13 @@
// OpenAL
#ifdef LOVE_APPLE_USE_FRAMEWORKS // Frameworks have different include paths.
#ifdef LOVE_IOS
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <OpenAL-Soft/alc.h>
#include <OpenAL-Soft/al.h>
#endif
#else
#include <AL/alc.h>
#include <AL/al.h>
+2
View File
@@ -56,7 +56,9 @@ Pool::Pool()
// Create the mutex.
mutex = thread::newMutex();
#ifdef AL_SOFT_direct_channels
ALboolean hasext = alIsExtensionPresent("AL_SOFT_direct_channels");
#endif
// Make all sources available initially.
for (int i = 0; i < totalSources; i++)
+7
View File
@@ -33,9 +33,16 @@
// OpenAL
#ifdef LOVE_APPLE_USE_FRAMEWORKS
#ifdef LOVE_IOS
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#include <OpenAL/oalMacOSX_OALExtensions.h>
#include <OpenAL/oalStaticBufferExtension.h>
#else
#include <OpenAL-Soft/alc.h>
#include <OpenAL-Soft/al.h>
#include <OpenAL-Soft/alext.h>
#endif
#else
#include <AL/alc.h>
#include <AL/al.h>
+5
View File
@@ -30,8 +30,13 @@
// OpenAL
#ifdef LOVE_APPLE_USE_FRAMEWORKS
#ifdef LOVE_IOS
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <OpenAL-Soft/alc.h>
#include <OpenAL-Soft/al.h>
#endif
#else
#include <AL/alc.h>
#include <AL/al.h>
+1 -1
View File
@@ -41,7 +41,7 @@
# define LOVE_PATH_SEPARATOR "/"
# define LOVE_MAX_PATH _MAX_PATH
#else
# ifdef LOVE_MACOSX
# if defined(LOVE_MACOSX) || defined(LOVE_IOS)
# define LOVE_APPDATA_FOLDER "LOVE"
# elif defined(LOVE_LINUX)
# define LOVE_APPDATA_FOLDER "love"
@@ -46,6 +46,10 @@
# include <unistd.h>
#endif
#ifdef LOVE_IOS
# include "common/iOS.h"
#endif
namespace
{
size_t getDriveDelim(const std::string &input)
@@ -422,6 +426,8 @@ std::string Filesystem::getAppdataDirectory()
std::string udir = getUserDirectory();
udir.append("/Library/Application Support");
appdata = normalize(udir);
#elif defined(LOVE_IOS)
appdata = normalize(love::ios::getAppdataDirectory());
#elif defined(LOVE_LINUX)
char *xdgdatahome = getenv("XDG_DATA_HOME");
if (!xdgdatahome)
+2
View File
@@ -230,6 +230,8 @@ int luaopen_love(lua_State * L)
lua_pushstring(L, "Windows");
#elif defined(LOVE_MACOSX)
lua_pushstring(L, "OS X");
#elif defined(LOVE_IOS)
lua_pushstring(L, "iOS");
#elif defined(LOVE_LINUX)
lua_pushstring(L, "Linux");
#else
+5 -1
View File
@@ -17,9 +17,11 @@
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#include "common/config.h"
#include "ModPlugDecoder.h"
#ifndef LOVE_NO_MODPLUG
#include "common/Exception.h"
namespace love
@@ -145,3 +147,5 @@ int ModPlugDecoder::getBitDepth() const
} // lullaby
} // sound
} // love
#endif // LOVE_NO_MODPLUG
@@ -21,6 +21,10 @@
#ifndef LOVE_SOUND_LULLABY_MODPLUG_DECODER_H
#define LOVE_SOUND_LULLABY_MODPLUG_DECODER_H
#include "common/config.h"
#ifndef LOVE_NO_MODPLUG
// LOVE
#include "common/Data.h"
#include "Decoder.h"
@@ -62,4 +66,6 @@ private:
} // sound
} // love
#endif // LOVE_NO_MODPLUG
#endif // LOVE_SOUND_LULLABY_MODPLUG_DECODER_H
+5 -1
View File
@@ -69,8 +69,12 @@ sound::Decoder *Sound::newDecoder(love::filesystem::FileData *data, int bufferSi
sound::Decoder *decoder = 0;
// Find a suitable decoder here, and return it.
if (ModPlugDecoder::accepts(ext))
if (false)
/* nothing */;
#ifndef LOVE_NO_MODPLUG
else if (ModPlugDecoder::accepts(ext))
decoder = new ModPlugDecoder(data, ext, bufferSize);
#endif // LOVE_NO_MODPLUG
#ifndef LOVE_NOMPG123
else if (Mpg123Decoder::accepts(ext))
decoder = new Mpg123Decoder(data, ext, bufferSize);
+8
View File
@@ -24,6 +24,8 @@
#if defined(LOVE_MACOSX)
#include <CoreServices/CoreServices.h>
#elif defined(LOVE_IOS)
#include "common/iOS.h"
#elif defined(LOVE_LINUX)
#include <spawn.h>
//#include <stdlib.h>
@@ -60,6 +62,8 @@ std::string System::getOS() const
{
#if defined(LOVE_MACOSX)
return "OS X";
#elif defined(LOVE_IOS)
return "iOS";
#elif defined(LOVE_WINDOWS)
return "Windows";
#elif defined(LOVE_LINUX)
@@ -91,6 +95,10 @@ bool System::openURL(const std::string &url) const
CFRelease(cfurl);
return success;
#elif defined(LOVE_IOS)
return love::ios::openURL(url);
#elif defined(LOVE_LINUX)
pid_t pid;
+3 -3
View File
@@ -30,7 +30,7 @@
#if defined(LOVE_WINDOWS)
#include <windows.h>
#elif defined(LOVE_MACOSX)
#elif defined(LOVE_MACOSX) || defined(LOVE_IOS)
#include <mach/mach_time.h>
#include <sys/time.h>
#elif defined(LOVE_LINUX)
@@ -134,7 +134,7 @@ double Timer::getAverageDelta() const
double Timer::getTimerPeriod()
{
#if defined(LOVE_MACOSX)
#if defined(LOVE_MACOSX) || defined(LOVE_IOS)
mach_timebase_info_data_t info;
mach_timebase_info(&info);
return (double) info.numer / (double) info.denom / 1000000000.0;
@@ -165,7 +165,7 @@ double Timer::getTime() const
#endif
mt = getTimeOfDay();
return mt;
#elif defined(LOVE_MACOSX)
#elif defined(LOVE_MACOSX) || defined(LOVE_IOS)
return (double) mach_absolute_time() * timerPeriod;
#elif defined(LOVE_WINDOWS)
LARGE_INTEGER microTime;