Changeset 2237
- Timestamp:
- Jan 21, 2013, 12:28:22 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r2175 r2237 406 406 407 407 408 dnl Extra libraries we may need408 dnl Extra libraries we may need 409 409 AC_SUBST(MATH_LIBS) 410 410 AC_SUBST(PAM_LIBS) 411 411 AC_SUBST(UTIL_LIBS) 412 412 413 dnl How to use the Lol Engine inside this tree 414 LOL_CFLAGS="$LOL_CFLAGS -I \$(top_srcdir)/src" 413 dnl How to use the Lol Engine inside this tree 414 LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/src" 415 LOL_CFLAGS="$LOL_CFLAGS -DLOL_SOURCE_SUBDIR=\\\"\$(subdir)\\\"" 415 416 LOL_CFLAGS="$LOL_CFLAGS $SDL_CFLAGS $GL_CFLAGS $EGL_CFLAGS $LIBPNG_CFLAGS" 416 417 LOL_LIBS="$LOL_LIBS $SDL_LIBS $GL_LIBS $EGL_LIBS $LIBPNG_LIBS $D3D_LIBS" 417 418 419 dnl Extra flags 418 420 AC_SUBST(LOL_CFLAGS) 419 421 AC_SUBST(LOL_LIBS) -
trunk/src/Makefile.am
r2226 r2237 23 23 lol/math/math.h \ 24 24 lol/math/geometry.h \ 25 lol/sys/init.h \ 25 26 lol/image/color.h \ 26 27 \ … … 72 73 \ 73 74 mesh/mesh.cpp mesh/mesh.h \ 75 \ 76 sys/init.cpp \ 74 77 \ 75 78 image/image.cpp image/image.h image/image-private.h \ -
trunk/src/core.h
r2226 r2237 89 89 #include <lol/math/geometry.h> 90 90 91 #include <lol/sys/init.h> 92 91 93 #include <lol/image/color.h> 92 94 -
trunk/src/image/codec/gdiplus-image.cpp
r2183 r2237 2 2 // Lol Engine 3 3 // 4 // Copyright: (c) 2010-201 1Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 63 63 } 64 64 65 String fullpath = String(System::GetDataDir()) + String(path); 65 66 size_t len; 66 len = mbstowcs(NULL, path, 0);67 len = mbstowcs(NULL, &fullpath[0], 0); 67 68 wchar_t *wpath = new wchar_t[len + 1]; 68 if (mbstowcs(wpath, path, len + 1) == (size_t)-1)69 if (mbstowcs(wpath, &fullpath[0], len + 1) == (size_t)-1) 69 70 { 70 71 #if !LOL_RELEASE 71 Log::Error("invalid image name %s\n", path);72 Log::Error("invalid image name %s\n", &fullpath[0]); 72 73 #endif 73 74 delete[] wpath; … … 77 78 bitmap = NULL; 78 79 status = Gdiplus::Ok; 79 for (wchar_t const *wname = wpath; *wname; wname++) 80 bitmap = Gdiplus::Bitmap::FromFile(wpath, 0); 81 if (bitmap) 80 82 { 81 bitmap = Gdiplus::Bitmap::FromFile(wname, 0);82 if ( bitmap)83 status = bitmap->GetLastStatus(); 84 if (status != Gdiplus::Ok) 83 85 { 84 status = bitmap->GetLastStatus();85 if (status == Gdiplus::Ok)86 break;87 86 #if !LOL_RELEASE 88 87 if (status != Gdiplus::InvalidParameter) … … 90 89 #endif 91 90 delete bitmap; 91 bitmap = NULL; 92 92 } 93 93 } -
trunk/src/image/codec/sdl-image.cpp
r2183 r2237 2 2 // Lol Engine 3 3 // 4 // Copyright: (c) 2010-201 1Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 49 49 50 50 private: 51 SDL_Surface * img;51 SDL_Surface *m_img; 52 52 }; 53 53 … … 58 58 bool SdlImageData::Open(char const *path) 59 59 { 60 for (char const *name = path; *name; name++) 61 if ((img = IMG_Load(name))) 62 break; 63 64 if (!img) 60 String fullpath = String(System::GetDataDir()) + String(path); 61 m_img = IMG_Load(&fullpath[0]); 62 if (!m_img) 65 63 { 66 64 #if !LOL_RELEASE 67 Log::Error("could not load %s\n", path);65 Log::Error("could not load %s\n", &fullpath[0]); 68 66 #endif 69 67 return false; 70 68 } 71 69 72 size = ivec2( img->w,img->h);70 size = ivec2(m_img->w, m_img->h); 73 71 74 if ( img->format->BytesPerPixel != 4)72 if (m_img->format->BytesPerPixel != 4) 75 73 { 76 74 SDL_Surface *tmp = Create32BppSurface(size); 77 SDL_BlitSurface( img, NULL, tmp, NULL);78 SDL_FreeSurface( img);79 img = tmp;75 SDL_BlitSurface(m_img, NULL, tmp, NULL); 76 SDL_FreeSurface(m_img); 77 m_img = tmp; 80 78 } 81 79 82 format = img->format->Amask ? Image::FORMAT_RGBA : Image::FORMAT_RGB;80 format = m_img->format->Amask ? Image::FORMAT_RGBA : Image::FORMAT_RGB; 83 81 84 82 return true; … … 87 85 bool SdlImageData::Close() 88 86 { 89 SDL_FreeSurface( img);87 SDL_FreeSurface(m_img); 90 88 91 89 return true; … … 94 92 void * SdlImageData::GetData() const 95 93 { 96 return img->pixels;94 return m_img->pixels; 97 95 } 98 96 -
trunk/src/sample.cpp
r2216 r2237 64 64 65 65 #if defined USE_SDL_MIXER 66 data->chunk = Mix_LoadWAV(path); 66 String fullpath = String(System::GetDataDir()) + String(path); 67 data->chunk = Mix_LoadWAV(&fullpath[0]); 67 68 if (!data->chunk) 68 69 { 69 70 #if !LOL_RELEASE 70 Log::Error("could not load %s\n", path);71 Log::Error("could not load %s\n", &fullpath[0]); 71 72 #endif 72 73 SDL_Quit(); -
trunk/test/BtPhysTest.cpp
r2216 r2237 3 3 // 4 4 // Copyright: (c) 2009-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com> 5 // (c) 2012 Sam Hocevar <sam@hocevar.net>5 // (c) 2012-2013 Sam Hocevar <sam@hocevar.net> 6 6 // 7 7 … … 476 476 int main(int argc, char **argv) 477 477 { 478 System::Init(argc, argv); 479 478 480 Application app("BtPhysTest", ivec2(1280, 720), 60.0f); 479 481 -
trunk/tools/neercs/neercs.cpp
r2000 r2237 2 2 // Neercs 3 3 // 4 // Copyright: (c) 2012 Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2012-2013 Sam Hocevar <sam@hocevar.net> 5 5 // 6 6 … … 71 71 int main(int argc, char **argv) 72 72 { 73 System::Init(argc, argv); 74 73 75 Application app("Neercs", ivec2(800, 600), 60.0f); 74 76 -
trunk/tutorial/01_triangle.cpp
r2183 r2237 2 2 // Lol Engine - Triangle tutorial 3 3 // 4 // Copyright: (c) 2012 Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2012-2013 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 75 75 int main(int argc, char **argv) 76 76 { 77 System::Init(argc, argv); 78 77 79 Application app("Tutorial 1: Triangle", ivec2(640, 480), 60.0f); 78 80 -
trunk/tutorial/02_cube.cpp
r2216 r2237 136 136 int main(int argc, char **argv) 137 137 { 138 System::Init(argc, argv); 139 138 140 Application app("Tutorial 2: Cube", ivec2(640, 480), 60.0f); 139 141 -
trunk/tutorial/03_noise.cpp
r2183 r2237 2 2 // Lol Engine - Noise tutorial 3 3 // 4 // Copyright: (c) 2012 Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2012-2013 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 86 86 int main(int argc, char **argv) 87 87 { 88 System::Init(argc, argv); 89 88 90 Application app("Tutorial 3: Noise", ivec2(1280, 720), 60.0f); 89 91 -
trunk/tutorial/04_texture.cpp
r2197 r2237 2 2 // Lol Engine - Graphing tutorial 3 3 // 4 // Copyright: (c) 2012 Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2012-2013 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 116 116 int main(int argc, char **argv) 117 117 { 118 System::Init(argc, argv); 119 118 120 Application app("Tutorial 4: Texture", ivec2(640, 480), 60.0f); 119 121 -
trunk/tutorial/05_easymesh.cpp
r2226 r2237 30 30 m_gears.Push(EasyMesh(), mat4(1.0f), 180.0f / 18); 31 31 32 m_gears[0].m1.Compile("[sc#00f ab 8 1 8 ty -.25]\ 33 [sc#f9f scb#f9f acg 12 10 5 5 20 20 5 5 0.1 0 s .1 .1 .1 ty -.1 csgu]\ 34 [sc#fff scb#000 acg 12 10 10 10 20 20 5 5 0.1 0 s .05 .05 .05 tx -1.5 ty .3 csgu]\ 35 [sc#00f ab 5 3 9 tx 2.5 csgs]\ 36 [[ sc#fff ab 3 1.4 2 tx -2 tz -2 \ 37 [sc#fff ab 2.1 .7 1.1 ty .5 tx -1.4 tz -1.4 csgs] mz] csgu] \ 38 "); 32 m_gears[0].m1.Compile("[sc#00f ab 8 1 8 ty -.25]" 33 "[sc#f9f scb#f9f acg 12 10 5 5 20 20 5 5 0.1 0 s .1 .1 .1 ty -.1 csgu]" 34 "[sc#fff scb#000 acg 12 10 10 10 20 20 5 5 0.1 0 s .05 .05 .05 tx -1.5 ty .3 csgu]" 35 "[sc#00f ab 5 3 9 tx 2.5 csgs]" 36 "[[ sc#fff ab 3 1.4 2 tx -2 tz -2 " 37 "[sc#fff ab 2.1 .7 1.1 ty .5 tx -1.4 tz -1.4 csgs] mz] csgu]"); 39 38 //m_gears[0].m1.Compile("[sc#f9f scb#f9f acg 12 10 5 5 20 20 5 5 0.1 0 s .1 .1 .1 [sc#00f ab 3 1 2 ty .25 tx 1 csgs]]"); 40 39 m_gears[1].m1.Compile("sc#ff9 scb#ff9 acg 54 10 95 95 90 90 -5 -5 0.1 0 s .1 .1 .1"); … … 122 121 int main(int argc, char **argv) 123 122 { 123 System::Init(argc, argv); 124 124 125 Application app("Tutorial 5: EasyMesh", ivec2(960, 600), 60.0f); 125 126 new EasyMeshTutorial(); -
trunk/tutorial/08_fbo.cpp
r2183 r2237 2 2 // Lol Engine - Framebuffer Object tutorial 3 3 // 4 // Copyright: (c) 2012 Sam Hocevar <sam@hocevar.net>4 // Copyright: (c) 2012-2013 Sam Hocevar <sam@hocevar.net> 5 5 // This program is free software; you can redistribute it and/or 6 6 // modify it under the terms of the Do What The Fuck You Want To … … 139 139 int main(int argc, char **argv) 140 140 { 141 System::Init(argc, argv); 142 141 143 Application app("Tutorial 08: Framebuffer Object", ivec2(640, 480), 60.0f); 142 144 -
trunk/tutorial/11_fractal.cpp
r2216 r2237 554 554 ivec2 window_size(640, 480); 555 555 556 System::Init(argc, argv); 556 557 Application app("Tutorial 3: Fractal", window_size, 60.0f); 557 558
Note: See TracChangeset
for help on using the changeset viewer.