Permalink
Browse files

Initial port of Frogatto to the BlackBerry PlayBook.

  • Loading branch information...
Artem Simonov
Artem Simonov committed Feb 15, 2012
1 parent 24ab30b commit 7e8978d2a4fd429445af7d702b88ae5365b2486a
View
663 .cproject

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>frogatto</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/frogatto/Device-Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ </natures>
+</projectDescription>
View
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
+
+<!-- BlackBerry Tablet OS application descriptor file.
+
+ Specifies parameters for identifying, installing, and launching native applications on BlackBerry Tablet OS.
+
+-->
+
+ <!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
+ Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
+ <id>com.example.frogatto</id>
+
+ <!-- The name that is displayed in the BlackBerry Tablet OS application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <name>Frogatto</name>
+
+ <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
+ Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
+ An updated version of application must have a versionNumber value higher than the previous version. Required. -->
+ <versionNumber>1.0.0</versionNumber>
+
+ <!-- Fourth digit segment of the package version. First three segments are taken from the
+ <versionNumber> element. Must be an integer from 0 to 2^16-1 -->
+ <buildId>1</buildId>
+
+ <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
+ <!-- <versionLabel></versionLabel> -->
+
+ <!-- Description, displayed in the BlackBerry Tablet OS application installer.
+ May have multiple values for each language. See samples or xsd schema file. Optional. -->
+ <description>The frogatto application</description>
+
+ <!-- Copyright information. Optional. -->
+ <!-- <copyright></copyright> -->
+
+ <!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
+ <author>Pandas in Motion</author>
+ <authorId>gYAAgM2mCYw-oMB3ErQwGys2iV4</authorId>
+ <splashscreen>bbsplash.png</splashscreen>
+
+ <!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
+ <!-- <authorId>ABC1234YjsnUk235h</authorId> -->
+
+ <initialWindow>
+ <aspectRatio>landscape</aspectRatio>
+ <autoOrients>false</autoOrients>
+ <systemChrome>none</systemChrome>
+ <transparent>false</transparent>
+ </initialWindow>
+
+ <!-- The category where the application appears. Either core.games or core.media. -->
+ <category>core.games</category>
+ <asset path="data">data</asset>
+ <asset path="images">images</asset>
+ <asset path="music">music</asset>
+ <asset path="sounds">sounds</asset>
+ <asset path="DejaVuSans.ttf">DejaVuSans.ttf</asset>
+ <asset path="FreeMono.ttf">FreeMono.ttf</asset>
+ <asset path="images/bbicon.png">bbicon.png</asset>
+ <asset path="images/bbsplash.png">bbsplash.png</asset>
+ <configuration id="com.qnx.qcc.configuration.exe.debug.925317493" name="Device-Debug">
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset path="Device-Debug/frogatto" entry="true" type="Qnx/Elf">frogatto</asset>
+ <asset path="${workspace_loc:/boost_iostreams/Device-Debug/libboost_iostreams.so}" type="Qnx/Elf">lib/libboost_iostreams.so</asset>
+ <asset path="${workspace_loc:/boost_regex/Device-Debug/libboost_regex.so}" type="Qnx/Elf">lib/libboost_regex.so</asset>
+ <asset path="${workspace_loc:/boost_system/Device-Debug/libboost_system.so}" type="Qnx/Elf">lib/libboost_system.so</asset>
+ <asset path="${workspace_loc:/SDL_image/Device-Debug/libSDL_image.so}" type="Qnx/Elf">lib/libSDL_image.so</asset>
+ <asset path="${workspace_loc:/SDL_mixer/Device-Debug/libSDL_mixer.so}" type="Qnx/Elf">lib/libSDL_mixer.so</asset>
+ <asset path="${workspace_loc:/SDL12/Device-Debug/libSDL12.so}" type="Qnx/Elf">lib/libSDL12.so</asset>
+ <asset path="${workspace_loc:/TouchControlOverlay/Device-Debug/libTouchControlOverlay.so}" type="Qnx/Elf">lib/libTouchControlOverlay.so</asset>
+ <asset path="${workspace_loc:/SDL_ttf/Device-Debug/libSDL_ttf.so}" type="Qnx/Elf">lib/libSDL_ttf.so</asset>
+ <asset path="${workspace_loc:/vorbis/Device-Debug/libvorbis.so}" type="Qnx/Elf">lib/libvorbis.so</asset>
+ <asset path="${workspace_loc:/ogg/Device-Debug/libogg.so}" type="Qnx/Elf">lib/libogg.so</asset>
+ <!-- <asset path="${QNX_TARGET}/../qnx6/${CPUVARDIR}/usr/lib/libbps.so.3" type="Qnx/Elf">lib/libbps.so.3</asset> -->
+ </configuration>
+ <configuration id="com.qnx.qcc.configuration.exe.release.1548331336" name="Device-Release">
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset path="Device-Release/frogatto" entry="true" type="Qnx/Elf">frogatto</asset>
+ <asset path="${workspace_loc:/boost_iostreams/Device-Release/libboost_iostreams.so}" type="Qnx/Elf">lib/libboost_iostreams.so</asset>
+ <asset path="${workspace_loc:/boost_regex/Device-Release/libboost_regex.so}" type="Qnx/Elf">lib/libboost_regex.so</asset>
+ <asset path="${workspace_loc:/boost_system/Device-Release/libboost_system.so}" type="Qnx/Elf">lib/libboost_system.so</asset>
+ <asset path="${workspace_loc:/SDL_image/Device-Release/libSDL_image.so}" type="Qnx/Elf">lib/libSDL_image.so</asset>
+ <asset path="${workspace_loc:/SDL_mixer/Device-Release/libSDL_mixer.so}" type="Qnx/Elf">lib/libSDL_mixer.so</asset>
+ <asset path="${workspace_loc:/SDL12/Device-Release/libSDL12.so}" type="Qnx/Elf">lib/libSDL12.so</asset>
+ <asset path="${workspace_loc:/TouchControlOverlay/Device-Release/libTouchControlOverlay.so}" type="Qnx/Elf">lib/libTouchControlOverlay.so</asset>
+ <asset path="${workspace_loc:/SDL_ttf/Device-Release/libSDL_ttf.so}" type="Qnx/Elf">lib/libSDL_ttf.so</asset>
+ <asset path="${workspace_loc:/vorbis/Device-Release/libvorbis.so}" type="Qnx/Elf">lib/libvorbis.so</asset>
+ <asset path="${workspace_loc:/ogg/Device-Release/libogg.so}" type="Qnx/Elf">lib/libogg.so</asset>
+ <!-- <asset path="${QNX_TARGET}/../qnx6/${CPUVARDIR}/usr/lib/libbps.so.3" type="Qnx/Elf">lib/libbps.so.3</asset> -->
+ </configuration>
+ <configuration id="com.qnx.qcc.configuration.exe.profile.471254918" name="Device-Profile">
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset path="Device-Profile/frogatto" entry="true" type="Qnx/Elf">frogatto</asset>
+ <asset path="${workspace_loc:/boost_iostreams/Device-Profile/libboost_iostreams.so}" type="Qnx/Elf">lib/libboost_iostreams.so</asset>
+ <asset path="${workspace_loc:/boost_regex/Device-Profile/libboost_regex.so}" type="Qnx/Elf">lib/libboost_regex.so</asset>
+ <asset path="${workspace_loc:/boost_system/Device-Profile/libboost_system.so}" type="Qnx/Elf">lib/libboost_system.so</asset>
+ <asset path="${workspace_loc:/SDL_image/Device-Profile/libSDL_image.so}" type="Qnx/Elf">lib/libSDL_image.so</asset>
+ <asset path="${workspace_loc:/SDL_mixer/Device-Profile/libSDL_mixer.so}" type="Qnx/Elf">lib/libSDL_mixer.so</asset>
+ <asset path="${workspace_loc:/SDL12/Device-Profile/libSDL12.so}" type="Qnx/Elf">lib/libSDL12.so</asset>
+ <asset path="${workspace_loc:/TouchControlOverlay/Device-Profile/libTouchControlOverlay.so}" type="Qnx/Elf">lib/libTouchControlOverlay.so</asset>
+ <asset path="${workspace_loc:/SDL_ttf/Device-Profile/libSDL_ttf.so}" type="Qnx/Elf">lib/libSDL_ttf.so</asset>
+ <asset path="${workspace_loc:/vorbis/Device-Profile/libvorbis.so}" type="Qnx/Elf">lib/libvorbis.so</asset>
+ <asset path="${workspace_loc:/ogg/Device-Profile/libogg.so}" type="Qnx/Elf">lib/libogg.so</asset>
+ </configuration>
+ <configuration id="com.qnx.qcc.configuration.exe.profile.coverage.2070637452" name="Device-Coverage">
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset path="Device-Coverage/frogatto" entry="true" type="Qnx/Elf">frogatto</asset>
+ </configuration>
+ <configuration id="com.qnx.qcc.configuration.exe.debug.599230539" name="Simulator-Debug">
+ <platformArchitecture>x86</platformArchitecture>
+ <asset path="Simulator-Debug/frogatto" entry="true" type="Qnx/Elf">frogatto</asset>
+ </configuration>
+ <configuration id="com.qnx.qcc.configuration.exe.profile.742294966" name="Simulator-Profile">
+ <platformArchitecture>x86</platformArchitecture>
+ <asset path="Simulator-Profile/frogatto" entry="true" type="Qnx/Elf">frogatto</asset>
+ </configuration>
+ <configuration id="com.qnx.qcc.configuration.exe.profile.coverage.1249164674" name="Simulator-Coverage">
+ <platformArchitecture>x86</platformArchitecture>
+ <asset path="Simulator-Coverage/frogatto" entry="true" type="Qnx/Elf">frogatto</asset>
+ </configuration>
+
+ <!-- The icon for the application, which should be 86x86. -->
+ <icon>
+ <image>bbicon.png</image>
+ </icon>
+
+ <!-- The splash screen that will appear when your application is launching. Should be 1024x600. -->
+ <!-- <splashscreen></splashscreen> -->
+
+ <!-- Request permission to execute native code. Required for native applications. -->
+ <action system="true">run_native</action>
+
+ <!-- The permissions requested by your application. -->
+ <!-- <action>access_shared</action> -->
+ <!-- <action>record_audio</action> -->
+ <!-- <action>read_geolocation</action> -->
+ <!-- <action>use_camera</action> -->
+ <!-- <action>access_internet</action> -->
+ <!-- <action>play_audio</action> -->
+ <!-- <action>post_notification</action> -->
+ <!-- <action>set_audio_volume</action> -->
+ <!-- <action>read_device_identifying_information</action> -->
+
+ <!-- Ensure that shared libraries in the package are found at run-time. -->
+ <env var="LD_LIBRARY_PATH" value="app/native/lib"/>
+
+</qnx>
View
Binary file not shown.
View
Binary file not shown.
View
@@ -31,8 +31,12 @@
#endif
#include <stdlib.h>
+#if defined(TARGET_BLACKBERRY)
+#include <SDL.h>
+#else
#include <SDL/SDL.h>
-#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA)
+#endif
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA) || defined(TARGET_BLACKBERRY)
#include <GLES/gl.h>
#else
#include <GL/gl.h>
View
@@ -1,4 +1,4 @@
-#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA)
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA) || defined(TARGET_BLACKBERRY)
#include <GLES/gl.h>
#else
#include <GL/gl.h>
View
@@ -1,4 +1,4 @@
-#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA)
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA) || defined(TARGET_BLACKBERRY)
#include <GLES/gl.h>
#else
#include <GL/gl.h>
View
@@ -1,7 +1,7 @@
#include <sstream>
#include <string>
#include <vector>
-#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA)
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA) || defined(TARGET_BLACKBERRY)
#include <GLES/gl.h>
#else
#include <GL/gl.h>
View
@@ -2,7 +2,7 @@
#define COLOR_UTILS_HPP_INCLUDED
#include "SDL.h"
-#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA)
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA) || defined(TARGET_BLACKBERRY)
#include <GLES/gl.h>
#else
#include <GL/gl.h>
View
@@ -1,4 +1,4 @@
-#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA)
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA) || defined(TARGET_BLACKBERRY)
#include <GLES/gl.h>
#ifdef TARGET_PANDORA
#include <GLES/glues.h>
View
@@ -1,4 +1,4 @@
-#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA)
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_PANDORA) || defined(TARGET_TEGRA) || defined(TARGET_BLACKBERRY)
#include <GLES/gl.h>
#ifdef TARGET_PANDORA
#include <GLES/glues.h>
View
@@ -452,6 +452,9 @@ std::string get_user_data_dir()
#elif defined(TARGET_PANDORA)
static const char* const current_dir = ".";
const char* home_str = getenv("PWD");
+#elif defined(TARGET_BLACKBERRY)
+ static const char* const current_dir = ".";
+ const char* home_str = getenv("HOME");
#else
static const char* const current_dir = " ";
const char* home_str = "PROGDIR:";
@@ -27,13 +27,13 @@ variant get_constant(const std::string& id)
} else if(id == "SCREEN_HEIGHT") {
return variant(graphics::screen_height());
} else if(id == "LOW_END_SYSTEM") {
-#if TARGET_OS_HARMATTAN || TARGET_OS_IPHONE
+#if TARGET_OS_HARMATTAN || TARGET_OS_IPHONE || TARGET_BLACKBERRY
return variant(1);
#else
return variant(0);
#endif
} else if(id == "IPHONE_SYSTEM") {
-#if TARGET_OS_HARMATTAN || TARGET_OS_IPHONE
+#if TARGET_OS_HARMATTAN || TARGET_OS_IPHONE || TARGET_BLACKBERRY
return variant(1);
#else
return variant(preferences::sim_iphone() ? 1 : 0);
View
@@ -1,10 +1,10 @@
#include "iphone_controls.hpp"
-#if TARGET_OS_HARMATTAN || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
+#if TARGET_OS_HARMATTAN || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR || TARGET_BLACKBERRY
#include <SDL.h>
-#ifdef TARGET_OS_HARMATTAN
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_BLACKBERRY)
#include <math.h> // sqrt
#endif
@@ -103,7 +103,7 @@ void iphone_controls::read_controls()
{
active_mice.clear();
-#ifdef TARGET_OS_HARMATTAN
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_BLACKBERRY)
// there is no SDL_Get_NumMice and SDL_SelectMouse support on
// Harmattan, so all_mice has been updated via calls to handle_event
const int nmice = all_mice.size();
@@ -140,7 +140,7 @@ void iphone_controls::read_controls()
}
}
-#ifdef TARGET_OS_HARMATTAN
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_BLACKBERRY)
void iphone_controls::handle_event (const SDL_Event& event)
{
int x = event.type == SDL_MOUSEMOTION ? event.motion.x : event.button.x;
View
@@ -27,7 +27,7 @@ class iphone_controls
static void draw();
static void read_controls();
-#ifdef TARGET_OS_HARMATTAN
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_BLACKBERRY)
static void handle_event(const SDL_Event& event);
#endif
View
@@ -18,7 +18,7 @@
#include "foreach.hpp"
#include "formula_profiler.hpp"
#include "inventory.hpp"
-#ifdef TARGET_OS_HARMATTAN
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_BLACKBERRY)
#include "iphone_controls.hpp"
#endif
#include "joystick.hpp"
@@ -651,7 +651,7 @@ bool level_runner::play_cycle()
}
break;
}
-#ifdef TARGET_OS_HARMATTAN
+#if defined(TARGET_OS_HARMATTAN) || defined(TARGET_BLACKBERRY)
case SDL_MOUSEMOTION:
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
Oops, something went wrong.

0 comments on commit 7e8978d

Please sign in to comment.