Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F131469
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
7 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/include/r-tech1/input/touch.h b/include/r-tech1/input/touch.h
new file mode 100644
index 00000000..3a2e157a
--- /dev/null
+++ b/include/r-tech1/input/touch.h
@@ -0,0 +1,20 @@
+#ifndef _rtech1_touch
+#define _rtech1_touch
+
+#include "../pointer.h"
+
+/* Manages devices that respond to touch input, such as android/ios */
+
+namespace Input{
+
+class Touch{
+public:
+ Touch();
+ virtual ~Touch();
+};
+
+Util::ReferenceCount<Touch> getTouchDevice();
+
+}
+
+#endif
diff --git a/scons/env.py b/scons/env.py
new file mode 100644
index 00000000..790e2996
--- /dev/null
+++ b/scons/env.py
@@ -0,0 +1,61 @@
+from SCons.Script import Split
+
+def android(env):
+ # Sets up the environment for Google Android
+ def setup(pre, x):
+ return '%s%s' % (pre, x)
+
+ platform = 'android-9'
+ arch = 'armeabi-v7a'
+ path = '/opt/android/android-toolchain'
+ # bin_path = setup(path, '/arm-linux-androideabi-4.4.3/bin')
+ bin_path = setup(path, '/bin')
+ prefix = 'arm-linux-androideabi-'
+ def set_prefix(x):
+ return '%s%s' % (prefix, x)
+ env['CC'] = set_prefix('gcc')
+ env['LD'] = set_prefix('ld')
+ env['CXX'] = set_prefix('g++')
+ env['AS'] = set_prefix('as')
+ env['AR'] = set_prefix('ar')
+ env['OBJCOPY'] = set_prefix('objcopy')
+
+ base = setup(path, '/user/%(arch)s' % {'arch': arch})
+
+ env.PrependENVPath('PKG_CONFIG_PATH', base + '/lib/pkgconfig')
+
+ env.Append(CPPPATH = ['%s/include' % base,
+ # '%s/include/allegro5' % base
+ ])
+
+ #env.Append(CPPPATH = [setup(path, '/arm-linux-androideabi-4.4.3/include'),
+ # setup(path, '/platforms/%s/arch-arm/usr/include' % platform),
+ # setup(path, '/platforms/%s/arch-arm/usr/include/SDL' % platform),
+ # setup(path, '/platforms/%s/arch-arm/usr/include/freetype' % platform),
+ # setup(path, '/sources/cxx-stl/gnu-libstdc++/include')
+ # ])
+ env.Append(CPPDEFINES = Split("""ANDROID __ARM_ARCH_5__ __ARM_ARCH_5T__ __ARM_ARCH_5E__ __ARM_ARCH_5TE__"""))
+ # flags = ['-fpic', '-fexceptions', '-ffunction-sections', '-funwind-tables', '-fstack-protector', '-Wno-psabi', '-march=armv5te', '-mtune=xscale', '-msoft-float', '-mthumb', '-Os', '-fomit-frame-pointer', '-fno-strict-aliasing', '-finline-limit=64',]
+ flags = ['-shared', '-fpic', '-fexceptions', '-ffunction-sections', '-funwind-tables', '-Wno-psabi', '-march=armv5te', '-mtune=xscale', '-msoft-float', '-mthumb', '-Os', '-fomit-frame-pointer', '-fno-strict-aliasing', '-finline-limit=64']
+ # linkflags = flags + ['-Wl,--allow-shlib-undefined']
+ linkflags = flags + ['-Wl,--no-undefined']
+ # libs = ['freetype', 'png', 'SDL', 'm', 'log', 'jnigraphics', 'c', 'm', 'supc++',]
+ # Copy the static stdc++ from gnu-libstdc++
+ # gnustdlib = env.InstallAs('misc/libgnustdc++.a', '/opt/android/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a')
+ # libs = Split("""freetype2-static png SDL m log c jnigraphics supc++ EGL GLESv2 GLESv1_CM z gnustdc++""")
+ libs = Split("""freetype2-static png m log c jnigraphics EGL GLESv2 GLESv1_CM z gnustl_static""")
+ env.Append(CCFLAGS = flags)
+ env.Append(CXXFLAGS = flags)
+ env.Append(LINKFLAGS = linkflags)
+ env.Append(CPPPATH = ['#src/android'])
+ env['LINKCOM'] = '$CXX $LINKFLAGS -Wl,--start-group $SOURCES $ARCHIVES $_LIBDIRFLAGS $_LIBFLAGS -Wl,--end-group -o $TARGET'
+ # Hack to put libstdc++ at the end
+ # env['LINKCOM'] = '$CXX $LINKFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS /opt/android/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a -o $TARGET'
+ # env['LINKCOM'] = '$CXX $LINKFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET'
+ env.Append(LIBS = libs)
+ env.Append(LIBPATH = ['%s/lib' % base,
+ #setup(path, '/platforms/%s/arch-arm/usr/lib' % platform),
+ ])
+
+ env.PrependENVPath('PATH', bin_path)
+ return env
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 964ff2aa..31e561c7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,102 +1,104 @@
# -------------------------------------------------------
# util cmake build script for r-tech1.
# Written by: juvinious
# Modified by: kazzmir
# -------------------------------------------------------
# -------------------------------------------------------
# Source directories containing all the necessary .cpp files
# -------------------------------------------------------
set(UTIL_SRC
argument.cpp
configuration.cpp
network/network.cpp
network/chat.cpp
network/irc.cpp
token.cpp
resource.cpp
tokenreader.cpp
timedifference.cpp
debug.cpp
timer.cpp
init.cpp
utf.cpp
console.cpp
input/keyboard.cpp
loading.cpp
messages.cpp
graphics/bitmap.cpp
graphics/image.cpp
events.cpp
font.cpp
font_factory.cpp
graphics/fire.cpp
ftalleg.cpp
funcs.cpp
directory.cpp
file-system.cpp
graphics/gradient.cpp
ebox.cpp
regex.cpp
language-string.cpp
thread.cpp
input/text-input.cpp
input/input-manager.cpp
input/input-source.cpp
input/joystick.cpp
input/allegro5/joystick.cpp
+input/touch.cpp
+input/allegro5/touch.cpp
xenon/xenon.cpp
libs/lz4/lz4.c
system.cpp
version.cpp
compress.cpp
message-queue.cpp
input/linux_joystick.cpp
exceptions/load_exception.cpp
windows/system.cpp
nacl/module.cpp
nacl/network-system.cpp
exceptions/exception.cpp
menu/actionfactory.cpp
menu/action_speed.cpp
menu/menu.cpp
menu/font-info.cpp
menu/menu_action.cpp
menu/menu_option.cpp
menu/options.cpp
menu/optionfactory.cpp
gui/animation.cpp
gui/box.cpp
gui/container.cpp
gui/context-box.cpp
gui/coordinate.cpp
gui/cutscene.cpp
gui/fadetool.cpp
gui/lineedit.cpp
gui/list.cpp
gui/rectarea.cpp
gui/popup-box.cpp
gui/scroll-list.cpp
gui/select-list.cpp
gui/tab-container.cpp
gui/tabbed-box.cpp
gui/timer.cpp
gui/widget.cpp
sound/sound.cpp
sound/audio.cpp
sound/music-player.cpp
sound/music-renderer.cpp
sound/music.cpp
system/timer.cpp
system/allegro5/timer.cpp
system/allegro5/init.cpp)
# -------------------------------------------------------
# Include directory
# -------------------------------------------------------
#include_directories(include include/internal)
# -------------------------------------------------------
# module
# -------------------------------------------------------
add_library (util_module ${UTIL_SRC})
diff --git a/src/input/allegro5/touch.cpp b/src/input/allegro5/touch.cpp
new file mode 100644
index 00000000..380c9b19
--- /dev/null
+++ b/src/input/allegro5/touch.cpp
@@ -0,0 +1,35 @@
+#ifdef USE_ALLEGRO5
+
+#include "r-tech1/input/touch.h"
+#include "r-tech1/pointer.h"
+#include <allegro5/allegro.h>
+
+namespace Input{
+
+class Allegro5Touch: public Touch {
+public:
+ Allegro5Touch();
+ virtual ~Allegro5Touch();
+
+protected:
+ ALLEGRO_EVENT_QUEUE * queue;
+};
+
+Allegro5Touch::Allegro5Touch():
+queue(NULL){
+ queue = al_create_event_queue();
+ al_register_event_source(queue, al_get_touch_input_event_source());
+}
+
+Allegro5Touch::~Allegro5Touch(){
+ al_destroy_event_queue(queue);
+ queue = NULL;
+}
+
+Util::ReferenceCount<Touch> getTouchDevice(){
+ return Util::ReferenceCount<Touch>(new Allegro5Touch());
+}
+
+}
+
+#endif
diff --git a/src/input/touch.cpp b/src/input/touch.cpp
new file mode 100644
index 00000000..e9f8519d
--- /dev/null
+++ b/src/input/touch.cpp
@@ -0,0 +1,11 @@
+#include "r-tech1/input/touch.h"
+
+namespace Input{
+
+Touch::Touch(){
+}
+
+Touch::~Touch(){
+}
+
+}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Jun 16, 12:14 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71355
Default Alt Text
(7 KB)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline