Changeset 939


Ignore:
Timestamp:
Sep 10, 2011, 2:42:13 PM (8 years ago)
Author:
sam
Message:

build: stop defining ANDROID_NDK and check for ANDROID instead.

According to David Turner, “it should be the only thing that NDK users
should be testing again.”

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/android/jni/Android.mk

    r865 r939  
    88LOCAL_MODULE := lolengine
    99
    10 LOCAL_CFLAGS := -DANDROID_NDK \
    11                 -DDISABLE_IMPORTGL \
     10LOCAL_CFLAGS := -DDISABLE_IMPORTGL \
    1211                -DHAVE_GLES_2X \
    1312                -I$(LOCAL_PATH)/$(LOL_SRC) \
  • trunk/src/debug/quad.cpp

    r907 r939  
    6666    int initialised;
    6767    float time;
    68 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     68#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    6969    GLuint array[NUM_ARRAYS];
    7070#endif
     
    154154    if (!data->initialised && !IsDestroying())
    155155    {
    156 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     156#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    157157        glGenVertexArrays(NUM_ARRAYS, data->array);
    158158#endif
     
    184184    else if (data->initialised && IsDestroying())
    185185    {
    186 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     186#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    187187        glDeleteVertexArrays(NUM_ARRAYS, data->array);
    188188#endif
     
    237237
    238238    /* Cheap iterators */
    239 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     239#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    240240    GLuint *array = data->array;
    241241#endif
     
    495495     * Renders an orange square.
    496496     */
    497 #if !defined ANDROID_NDK && !defined __APPLE__
     497#if !defined __ANDROID__ && !defined __APPLE__
    498498    glColor4f(orange.x, orange.y, orange.z, orange.w);
    499499    glEnableClientState(GL_VERTEX_ARRAY);
     
    513513     * Renders a green sine wave made of 1-pixel points.
    514514     */
    515 #if !defined ANDROID_NDK && !defined __APPLE__
     515#if !defined __ANDROID__ && !defined __APPLE__
    516516    glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
    517517    glPointSize(1.0f);
     
    532532     * Renders a multicoloured square with varying colors.
    533533     */
    534 #if !defined ANDROID_NDK && !defined __APPLE__
     534#if !defined __ANDROID__ && !defined __APPLE__
    535535    glEnableClientState(GL_VERTEX_ARRAY);
    536536    glEnableClientState(GL_COLOR_ARRAY);
     
    553553     * animated distorted checkerboard.
    554554     */
    555 #if !defined ANDROID_NDK && !defined __APPLE__
     555#if !defined __ANDROID__ && !defined __APPLE__
    556556    glEnable(GL_TEXTURE_2D);
    557557    glBindTexture(GL_TEXTURE_2D, data->texture[0]);
     
    581581     * Renders an orange square.
    582582     */
    583 #if !defined ANDROID_NDK && !defined __APPLE__
     583#if !defined __ANDROID__ && !defined __APPLE__
    584584    if (!shader[0])
    585585#if !defined __CELLOS_LV2__
     
    627627     * Renders an orange square.
    628628     */
    629 #if !defined ANDROID_NDK && !defined __APPLE__
     629#if !defined __ANDROID__ && !defined __APPLE__
    630630    if (!shader[0])
    631631    {
     
    680680     * Renders a static, coloured and tiled pattern.
    681681     */
    682 #if !defined ANDROID_NDK && !defined __APPLE__
     682#if !defined __ANDROID__ && !defined __APPLE__
    683683    if (!shader[0])
    684684#if !defined __CELLOS_LV2__
     
    733733     * Renders a multicoloured square with varying colors.
    734734     */
    735 #if !defined ANDROID_NDK && !defined __APPLE__
     735#if !defined __ANDROID__ && !defined __APPLE__
    736736    if (!shader[0])
    737737    {
     
    797797     * Renders an antialiased green sine wave made of 1-pixel points.
    798798     */
    799 #if !defined ANDROID_NDK && !defined __APPLE__ && !defined __CELLOS_LV2__
     799#if !defined __ANDROID__ && !defined __APPLE__ && !defined __CELLOS_LV2__
    800800    if (!shader[0])
    801801        shader[0] = Shader::Create(
     
    843843     * animated distorted checkerboard.
    844844     */
    845 #if !defined ANDROID_NDK && !defined __APPLE__
     845#if !defined __ANDROID__ && !defined __APPLE__
    846846    if (!shader[0])
    847847#if !defined __CELLOS_LV2__
     
    916916     * animated distorted checkerboard.
    917917     */
    918 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     918#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    919919    if (!shader[0])
    920920    {
     
    986986     * animated distorted checkerboard.
    987987     */
    988 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     988#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    989989    if (!shader[0])
    990990    {
     
    10511051
    10521052    /* Check that we didn't overflow our list */
    1053 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     1053#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    10541054    if (array > data->array + NUM_ARRAYS)
    10551055        Log::Error("too many arrays used\n");
     
    10741074#endif
    10751075
    1076 #if !defined ANDROID_NDK && !defined __APPLE__
     1076#if !defined __ANDROID__ && !defined __APPLE__
    10771077    glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    10781078#endif
     
    10831083    glClientActiveTexture(GL_TEXTURE0);
    10841084#endif
    1085 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     1085#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    10861086    glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
    10871087#endif
     
    10891089
    10901090    glDisable(GL_BLEND);
    1091 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     1091#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    10921092    glDisable(GL_POINT_SPRITE);
    10931093#endif
     
    11011101#endif
    11021102
    1103 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     1103#if !defined __CELLOS_LV2__ && !defined __ANDROID__
    11041104    glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
    11051105#endif
  • trunk/src/image/image.cpp

    r864 r939  
    2020#   include <SDL.h>
    2121#   include <SDL_image.h>
    22 #elif defined ANDROID_NDK
     22#elif defined __ANDROID__
    2323#   include <jni.h>
    2424#   include <android/log.h>
     
    3535{
    3636
    37 #if defined ANDROID_NDK
     37#if defined __ANDROID__
    3838extern JavaVM *g_vm;
    3939extern jobject g_activity;
     
    5656#elif defined USE_SDL
    5757    SDL_Surface *img;
    58 #elif defined ANDROID_NDK
     58#elif defined __ANDROID__
    5959    jobject bmp;
    6060    jintArray array;
     
    126126    data->size = ivec2(data->img->w, data->img->h);
    127127    data->format = data->img->format->Amask ? FORMAT_RGBA : FORMAT_RGB;
    128 #elif defined ANDROID_NDK
     128#elif defined __ANDROID__
    129129    JNIEnv *env;
    130130    jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2);
     
    337337#elif defined USE_SDL
    338338    return data->img->pixels;
    339 #elif defined ANDROID_NDK
     339#elif defined __ANDROID__
    340340    return data->pixels;
    341341#elif defined __CELLOS_LV2__
     
    352352#elif defined USE_SDL
    353353    SDL_FreeSurface(data->img);
    354 #elif defined ANDROID_NDK
     354#elif defined __ANDROID__
    355355    JNIEnv *env;
    356356    jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2);
  • trunk/src/log.cpp

    r734 r939  
    1616#include <cstdio>
    1717
    18 #if defined ANDROID_NDK
     18#if defined __ANDROID__
    1919#   include <android/log.h>
    2020#else
     
    3535    va_list ap;
    3636    va_start(ap, fmt);
    37 #if defined ANDROID_NDK
     37#if defined __ANDROID__
    3838    __android_log_vprint(ANDROID_LOG_DEBUG, "LOL", fmt, ap);
    3939#else
     
    4848    va_list ap;
    4949    va_start(ap, fmt);
    50 #if defined ANDROID_NDK
     50#if defined __ANDROID__
    5151    __android_log_vprint(ANDROID_LOG_INFO, "LOL", fmt, ap);
    5252#else
     
    6161    va_list ap;
    6262    va_start(ap, fmt);
    63 #if defined ANDROID_NDK
     63#if defined __ANDROID__
    6464    __android_log_vprint(ANDROID_LOG_WARN, "LOL", fmt, ap);
    6565#else
     
    7474    va_list ap;
    7575    va_start(ap, fmt);
    76 #if defined ANDROID_NDK
     76#if defined __ANDROID__
    7777    __android_log_vprint(ANDROID_LOG_ERROR, "LOL", fmt, ap);
    7878#else
  • trunk/src/matrix.cpp

    r929 r939  
    8181}
    8282
     83#if !defined __ANDROID__
    8384template<> std::ostream &operator<<(std::ostream &stream, ivec2 const &v)
    8485{
     
    125126    return stream;
    126127}
     128#endif
    127129
    128130template<> mat4 mat4::ortho(float left, float right, float bottom,
  • trunk/src/matrix.h

    r929 r939  
    1818
    1919#include <cmath>
    20 #include <iostream>
     20#if !defined __ANDROID__
     21#   include <iostream>
     22#endif
    2123
    2224namespace lol
     
    127129        using namespace std; \
    128130        return sqrtf((float)sqlen()); \
    129     } \
    130     \
    131     template<typename U> \
    132     friend std::ostream &operator<<(std::ostream &stream, \
    133                                     Vec##elems<U> const &v);
     131    }
    134132
    135133template <typename T> struct Vec2;
     
    145143    OPERATORS(2)
    146144
     145#if !defined __ANDROID__
     146    template<typename U>
     147    friend std::ostream &operator<<(std::ostream &stream, Vec2<U> const &v);
     148#endif
     149
    147150    union { T x; T a; T i; };
    148151    union { T y; T b; T j; };
     
    159162
    160163    OPERATORS(3)
     164
     165#if !defined __ANDROID__
     166    template<typename U>
     167    friend std::ostream &operator<<(std::ostream &stream, Vec3<U> const &v);
     168#endif
    161169
    162170    union { T x; T a; T i; };
     
    175183
    176184    OPERATORS(4)
     185
     186#if !defined __ANDROID__
     187    template<typename U>
     188    friend std::ostream &operator<<(std::ostream &stream, Vec4<U> const &v);
     189#endif
    177190
    178191    union { T x; T a; T i; };
     
    238251    void printf() const;
    239252
     253#if !defined __ANDROID__
    240254    template<class U>
    241255    friend std::ostream &operator<<(std::ostream &stream, Mat4<U> const &m);
     256#endif
    242257
    243258    inline Mat4<T> operator +(Mat4<T> const val) const
  • trunk/src/platform.cpp

    r749 r939  
    2626int Platform::GetMouseCount()
    2727{
    28 #if defined ANDROID_NDK
     28#if defined __ANDROID__
    2929    /* Assume Android devices are touch devices that don't have a mouse */
    3030    return 0;
  • trunk/src/video.cpp

    r863 r939  
    3434private:
    3535    static mat4 proj_matrix, view_matrix;
    36 #if defined ANDROID_NDK || defined __CELLOS_LV2__
     36#if defined __ANDROID__ || defined __CELLOS_LV2__
    3737    static ivec2 saved_viewport;
    3838#endif
     
    4242mat4 VideoData::view_matrix;
    4343
    44 #if defined ANDROID_NDK || defined __CELLOS_LV2__
     44#if defined __ANDROID__ || defined __CELLOS_LV2__
    4545ivec2 VideoData::saved_viewport = 0;
    4646#endif
     
    6565    glViewport(0, 0, size.x, size.y);
    6666
    67 #if defined ANDROID_NDK || defined __CELLOS_LV2__
     67#if defined __ANDROID__ || defined __CELLOS_LV2__
    6868    VideoData::saved_viewport = size;
    6969#endif
     
    8686    float far = size.x + size.y;
    8787
    88 #if defined ANDROID_NDK
     88#if defined __ANDROID__
    8989    size = vec2(640.0f, 480.0f);
    9090#endif
     
    179179ivec2 Video::GetSize()
    180180{
    181 #if defined ANDROID_NDK
     181#if defined __ANDROID__
    182182    return VideoData::saved_viewport;
    183183#elif defined __CELLOS_LV2__
Note: See TracChangeset for help on using the changeset viewer.