Changeset 1222


Ignore:
Timestamp:
Apr 13, 2012, 8:31:49 AM (11 years ago)
Author:
sam
Message:

build: compilation fixes for errors introduced in the recent Direct3D
and Android changes.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/android/androidapp.cpp

    r1219 r1222  
    1212#   include "config.h"
    1313#endif
     14
     15#if defined __ANDROID__
    1416
    1517#include <jni.h>
     
    126128}
    127129
     130#endif /* __ANDROID__ */
     131
  • trunk/src/scene.cpp

    r1221 r1222  
    130130    if (data->nbufs > 0)
    131131        glDeleteBuffers(data->nbufs, data->bufs);
    132 #if defined HAVE_GL_2X && !defined __APPLE__
     132#   if defined HAVE_GL_2X && !defined __APPLE__
    133133    glDeleteVertexArrays(1, &data->vao);
    134 #endif
     134#   endif
    135135    free(data->bufs);
    136136#endif
     
    173173#if !defined _XBOX && !defined __CELLOS_LV2__ && !defined USE_D3D9
    174174        stdshader = Shader::Create(
    175 #if !defined HAVE_GLES_2X
     175#   if !defined HAVE_GLES_2X
    176176            "#version 130\n"
    177 #endif
     177#   endif
    178178            "\n"
    179 #if defined HAVE_GLES_2X
     179#   if defined HAVE_GLES_2X
    180180            "attribute vec3 in_Position;\n"
    181181            "attribute vec2 in_TexCoord;\n"
    182182            "varying vec2 pass_TexCoord;\n"
    183 #else
     183#   else
    184184            "in vec3 in_Position;\n"
    185185            "in vec2 in_TexCoord;\n"
    186 #endif
     186#   endif
    187187            "uniform mat4 proj_matrix;\n"
    188188            "uniform mat4 view_matrix;\n"
     
    193193            "    gl_Position = proj_matrix * view_matrix * model_matrix"
    194194            "                * vec4(in_Position, 1.0);\n"
    195 #if defined HAVE_GLES_2X
     195#   if defined HAVE_GLES_2X
    196196            "    pass_TexCoord = in_TexCoord;\n"
    197 #else
     197#   else
    198198            "    gl_TexCoord[0] = vec4(in_TexCoord, 0.0, 0.0);\n"
    199 #endif
     199#   endif
    200200            "}\n",
    201201
    202 #if !defined HAVE_GLES_2X
     202#   if !defined HAVE_GLES_2X
    203203            "#version 130\n"
    204 #else
     204#   else
    205205            "precision mediump float;\n"
    206 #endif
     206#   endif
    207207            "\n"
    208208            "uniform sampler2D in_Texture;\n"
    209 #if defined HAVE_GLES_2X
     209#   if defined HAVE_GLES_2X
    210210            "varying vec2 pass_TexCoord;\n"
    211 #endif
     211#   endif
    212212            "\n"
    213213            "void main()\n"
    214214            "{\n"
    215 #if defined HAVE_GLES_2X
     215#   if defined HAVE_GLES_2X
    216216            "    vec4 col = texture2D(in_Texture, pass_TexCoord);\n"
    217217            //"    vec4 col = vec4(0.5, 1.0, 0.0, 0.5);\n"
    218218            //"    vec4 col = vec4(pass_TexCoord * 4.0, 0.0, 0.25);\n"
    219 #else
     219#   else
    220220            "    vec4 col = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n"
    221 #endif
    222 #if 0
     221#   endif
     222#   if 0
    223223            "    float mul = 2.0;\n"
    224 #if 1
     224#       if 1
    225225            "    vec2 d1 = mod(vec2(gl_FragCoord), vec2(2.0, 2.0));\n"
    226226            "    float t1 = mod(3.0 * d1.x + 2.0 * d1.y, 4.0);\n"
     
    234234            "    t2 = t1;\n"
    235235            "    t3 = t1;\n"
    236 #else
     236#       else
    237237            "    float rand = sin(gl_FragCoord.x * 1.23456) * 123.456\n"
    238238            "               + cos(gl_FragCoord.y * 2.34567) * 789.012;\n"
     
    240240            "    float t2 = mod(sin(rand) * 27.13043, 1.0);\n"
    241241            "    float t3 = mod(sin(rand) * 37.13043, 1.0);\n"
    242 #endif
     242#       endif
    243243            "    float fracx = fract(col.x * mul);\n"
    244244            "    float fracy = fract(col.y * mul);\n"
     
    250250            "    col.y = (floor(col.y * mul) + fracy) / mul;\n"
    251251            "    col.z = (floor(col.z * mul) + fracz) / mul;\n"
    252 #endif
     252#   endif
    253253            "    gl_FragColor = col;\n"
    254254            "}\n");
     
    268268
    269269            "void main(float2 in_TexCoord : TEXCOORD0,"
    270 #if 0
     270#   if 0
    271271            "          float4 in_FragCoord : WPOS,"
    272 #endif
     272#   endif
    273273            "          uniform sampler2D tex,"
    274274            "          out float4 out_FragColor : COLOR)"
    275275            "{"
    276276            "    float4 col = tex2D(tex, in_TexCoord);"
    277 #if 0
     277#   if 0
    278278            "    float mul = 2.0;\n"
    279279            "    float t1, t2, t3;\n"
    280 #if 1
     280#       if 1
    281281            "    float dx1 = frac(in_FragCoord.x * 0.5) * 2.0;\n"
    282282            "    float dy1 = frac(in_FragCoord.y * 0.5) * 2.0;\n"
     
    291291            "    t2 = t1;\n"
    292292            "    t3 = t1;\n"
    293 #else
     293#       else
    294294            "    float rand = sin(in_FragCoord.x * 1.23456) * 123.456\n"
    295295            "               + cos(in_FragCoord.y * 2.34567) * 789.012;\n"
     
    297297            "    t2 = frac(sin(rand) * 27.13043);\n"
    298298            "    t3 = frac(sin(rand) * 37.13043);\n"
    299 #endif
     299#       endif
    300300            "    float fracx = frac(col.x * mul);\n"
    301301            "    float fracy = frac(col.y * mul);\n"
     
    307307            "    col.y = (floor(col.y * mul) + fracy) / mul;\n"
    308308            "    col.z = (floor(col.z * mul) + fracz) / mul;\n"
    309 #endif
     309#   endif
    310310            "    out_FragColor = col;"
    311311            "}");
     312#endif
    312313    }
    313314
     
    339340#if defined USE_D3D9 || defined _XBOX
    340341    /* Nothing? */
    341 #else
     342#elif !defined __CELLOS_LV2__
    342343    int attr_pos, attr_tex;
    343 #if !defined __CELLOS_LV2__
    344344    attr_pos = stdshader->GetAttribLocation("in_Position");
    345345    attr_tex = stdshader->GetAttribLocation("in_TexCoord");
    346 #endif
    347346#endif
    348347
     
    504503    glDisable(GL_BLEND);
    505504#endif
    506 #endif /* _XBOX || USE_D3D9 */
    507505}
    508506
Note: See TracChangeset for help on using the changeset viewer.