mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 08:30:16 +00:00
(BB10) Start cleaning up some include header references
(Android) Uniquely name symbols - platform_android.c
This commit is contained in:
parent
90b7589b5d
commit
a0567c3c77
@ -5,6 +5,11 @@
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<arguments>
|
||||
@ -80,7 +85,7 @@
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.rim.tad.tools.wst.jsdt.core.jsNature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
|
@ -1,2 +0,0 @@
|
||||
// This file is used to store precompiled headers.
|
||||
// It is intentionally left blank. It is up to you to decide which headers should be included here.
|
@ -5,17 +5,19 @@
|
||||
|
||||
#include "ButtonMap.h"
|
||||
#include "RetroArch-Cascades.h"
|
||||
#include "input/input_common.h"
|
||||
#include "../../../input/input_common.h"
|
||||
#include "../../frontend_qnx.h"
|
||||
|
||||
ButtonMap::ButtonMap(screen_context_t screen_ctx, QString groupId, int coid)
|
||||
{
|
||||
int rc, usage, format, z;
|
||||
screen_display_t screen_disp;
|
||||
|
||||
this->screen_cxt = screen_ctx;
|
||||
this->groupId = groupId;
|
||||
this->coid = coid;
|
||||
|
||||
const int usage = SCREEN_USAGE_NATIVE | SCREEN_USAGE_WRITE | SCREEN_USAGE_READ;
|
||||
int rc;
|
||||
usage = SCREEN_USAGE_NATIVE | SCREEN_USAGE_WRITE | SCREEN_USAGE_READ;
|
||||
|
||||
if(screen_create_window_type(&screen_win, screen_cxt, SCREEN_CHILD_WINDOW))
|
||||
{
|
||||
@ -23,12 +25,11 @@ ButtonMap::ButtonMap(screen_context_t screen_ctx, QString groupId, int coid)
|
||||
}
|
||||
|
||||
screen_join_window_group(screen_win, (const char *)groupId.toAscii().constData());
|
||||
int format = SCREEN_FORMAT_RGBA8888;
|
||||
format = SCREEN_FORMAT_RGBA8888;
|
||||
screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_FORMAT, &format);
|
||||
|
||||
screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_USAGE, &usage);
|
||||
|
||||
screen_display_t screen_disp;
|
||||
if (screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_DISPLAY, (void **)&screen_disp))
|
||||
{
|
||||
RARCH_ERR("screen_get_window_property_pv [SCREEN_PROPERTY_DISPLAY] failed.\n");
|
||||
@ -40,19 +41,16 @@ ButtonMap::ButtonMap(screen_context_t screen_ctx, QString groupId, int coid)
|
||||
}
|
||||
|
||||
rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_BUFFER_SIZE, screen_resolution);
|
||||
if (rc) {
|
||||
if (rc)
|
||||
perror("screen_set_window_property_iv");
|
||||
}
|
||||
|
||||
int z = -10;
|
||||
if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &z) != 0) {
|
||||
z = -10;
|
||||
if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &z) != 0)
|
||||
return;
|
||||
}
|
||||
|
||||
rc = screen_create_window_buffers(screen_win, 1);
|
||||
if (rc) {
|
||||
if (rc)
|
||||
perror("screen_create_window_buffers");
|
||||
}
|
||||
|
||||
screen_get_window_property_pv(screen_win, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)&screen_buf);
|
||||
|
||||
@ -80,15 +78,13 @@ QString ButtonMap::getLabel(int button)
|
||||
|
||||
int ButtonMap::mapNextButtonPressed()
|
||||
{
|
||||
int sym, z;
|
||||
bps_event_t *event = NULL;
|
||||
int sym;
|
||||
|
||||
//use in frontend run loop, get key pressed back, and map
|
||||
int z = 10;
|
||||
z = 10;
|
||||
if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &z) != 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
screen_post_window(screen_win, screen_buf, 1, screen_resolution, 0);
|
||||
|
||||
@ -106,8 +102,8 @@ int ButtonMap::mapNextButtonPressed()
|
||||
|
||||
if (domain == screen_get_domain())
|
||||
{
|
||||
screen_event_t screen_event = screen_event_get_event(event);
|
||||
int screen_val;
|
||||
screen_event_t screen_event = screen_event_get_event(event);
|
||||
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &screen_val);
|
||||
|
||||
//TODO: Should we only let the buttons through that we are trying to map?
|
||||
@ -134,9 +130,7 @@ int ButtonMap::mapNextButtonPressed()
|
||||
|
||||
z = -10;
|
||||
if (screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &z) != 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
screen_post_window(screen_win, screen_buf, 1, screen_resolution, 0);
|
||||
|
||||
@ -159,11 +153,12 @@ void ButtonMap::mapDevice(int index, int player)
|
||||
|
||||
void ButtonMap::refreshButtonMap(int player)
|
||||
{
|
||||
int i;
|
||||
QVariantMap map;
|
||||
|
||||
buttonDataModel->clear();
|
||||
|
||||
for (int i=0; i<16; ++i)
|
||||
for (i=0; i < 16; ++i)
|
||||
{
|
||||
QString desc = QString(input_config_bind_map[i].desc);
|
||||
int index = desc.indexOf("(");
|
||||
@ -209,18 +204,16 @@ int ButtonMap::mapButton(int player, int button)
|
||||
|
||||
QString ButtonMap::buttonToString(int player, int button)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(g_settings.input.device[player] == DEVICE_KEYPAD || g_settings.input.device[player] == DEVICE_KEYBOARD)
|
||||
{
|
||||
return QString(button);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i=0;i<20;++i)
|
||||
for(i = 0; i < 20; ++i)
|
||||
{
|
||||
if(platform_keys[i].joykey == (uint)button)
|
||||
{
|
||||
return QString(platform_keys[i].desc);
|
||||
}
|
||||
}
|
||||
|
||||
return (button!=NO_BTN) ? QString(button) : QString("Not Mapped");
|
||||
|
@ -7,9 +7,9 @@
|
||||
|
||||
#include <screen/screen.h>
|
||||
#include <sys/neutrino.h>
|
||||
#include "general.h"
|
||||
#include "conf/config_file.h"
|
||||
#include "file.h"
|
||||
#include "../../../general.h"
|
||||
#include "../../../conf/config_file.h"
|
||||
#include "../../../file.h"
|
||||
|
||||
/*
|
||||
typedef struct {
|
||||
|
@ -1,26 +1,8 @@
|
||||
/* Copyright (c) 2012 Research In Motion Limited.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "RetroArch-Cascades.h"
|
||||
#include "general.h"
|
||||
#include "conf/config_file.h"
|
||||
#include "file.h"
|
||||
#include "core_info.h"
|
||||
|
||||
#ifdef HAVE_RGUI
|
||||
#include "frontend/menu/rgui.h"
|
||||
#endif
|
||||
#include "../../../general.h"
|
||||
#include "../../../conf/config_file.h"
|
||||
#include "../../../file.h"
|
||||
#include "../../../frontend/info/core_info.h"
|
||||
|
||||
#include "../../frontend_qnx.h"
|
||||
|
||||
@ -53,6 +35,9 @@ extern screen_context_t screen_ctx;
|
||||
|
||||
RetroArch::RetroArch()
|
||||
{
|
||||
bool res;
|
||||
QmlDocument *qml;
|
||||
|
||||
qmlRegisterType<bb::cascades::pickers::FilePicker>("bb.cascades.pickers", 1, 0, "FilePicker");
|
||||
qmlRegisterUncreatableType<bb::cascades::pickers::FileType>("bb.cascades.pickers", 1, 0, "FileType", "");
|
||||
|
||||
@ -60,7 +45,7 @@ RetroArch::RetroArch()
|
||||
chid = ChannelCreate(0);
|
||||
coid = ConnectAttach(0, 0, chid, _NTO_SIDE_CHANNEL, 0);
|
||||
|
||||
bool res = connect(
|
||||
res = connect(
|
||||
OrientationSupport::instance(), SIGNAL(rotationCompleted()),
|
||||
this, SLOT(onRotationCompleted()));
|
||||
|
||||
@ -74,7 +59,7 @@ RetroArch::RetroArch()
|
||||
//Stop config overwritting values
|
||||
g_extern.block_config_read = true;
|
||||
|
||||
QmlDocument *qml = QmlDocument::create("asset:///main.qml");
|
||||
qml = QmlDocument::create("asset:///main.qml");
|
||||
|
||||
if (!qml->hasErrors())
|
||||
{
|
||||
@ -236,9 +221,7 @@ void RetroArch::onRotationCompleted()
|
||||
if (OrientationSupport::instance()->orientation() == UIOrientation::Landscape)
|
||||
{
|
||||
if (state == RETROARCH_START_REQUESTED)
|
||||
{
|
||||
startEmulator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,9 +250,7 @@ void RetroArch::startEmulator()
|
||||
|
||||
if (OrientationSupport::instance()->orientation() == UIOrientation::Portrait &&
|
||||
OrientationSupport::instance()->supportedDisplayOrientation() != SupportedDisplayOrientation::DeviceNorth)
|
||||
{
|
||||
OrientationSupport::instance()->setSupportedDisplayOrientation(SupportedDisplayOrientation::DisplayLandscape);
|
||||
}
|
||||
else
|
||||
{
|
||||
recv_msg msg;
|
||||
@ -315,9 +296,7 @@ void RetroArch::findDevices()
|
||||
|
||||
//QML shows player 1 by default, so set dropdown to their controller.
|
||||
if(devices[i].port == 0 || devices[i].device == DEVICE_KEYPAD)
|
||||
{
|
||||
deviceSelection->setSelectedIndex(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,10 +312,12 @@ void RetroArch::discoverController(int player)
|
||||
|
||||
void RetroArch::initRASettings()
|
||||
{
|
||||
HardwareInfo *hwInfo;
|
||||
|
||||
strlcpy(g_settings.libretro,(char *)core.toAscii().constData(), sizeof(g_settings.libretro));
|
||||
strlcpy(g_extern.fullpath, (char *)rom.toAscii().constData(), sizeof(g_extern.fullpath));
|
||||
|
||||
HardwareInfo *hwInfo = new HardwareInfo();
|
||||
hwInfo = new HardwareInfo();
|
||||
|
||||
//If Physical keyboard or a device mapped to player 1, hide overlay
|
||||
//TODO: Should there be a minimized/quick settings only overlay?
|
||||
|
@ -1,19 +1,3 @@
|
||||
/* Copyright (c) 2012 Research In Motion Limited.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#include "RetroArch-Cascades.h"
|
||||
#include <Qt/qdeclarativedebug.h>
|
||||
|
||||
@ -21,12 +5,12 @@ using ::bb::cascades::Application;
|
||||
|
||||
Q_DECL_EXPORT int main(int argc, char **argv)
|
||||
{
|
||||
RetroArch mainApp;
|
||||
|
||||
// Instantiate the main application constructor.
|
||||
Application app(argc, argv);
|
||||
|
||||
// Initialize our application.
|
||||
RetroArch mainApp;
|
||||
|
||||
QObject::connect(&app, SIGNAL( aboutToQuit() ), &mainApp, SLOT( aboutToQuit() ));
|
||||
|
||||
// We complete the transaction started in the main application constructor and start the
|
||||
|
@ -33,8 +33,8 @@ struct android_app *g_android;
|
||||
static pthread_key_t thread_key;
|
||||
|
||||
//forward decls
|
||||
static void system_deinit(void *data);
|
||||
static void system_shutdown(bool unused);
|
||||
static void frontend_android_deinit(void *data);
|
||||
static void frontend_android_shutdown(bool unused);
|
||||
extern void android_app_entry(void *args);
|
||||
|
||||
void engine_handle_cmd(void *data)
|
||||
@ -376,7 +376,7 @@ static bool android_run_events (void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void get_environment_settings(int argc, char *argv[], void *data)
|
||||
static void frontend_android_get_environment_settings(int argc, char *argv[], void *data)
|
||||
{
|
||||
JNIEnv *env;
|
||||
struct android_app* android_app = (struct android_app*)data;
|
||||
@ -550,7 +550,7 @@ static void process_pending_intent(void *data)
|
||||
#endif
|
||||
}
|
||||
|
||||
static int process_events(void *data)
|
||||
static int frontend_android_process_events(void *data)
|
||||
{
|
||||
//jboolean hasPendingIntent;
|
||||
//JNIEnv *env;
|
||||
@ -572,7 +572,7 @@ static int process_events(void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void system_init(void *data)
|
||||
static void frontend_android_init(void *data)
|
||||
{
|
||||
JNIEnv *env;
|
||||
jclass class = NULL;
|
||||
@ -599,8 +599,8 @@ static void system_init(void *data)
|
||||
{
|
||||
if (!android_run_events(android_app))
|
||||
{
|
||||
system_deinit(android_app);
|
||||
system_shutdown(android_app);
|
||||
frontend_android_deinit(android_app);
|
||||
frontend_android_shutdown(android_app);
|
||||
}
|
||||
}
|
||||
|
||||
@ -628,7 +628,7 @@ static void system_init(void *data)
|
||||
GET_METHOD_ID(env, android_app->getStringExtra, class, "getStringExtra", "(Ljava/lang/String;)Ljava/lang/String;");
|
||||
}
|
||||
|
||||
static void system_deinit(void *data)
|
||||
static void frontend_android_deinit(void *data)
|
||||
{
|
||||
struct android_app* android_app = (struct android_app*)data;
|
||||
|
||||
@ -640,7 +640,7 @@ static void system_deinit(void *data)
|
||||
AInputQueue_detachLooper(android_app->inputQueue);
|
||||
}
|
||||
|
||||
static void system_shutdown(bool unused)
|
||||
static void frontend_android_shutdown(bool unused)
|
||||
{
|
||||
(void)unused;
|
||||
// exit() here is nasty.
|
||||
@ -657,14 +657,14 @@ static int frontend_android_get_rating(void)
|
||||
}
|
||||
|
||||
const frontend_ctx_driver_t frontend_ctx_android = {
|
||||
get_environment_settings, /* get_environment_settings */
|
||||
system_init, /* init */
|
||||
system_deinit, /* deinit */
|
||||
frontend_android_get_environment_settings, /* get_environment_settings */
|
||||
frontend_android_init, /* init */
|
||||
frontend_android_deinit, /* deinit */
|
||||
NULL, /* exitspawn */
|
||||
NULL, /* process_args */
|
||||
process_events, /* process_events */
|
||||
frontend_android_process_events, /* process_events */
|
||||
NULL, /* exec */
|
||||
system_shutdown, /* shutdown */
|
||||
frontend_android_shutdown, /* shutdown */
|
||||
frontend_android_get_rating, /* get_rating */
|
||||
"android",
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user