Changeset 939
- Timestamp:
- Sep 10, 2011, 2:42:13 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/monsterz/android/jni/Android.mk
r865 r939 8 8 LOCAL_MODULE := lolengine 9 9 10 LOCAL_CFLAGS := -DANDROID_NDK \ 11 -DDISABLE_IMPORTGL \ 10 LOCAL_CFLAGS := -DDISABLE_IMPORTGL \ 12 11 -DHAVE_GLES_2X \ 13 12 -I$(LOCAL_PATH)/$(LOL_SRC) \ -
trunk/src/debug/quad.cpp
r907 r939 66 66 int initialised; 67 67 float time; 68 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK68 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 69 69 GLuint array[NUM_ARRAYS]; 70 70 #endif … … 154 154 if (!data->initialised && !IsDestroying()) 155 155 { 156 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK156 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 157 157 glGenVertexArrays(NUM_ARRAYS, data->array); 158 158 #endif … … 184 184 else if (data->initialised && IsDestroying()) 185 185 { 186 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK186 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 187 187 glDeleteVertexArrays(NUM_ARRAYS, data->array); 188 188 #endif … … 237 237 238 238 /* Cheap iterators */ 239 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK239 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 240 240 GLuint *array = data->array; 241 241 #endif … … 495 495 * Renders an orange square. 496 496 */ 497 #if !defined ANDROID_NDK&& !defined __APPLE__497 #if !defined __ANDROID__ && !defined __APPLE__ 498 498 glColor4f(orange.x, orange.y, orange.z, orange.w); 499 499 glEnableClientState(GL_VERTEX_ARRAY); … … 513 513 * Renders a green sine wave made of 1-pixel points. 514 514 */ 515 #if !defined ANDROID_NDK&& !defined __APPLE__515 #if !defined __ANDROID__ && !defined __APPLE__ 516 516 glColor4f(0.0f, 1.0f, 0.0f, 1.0f); 517 517 glPointSize(1.0f); … … 532 532 * Renders a multicoloured square with varying colors. 533 533 */ 534 #if !defined ANDROID_NDK&& !defined __APPLE__534 #if !defined __ANDROID__ && !defined __APPLE__ 535 535 glEnableClientState(GL_VERTEX_ARRAY); 536 536 glEnableClientState(GL_COLOR_ARRAY); … … 553 553 * animated distorted checkerboard. 554 554 */ 555 #if !defined ANDROID_NDK&& !defined __APPLE__555 #if !defined __ANDROID__ && !defined __APPLE__ 556 556 glEnable(GL_TEXTURE_2D); 557 557 glBindTexture(GL_TEXTURE_2D, data->texture[0]); … … 581 581 * Renders an orange square. 582 582 */ 583 #if !defined ANDROID_NDK&& !defined __APPLE__583 #if !defined __ANDROID__ && !defined __APPLE__ 584 584 if (!shader[0]) 585 585 #if !defined __CELLOS_LV2__ … … 627 627 * Renders an orange square. 628 628 */ 629 #if !defined ANDROID_NDK&& !defined __APPLE__629 #if !defined __ANDROID__ && !defined __APPLE__ 630 630 if (!shader[0]) 631 631 { … … 680 680 * Renders a static, coloured and tiled pattern. 681 681 */ 682 #if !defined ANDROID_NDK&& !defined __APPLE__682 #if !defined __ANDROID__ && !defined __APPLE__ 683 683 if (!shader[0]) 684 684 #if !defined __CELLOS_LV2__ … … 733 733 * Renders a multicoloured square with varying colors. 734 734 */ 735 #if !defined ANDROID_NDK&& !defined __APPLE__735 #if !defined __ANDROID__ && !defined __APPLE__ 736 736 if (!shader[0]) 737 737 { … … 797 797 * Renders an antialiased green sine wave made of 1-pixel points. 798 798 */ 799 #if !defined ANDROID_NDK&& !defined __APPLE__ && !defined __CELLOS_LV2__799 #if !defined __ANDROID__ && !defined __APPLE__ && !defined __CELLOS_LV2__ 800 800 if (!shader[0]) 801 801 shader[0] = Shader::Create( … … 843 843 * animated distorted checkerboard. 844 844 */ 845 #if !defined ANDROID_NDK&& !defined __APPLE__845 #if !defined __ANDROID__ && !defined __APPLE__ 846 846 if (!shader[0]) 847 847 #if !defined __CELLOS_LV2__ … … 916 916 * animated distorted checkerboard. 917 917 */ 918 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK918 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 919 919 if (!shader[0]) 920 920 { … … 986 986 * animated distorted checkerboard. 987 987 */ 988 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK988 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 989 989 if (!shader[0]) 990 990 { … … 1051 1051 1052 1052 /* Check that we didn't overflow our list */ 1053 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK1053 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 1054 1054 if (array > data->array + NUM_ARRAYS) 1055 1055 Log::Error("too many arrays used\n"); … … 1074 1074 #endif 1075 1075 1076 #if !defined ANDROID_NDK&& !defined __APPLE__1076 #if !defined __ANDROID__ && !defined __APPLE__ 1077 1077 glColor4f(1.0f, 1.0f, 1.0f, 1.0f); 1078 1078 #endif … … 1083 1083 glClientActiveTexture(GL_TEXTURE0); 1084 1084 #endif 1085 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK1085 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 1086 1086 glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE); 1087 1087 #endif … … 1089 1089 1090 1090 glDisable(GL_BLEND); 1091 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK1091 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 1092 1092 glDisable(GL_POINT_SPRITE); 1093 1093 #endif … … 1101 1101 #endif 1102 1102 1103 #if !defined __CELLOS_LV2__ && !defined ANDROID_NDK1103 #if !defined __CELLOS_LV2__ && !defined __ANDROID__ 1104 1104 glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); 1105 1105 #endif -
trunk/src/image/image.cpp
r864 r939 20 20 # include <SDL.h> 21 21 # include <SDL_image.h> 22 #elif defined ANDROID_NDK22 #elif defined __ANDROID__ 23 23 # include <jni.h> 24 24 # include <android/log.h> … … 35 35 { 36 36 37 #if defined ANDROID_NDK37 #if defined __ANDROID__ 38 38 extern JavaVM *g_vm; 39 39 extern jobject g_activity; … … 56 56 #elif defined USE_SDL 57 57 SDL_Surface *img; 58 #elif defined ANDROID_NDK58 #elif defined __ANDROID__ 59 59 jobject bmp; 60 60 jintArray array; … … 126 126 data->size = ivec2(data->img->w, data->img->h); 127 127 data->format = data->img->format->Amask ? FORMAT_RGBA : FORMAT_RGB; 128 #elif defined ANDROID_NDK128 #elif defined __ANDROID__ 129 129 JNIEnv *env; 130 130 jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); … … 337 337 #elif defined USE_SDL 338 338 return data->img->pixels; 339 #elif defined ANDROID_NDK339 #elif defined __ANDROID__ 340 340 return data->pixels; 341 341 #elif defined __CELLOS_LV2__ … … 352 352 #elif defined USE_SDL 353 353 SDL_FreeSurface(data->img); 354 #elif defined ANDROID_NDK354 #elif defined __ANDROID__ 355 355 JNIEnv *env; 356 356 jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); -
trunk/src/log.cpp
r734 r939 16 16 #include <cstdio> 17 17 18 #if defined ANDROID_NDK18 #if defined __ANDROID__ 19 19 # include <android/log.h> 20 20 #else … … 35 35 va_list ap; 36 36 va_start(ap, fmt); 37 #if defined ANDROID_NDK37 #if defined __ANDROID__ 38 38 __android_log_vprint(ANDROID_LOG_DEBUG, "LOL", fmt, ap); 39 39 #else … … 48 48 va_list ap; 49 49 va_start(ap, fmt); 50 #if defined ANDROID_NDK50 #if defined __ANDROID__ 51 51 __android_log_vprint(ANDROID_LOG_INFO, "LOL", fmt, ap); 52 52 #else … … 61 61 va_list ap; 62 62 va_start(ap, fmt); 63 #if defined ANDROID_NDK63 #if defined __ANDROID__ 64 64 __android_log_vprint(ANDROID_LOG_WARN, "LOL", fmt, ap); 65 65 #else … … 74 74 va_list ap; 75 75 va_start(ap, fmt); 76 #if defined ANDROID_NDK76 #if defined __ANDROID__ 77 77 __android_log_vprint(ANDROID_LOG_ERROR, "LOL", fmt, ap); 78 78 #else -
trunk/src/matrix.cpp
r929 r939 81 81 } 82 82 83 #if !defined __ANDROID__ 83 84 template<> std::ostream &operator<<(std::ostream &stream, ivec2 const &v) 84 85 { … … 125 126 return stream; 126 127 } 128 #endif 127 129 128 130 template<> mat4 mat4::ortho(float left, float right, float bottom, -
trunk/src/matrix.h
r929 r939 18 18 19 19 #include <cmath> 20 #include <iostream> 20 #if !defined __ANDROID__ 21 # include <iostream> 22 #endif 21 23 22 24 namespace lol … … 127 129 using namespace std; \ 128 130 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 } 134 132 135 133 template <typename T> struct Vec2; … … 145 143 OPERATORS(2) 146 144 145 #if !defined __ANDROID__ 146 template<typename U> 147 friend std::ostream &operator<<(std::ostream &stream, Vec2<U> const &v); 148 #endif 149 147 150 union { T x; T a; T i; }; 148 151 union { T y; T b; T j; }; … … 159 162 160 163 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 161 169 162 170 union { T x; T a; T i; }; … … 175 183 176 184 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 177 190 178 191 union { T x; T a; T i; }; … … 238 251 void printf() const; 239 252 253 #if !defined __ANDROID__ 240 254 template<class U> 241 255 friend std::ostream &operator<<(std::ostream &stream, Mat4<U> const &m); 256 #endif 242 257 243 258 inline Mat4<T> operator +(Mat4<T> const val) const -
trunk/src/platform.cpp
r749 r939 26 26 int Platform::GetMouseCount() 27 27 { 28 #if defined ANDROID_NDK28 #if defined __ANDROID__ 29 29 /* Assume Android devices are touch devices that don't have a mouse */ 30 30 return 0; -
trunk/src/video.cpp
r863 r939 34 34 private: 35 35 static mat4 proj_matrix, view_matrix; 36 #if defined ANDROID_NDK|| defined __CELLOS_LV2__36 #if defined __ANDROID__ || defined __CELLOS_LV2__ 37 37 static ivec2 saved_viewport; 38 38 #endif … … 42 42 mat4 VideoData::view_matrix; 43 43 44 #if defined ANDROID_NDK|| defined __CELLOS_LV2__44 #if defined __ANDROID__ || defined __CELLOS_LV2__ 45 45 ivec2 VideoData::saved_viewport = 0; 46 46 #endif … … 65 65 glViewport(0, 0, size.x, size.y); 66 66 67 #if defined ANDROID_NDK|| defined __CELLOS_LV2__67 #if defined __ANDROID__ || defined __CELLOS_LV2__ 68 68 VideoData::saved_viewport = size; 69 69 #endif … … 86 86 float far = size.x + size.y; 87 87 88 #if defined ANDROID_NDK88 #if defined __ANDROID__ 89 89 size = vec2(640.0f, 480.0f); 90 90 #endif … … 179 179 ivec2 Video::GetSize() 180 180 { 181 #if defined ANDROID_NDK181 #if defined __ANDROID__ 182 182 return VideoData::saved_viewport; 183 183 #elif defined __CELLOS_LV2__
Note: See TracChangeset
for help on using the changeset viewer.