Changeset 1219


Ignore:
Timestamp:
Apr 12, 2012, 12:59:29 AM (8 years ago)
Author:
sam
Message:

android: slightly update Android project for newer SDK versions.

Location:
trunk
Files:
2 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/android/build.xml

    r720 r1219  
    22<project name="LolActivity" default="help">
    33
    4 <!-- The local.properties file is created and updated by the 'android'
    5      tool.
    6      It contains the path to the SDK. It should *NOT* be checked into
    7      Version Control Systems. -->
     4    <!-- The local.properties file is created and updated by the 'android' tool.
     5         It contains the path to the SDK. It should *NOT* be checked into
     6         Version Control Systems. -->
    87    <property file="local.properties" />
    98
    10     <!-- The build.properties file can be created by you and is never touched
    11          by the 'android' tool. This is the place to change some of the
    12          default property values used by the Ant rules.
     9    <!-- The ant.properties file can be created by you. It is only edited by the
     10         'android' tool to add properties to it.
     11         This is the place to change some Ant specific build properties.
    1312         Here are some properties you may want to change/update:
    1413
     
    1716         out.dir
    1817             The name of the output directory. Default is 'bin'.
     18
     19         For other overridable properties, look at the beginning of the rules
     20         files in the SDK, at tools/ant/build.xml
    1921
    2022         Properties related to the SDK location or the project target should
     
    2527
    2628         -->
    27     <property file="build.properties" />
     29    <property file="ant.properties" />
    2830
    29     <!-- The default.properties file is created and updated by the 'android'
     31    <!-- The project.properties file is created and updated by the 'android'
    3032         tool, as well as ADT.
     33
     34         This contains project specific properties such as project target, and library
     35         dependencies. Lower level build properties are stored in ant.properties
     36         (or in .classpath for Eclipse projects).
     37
    3138         This file is an integral part of the build system for your
    3239         application and should be checked into Version Control Systems. -->
    33     <property file="default.properties" />
     40    <loadproperties srcFile="project.properties" />
    3441
    35     <!-- Custom Android task to deal with the project target, and import the
    36          proper rules.
    37          This requires ant 1.6.0 or above. -->
    38     <path id="android.antlibs">
    39         <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
    40         <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
    41         <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
    42     </path>
     42    <!-- quick check on sdk.dir -->
     43    <fail
     44            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
     45            unless="sdk.dir"
     46    />
    4347
    44     <taskdef name="setup"
    45         classname="com.android.ant.SetupTask"
    46         classpathref="android.antlibs" />
     48    <!--
     49        Import per project custom build rules if present at the root of the project.
     50        This is the place to put custom intermediary targets such as:
     51            -pre-build
     52            -pre-compile
     53            -post-compile (This is typically used for code obfuscation.
     54                           Compiled code location: ${out.classes.absolute.dir}
     55                           If this is not done in place, override ${out.dex.input.absolute.dir})
     56            -post-package
     57            -post-build
     58            -pre-clean
     59    -->
     60    <import file="custom_rules.xml" optional="true" />
    4761
    48 <!-- extension targets. Uncomment the ones where you want to do custom work
    49      in between standard targets -->
    50 <!--
    51     <target name="-pre-build">
    52     </target>
    53     <target name="-pre-compile">
    54     </target>
    55 
    56     [This is typically used for code obfuscation.
    57      Compiled code location: ${out.classes.absolute.dir}
    58      If this is not done in place, override ${out.dex.input.absolute.dir}]
    59     <target name="-post-compile">
    60     </target>
    61 -->
    62 
    63 
    64     <!-- Execute the Android Setup task that will setup some properties
    65          specific to the target, and import the build rules files.
    66 
    67          The rules file is imported from
    68             <SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml
     62    <!-- Import the actual build file.
    6963
    7064         To customize existing targets, there are two options:
    7165         - Customize only one target:
    7266             - copy/paste the target into this file, *before* the
    73                <setup> task.
     67               <import> task.
    7468             - customize it to your needs.
    75          - Customize the whole script.
     69         - Customize the whole content of build.xml
    7670             - copy/paste the content of the rules files (minus the top node)
    77                into this file, *after* the <setup> task
    78              - disable the import of the rules by changing the setup task
    79                below to <setup import="false" />.
     71               into this file, replacing the <import> task.
    8072             - customize to your needs.
     73
     74         ***********************
     75         ****** IMPORTANT ******
     76         ***********************
     77         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
     78         in order to avoid having your file be overridden by tools such as "android update project"
    8179    -->
    82     <setup />
     80    <!-- version-tag: 1 -->
     81    <import file="${sdk.dir}/tools/ant/build.xml" />
    8382
    8483</project>
  • trunk/monsterz/android/jni/Android.mk

    r939 r1219  
    1010LOCAL_CFLAGS := -DDISABLE_IMPORTGL \
    1111                -DHAVE_GLES_2X \
     12                -DHAVE_PTHREAD_H \
    1213                -I$(LOCAL_PATH)/$(LOL_SRC) \
    1314                -I$(LOCAL_PATH)/$(MONSTERZ_SRC)
  • trunk/src/Makefile.am

    r1180 r1219  
    2323    $(nacl_sources) \
    2424    $(sdl_sources) \
     25    $(android_sources) \
    2526    \
    2627    thread/threadbase.h thread/thread.h \
     
    3233    \
    3334    image/image.cpp image/image.h image/image-private.h \
    34     image/codec/android-image.cpp \
    3535    image/codec/gdiplus-image.cpp \
    3636    image/codec/ios-image.cpp \
    37     image/codec/sdl-image.cpp \
    38     image/codec/ps3-image.cpp \
    3937    image/codec/dummy-image.cpp \
    4038    \
     
    4644
    4745sdl_sources = \
     46    image/codec/sdl-image.cpp \
    4847    platform/sdl/sdlapp.cpp platform/sdl/sdlapp.h \
    4948    platform/sdl/sdlinput.cpp platform/sdl/sdlinput.h
     
    6059if HAVE_PS3
    6160ps3_sources = \
     61    image/codec/ps3-image.cpp \
    6262    platform/ps3/threadbase.h \
    6363    platform/ps3/ps3app.cpp platform/ps3/ps3app.h \
     
    7070endif
    7171
     72android_sources = \
     73    image/codec/android-image.cpp \
     74    platform/android/androidapp.cpp platform/android/androidapp.h
     75
  • trunk/src/application/application.cpp

    r1173 r1219  
    2222#elif defined __native_client__
    2323#   include "platform/nacl/naclapp.h"
     24#elif defined __ANDROID__
     25#   include "platform/android/androidapp.h"
    2426#elif defined HAVE_GLES_2X
    2527#   include "eglapp.h"
     
    4850#elif defined __native_client__
    4951    NaClApp app;
     52#elif defined __ANDROID__
     53    AndroidApp app;
    5054#elif defined HAVE_GLES_2X
    5155    /* FIXME: this macro is only deactivated if we include "lolgl.h" */
  • trunk/src/platform/android/androidapp.cpp

    r1106 r1219  
    1717
    1818#include "core.h"
    19 #include "lolgl.h"
    2019#include "loldebug.h"
     20#include "androidapp.h"
    2121
    2222using namespace lol;
     23
     24/* Monsterz-specific */
     25#include "interface.h"
    2326
    2427namespace lol
     
    2629JavaVM *g_vm;
    2730jobject g_activity;
     31
     32AndroidApp::AndroidApp(char const *title, ivec2 res, float fps) :
     33    data(0)
     34{
     35}
     36
     37void AndroidApp::ShowPointer(bool show)
     38{
     39}
     40
     41void AndroidApp::Run()
     42{
     43    while (!Ticker::Finished())
     44    {
     45        /* Tick the renderer, show the frame and clamp to desired framerate. */
     46        Ticker::TickDraw();
     47    }
     48}
     49
     50AndroidApp::~AndroidApp()
     51{
     52}
     53
    2854};
    2955
Note: See TracChangeset for help on using the changeset viewer.