Changeset 1084
- Timestamp:
- Nov 21, 2011, 1:49:53 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/build/lol-build
r1082 r1084 16 16 # - linux-i386 17 17 # - linux-amd64 18 # - nacl-i386 18 19 # - nacl-amd64 19 20 # - ios-arm … … 120 121 android update project --path . 121 122 ;; 123 nacl-i386) 124 ./configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=none LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" 125 ;; 122 126 nacl-amd64) 123 # no need for "-u _ZN2pp12CreateModuleEv" but it could be helpful 124 ./configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.nexe --host=none LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp" 127 ./configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.64.nexe --host=none LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" 125 128 ;; 126 129 ps3-ppu) -
trunk/configure.ac
r1082 r1084 191 191 AC_CHECK_FUNCS(glBegin) 192 192 LIBS="${save_LIBS}" 193 193 194 194 195 dnl Use SDL? (always required on Linux or Win32) … … 253 254 254 255 256 dnl Use NativeClient? 257 ac_cv_my_have_nacl="no" 258 AC_LANG_PUSH(C++) 259 AC_CHECK_HEADERS(ppapi/cpp/instance.h, [ac_cv_my_have_nacl="yes"]) 260 AC_LANG_POP(C++) 261 AM_CONDITIONAL(USE_NACL, test "${ac_cv_my_have_nacl}" != "no") 262 255 263 dnl Use EGL? 256 264 ac_cv_my_have_egl="no" -
trunk/src/Makefile.am
r1082 r1084 44 44 platform/sdl/sdlinput.cpp platform/sdl/sdlinput.h 45 45 46 if USE_NACL 46 47 nacl_sources = \ 47 platform/nacl/naclapp.cpp platform/nacl/naclapp.h 48 platform/nacl/naclapp.cpp platform/nacl/naclapp.h \ 49 platform/nacl/nacl_instance.cpp platform/nacl/nacl_instance.h \ 50 platform/nacl/nacl_module.cpp \ 51 platform/nacl/opengl_context.cpp platform/nacl/opengl_context.h \ 52 platform/nacl/opengl_context_ptrs.h 53 endif 48 54 49 55 if HAVE_PS3 -
trunk/src/platform/nacl/naclapp.cpp
r1082 r1084 14 14 15 15 #if defined __native_client__ 16 # include "ppapi/cpp/instance.h"17 # include "ppapi/cpp/module.h"18 # include "ppapi/cpp/var.h"16 # include <ppapi/cpp/instance.h> 17 # include <ppapi/cpp/module.h> 18 # include <ppapi/cpp/var.h> 19 19 #endif 20 20 -
trunk/test/tutorial/tut01.cpp
r1050 r1084 22 22 #if USE_SDL && defined __APPLE__ 23 23 # include <SDL_main.h> 24 #endif 25 26 #if defined __native_client__ 27 # define main old_main 24 28 #endif 25 29 -
trunk/test/tutorial/tut03.cpp
r1082 r1084 60 60 /* Window size decides the world aspect ratio. For instance, 640×480 61 61 * will be mapped to (-0.66,-0.5) - (0.66,0.5). */ 62 #if !defined __native_client__ 62 63 m_window_size = Video::GetSize(); 64 #else 65 /* FIXME: it's illegal to call this on the game thread! */ 66 m_window_size = ivec2(640, 480); 67 #endif 63 68 if (m_window_size.y < m_window_size.x) 64 69 m_window2world = 0.5 / m_window_size.y; … … 77 82 } 78 83 m_center = -0.75; 84 #if defined __CELLOS_LV2__ || defined __native_client__ 85 m_zoom_speed = -0.0025; 86 #else 79 87 m_zoom_speed = 0.0; 88 #endif 80 89 m_radius = 5.0; 81 90 m_ready = false; … … 101 110 uint8_t green = g * 255.99f; 102 111 uint8_t blue = b * 255.99f; 103 m_palette[i] = u8vec4(blue, green, red, 0); 104 } 105 112 #if defined __native_client__ 113 m_palette[i] = u8vec4(red, green, blue, 255); 114 #else 115 m_palette[i] = u8vec4(blue, green, red, 255); 116 #endif 117 } 118 119 #if !defined __native_client__ 106 120 m_centertext = new Text(NULL, "gfx/font/ascii.png"); 107 121 m_centertext->SetPos(ivec3(5, m_window_size.y - 15, 1)); … … 115 129 m_zoomtext->SetPos(ivec3(5, m_window_size.y - 43, 1)); 116 130 Ticker::Ref(m_zoomtext); 131 #endif 117 132 118 133 position = ivec3(0, 0, 0); … … 125 140 { 126 141 Input::UntrackMouse(this); 142 #if !defined __native_client__ 127 143 Ticker::Unref(m_centertext); 128 144 Ticker::Unref(m_mousetext); 129 145 Ticker::Unref(m_zoomtext); 146 #endif 130 147 delete m_pixels; 131 148 delete m_tmppixels; … … 159 176 160 177 ivec3 buttons = Input::GetMouseButtons(); 161 #ifdef __CELLOS_LV2__ 162 m_zoom_speed = 0.0005; 163 #else 178 #if !defined __CELLOS_LV2__ && !defined __native_client__ 164 179 if ((buttons[0] || buttons[2]) && mousepos.x != -1) 165 180 { … … 183 198 double zoom = pow(2.0, deltams * m_zoom_speed); 184 199 if (m_radius * zoom > 8.0) 200 { 201 m_zoom_speed *= -1.0; 185 202 zoom = 8.0 / m_radius; 203 } 186 204 else if (m_radius * zoom < 1e-14) 205 { 206 m_zoom_speed *= -1.0; 187 207 zoom = 1e-14 / m_radius; 208 } 188 209 m_radius *= zoom; 189 #if def __CELLOS_LV2__190 m_center = f64cmplx(-.22815528839841, -1.11514249704382);210 #if defined __CELLOS_LV2__ || defined __native_client__ 211 //m_center = f64cmplx(-.22815528839841, -1.11514249704382); 191 212 //m_center = f64cmplx(0.001643721971153, 0.822467633298876); 213 m_center = f64cmplx(-0.65823419062254, .50221777363480); 192 214 #else 193 215 m_center = (m_center - worldmouse) * zoom + worldmouse; … … 231 253 } 232 254 255 #if !defined __native_client__ 233 256 char buf[128]; 234 257 sprintf(buf, "center: %+16.14f%+16.14fi", m_center.x, m_center.y); … … 238 261 sprintf(buf, " zoom: %g", 1.0 / m_radius); 239 262 m_zoomtext->SetText(buf); 263 #endif 240 264 241 265 u8vec4 *m_pixelstart = m_pixels + m_size.x * m_size.y / 4 * m_frame; … … 285 309 else 286 310 { 287 *m_pixelstart++ = u8vec4(0, 0, 0, 0);311 *m_pixelstart++ = u8vec4(0, 0, 0, 255); 288 312 } 289 313 } … … 335 359 m_shader = Shader::Create( 336 360 #if !defined __CELLOS_LV2__ 361 #if !defined HAVE_GLES_2X 337 362 "#version 120\n" 338 "attribute vec2 in_TexCoord;\n" 363 #else 364 "precision highp float;" 365 #endif 366 "" 367 #if defined HAVE_GLES_2X 368 "varying vec2 pass_TexCoord;" 369 #endif 370 "attribute vec2 in_TexCoord;" 339 371 "attribute vec2 in_Vertex;" 340 372 "void main(void) {" 341 373 " gl_Position = vec4(in_Vertex, 0.0, 1.0);" 342 " gl_TexCoord[0] = vec4(in_TexCoord, 0.0, 0.0);\n" 374 #if defined HAVE_GLES_2X 375 " pass_TexCoord = in_TexCoord;" 376 #else 377 " gl_TexCoord[0] = vec4(in_TexCoord, 0.0, 0.0);" 378 #endif 343 379 "}", 344 380 381 #if !defined HAVE_GLES_2X 345 382 "#version 120\n" 346 "" 383 #else 384 "precision highp float;" 385 #endif 386 "" 387 #if defined HAVE_GLES_2X 388 "varying vec2 pass_TexCoord;" 389 #endif 347 390 "uniform vec4 in_TexelSize;" 348 391 "uniform mat4 in_ZoomSettings;" … … 412 455 "" 413 456 "void main(void) {" 457 #if defined HAVE_GLES_2X 458 " vec2 coord = pass_TexCoord;" 459 #else 414 460 " vec2 coord = gl_TexCoord[0].xy;" 461 #endif 415 462 /* Slightly shift our pixel so that it does not lie at 416 463 * an exact texel boundary. This would lead to visual … … 514 561 } 515 562 563 #if !defined HAVE_GLES_2X 516 564 glEnable(GL_TEXTURE_2D); 565 #endif 517 566 glBindTexture(GL_TEXTURE_2D, m_texid); 518 567 … … 599 648 600 649 /* Debug information */ 650 #if !defined __native_client__ 601 651 Text *m_centertext, *m_mousetext, *m_zoomtext; 652 #endif 602 653 }; 603 654
Note: See TracChangeset
for help on using the changeset viewer.