Initial work on SharedObject, system directory and other minor fixes

This commit is contained in:
Joshua Granick
2013-12-01 01:28:57 -08:00
parent 6b75049e13
commit fd9aeb5937
5 changed files with 28 additions and 83 deletions

View File

@@ -223,6 +223,7 @@
<file name="src/platform/tizen/TizenUIFrame.cpp"/> --> <file name="src/platform/tizen/TizenUIFrame.cpp"/> -->
<file name="src/platform/tizen/TizenStage.cpp"/> <file name="src/platform/tizen/TizenStage.cpp"/>
<file name="src/platform/tizen/TizenFrame.cpp"/> <file name="src/platform/tizen/TizenFrame.cpp"/>
<file name="src/platform/tizen/System.cpp" />
<file name="src/sound/openal/OpenALSound.cpp" if="openal"/> <file name="src/sound/openal/OpenALSound.cpp" if="openal"/>
</files> </files>
@@ -264,6 +265,8 @@
<compilerflag value="-I${NATIVE_DEV}/include/SDL12" if="sdl" unless="dynamic_sdl"/> <compilerflag value="-I${NATIVE_DEV}/include/SDL12" if="sdl" unless="dynamic_sdl"/>
<compilerflag value="-I${NATIVE_DEV}/include/SDL2" if="sdl2" /> <compilerflag value="-I${NATIVE_DEV}/include/SDL2" if="sdl2" />
<compilerflag value="-I${GPH_ROOT}/gcc-4.2.4-glibc-2.7-eabi/arm-gph-linux-gnueabi/sys-root/usr/include" if="gph"/> <compilerflag value="-I${GPH_ROOT}/gcc-4.2.4-glibc-2.7-eabi/arm-gph-linux-gnueabi/sys-root/usr/include" if="gph"/>
<compilerflag value="-I${TIZEN_SDK}/platforms/tizen2.2/rootstraps/tizen-device-2.2.native/usr/include" if="tizen" />
<compilerflag value="-I${TIZEN_SDK}/platforms/tizen2.2/rootstraps/tizen-device-2.2.native/usr/include/osp" if="tizen" />
<compilerflag value="-I/opt/vc/include" if="rpi"/> <compilerflag value="-I/opt/vc/include" if="rpi"/>
<compilerflag value="-I/opt/vc/include/interface/vcos/pthreads/" if="rpi"/> <compilerflag value="-I/opt/vc/include/interface/vcos/pthreads/" if="rpi"/>
<compilerflag value="-I${GPH_ROOT}/include/freetype2" if="gph"/> <compilerflag value="-I${GPH_ROOT}/include/freetype2" if="gph"/>

View File

@@ -995,7 +995,7 @@ DEFINE_PRIM(lime_haptic_vibrate,2);
// --- SharedObject ---------------------------------------------------------------------- // --- SharedObject ----------------------------------------------------------------------
value lime_set_user_preference(value inId,value inValue) value lime_set_user_preference(value inId,value inValue)
{ {
#if defined(IPHONE) || defined(ANDROID) || defined(WEBOS) #if defined(IPHONE) || defined(ANDROID) || defined(WEBOS) || defined(TIZEN)
bool result=SetUserPreference(val_string(inId),val_string(inValue)); bool result=SetUserPreference(val_string(inId),val_string(inValue));
return alloc_bool(result); return alloc_bool(result);
#endif #endif
@@ -1005,7 +1005,7 @@ DEFINE_PRIM(lime_set_user_preference,2);
value lime_get_user_preference(value inId) value lime_get_user_preference(value inId)
{ {
#if defined(IPHONE) || defined(ANDROID) || defined(WEBOS) #if defined(IPHONE) || defined(ANDROID) || defined(WEBOS) || defined(TIZEN)
std::string result=GetUserPreference(val_string(inId)); std::string result=GetUserPreference(val_string(inId));
return alloc_string(result.c_str()); return alloc_string(result.c_str());
#endif #endif
@@ -1015,7 +1015,7 @@ DEFINE_PRIM(lime_get_user_preference,1);
value lime_clear_user_preference(value inId) value lime_clear_user_preference(value inId)
{ {
#if defined(IPHONE) || defined(ANDROID) || defined(WEBOS) #if defined(IPHONE) || defined(ANDROID) || defined(WEBOS) || defined(TIZEN)
bool result=ClearUserPreference(val_string(inId)); bool result=ClearUserPreference(val_string(inId));
return alloc_bool(result); return alloc_bool(result);
#endif #endif

View File

@@ -24,6 +24,10 @@ typedef uint64_t __int64;
#include <android/log.h> #include <android/log.h>
#endif #endif
#ifdef TIZEN
#include <FSystem.h>
#endif
#ifdef IPHONE #ifdef IPHONE
#include <QuartzCore/QuartzCore.h> #include <QuartzCore/QuartzCore.h>
#endif #endif
@@ -379,6 +383,20 @@ void GetSpecialDir(SpecialDir inDir,std::string &outDir)
{ {
outDir = "shared/documents"; outDir = "shared/documents";
} }
#elif defined(TIZEN)
if (inDir == DIR_APP)
{
outDir = "../";
}
else if (inDir == DIR_STORAGE)
{
outDir = "../";
}
else if (inDir == DIR_USER || inDir == DIR_DOCS || inDir == DIR_DESKTOP)
{
std::wstring dir = std::wstring (Tizen::System::Environment::GetExternalStoragePath ().GetPointer ());
outDir = std::string (dir.begin (), dir.end ());
}
#elif defined(WEBOS) #elif defined(WEBOS)
if (inDir == DIR_APP) if (inDir == DIR_APP)
{ {

View File

@@ -24,14 +24,14 @@ namespace lime {
sgFlags = inFlags; sgFlags = inFlags;
sgTitle = inTitle; sgTitle = inTitle;
if (sgWidth == 0 && sgHeight == 0) { //if (sgWidth == 0 && sgHeight == 0) {
// Hard-code screen size for now // Hard-code screen size for now
sgWidth = 720; sgWidth = 720;
sgHeight = 1280; sgHeight = 1280;
} //}
// For now, swap the width/height for proper EGL initialization, when landscape // For now, swap the width/height for proper EGL initialization, when landscape

View File

@@ -269,82 +269,6 @@ namespace lime {
void SetIcon (const char *path) {} void SetIcon (const char *path) {}
QuickVec<int>* CapabilitiesGetScreenResolutions () {
// glfwInit();
int count;
QuickVec<int> *out = new QuickVec<int>();
/*const GLFWvidmode *modes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &count);
for (int i = 0; i < count; i++)
{
out->push_back( modes[i].width );
out->push_back( modes[i].height );
}*/
return out;
}
double CapabilitiesGetScreenResolutionX () {
// glfwInit();
//const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
//return mode->width;
return 0;
}
double CapabilitiesGetScreenResolutionY () {
// glfwInit();
//const GLFWvidmode *mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
//return mode->width;
return 0;
}
std::string CapabilitiesGetLanguage () {
return "en-US";
}
double CapabilitiesGetScreenDPI() {
return 200;
}
double CapabilitiesGetPixelAspectRatio() {
return 1;
}
bool LaunchBrowser (const char *inUtf8URL) {
return false;
}
std::string FileDialogFolder( const std::string &title, const std::string &text ) {
return "";
}
std::string FileDialogOpen( const std::string &title, const std::string &text, const std::vector<std::string> &fileTypes ) {
return "";
}
std::string FileDialogSave( const std::string &title, const std::string &text, const std::vector<std::string> &fileTypes ) {
return "";
}
} }