├── README.md ├── debian ├── copyright ├── compat ├── source │ └── format ├── patches │ └── series ├── rules ├── files ├── renderer.postrm.debhelper ├── renderer.postinst.debhelper ├── changelog ├── renderer.substvars ├── renderer.debhelper.log └── control ├── lib3ds-1.3.0 ├── NEWS ├── TODO ├── AUTHORS ├── README ├── m4 │ └── ltversion.m4 ├── msvc8 │ ├── lib3ds.rc │ └── lib3ds.sln ├── tools │ ├── Makefile.am │ ├── 3dsdump.1 │ └── 3dsdump.1.in ├── lib3ds │ ├── ease.h │ ├── chunktable.sed │ ├── shadow.h │ ├── ease.c │ ├── camera.h │ ├── tcb.h │ ├── Makefile.am │ ├── types.txt │ ├── background.h │ ├── light.h │ ├── vector.h │ ├── quat.h │ ├── atmosphere.h │ ├── matrix.h │ └── tcb.c ├── configure.ac ├── lib3ds.spec.in ├── lib3ds-config.in ├── 3ds-utils.spec.in ├── Makefile.am ├── lib3ds-config.1 ├── lib3ds-config.1.in └── lib3ds.m4 ├── 3D-Objects ├── .gitignore ├── legocar.3ds ├── chessboard.tri ├── trainColor.tri ├── single.ply ├── square.ply ├── box-and-plane.ply └── platform.ply ├── bootstrap ├── contrib ├── onScreenKeys.txt ├── bits ├── README ├── build.using.IntelCC.and.TBB ├── build.using.IntelCC.and.OpenMP ├── keys.txt └── createHelpTexture.sh ├── AUTHORS ├── src ├── cppcheck.sh ├── MLAA.h ├── Wu.h ├── sdl12compat_workaround.h ├── 3d.h ├── Clock.h ├── Exceptions.h ├── Keyboard.h ├── Makefile.am ├── Defines.h ├── Camera.cc ├── Camera.h ├── BVH.h ├── Base3d.h ├── Light.h ├── Base3d.cc ├── Algebra.h ├── Scene.h └── config.h.in ├── VisualC └── Renderer-2.x │ ├── SDL.dll │ ├── tbb.dll │ ├── lib3ds-1_3.dll │ ├── libtbb │ ├── tbb.lib │ └── tbb │ │ ├── index.html │ │ ├── compat │ │ └── ppl.h │ │ ├── machine │ │ ├── ibm_aix51.h │ │ └── linux_common.h │ │ ├── aligned_space.h │ │ ├── null_mutex.h │ │ ├── null_rw_mutex.h │ │ ├── tbbmalloc_proxy.h │ │ ├── task_scheduler_observer.h │ │ ├── tbb.h │ │ ├── combinable.h │ │ ├── parallel_for_each.h │ │ ├── _tbb_windef.h │ │ └── blocked_range2d.h │ ├── libSDL │ ├── lib │ │ ├── SDL.lib │ │ └── SDLmain.lib │ └── include │ │ ├── SDL_name.h │ │ ├── SDL_copying.h │ │ ├── SDL_getenv.h │ │ ├── SDL_types.h │ │ ├── SDL_byteorder.h │ │ ├── SDL_config.h │ │ ├── close_code.h │ │ ├── SDL_error.h │ │ ├── SDL_active.h │ │ ├── SDL_quit.h │ │ ├── SDL_config_minimal.h │ │ ├── SDL_config_amiga.h │ │ ├── SDL_cpuinfo.h │ │ ├── SDL_version.h │ │ ├── SDL_loadso.h │ │ ├── SDL_platform.h │ │ ├── SDL_config_dreamcast.h │ │ ├── SDL_config_macos.h │ │ ├── SDL_main.h │ │ ├── SDL_config_nds.h │ │ ├── SDL.h │ │ └── SDL_config_symbian.h │ ├── lib3ds │ └── lib │ │ └── lib3ds-1_3.lib │ ├── config.h │ ├── ReadMe.txt │ ├── Renderer-2.x.sln │ └── Renderer-2.x.vcproj.SEMANTIX.ttsiodras.user ├── .gitattributes ├── acinclude.m4 ├── NEWS ├── .gitignore └── ac-macros ├── ax_openmp.m4 ├── ax_check_linker_flags.m4 └── ax_check_compiler_flags.m4 /README.md: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/TODO: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /3D-Objects/.gitignore: -------------------------------------------------------------------------------- 1 | *.bvh 2 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | autoreconf 2 | automake 3 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /contrib/onScreenKeys.txt: -------------------------------------------------------------------------------- 1 | Press H for help 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Thanassis Tsiodras 2 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- 1 | create_installable_binary 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ 4 | -------------------------------------------------------------------------------- /contrib/bits: -------------------------------------------------------------------------------- 1 | /usr/include/c++/4.7.0/i686-pc-linux-gnu/bits -------------------------------------------------------------------------------- /debian/files: -------------------------------------------------------------------------------- 1 | renderer_2.3a-1_i386.deb misc optional 2 | -------------------------------------------------------------------------------- /src/cppcheck.sh: -------------------------------------------------------------------------------- 1 | cppcheck --enable=all -I ../lib3ds-1.3.0/ *.cc 2 | -------------------------------------------------------------------------------- /contrib/README: -------------------------------------------------------------------------------- 1 | Two build scripts for compiling with the Intel compiler (under Linux). 2 | -------------------------------------------------------------------------------- /3D-Objects/legocar.3ds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/3D-Objects/legocar.3ds -------------------------------------------------------------------------------- /3D-Objects/chessboard.tri: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/3D-Objects/chessboard.tri -------------------------------------------------------------------------------- /3D-Objects/trainColor.tri: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/3D-Objects/trainColor.tri -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/SDL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/VisualC/Renderer-2.x/SDL.dll -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/tbb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/VisualC/Renderer-2.x/tbb.dll -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | VisualC/**/* linguist-vendored 2 | lib3ds-1.3.0/**/* linguist-vendored 3 | src/*.[ch] linguist-language=C++ 4 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/lib3ds-1_3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/VisualC/Renderer-2.x/lib3ds-1_3.dll -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/VisualC/Renderer-2.x/libtbb/tbb.lib -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/lib/SDL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/VisualC/Renderer-2.x/libSDL/lib/SDL.lib -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/lib/SDLmain.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/VisualC/Renderer-2.x/libSDL/lib/SDLmain.lib -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/lib3ds/lib/lib3ds-1_3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttsiodras/renderer/HEAD/VisualC/Renderer-2.x/lib3ds/lib/lib3ds-1_3.lib -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/config.h: -------------------------------------------------------------------------------- 1 | #ifndef __config_h__ 2 | #define __config_h__ 3 | 4 | #define HANDLERAYTRACER 5 | #define SIMD_SSE 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /debian/renderer.postrm.debhelper: -------------------------------------------------------------------------------- 1 | # Automatically added by dh_makeshlibs 2 | if [ "$1" = "remove" ]; then 3 | ldconfig 4 | fi 5 | # End automatically added section 6 | -------------------------------------------------------------------------------- /debian/renderer.postinst.debhelper: -------------------------------------------------------------------------------- 1 | # Automatically added by dh_makeshlibs 2 | if [ "$1" = "configure" ]; then 3 | ldconfig 4 | fi 5 | # End automatically added section 6 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | renderer (2.3a-1) UNRELEASED; urgency=medium 2 | 3 | * Initial release. 4 | 5 | -- Thanassis Tsiodras Tue, 26 Jan 2016 13:18:22 +0100 6 | -------------------------------------------------------------------------------- /src/MLAA.h: -------------------------------------------------------------------------------- 1 | #ifndef __MLAA_H__ 2 | #define __MLAA_H__ 3 | 4 | void MLAA(unsigned int* fbi, unsigned int* fb0, int resX, int resY, int job=0, int threadID = 0); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | m4_include([ac-macros/ax_cflags_gcc_option.m4]) 2 | m4_include([ac-macros/ax_openmp.m4]) 3 | m4_include([ac-macros/ax_check_linker_flags.m4]) 4 | m4_include([ac-macros/ax_check_compiler_flags.m4]) 5 | -------------------------------------------------------------------------------- /debian/renderer.substvars: -------------------------------------------------------------------------------- 1 | misc:Pre-Depends=multiarch-support 2 | shlibs:Depends=libc6 (>= 2.15), libc6 (>= 2.3.6-6~), libgcc1 (>= 1:4.1.1), libgomp1 (>= 4.9), libsdl1.2debian (>= 1.2.11), libstdc++6 (>= 4.6), renderer 3 | misc:Depends= 4 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDLname_h_ 3 | #define _SDLname_h_ 4 | 5 | #if defined(__STDC__) || defined(__cplusplus) 6 | #define NeedFunctionPrototypes 1 7 | #endif 8 | 9 | #define SDL_NAME(X) SDL_##X 10 | 11 | #endif /* _SDLname_h_ */ 12 | -------------------------------------------------------------------------------- /src/Wu.h: -------------------------------------------------------------------------------- 1 | #ifndef __WU_H__ 2 | #define __WU_H__ 3 | 4 | #include 5 | 6 | int my_aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); 7 | int my_aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /debian/renderer.debhelper.log: -------------------------------------------------------------------------------- 1 | dh_auto_configure 2 | dh_auto_build 3 | dh_auto_test 4 | dh_prep 5 | dh_auto_install 6 | dh_installdocs 7 | dh_installchangelogs 8 | dh_installman 9 | dh_perl 10 | dh_link 11 | dh_compress 12 | dh_fixperms 13 | dh_strip 14 | dh_makeshlibs 15 | dh_shlibdeps 16 | dh_installdeb 17 | dh_gencontrol 18 | dh_md5sums 19 | dh_builddeb 20 | dh_builddeb 21 | -------------------------------------------------------------------------------- /src/sdl12compat_workaround.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | [[gnu::always_inline]] static inline Uint32 fast_SDL_MapRGB(const SDL_PixelFormat *const format12, const Uint8 r, const Uint8 g, const Uint8 b) { 6 | return (r >> format12->Rloss) << format12->Rshift | (g >> format12->Gloss) << format12->Gshift | (b >> format12->Bloss) << format12->Bshift | format12->Amask; 7 | } 8 | -------------------------------------------------------------------------------- /3D-Objects/single.ply: -------------------------------------------------------------------------------- 1 | ply 2 | element vertex 3 3 | property float x 4 | property float y 5 | property float z 6 | property uchar red 7 | property uchar green 8 | property uchar blue 9 | property uchar alpha 10 | element face 1 11 | property list uchar int vertex_indices 12 | end_header 13 | 0. 0. 0. 229 229 229 255 14 | 0. .2 0. 229 229 229 255 15 | 0. 0. .2 229 229 229 255 16 | 3 0 1 2 17 | -------------------------------------------------------------------------------- /3D-Objects/square.ply: -------------------------------------------------------------------------------- 1 | ply 2 | element vertex 4 3 | property float x 4 | property float y 5 | property float z 6 | property uchar red 7 | property uchar green 8 | property uchar blue 9 | property uchar alpha 10 | element face 2 11 | property list uchar int vertex_indices 12 | end_header 13 | 0. 0. 0. 229 229 229 255 14 | 0. .2 0. 229 229 229 255 15 | 0. .2 .2 229 229 229 255 16 | 0. 0. .2 229 229 229 255 17 | 3 0 1 2 18 | 3 0 2 3 19 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: renderer 2 | Maintainer: Thanassis Tsiodras 3 | Section: misc 4 | Priority: optional 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 9), libsdl1.2-dev (>= 1.2) 7 | 8 | Package: renderer 9 | Architecture: any 10 | Depends: ${shlibs:Depends}, ${misc:Depends} 11 | Description: Software renderer of 3D meshes 12 | Portable software-only renderer that can 13 | render 3D objects in multiple rendering 14 | modes. 15 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | lib3ds was originally written by Jan Eric Kyprianidis 3 | 4 | The project is currently administered by Reed Hedges . 5 | Please contact Reed with any inquiries. 6 | 7 | Since April, 2004, the following people have contributed additional 8 | changes to lib3ds: 9 | 10 | David Rogers 11 | Edward Falk 12 | Gernot Zeigler 13 | Haik Lorenz 14 | Jean-Charles Quillet 15 | Mike Frysinger 16 | Miles Bader 17 | Tomas Rapkauskas 18 | Torsten Blank 19 | Ralf Corsepius 20 | Stephane Denis 21 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 1. Open the Renderer-2.x.sln with your Visual Studio 2 | 2. Compile in Release mode 3 | 3. Right-click on "Renderer-2.x" in the Solution explorer, and select "Properties" 4 | 4. Click on "Configuration Properties/Debugging" 5 | 5. Enter ..\..\3D-Objects\chessboard.tri inside the "Command Arguments", click OK 6 | 6. Hit Ctrl-F5 to run. 7 | 8 | You should see a rotating chessboard... 9 | 10 | Read the upper-level README for details on navigation, or hit H (for help). 11 | 12 | (I used the free Visual C++ 2008 Express Edition, 13 | but this should work with the commercial one, too) 14 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/README: -------------------------------------------------------------------------------- 1 | 2 | Lib3ds is a free toolkit for handling the "3DS" format for 3D model files. 3 | Its main goal is to simplify the creation of 3DS import and export filters. 4 | 5 | This project is not related in any form to Autodesk Inc. The library is 6 | based on unofficial information about the 3DS format found on the web. 7 | 8 | This program is distributed in the hope that it will be useful, but 9 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 10 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 11 | License for more details. 12 | 13 | The official Lib3ds Homepage can be found under: 14 | http://lib3ds.sourceforge.net 15 | 16 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3012 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3012]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6' 20 | macro_revision='1.3012' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | 2009-10-29: 2 | 3 | Lots of optimizations, and the code is now as close to perfect 4 | as I will ever get: there is no repetition anywhere, C++ templates 5 | are used to create perfect, type-safe versions of the desired 6 | rasterizer (Gouraud, Phong, shadows, etc). Also, MSVC-specific 7 | project file (solution) was added. 8 | 9 | 2009-03-15: 10 | 11 | Now supporting meshes saved from shadevis, and interpolating the 12 | ambient occlusion factor per pixel - much better looking renders. 13 | 14 | 2008-11-18: 15 | 16 | The package now supports loading of meshes from .3ds files (3D Studio 17 | files), via lib3ds. To avoid adding lib3ds as an external dependency 18 | (since it appears to currently be in a state of flux), I added version 19 | 1.3.0 alongside the package sources. It will be auto-built before the 20 | renderer package. 21 | -------------------------------------------------------------------------------- /3D-Objects/box-and-plane.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment VCGLIB generated 4 | element vertex 12 5 | property float x 6 | property float y 7 | property float z 8 | property uchar red 9 | property uchar green 10 | property uchar blue 11 | property uchar alpha 12 | element face 14 13 | property list uchar int vertex_indices 14 | end_header 15 | .2 .2 .2 229 229 229 255 16 | -.2 .2 .2 245 245 245 255 17 | .2 -.2 .2 247 247 247 255 18 | -.2 -.2 .2 255 255 255 255 19 | .2 .2 -.2 213 213 213 255 20 | -.2 .2 -.2 225 225 225 255 21 | .2 -.2 -.2 224 224 224 255 22 | -.2 -.2 -.2 226 226 226 255 23 | .3 .3 -.3 61 61 61 255 24 | .3 -.3 -.3 0 0 0 255 25 | -.3 -.3 -.3 58 58 58 255 26 | -.3 .3 -.3 114 114 114 255 27 | 3 0 1 2 28 | 3 3 2 1 29 | 3 0 2 4 30 | 3 6 4 2 31 | 3 0 4 1 32 | 3 5 1 4 33 | 3 7 5 6 34 | 3 4 6 5 35 | 3 7 6 3 36 | 3 2 3 6 37 | 3 7 3 5 38 | 3 1 5 3 39 | 3 8 10 9 40 | 3 8 11 10 41 | -------------------------------------------------------------------------------- /contrib/build.using.IntelCC.and.TBB: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo 3 | echo Make sure you have configured the parent directory 4 | echo with the TBB option, and that you have successfully 5 | echo built a normal, GCC based version first ... 6 | echo 7 | ARCH=ia32 8 | uname -a | grep amd64 >/dev/null && ARCH=intel64 9 | echo Setting environment vars for Intel compiler to $ARCH 10 | . /opt/intel/composerxe/bin/compilervars.sh $ARCH || exit 1 11 | # -ipo is buggy... 12 | icpc -O3 -pc32 -xHOST -no-prec-div -opt-mem-layout-trans=3 -ansi-alias -I ../src/common/ -I ../lib3ds-1.3.0/ -DHAVE_GETOPT_H -DUSE_LIB3DS -DUSE_TBB -D_REENTRANT -I. -I /usr/include/SDL/ -I ../src/common -DNDEBUG -o renderer.intel.tbb -lSDL -lpthread ../src/renderer.cc ../src/Loader.cc ../src/Base3d.cc ../src/Camera.cc ../src/Keyboard.cc ../src/Light.cc ../src/Screen.cc ../src/BVH.cc ../src/Rasterizers.cc ../src/Raytracer.cc ../src/Wu.cc -L ../lib3ds-1.3.0/lib3ds/.libs/ -l3ds -ltbb -Wl,-R../lib3ds-1.3.0/lib3ds/.libs/ 13 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Overview

5 | Include files for Threading Building Blocks classes and functions. 6 | 7 |
Click here to see all files in the directory. 8 | 9 |

Directories

10 |
11 |
machine 12 |
Include files for low-level architecture specific functionality. 13 |
compat 14 |
Include files for source level compatibility with other frameworks. 15 |
16 | 17 |
18 | Up to parent directory 19 |

20 | Copyright © 2005-2009 Intel Corporation. All Rights Reserved. 21 |

22 | Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are 23 | registered trademarks or trademarks of Intel Corporation or its 24 | subsidiaries in the United States and other countries. 25 |

26 | * Other names and brands may be claimed as the property of others. 27 | 28 | 29 | -------------------------------------------------------------------------------- /contrib/build.using.IntelCC.and.OpenMP: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo 3 | echo Make sure you have configured the parent directory 4 | echo with the OpenMP option, and that you have successfully 5 | echo built a normal, GCC based version first ... 6 | echo 7 | ARCH=ia32 8 | uname -a | grep amd64 >/dev/null && ARCH=intel64 9 | echo Setting environment vars for Intel compiler to $ARCH 10 | . /opt/intel/composerxe/bin/compilervars.sh $ARCH || exit 1 11 | # -ipo is buggy... 12 | icpc -I ../src/ -I ../lib3ds-1.3.0/ -DHAVE_GETOPT_H -DUSE_LIB3DS -DUSE_OPENMP -D_REENTRANT -I. -I /usr/include/SDL/ -DNDEBUG -pc32 -xHOST -no-prec-div -O3 -openmp -parallel -opt-mem-layout-trans=3 -ansi-alias -o renderer.intel.openmp -lSDL -lpthread ../src/renderer.cc ../src/Base3d.cc ../src/BVH.cc ../src/Camera.cc ../src/Keyboard.cc ../src/Light.cc ../src/Loader.cc ../src/MLAA.cc ../src/Rasterizers.cc ../src/Raytracer.cc ../src/Screen.cc ../src/Wu.cc -L ../lib3ds-1.3.0/lib3ds/.libs/ -l3ds -Wl,-R../lib3ds-1.3.0/lib3ds/.libs/ 13 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/Renderer-2.x.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Renderer-2.x", "Renderer-2.x.vcproj", "{7FBEA2C4-9667-4BD0-9A0C-4BF316301938}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {7FBEA2C4-9667-4BD0-9A0C-4BF316301938}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {7FBEA2C4-9667-4BD0-9A0C-4BF316301938}.Debug|Win32.Build.0 = Debug|Win32 14 | {7FBEA2C4-9667-4BD0-9A0C-4BF316301938}.Release|Win32.ActiveCfg = Release|Win32 15 | {7FBEA2C4-9667-4BD0-9A0C-4BF316301938}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/msvc8/lib3ds.rc: -------------------------------------------------------------------------------- 1 | #include "winres.h" 2 | 3 | #ifdef _WIN32 4 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 5 | #pragma code_page(1252) 6 | #endif //_WIN32 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION 1,3,0,0 10 | PRODUCTVERSION 1,3,0,0 11 | FILEFLAGSMASK 0x17L 12 | #ifdef _DEBUG 13 | FILEFLAGS 0x1L 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS 0x4L 18 | FILETYPE 0x2L 19 | FILESUBTYPE 0x0L 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904b0" 24 | BEGIN 25 | VALUE "FileDescription", "lib3ds Dynamic Link Library" 26 | VALUE "FileVersion", "1.3.0" 27 | VALUE "InternalName", "lib3ds" 28 | VALUE "LegalCopyright", "Copyright (C) 1996-2007 by Jan Eric Kyprianidis" 29 | VALUE "OriginalFilename", "lib3ds.dll" 30 | VALUE "ProductName", "lib3ds Dynamic Link Library" 31 | VALUE "ProductVersion", "1.3.0" 32 | END 33 | END 34 | BLOCK "VarFileInfo" 35 | BEGIN 36 | VALUE "Translation", 0x409, 1200 37 | END 38 | END 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_getenv.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_getenv.h 24 | * @deprecated Use SDL_stdinc.h instead 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_types.h 24 | * @deprecated Use SDL_stdinc.h instead. 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /contrib/keys.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------- 2 | KEYS (available only when not benchmarking) 3 | ------------------------------------------- 4 | 5 | - Hit 'R' to stop/start auto-rotation of the camera around the object. 6 | - Fly using the cursor keys,A,Z - and rotate the light with W and Q. 7 | - S and F are 'strafe' left/right 8 | - E and D are 'strafe' up/down 9 | (strafe keys don't work in auto-rotation mode). 10 | - PgUp/PgDown, as well as the numeric keys (1-9 and 0) change the 11 | rendering mode: 12 | 1 : point mode 13 | 2 : points based on triangles (culling,color) 14 | 3 : triangles, wireframe, anti-aliased 15 | 4 : triangles, interpolated ambient (occlusion data too, if available) 16 | 5 : triangles, Gouraud shading, ZBuffer 17 | 6 : triangles, per-pixel Phong, ZBuffer 18 | 7 : triangles, per-pixel Phong, ZBuffer, Shadowmaps 19 | 8 : triangles, per-pixel Phong, ZBuffer, Soft shadowmaps 20 | 9 : raytracing, with shadows and reflections 21 | 0 : raytracing, with shadows, reflections and anti-aliasing 22 | - ESC quits. 23 | 24 | Now hit 'H' again to close this help screen. 25 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_byteorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_byteorder.h 25 | * @deprecated Use SDL_endian.h instead 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_endian.h" 30 | -------------------------------------------------------------------------------- /src/3d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __3d_h__ 21 | #define __3d_h__ 22 | 23 | #include "Defines.h" 24 | #include "Exceptions.h" 25 | #include "Types.h" 26 | #include "Base3d.h" 27 | #include "Light.h" 28 | #include "Scene.h" 29 | #include "Camera.h" 30 | #include "BVH.h" 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/tools/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # The 3D Studio File Format Library 3 | # Copyright (C) 1996-2007 by Jan Eric Kyprianidis 4 | # All rights reserved. 5 | # 6 | # This program is free software; you can redistribute it and/or modify it 7 | # under the terms of the GNU Lesser General Public License as published by 8 | # the Free Software Foundation; either version 2.1 of the License, or (at 9 | # your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, but 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14 | # License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public License 17 | # along with this program; if not, write to the Free Software Foundation, 18 | # Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | # 20 | # $Id: Makefile.am,v 1.5 2007/06/14 09:59:10 jeh Exp $ 21 | # 22 | 23 | INCLUDES = \ 24 | -I$(top_srcdir) 25 | 26 | bin_PROGRAMS = \ 27 | 3dsdump 28 | 29 | LDADD = \ 30 | $(top_builddir)/lib3ds/lib3ds.la 31 | 32 | MANPAGES = \ 33 | 3dsdump.1 34 | 35 | man_MANS = $(MANPAGES) 36 | EXTRA_DIST = $(MANPAGES) 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/Clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __CLOCK_H__ 21 | #define __CLOCK_H__ 22 | 23 | #include 24 | #include "Types.h" 25 | 26 | class Clock { 27 | Uint32 firstValue; 28 | public: 29 | Clock() { 30 | reset(); 31 | } 32 | void reset() { 33 | firstValue = SDL_GetTicks(); 34 | } 35 | Uint32 readMS() { 36 | return(SDL_GetTicks() - firstValue); 37 | } 38 | }; 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Exceptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __exceptions_h__ 21 | #define __exceptions_h__ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #define THROW(msg) { \ 29 | std::stringstream str; \ 30 | str << "Exception thrown from " << __FILE__ << " at line " << __LINE__ << std::endl; \ 31 | str << msg << std::endl; \ 32 | throw std::string(str.str()); \ 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Keyboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __KEYBOARD_H__ 21 | #define __KEYBOARD_H__ 22 | 23 | #include 24 | 25 | struct Keyboard { 26 | Uint32 _isDown, _isUp, _isLeft, _isRight; 27 | Uint32 _isForward, _isBackward, _isLight, _isLight2; 28 | Uint32 _isAbort, _isPgUp, _isPgDown; 29 | Uint32 _isS, _isD, _isE, _isF, _isR, _isH; 30 | Uint32 _is0, _is1, _is2, _is3, _is4, _is5, _is6, _is7, _is8, _is9; 31 | 32 | Keyboard(); 33 | ~Keyboard(); 34 | 35 | void poll(bool bYield = true); 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /contrib/createHelpTexture.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | convert -font /usr/share/fonts/TTF/verdana.ttf -depth 8 -trim keys.txt Help.ppm 3 | cat Help.ppm | sed 1,3d > a && mv a Help.raw 4 | identify Help.ppm | awk '{print $3}' | awk -Fx '{printf("#define HELPW %s\n", $1);}' > ../src/HelpKeys.h 5 | identify Help.ppm | awk '{print $3}' | awk -Fx '{printf("#define HELPH %s\n", $2);}' >> ../src/HelpKeys.h 6 | identify Help.ppm | sed 's,^,//,' >> ../src/HelpKeys.h 7 | bin2header helpKeysImage < Help.raw | sed 1d >> ../src/HelpKeys.h 8 | rm Help.ppm Help.raw 9 | convert -font /usr/share/fonts/TTF/verdana.ttf -depth 8 -trim onScreenKeys.txt OnlineHelp.ppm 10 | cat OnlineHelp.ppm | sed 1,3d > a && mv a OnlineHelp.raw 11 | cat > ../src/OnlineHelpKeys.h <> ../src/OnlineHelpKeys.h 17 | identify OnlineHelp.ppm | awk '{print $3}' | awk -Fx '{printf("#define OHELPH %s\n", $2);}' >> ../src/OnlineHelpKeys.h 18 | cat >> ../src/OnlineHelpKeys.h <> ../src/OnlineHelpKeys.h 25 | bin2header onlineHelpKeysImage < OnlineHelp.raw | sed 1d >> ../src/OnlineHelpKeys.h 26 | cat >> ../src/OnlineHelpKeys.h < 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: ease.h,v 1.6 2007/06/14 09:59:10 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | extern LIB3DSAPI Lib3dsFloat lib3ds_ease(Lib3dsFloat fp, Lib3dsFloat fc, 35 | Lib3dsFloat fn, Lib3dsFloat ease_from, Lib3dsFloat ease_to); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/tools/3dsdump.1: -------------------------------------------------------------------------------- 1 | .TH 3dsdump 1 "16 Jun 2001" Version 1.3.0 2 | .SH NAME 3 | 3dsdump - Displays information about the internal structure of a 3DS file. 4 | .SH SYNOPSIS 5 | .B 3dsdump 6 | [options] filename [options] 7 | .SH DESCRIPTION 8 | .PP 9 | \fI3dsdump\fP is a tool that is used to display information about 10 | the internal structure of a 3DS file. 11 | . 12 | .SH OPTIONS 13 | .l 14 | \fI3dsdump\fP accepts the following options: 15 | .TP 8 16 | .B \-h/\-\-help 17 | This help 18 | .TP 8 19 | .B \-m/\-\-materials 20 | Dump materials 21 | .TP 8 22 | .B \-t/\-\-trimeshes 23 | Dump meshes 24 | .TP 8 25 | .B \-i/\-\-instance 26 | Dump mesh instances 27 | .TP 8 28 | .B \-c/\-\-cameras 29 | Dump cameras 30 | .TP 8 31 | .B \-l/\-\-lights 32 | Dump lights 33 | .TP 8 34 | .B \-n/\-\-nodes 35 | Dump node hierarchy 36 | .SH COPYRIGHT 37 | .PP 38 | This program is free software; you can redistribute it and/or modify 39 | it under the terms of the GNU General Public License as published by 40 | the Free Software Foundation; either version 2 of the License, or (at 41 | your option) any later version. 42 | .PP 43 | This program is distributed in the hope that it will be useful, but 44 | WITHOUT ANY WARRANTY; without even the implied warranty of 45 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 46 | General Public License for more details. 47 | .PP 48 | You should have received a copy of the GNU General Public License 49 | along with this program; if not, write to the Free Software 50 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 51 | 52 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/tools/3dsdump.1.in: -------------------------------------------------------------------------------- 1 | .TH 3dsdump 1 "16 Jun 2001" Version @LIB3DS_VERSION@ 2 | .SH NAME 3 | 3dsdump - Displays information about the internal structure of a 3DS file. 4 | .SH SYNOPSIS 5 | .B 3dsdump 6 | [options] filename [options] 7 | .SH DESCRIPTION 8 | .PP 9 | \fI3dsdump\fP is a tool that is used to display information about 10 | the internal structure of a 3DS file. 11 | . 12 | .SH OPTIONS 13 | .l 14 | \fI3dsdump\fP accepts the following options: 15 | .TP 8 16 | .B \-h/\-\-help 17 | This help 18 | .TP 8 19 | .B \-m/\-\-materials 20 | Dump materials 21 | .TP 8 22 | .B \-t/\-\-trimeshes 23 | Dump meshes 24 | .TP 8 25 | .B \-i/\-\-instance 26 | Dump mesh instances 27 | .TP 8 28 | .B \-c/\-\-cameras 29 | Dump cameras 30 | .TP 8 31 | .B \-l/\-\-lights 32 | Dump lights 33 | .TP 8 34 | .B \-n/\-\-nodes 35 | Dump node hierarchy 36 | .SH COPYRIGHT 37 | .PP 38 | This program is free software; you can redistribute it and/or modify 39 | it under the terms of the GNU General Public License as published by 40 | the Free Software Foundation; either version 2 of the License, or (at 41 | your option) any later version. 42 | .PP 43 | This program is distributed in the hope that it will be useful, but 44 | WITHOUT ANY WARRANTY; without even the implied warranty of 45 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 46 | General Public License for more details. 47 | .PP 48 | You should have received a copy of the GNU General Public License 49 | along with this program; if not, write to the Free Software 50 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 51 | 52 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_INIT(Makefile.am) 3 | AC_CONFIG_MACRO_DIR([m4]) 4 | 5 | LIB3DS_MAJOR_VERSION=1 6 | LIB3DS_MINOR_VERSION=3 7 | LIB3DS_MICRO_VERSION=0 8 | LIB3DS_VERSION=$LIB3DS_MAJOR_VERSION.$LIB3DS_MINOR_VERSION.$LIB3DS_MICRO_VERSION 9 | AC_SUBST(LIB3DS_MAJOR_VERSION) 10 | AC_SUBST(LIB3DS_MINOR_VERSION) 11 | AC_SUBST(LIB3DS_MICRO_VERSION) 12 | AC_SUBST(LIB3DS_VERSION) 13 | 14 | AM_CONFIG_HEADER(config.h) 15 | AM_INIT_AUTOMAKE(lib3ds, $LIB3DS_VERSION) 16 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 17 | 18 | AC_PROG_CC 19 | AC_PROG_LIBTOOL 20 | 21 | AC_MSG_CHECKING([for debugging mode]) 22 | AC_ARG_ENABLE(debug-mode, 23 | [ --enable-debug-mode enable debugging mode], 24 | [ 25 | LIB3DS_DEBUG_MODE=yes 26 | ] 27 | ) 28 | if test "$LIB3DS_DEBUG_MODE" = yes; then 29 | AC_MSG_RESULT(yes) 30 | CFLAGS="$CFLAGS -D_DEBUG" 31 | else 32 | AC_MSG_RESULT(no) 33 | fi 34 | 35 | AC_CHECK_FUNCS([floor]) 36 | AC_CHECK_FUNCS([memset]) 37 | AC_CHECK_FUNCS([pow]) 38 | AC_CHECK_FUNCS([sqrt]) 39 | AC_CHECK_FUNCS([strrchr]) 40 | AC_CHECK_HEADERS([float.h]) 41 | AC_FUNC_MALLOC 42 | AC_FUNC_REALLOC 43 | AC_PROG_CXX 44 | LT_INIT 45 | AC_TYPE_INT16_T 46 | AC_TYPE_INT32_T 47 | AC_TYPE_INT8_T 48 | AC_TYPE_SIZE_T 49 | AC_TYPE_UINT16_T 50 | AC_TYPE_UINT32_T 51 | AC_TYPE_UINT8_T 52 | 53 | 54 | AC_OUTPUT([ \ 55 | lib3ds-config \ 56 | lib3ds-config.1 \ 57 | Makefile \ 58 | lib3ds/Makefile \ 59 | tools/Makefile \ 60 | tools/3dsdump.1 \ 61 | lib3ds.spec \ 62 | 3ds-utils.spec \ 63 | ],[chmod a+x lib3ds-config]) 64 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_PROGRAMS = renderer showShadowMap 2 | 3 | common_SRC = \ 4 | 3d.h Algebra.h Base3d.h Camera.h Clock.h Defines.h Exceptions.h \ 5 | Keyboard.h Light.h Scene.h Screen.h Types.h Camera.cc \ 6 | Keyboard.cc Light.cc Rasterizers.cc Screen.cc ScanConverter.h \ 7 | Fillers.h LightingEq.h Base3d.cc Wu.h Wu.cc HelpKeys.h \ 8 | OnlineHelpKeys.h BVH.h BVH.cc Loader.cc Raytracer.cc 9 | 10 | renderer_SOURCES = renderer.cc ${common_SRC} 11 | if MLAA_ENABLED 12 | renderer_SOURCES += MLAA.h MLAA.cc 13 | endif 14 | 15 | renderer_CPPFLAGS = @SDL_CFLAGS@ -I$(srcdir)/../lib3ds-1.3.0/ 16 | 17 | renderer_LDADD = @SDL_LIBS@ @TBB_LIBS@ @OPENMP_LIBS@ ../lib3ds-1.3.0/lib3ds/.libs/lib3ds.a @MINGWSTACK@ @WHOLEPROGRAM@ 18 | 19 | showShadowMap_SOURCES = showShadowMap.cc Keyboard.h Keyboard.cc 20 | 21 | showShadowMap_CPPFLAGS = @SDL_CFLAGS@ 22 | 23 | showShadowMap_LDADD = @SDL_LIBS@ 24 | 25 | bench: 26 | @for i in 1 2 3 4 5 ; do SDL_VIDEODRIVER=dummy ./renderer -b -n 500 ../3D-Objects/trainColor.tri | tail -1 | awk '{print substr($$(NF-1),2);}' ; done | perl -e '$$total=0; $$totalSq=0; $$n=0; my @allOfThem; while(<>) { print; chomp; $$total += $$_; $$totalSq += $$_*$$_; $$n++; push @allOfThem, $$_; } my $$variance = ($$totalSq - $$total*$$total/$$n)/($$n-1); my @srted = sort {$$a <=> $$b} @allOfThem; my $$len = scalar(@allOfThem); if ($$len % 2) { $$len++; } my @measurements = ( ["Average value",$$total/$$n], ["Std deviation",sqrt($$variance)], ["Median",$$srted[-1 + $$len/2]], ["Min",$$srted[0]], ["Max",$$srted[-1]]); foreach (@measurements) { printf("%*s: %f\n", 15, $$_->[0], $$_->[1]);}' 27 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds.spec.in: -------------------------------------------------------------------------------- 1 | # Note that this is NOT a relocatable package 2 | %define ver @LIB3DS_VERSION@ 3 | %define prefix /usr 4 | BuildRoot: /tmp/lib3ds-%{PACKAGE_VERSION}-root 5 | 6 | Summary: The 3DS File Format Library 7 | Name: lib3ds 8 | Version: %ver 9 | Release: 1 10 | Copyright: LGPL 11 | Group: Development/Libraries 12 | Source: http://download.sourceforge.net/lib3ds/lib3ds-%{ver}.tar.gz 13 | URL: http://lib3ds.sourceforge.net 14 | Docdir: %{prefix}/share/doc 15 | 16 | %description 17 | 18 | Lib3ds is a free alternative to Autodesk's 3DS File Toolkit for handling 19 | 3DS files It's main goal is to simplify the creation of 3DS import and 20 | export filters. 21 | 22 | This project is not related in any form to Autodesk. The library is 23 | based on unofficial information about the 3DS format found on the web. 24 | 25 | This program is distributed in the hope that it will be useful, but 26 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 27 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 28 | License for more details. 29 | 30 | The official Lib3ds Homepage can be found under: 31 | http://lib3ds.sourceforge.net 32 | 33 | %prep 34 | %setup 35 | 36 | %build 37 | ./configure --prefix=%{prefix} 38 | make 39 | 40 | %install 41 | make DESTDIR=$RPM_BUILD_ROOT install 42 | 43 | %clean 44 | rm -rf $RPM_BUILD_ROOT 45 | 46 | %post -p /sbin/ldconfig 47 | 48 | %postun -p /sbin/ldconfig 49 | 50 | %files 51 | %defattr(-, root, root) 52 | %doc AUTHORS ChangeLog NEWS README COPYING TODO 53 | %{prefix}/lib/* 54 | %{prefix}/include/lib3ds/* 55 | %{prefix}/share/aclocal/* 56 | %{prefix}/man/man1/lib3ds-config.1 57 | 58 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_h 24 | #define _SDL_config_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* Add any platform that doesn't build using the configure system */ 29 | #if defined(__DREAMCAST__) 30 | #include "SDL_config_dreamcast.h" 31 | #elif defined(__MACOS__) 32 | #include "SDL_config_macos.h" 33 | #elif defined(__MACOSX__) 34 | #include "SDL_config_macosx.h" 35 | #elif defined(__SYMBIAN32__) 36 | #include "SDL_config_symbian.h" /* must be before win32! */ 37 | #elif defined(__WIN32__) 38 | #include "SDL_config_win32.h" 39 | #elif defined(__OS2__) 40 | #include "SDL_config_os2.h" 41 | #else 42 | #include "SDL_config_minimal.h" 43 | #endif /* platform config */ 44 | 45 | #endif /* _SDL_config_h */ 46 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file close_code.h 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #undef _begin_code_h 30 | 31 | /** 32 | * @file close_code.h 33 | * Reset structure packing at previous byte alignment 34 | */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #if (defined(__MWERKS__) && defined(__MACOS__)) 40 | #pragma options align=reset 41 | #pragma enumsalwaysint reset 42 | #else 43 | #pragma pack(pop) 44 | #endif 45 | #endif /* Compiler needs structure packing set */ 46 | 47 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | exec_prefix_set=no 6 | 7 | usage() 8 | { 9 | cat <&2 23 | fi 24 | 25 | while test $# -gt 0; do 26 | case "$1" in 27 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 28 | *) optarg= ;; 29 | esac 30 | 31 | case $1 in 32 | --prefix=*) 33 | prefix=$optarg 34 | if test $exec_prefix_set = no ; then 35 | exec_prefix=$optarg 36 | fi 37 | ;; 38 | --prefix) 39 | echo_prefix=yes 40 | ;; 41 | --exec-prefix=*) 42 | exec_prefix=$optarg 43 | exec_prefix_set=yes 44 | ;; 45 | --exec-prefix) 46 | echo_exec_prefix=yes 47 | ;; 48 | --version) 49 | echo @LIB3DS_VERSION@ 50 | ;; 51 | --cflags) 52 | echo_cflags=yes 53 | ;; 54 | --libs) 55 | echo_libs=yes 56 | ;; 57 | *) 58 | usage 1 1>&2 59 | ;; 60 | esac 61 | shift 62 | done 63 | 64 | if test "$echo_prefix" = "yes"; then 65 | echo $prefix 66 | fi 67 | 68 | if test "$echo_exec_prefix" = "yes"; then 69 | echo $exec_prefix 70 | fi 71 | 72 | if test "$echo_cflags" = "yes"; then 73 | if test @includedir@ != /usr/include ; then 74 | echo -I@includedir@ 75 | fi 76 | fi 77 | 78 | if test "$echo_libs" = "yes"; then 79 | if test @libdir@ != /usr/lib ; then 80 | my_linker_flags="-L@libdir@" 81 | fi 82 | echo ${my_linker_flags} -l3ds 83 | fi 84 | 85 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/chunktable.sed: -------------------------------------------------------------------------------- 1 | 1 { 2 | a\ 3 | /* -*- c -*- */\ 4 | #ifndef INCLUDED_LIB3DS_CHUNKTABLE_H\ 5 | #define INCLUDED_LIB3DS_CHUNKTABLE_H\ 6 | /*\ 7 | * The 3D Studio File Format Library\ 8 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis \ 9 | * All rights reserved.\ 10 | *\ 11 | * This program is free software; you can redistribute it and/or modify it\ 12 | * under the terms of the GNU Lesser General Public License as published by\ 13 | * the Free Software Foundation; either version 2.1 of the License, or (at\ 14 | * your option) any later version.\ 15 | *\ 16 | * This program is distributed in the hope that it will be useful, but\ 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\ 18 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\ 19 | * License for more details.\ 20 | *\ 21 | * You should have received a copy of the GNU Lesser General Public License\ 22 | * along with this program; if not, write to the Free Software Foundation,\ 23 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\ 24 | *\ 25 | * $Id: chunktable.sed,v 1.7 2007/06/14 09:59:10 jeh Exp $\ 26 | */\ 27 | \ 28 | #ifndef INCLUDED_LIB3DS_CHUNK_H\ 29 | #include \ 30 | #endif\ 31 | \ 32 | #ifdef __cplusplus\ 33 | extern "C" {\ 34 | #endif\ 35 | \ 36 | typedef struct _Lib3dsChunkTable {\ 37 | Lib3dsDword chunk;\ 38 | const char* name;\ 39 | } Lib3dsChunkTable;\ 40 | \ 41 | static Lib3dsChunkTable lib3ds_chunk_table[]={ 42 | } 43 | /^ *LIB3DS_/ { 44 | s/ *\([0-9A-Z_]*\).*/ {\1, "\1"},/ 45 | p 46 | } 47 | $ { 48 | i\ 49 | {0,0}\ 50 | };\ 51 | \ 52 | #ifdef __cplusplus\ 53 | };\ 54 | #endif\ 55 | #endif\ 56 | 57 | } 58 | d 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/Defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __defines_h__ 21 | #define __defines_h__ 22 | 23 | #define TRI_MAGIC 0xDEADBEEF 24 | #define TRI_MAGICNORMAL 0xDEADC0DE 25 | #define SHADOWMAPSIZE 1024 26 | #define WIDTH 800 27 | #define HEIGHT 600 28 | #define SCREEN_DIST (HEIGHT*2) 29 | 30 | #define AMBIENT 96.f 31 | #define DIFFUSE 128.f 32 | #define SPECULAR 192.f 33 | 34 | // Maximum allowed depth of BVH 35 | // Checked at BVH build time, no runtime crash possible, see CreateCFBVH() 36 | #define BVH_STACK_SIZE 32 37 | 38 | #define TRIANGLES_PER_THREAD 50 39 | 40 | #define ASSERT_OR_DIE(x) do { \ 41 | if (!(x)) { \ 42 | fprintf(stderr, "Internal error\n"); \ 43 | exit(1); \ 44 | } \ 45 | } while(0) 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/3ds-utils.spec.in: -------------------------------------------------------------------------------- 1 | # Note that this is NOT a relocatable package 2 | %define ver @LIB3DS_VERSION@ 3 | %define prefix /usr 4 | BuildRoot: /tmp/lib3ds-%{PACKAGE_VERSION}-root 5 | 6 | Summary: 3DS Viewing and Conversion Utilities 7 | Name: lib3ds-utils 8 | Version: %ver 9 | Release: 1 10 | Copyright: LGPL 11 | Group: Aplpications/Multimedia 12 | Source: http://download.sourceforge.net/lib3ds/lib3ds-%{ver}.tar.gz 13 | URL: http://lib3ds.sourceforge.net 14 | Docdir: %{prefix}/share/doc 15 | 16 | %description 17 | 18 | Lib3ds is a free alternative to Autodesk's 3DS File Toolkit for handling 19 | 3DS files It's main goal is to simplify the creation of 3DS import and 20 | export filters. 21 | 22 | This package contains some conversion and viewing utilities. 23 | 24 | This project is not related in any form to Autodesk. The library is 25 | based on unofficial information about the 3DS format found on the web. 26 | 27 | This program is distributed in the hope that it will be useful, but 28 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 29 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 30 | License for more details. 31 | 32 | The official Lib3ds Homepage can be found under: 33 | http://lib3ds.sourceforge.net 34 | 35 | %prep 36 | %setup 37 | 38 | %build 39 | ./configure --prefix=%{prefix} 40 | make 41 | 42 | %install 43 | make DESTDIR=$RPM_BUILD_ROOT install 44 | 45 | %clean 46 | rm -rf $RPM_BUILD_ROOT 47 | 48 | %post -p /sbin/ldconfig 49 | 50 | %postun -p /sbin/ldconfig 51 | 52 | %files 53 | %defattr(-, root, root) 54 | %doc AUTHORS ChangeLog NEWS README COPYING TODO 55 | %{prefix}/bin/* 56 | %{prefix}/man/man1/3dsplayer.1 57 | %{prefix}/man/man1/3ds2m.1 58 | %{prefix}/man/man1/3dsdump.1 59 | 60 | -------------------------------------------------------------------------------- /src/Camera.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #include "Camera.h" 23 | 24 | void Camera::UpdateMV() 25 | { 26 | Vector3 eyeToLookatPoint(_tox-_x, _toy-_y, _toz-_z); 27 | eyeToLookatPoint.normalize(); 28 | Vector3 zenith(0., 0., 1.); 29 | Vector3 rightAxis = cross(eyeToLookatPoint, zenith); 30 | rightAxis.normalize(); 31 | Vector3 upAxis = cross(rightAxis, eyeToLookatPoint); 32 | upAxis.normalize(); 33 | 34 | // Now that we have the three axes, create the transform matrix 35 | // for this camera, to prepare for the transforms of the scene's 36 | // triangles. The world coordinates must be xformed into the camera's, 37 | // located at _x,_y,_z and having the three axis we just calculated 38 | 39 | _mv._row1 = upAxis; 40 | _mv._row2 = rightAxis; 41 | _mv._row3 = eyeToLookatPoint; 42 | } 43 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/Renderer-2.x.vcproj.SEMANTIX.ttsiodras.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/shadow.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_SHADOW_H 3 | #define INCLUDED_LIB3DS_SHADOW_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: shadow.h,v 1.11 2007/06/20 17:04:09 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * Shadow map settings 36 | * \ingroup shadow 37 | */ 38 | struct Lib3dsShadow { 39 | Lib3dsIntw map_size; 40 | Lib3dsFloat lo_bias; 41 | Lib3dsFloat hi_bias; 42 | Lib3dsIntw samples; 43 | Lib3dsIntd range; 44 | Lib3dsFloat filter; 45 | Lib3dsFloat ray_bias; 46 | }; 47 | 48 | extern LIB3DSAPI Lib3dsBool lib3ds_shadow_read(Lib3dsShadow *shadow, Lib3dsIo *io); 49 | extern LIB3DSAPI Lib3dsBool lib3ds_shadow_write(Lib3dsShadow *shadow, Lib3dsIo *io); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | #endif 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/Camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __camera_h__ 21 | #define __camera_h__ 22 | 23 | #include "Types.h" 24 | #include "Algebra.h" 25 | 26 | struct Camera : public Vector3 { 27 | coord _tox, _toy, _toz; 28 | Matrix3 _mv; 29 | 30 | Camera(coord x, coord y, coord z, coord tox, coord toy, coord toz) 31 | : 32 | Vector3(x,y,z), 33 | _tox(tox), _toy(toy), _toz(toz) 34 | { 35 | UpdateMV(); 36 | } 37 | 38 | Camera(const Vector3& from, const Vector3& to) 39 | : 40 | Vector3(from) 41 | { 42 | set(from._x, from._y, from._z, to._x, to._y, to._z); 43 | } 44 | 45 | void set(coord x, coord y, coord z, coord tox, coord toy, coord toz) 46 | { 47 | _x = x; _y = y; _z = z; 48 | _tox = tox; _toy = toy; _toz = toz; 49 | UpdateMV(); 50 | } 51 | 52 | void set(const Vector3& from, const Vector3& to) 53 | { 54 | set(from._x, from._y, from._z, to._x, to._y, to._z); 55 | } 56 | 57 | void UpdateMV(); 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/ease.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The 3D Studio File Format Library 3 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 4 | * All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 2.1 of the License, or (at 9 | * your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14 | * License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this program; if not, write to the Free Software Foundation, 18 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | * 20 | * $Id: ease.c,v 1.6 2007/06/15 09:33:19 jeh Exp $ 21 | */ 22 | #include 23 | 24 | 25 | /*! 26 | * \defgroup ease Ease 27 | */ 28 | 29 | 30 | /*! 31 | * \ingroup ease 32 | */ 33 | Lib3dsFloat 34 | lib3ds_ease(Lib3dsFloat fp, Lib3dsFloat fc, Lib3dsFloat fn, 35 | Lib3dsFloat ease_from, Lib3dsFloat ease_to) 36 | { 37 | Lib3dsDouble s,step; 38 | Lib3dsDouble tofrom; 39 | Lib3dsDouble a; 40 | 41 | s=step=(Lib3dsFloat)(fc-fp)/(fn-fp); 42 | tofrom=ease_to+ease_from; 43 | if (tofrom!=0.0) { 44 | if (tofrom>1.0) { 45 | ease_to=(Lib3dsFloat)(ease_to/tofrom); 46 | ease_from=(Lib3dsFloat)(ease_from/tofrom); 47 | } 48 | a=1.0/(2.0-(ease_to+ease_from)); 49 | 50 | if (step 24 | 25 | #include "Types.h" 26 | 27 | struct BVHNode { 28 | Vector3 _bottom; 29 | Vector3 _top; 30 | virtual bool IsLeaf() = 0; 31 | }; 32 | 33 | struct BVHInner : BVHNode { 34 | BVHNode *_left; 35 | BVHNode *_right; 36 | virtual bool IsLeaf() { return false; } 37 | }; 38 | 39 | struct Triangle; 40 | struct BVHLeaf : BVHNode { 41 | std::list _triangles; 42 | virtual bool IsLeaf() { return true; } 43 | }; 44 | 45 | struct Scene; 46 | BVHNode *CreateBVH(const Scene *pScene); 47 | 48 | // More cache-able form of BVHNodes: 32 bytes 49 | 50 | typedef const Triangle *PtrTriangle; 51 | 52 | struct CacheFriendlyBVHNode { 53 | Vector3 _bottom; 54 | Vector3 _top; 55 | union { 56 | struct { 57 | unsigned _idxLeft; 58 | unsigned _idxRight; 59 | } inner; 60 | struct { 61 | unsigned _count; // Top-most bit set 62 | unsigned _startIndexInTriIndexList; 63 | } leaf; 64 | } u; 65 | }; 66 | 67 | void CreateCFBVH(Scene *); 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/camera.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_CAMERA_H 3 | #define INCLUDED_LIB3DS_CAMERA_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: camera.h,v 1.11 2007/06/20 17:04:08 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * Camera object 36 | * \ingroup camera 37 | */ 38 | struct Lib3dsCamera { 39 | Lib3dsCamera *next; 40 | char name[64]; 41 | Lib3dsDword object_flags; /*< @see Lib3dsObjectFlags */ 42 | Lib3dsVector position; 43 | Lib3dsVector target; 44 | Lib3dsFloat roll; 45 | Lib3dsFloat fov; 46 | Lib3dsBool see_cone; 47 | Lib3dsFloat near_range; 48 | Lib3dsFloat far_range; 49 | }; 50 | 51 | extern LIB3DSAPI Lib3dsCamera* lib3ds_camera_new(const char *name); 52 | extern LIB3DSAPI void lib3ds_camera_free(Lib3dsCamera *mesh); 53 | extern LIB3DSAPI void lib3ds_camera_dump(Lib3dsCamera *camera); 54 | extern LIB3DSAPI Lib3dsBool lib3ds_camera_read(Lib3dsCamera *camera, Lib3dsIo *io); 55 | extern LIB3DSAPI Lib3dsBool lib3ds_camera_write(Lib3dsCamera *camera, Lib3dsIo *io); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /src/Base3d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __base3d_h__ 21 | #define __base3d_h__ 22 | 23 | #include 24 | 25 | #include "Types.h" 26 | 27 | struct Vertex : public Vector3 28 | { 29 | Vector3 _normal; 30 | unsigned _ambientOcclusionCoeff; 31 | 32 | Vertex(coord x, coord y, coord z, coord nx, coord ny, coord nz, unsigned char amb=60) 33 | : 34 | Vector3(x,y,z), _normal(nx, ny, nz), _ambientOcclusionCoeff(amb) 35 | { 36 | // assert |nx,ny,nz| = 1 37 | } 38 | }; 39 | 40 | struct Triangle 41 | { 42 | const Vertex *_vertexA, *_vertexB, *_vertexC; 43 | Vector3 _center; 44 | Vector3 _normal; 45 | 46 | // Color: 47 | Pixel _colorf; 48 | // precomputed for SDL surface 49 | Uint32 _color; 50 | 51 | // Should we backface cull this triangle? 52 | bool _twoSided; 53 | 54 | // Raytracing intersection pre-computed cache: 55 | coord _d, _d1, _d2, _d3; 56 | Vector3 _e1, _e2, _e3; 57 | Vector3 _bottom; 58 | Vector3 _top; 59 | 60 | Triangle( 61 | const Vertex *vertexA, 62 | const Vertex *vertexB, 63 | const Vertex *vertexC, 64 | unsigned r, unsigned g, unsigned b, 65 | bool twosided = false, bool triNormalProvided=false, Vector3 triNormal=Vector3(0.,0.,0.) ); 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/tcb.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_TCB_H 3 | #define INCLUDED_LIB3DS_TCB_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: tcb.h,v 1.11 2007/06/20 17:04:09 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | typedef enum Lib3dsTcbFlags{ 35 | LIB3DS_USE_TENSION =0x0001, 36 | LIB3DS_USE_CONTINUITY =0x0002, 37 | LIB3DS_USE_BIAS =0x0004, 38 | LIB3DS_USE_EASE_TO =0x0008, 39 | LIB3DS_USE_EASE_FROM =0x0010 40 | } Lib3dsTcbFlags; 41 | 42 | typedef struct Lib3dsTcb { 43 | Lib3dsIntd frame; 44 | Lib3dsWord flags; 45 | Lib3dsFloat tens; 46 | Lib3dsFloat cont; 47 | Lib3dsFloat bias; 48 | Lib3dsFloat ease_to; 49 | Lib3dsFloat ease_from; 50 | } Lib3dsTcb; 51 | 52 | extern LIB3DSAPI void lib3ds_tcb(Lib3dsTcb *p, Lib3dsTcb *pc, Lib3dsTcb *c, 53 | Lib3dsTcb *nc, Lib3dsTcb *n, Lib3dsFloat *ksm, Lib3dsFloat *ksp, 54 | Lib3dsFloat *kdm, Lib3dsFloat *kdp); 55 | extern LIB3DSAPI Lib3dsBool lib3ds_tcb_read(Lib3dsTcb *tcb, Lib3dsIo *io); 56 | extern LIB3DSAPI Lib3dsBool lib3ds_tcb_write(Lib3dsTcb *tcb, Lib3dsIo *io); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_error.h 25 | * Simple error message routines for SDL 26 | */ 27 | 28 | #ifndef _SDL_error_h 29 | #define _SDL_error_h 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * @name Public functions 41 | */ 42 | /*@{*/ 43 | extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); 44 | extern DECLSPEC char * SDLCALL SDL_GetError(void); 45 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 46 | /*@}*/ 47 | 48 | /** 49 | * @name Private functions 50 | * @internal Private error message function - used internally 51 | */ 52 | /*@{*/ 53 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 54 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 55 | typedef enum { 56 | SDL_ENOMEM, 57 | SDL_EFREAD, 58 | SDL_EFWRITE, 59 | SDL_EFSEEK, 60 | SDL_UNSUPPORTED, 61 | SDL_LASTERROR 62 | } SDL_errorcode; 63 | extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); 64 | /*@}*/ 65 | 66 | /* Ends C function definitions when using C++ */ 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | #include "close_code.h" 71 | 72 | #endif /* _SDL_error_h */ 73 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_active.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_active.h 25 | * Include file for SDL application focus event handling 26 | */ 27 | 28 | #ifndef _SDL_active_h 29 | #define _SDL_active_h 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @name The available application states */ 41 | /*@{*/ 42 | #define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ 43 | #define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ 44 | #define SDL_APPACTIVE 0x04 /**< The application is active */ 45 | /*@}*/ 46 | 47 | /* Function prototypes */ 48 | /** 49 | * This function returns the current state of the application, which is a 50 | * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and 51 | * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to 52 | * see your application, otherwise it has been iconified or disabled. 53 | */ 54 | extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); 55 | 56 | 57 | /* Ends C function definitions when using C++ */ 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #include "close_code.h" 62 | 63 | #endif /* _SDL_active_h */ 64 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/msvc8/lib3ds.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib3ds", "lib3ds.vcproj", "{9CF2B398-9087-4D33-90EB-0320F42C78F4}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3dsdump", "3dsdump.vcproj", "{583C3AA7-9150-4BBD-A7F9-49E5C2D39D53}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {9CF2B398-9087-4D33-90EB-0320F42C78F4} = {9CF2B398-9087-4D33-90EB-0320F42C78F4} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "3dsplay", "3dsplay.vcproj", "{79DF8E20-21D9-47C2-8558-1F982A60264B}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {9CF2B398-9087-4D33-90EB-0320F42C78F4} = {9CF2B398-9087-4D33-90EB-0320F42C78F4} 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Win32 = Debug|Win32 19 | Release|Win32 = Release|Win32 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {9CF2B398-9087-4D33-90EB-0320F42C78F4}.Debug|Win32.ActiveCfg = Debug|Win32 23 | {9CF2B398-9087-4D33-90EB-0320F42C78F4}.Debug|Win32.Build.0 = Debug|Win32 24 | {9CF2B398-9087-4D33-90EB-0320F42C78F4}.Release|Win32.ActiveCfg = Release|Win32 25 | {9CF2B398-9087-4D33-90EB-0320F42C78F4}.Release|Win32.Build.0 = Release|Win32 26 | {583C3AA7-9150-4BBD-A7F9-49E5C2D39D53}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {583C3AA7-9150-4BBD-A7F9-49E5C2D39D53}.Debug|Win32.Build.0 = Debug|Win32 28 | {583C3AA7-9150-4BBD-A7F9-49E5C2D39D53}.Release|Win32.ActiveCfg = Release|Win32 29 | {583C3AA7-9150-4BBD-A7F9-49E5C2D39D53}.Release|Win32.Build.0 = Release|Win32 30 | {79DF8E20-21D9-47C2-8558-1F982A60264B}.Debug|Win32.ActiveCfg = Debug|Win32 31 | {79DF8E20-21D9-47C2-8558-1F982A60264B}.Debug|Win32.Build.0 = Debug|Win32 32 | {79DF8E20-21D9-47C2-8558-1F982A60264B}.Release|Win32.ActiveCfg = Release|Win32 33 | {79DF8E20-21D9-47C2-8558-1F982A60264B}.Release|Win32.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /3D-Objects/platform.ply: -------------------------------------------------------------------------------- 1 | ply 2 | format ascii 1.0 3 | comment VCGLIB generated 4 | element vertex 48 5 | property float x 6 | property float y 7 | property float z 8 | element face 24 9 | property list uchar int vertex_indices 10 | property uchar red 11 | property uchar green 12 | property uchar blue 13 | end_header 14 | 63.2034 80.1495 0 15 | -63.1745 -56.8584 0 16 | -63.1745 80.1495 0 17 | 63.2034 -56.8584 0 18 | 63.2034 80.1495 0 19 | 63.2034 -56.8584 8.66142 20 | 63.2034 -56.8584 0 21 | 63.2034 80.1495 8.66142 22 | 63.2034 -56.8584 8.66142 23 | -63.1745 -56.8584 0 24 | 63.2034 -56.8584 0 25 | -63.1745 -56.8584 8.66142 26 | -63.1745 80.1495 8.66142 27 | -63.1745 -56.8584 0 28 | -63.1745 -56.8584 8.66142 29 | -63.1745 80.1495 0 30 | -63.1745 80.1495 8.66142 31 | 63.2034 80.1495 0 32 | -63.1745 80.1495 0 33 | 63.2034 80.1495 8.66142 34 | 63.2034 -56.8584 8.66142 35 | -63.1745 80.1495 8.66142 36 | -63.1745 -56.8584 8.66142 37 | 63.2034 80.1495 8.66142 38 | 5.85998 14.5748 22.1212 39 | -21.6991 -37 22.1212 40 | -21.6991 14.5748 22.1212 41 | 5.85998 -37 22.1212 42 | -21.6991 14.5748 48.8928 43 | 5.85998 14.5748 22.1212 44 | -21.6991 14.5748 22.1212 45 | 5.85998 14.5748 48.8928 46 | 5.85998 14.5748 22.1212 47 | 5.85998 -37 48.8928 48 | 5.85998 -37 22.1212 49 | 5.85998 14.5748 48.8928 50 | 5.85998 -37 48.8928 51 | -21.6991 -37 22.1212 52 | 5.85998 -37 22.1212 53 | -21.6991 -37 48.8928 54 | -21.6991 14.5748 48.8928 55 | -21.6991 -37 22.1212 56 | -21.6991 -37 48.8928 57 | -21.6991 14.5748 22.1212 58 | 5.85998 -37 48.8928 59 | -21.6991 14.5748 48.8928 60 | -21.6991 -37 48.8928 61 | 5.85998 14.5748 48.8928 62 | 3 0 1 2 255 200 0 63 | 3 1 0 3 255 200 0 64 | 3 4 5 6 255 200 0 65 | 3 5 4 7 255 200 0 66 | 3 8 9 10 255 200 0 67 | 3 9 8 11 255 200 0 68 | 3 12 13 14 255 200 0 69 | 3 13 12 15 255 200 0 70 | 3 16 17 18 255 200 0 71 | 3 17 16 19 255 200 0 72 | 3 20 21 22 255 200 0 73 | 3 21 20 23 255 200 0 74 | 3 24 25 26 255 200 0 75 | 3 25 24 27 255 200 0 76 | 3 28 29 30 255 200 0 77 | 3 29 28 31 255 200 0 78 | 3 32 33 34 255 200 0 79 | 3 33 32 35 255 200 0 80 | 3 36 37 38 255 200 0 81 | 3 37 36 39 255 200 0 82 | 3 40 41 42 255 200 0 83 | 3 41 40 43 255 200 0 84 | 3 44 45 46 255 200 0 85 | 3 45 44 47 255 200 0 86 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_quit.h 24 | * Include file for SDL quit event handling 25 | */ 26 | 27 | #ifndef _SDL_quit_h 28 | #define _SDL_quit_h 29 | 30 | #include "SDL_stdinc.h" 31 | #include "SDL_error.h" 32 | 33 | /** @file SDL_quit.h 34 | * An SDL_QUITEVENT is generated when the user tries to close the application 35 | * window. If it is ignored or filtered out, the window will remain open. 36 | * If it is not ignored or filtered, it is queued normally and the window 37 | * is allowed to close. When the window is closed, screen updates will 38 | * complete, but have no effect. 39 | * 40 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 41 | * and SIGTERM (system termination request), if handlers do not already 42 | * exist, that generate SDL_QUITEVENT events as well. There is no way 43 | * to determine the cause of an SDL_QUITEVENT, but setting a signal 44 | * handler in your application will override the default generation of 45 | * quit events for that signal. 46 | */ 47 | 48 | /** @file SDL_quit.h 49 | * There are no functions directly affecting the quit event 50 | */ 51 | 52 | #define SDL_QuitRequested() \ 53 | (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) 54 | 55 | #endif /* _SDL_quit_h */ 56 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # The 3D Studio File Format Library 3 | # Copyright (C) 1996-2007 by Jan Eric Kyprianidis 4 | # All rights reserved. 5 | # 6 | # This program is free software; you can redistribute it and/or modify it 7 | # under the terms of the GNU Lesser General Public License as published by 8 | # the Free Software Foundation; either version 2.1 of the License, or (at 9 | # your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, but 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14 | # License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public License 17 | # along with this program; if not, write to the Free Software Foundation, 18 | # Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | # 20 | # $Id: Makefile.am,v 1.15 2007/06/15 09:53:20 jeh Exp $ 21 | # 22 | 23 | lib3dsdir=$(includedir)/lib3ds 24 | 25 | INCLUDES = -I$(top_srcdir) 26 | 27 | lib_LTLIBRARIES = lib3ds.la 28 | 29 | lib3ds_la_LDFLAGS = \ 30 | -version-info $(LIB3DS_MINOR_VERSION):$(LIB3DS_MICRO_VERSION):0 \ 31 | -release $(LIB3DS_MAJOR_VERSION) 32 | 33 | lib3ds_la_LIBADD = -lm 34 | 35 | lib3ds_la_SOURCES = \ 36 | io.c \ 37 | vector.c \ 38 | matrix.c \ 39 | quat.c \ 40 | tcb.c \ 41 | ease.c \ 42 | chunktable.h \ 43 | chunk.c \ 44 | file.c \ 45 | background.c \ 46 | atmosphere.c \ 47 | shadow.c \ 48 | viewport.c \ 49 | material.c \ 50 | mesh.c \ 51 | camera.c \ 52 | light.c \ 53 | tracks.c \ 54 | node.c 55 | 56 | lib3ds_HEADERS = \ 57 | types.h \ 58 | io.h \ 59 | vector.h \ 60 | matrix.h \ 61 | quat.h \ 62 | tcb.h \ 63 | ease.h \ 64 | chunk.h \ 65 | file.h \ 66 | background.h \ 67 | atmosphere.h \ 68 | shadow.h \ 69 | viewport.h \ 70 | material.h \ 71 | mesh.h \ 72 | camera.h \ 73 | light.h \ 74 | tracks.h \ 75 | node.h 76 | 77 | EXTRA_DIST = \ 78 | types.txt \ 79 | chunktable.sed 80 | 81 | chunktable.h: chunk.h chunktable.sed 82 | sed -f chunktable.sed chunk.h >chunktable.h 83 | 84 | chunk.c: chunktable.h 85 | 86 | 87 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/types.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * The 3D Studio File Format Library 3 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 4 | * All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 2.1 of the License, or (at 9 | * your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14 | * License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this program; if not, write to the Free Software Foundation, 18 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | * 20 | * $Id: types.txt,v 1.3 2007/06/20 17:04:09 jeh Exp $ 21 | */ 22 | /*! 23 | 24 | \defgroup types General Types 25 | 26 | */ 27 | /*! 28 | 29 | \typedef Lib3dsBool 30 | \ingroup types 31 | Bool Typedef 32 | 33 | */ 34 | /*! 35 | 36 | \typedef Lib3dsByte 37 | \ingroup types 38 | Byte (== 8bit unsigned int) Typedef 39 | 40 | */ 41 | /*! 42 | 43 | \typedef Lib3dsWord 44 | \ingroup types 45 | Word (== 16bit unsigned int) Typedef 46 | 47 | */ 48 | /*! 49 | 50 | \typedef Lib3dsDword 51 | \ingroup types 52 | Double-Word (== 32bit unsigned int) Typedef 53 | 54 | */ 55 | /*! 56 | 57 | \typedef Lib3dsIntb 58 | \ingroup types 59 | Signed Byte (== 8bit signed int) Typedef 60 | 61 | */ 62 | /*! 63 | 64 | \typedef Lib3dsIntw 65 | \ingroup types 66 | Signed Word (== 16bit signed int) Typedef 67 | 68 | */ 69 | /*! 70 | 71 | \typedef Lib3dsIntd 72 | \ingroup types 73 | Signed Double-Word (== 32bit signed int) Typedef 74 | 75 | */ 76 | /*! 77 | 78 | \typedef Lib3dsRgb 79 | \ingroup types 80 | Red, Green, Blue color Typedef 81 | 82 | */ 83 | /*! 84 | 85 | \typedef Lib3dsRgba 86 | \ingroup types 87 | Red, Green, Blue, Alpha color Typedef 88 | 89 | */ 90 | /*! 91 | 92 | \typedef Lib3dsTexel 93 | \ingroup types 94 | UV texture coordinates 95 | 96 | */ 97 | -------------------------------------------------------------------------------- /src/Light.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __light_h__ 21 | #define __light_h__ 22 | 23 | #include 24 | 25 | #include "Algebra.h" 26 | #include 27 | 28 | struct Scene; 29 | struct Camera; 30 | struct Triangle; 31 | 32 | struct Light : public Vector3 33 | { 34 | Matrix3 _worldToLightSpace; 35 | Matrix3 _cameraToLightSpace; 36 | Vector3 _inCameraSpace; 37 | 38 | // Shadow buffer, used in modes 7 and 8 39 | coord _shadowBuffer[SHADOWMAPSIZE][SHADOWMAPSIZE]; 40 | 41 | Light(coord x, coord y, coord z) 42 | : 43 | Vector3(x,y,z) 44 | { 45 | ClearShadowBuffer(); 46 | } 47 | 48 | void ClearShadowBuffer() 49 | { 50 | // For both float and double, a "body" of 0xFE..FE is a huge negative number 51 | memset(reinterpret_cast(&_shadowBuffer[0][0]), 254, sizeof(_shadowBuffer)); 52 | } 53 | 54 | void PlotShadowPixel(int y, const Vector3& v); 55 | void InterpolateTriangleOnShadowBuffer( 56 | const Vector3& v1, const Vector3& v2, const Vector3& v3, 57 | unsigned *lines, 58 | Vector3 *left, 59 | Vector3 *right); 60 | 61 | void RenderSceneIntoShadowBuffer(const Scene&); 62 | 63 | void CalculatePositionInCameraSpace(const Camera& camera); 64 | void CalculateXformFromCameraToLightSpace(const Camera& eye); 65 | void CalculateXformFromWorldToLightSpace(); 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_config_minimal.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_minimal_h 24 | #define _SDL_config_minimal_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This is the minimal configuration that can be used to build SDL */ 29 | 30 | #include 31 | 32 | typedef signed char int8_t; 33 | typedef unsigned char uint8_t; 34 | typedef signed short int16_t; 35 | typedef unsigned short uint16_t; 36 | typedef signed int int32_t; 37 | typedef unsigned int uint32_t; 38 | typedef unsigned int size_t; 39 | typedef unsigned long uintptr_t; 40 | 41 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 42 | #define SDL_AUDIO_DRIVER_DUMMY 1 43 | 44 | /* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ 45 | #define SDL_CDROM_DISABLED 1 46 | 47 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 48 | #define SDL_JOYSTICK_DISABLED 1 49 | 50 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 51 | #define SDL_LOADSO_DISABLED 1 52 | 53 | /* Enable the stub thread support (src/thread/generic/\*.c) */ 54 | #define SDL_THREADS_DISABLED 1 55 | 56 | /* Enable the stub timer support (src/timer/dummy/\*.c) */ 57 | #define SDL_TIMERS_DISABLED 1 58 | 59 | /* Enable the dummy video driver (src/video/dummy/\*.c) */ 60 | #define SDL_VIDEO_DRIVER_DUMMY 1 61 | 62 | #endif /* _SDL_config_minimal_h */ 63 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/compat/ppl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_compat_ppl_H 30 | #define __TBB_compat_ppl_H 31 | 32 | #include "../task_group.h" 33 | #include "../parallel_invoke.h" 34 | #include "../parallel_for_each.h" 35 | #include "../parallel_for.h" 36 | 37 | namespace Concurrency { 38 | 39 | using tbb::task_handle; 40 | using tbb::task_group_status; 41 | using tbb::task_group; 42 | using tbb::structured_task_group; 43 | using tbb::missing_wait; 44 | 45 | using tbb::not_complete; 46 | using tbb::complete; 47 | using tbb::canceled; 48 | 49 | using tbb::is_current_task_group_canceling; 50 | 51 | using tbb::parallel_invoke; 52 | using tbb::strict_ppl::parallel_for; 53 | using tbb::parallel_for_each; 54 | 55 | } // namespace Concurrency 56 | 57 | #endif /* __TBB_compat_ppl_H */ 58 | -------------------------------------------------------------------------------- /src/Base3d.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | #include "3d.h" 25 | #include "Screen.h" 26 | 27 | Triangle::Triangle( 28 | const Vertex *vertexA, 29 | const Vertex *vertexB, 30 | const Vertex *vertexC, 31 | unsigned r, unsigned g, unsigned b, 32 | bool twosided, bool triNormalProvided, Vector3 triNormal) 33 | : 34 | _vertexA(vertexA), _vertexB(vertexB), _vertexC(vertexC), 35 | 36 | _center((vertexA->_x + vertexB->_x + vertexC->_x)/3.0f, 37 | (vertexA->_y + vertexB->_y + vertexC->_y)/3.0f, 38 | (vertexA->_z + vertexB->_z + vertexC->_z)/3.0f), 39 | 40 | _colorf((float)r,(float)g,(float)b), // For use in all other cases 41 | _color(fast_SDL_MapRGB(Screen::_surface->format, r,g,b)), // For use with DrawPixel 42 | _twoSided(twosided), 43 | _bottom(FLT_MAX,FLT_MAX,FLT_MAX), // Will be updated after centering in Loader 44 | _top(-FLT_MAX,-FLT_MAX,-FLT_MAX) // Will be updated after centering in Loader 45 | { 46 | if (!triNormalProvided) { 47 | _normal = Vector3( 48 | (vertexA->_normal._x + vertexB->_normal._x + vertexC->_normal._x)/3.0f, 49 | (vertexA->_normal._y + vertexB->_normal._y + vertexC->_normal._y)/3.0f, 50 | (vertexA->_normal._z + vertexB->_normal._z + vertexC->_normal._z)/3.0f); 51 | _normal.normalize(); 52 | } else { 53 | _normal = triNormal; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/machine/ibm_aix51.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_machine_H 30 | #error Do not include this file directly; include tbb_machine.h instead 31 | #endif 32 | 33 | #define __TBB_WORDSIZE 8 34 | #define __TBB_BIG_ENDIAN 1 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | extern "C" { 41 | 42 | int32_t __TBB_machine_cas_32 (volatile void* ptr, int32_t value, int32_t comparand); 43 | int64_t __TBB_machine_cas_64 (volatile void* ptr, int64_t value, int64_t comparand); 44 | #define __TBB_fence_for_acquire() __TBB_machine_flush () 45 | #define __TBB_fence_for_release() __TBB_machine_flush () 46 | 47 | } 48 | 49 | #define __TBB_CompareAndSwap4(P,V,C) __TBB_machine_cas_32(P,V,C) 50 | #define __TBB_CompareAndSwap8(P,V,C) __TBB_machine_cas_64(P,V,C) 51 | #define __TBB_CompareAndSwapW(P,V,C) __TBB_machine_cas_64(P,V,C) 52 | #define __TBB_Yield() sched_yield() 53 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/aligned_space.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_aligned_space_H 30 | #define __TBB_aligned_space_H 31 | 32 | #include "tbb_stddef.h" 33 | #include "tbb_machine.h" 34 | 35 | namespace tbb { 36 | 37 | //! Block of space aligned sufficiently to construct an array T with N elements. 38 | /** The elements are not constructed or destroyed by this class. 39 | @ingroup memory_allocation */ 40 | template 41 | class aligned_space { 42 | private: 43 | typedef __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type; 44 | element_type array[(sizeof(T)*N+sizeof(element_type)-1)/sizeof(element_type)]; 45 | public: 46 | //! Pointer to beginning of array 47 | T* begin() {return reinterpret_cast(this);} 48 | 49 | //! Pointer to one past last element in array. 50 | T* end() {return begin()+N;} 51 | }; 52 | 53 | } // namespace tbb 54 | 55 | #endif /* __TBB_aligned_space_H */ 56 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/background.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_BACKGROUND_H 3 | #define INCLUDED_LIB3DS_BACKGROUND_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: background.h,v 1.8 2007/06/20 17:04:08 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * Bitmap background settings 36 | * \ingroup background 37 | */ 38 | typedef struct Lib3dsBitmap { 39 | Lib3dsBool use; 40 | char name[64]; 41 | } Lib3dsBitmap; 42 | 43 | /** 44 | * Solid color background settings 45 | * \ingroup background 46 | */ 47 | typedef struct Lib3dsSolid { 48 | Lib3dsBool use; 49 | Lib3dsRgb col; 50 | } Lib3dsSolid; 51 | 52 | /** 53 | * Gradient background settings 54 | * \ingroup background 55 | */ 56 | typedef struct Lib3dsGradient { 57 | Lib3dsBool use; 58 | Lib3dsFloat percent; 59 | Lib3dsRgb top; 60 | Lib3dsRgb middle; 61 | Lib3dsRgb bottom; 62 | } Lib3dsGradient; 63 | 64 | /** 65 | * Background settings 66 | * \ingroup background 67 | */ 68 | struct Lib3dsBackground { 69 | Lib3dsBitmap bitmap; 70 | Lib3dsSolid solid; 71 | Lib3dsGradient gradient; 72 | }; 73 | 74 | extern LIB3DSAPI Lib3dsBool lib3ds_background_read(Lib3dsBackground *background, Lib3dsIo *io); 75 | extern LIB3DSAPI Lib3dsBool lib3ds_background_write(Lib3dsBackground *background, Lib3dsIo *io); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | #endif 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_config_amiga.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2006 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_amiga_h 24 | #define _SDL_config_amiga_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This is a set of defines to configure the SDL features */ 29 | 30 | #define SDL_HAS_64BIT_TYPE 1 31 | 32 | /* Useful headers */ 33 | #define HAVE_SYS_TYPES_H 1 34 | #define HAVE_STDIO_H 1 35 | #define STDC_HEADERS 1 36 | #define HAVE_STRING_H 1 37 | #define HAVE_INTTYPES_H 1 38 | #define HAVE_SIGNAL_H 1 39 | 40 | /* C library functions */ 41 | #define HAVE_MALLOC 1 42 | #define HAVE_CALLOC 1 43 | #define HAVE_REALLOC 1 44 | #define HAVE_FREE 1 45 | #define HAVE_ALLOCA 1 46 | #define HAVE_GETENV 1 47 | #define HAVE_PUTENV 1 48 | #define HAVE_MEMSET 1 49 | #define HAVE_MEMCPY 1 50 | #define HAVE_MEMMOVE 1 51 | #define HAVE_MEMCMP 1 52 | 53 | /* Enable various audio drivers */ 54 | #define SDL_AUDIO_DRIVER_AHI 1 55 | #define SDL_AUDIO_DRIVER_DISK 1 56 | #define SDL_AUDIO_DRIVER_DUMMY 1 57 | 58 | /* Enable various cdrom drivers */ 59 | #define SDL_CDROM_DUMMY 1 60 | 61 | /* Enable various input drivers */ 62 | #define SDL_JOYSTICK_AMIGA 1 63 | 64 | /* Enable various shared object loading systems */ 65 | #define SDL_LOADSO_DUMMY 1 66 | 67 | /* Enable various threading systems */ 68 | #define SDL_THREAD_AMIGA 1 69 | 70 | /* Enable various timer systems */ 71 | #define SDL_TIMER_AMIGA 1 72 | 73 | /* Enable various video drivers */ 74 | #define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1 75 | #define SDL_VIDEO_DRIVER_DUMMY 1 76 | 77 | /* Enable OpenGL support */ 78 | #define SDL_VIDEO_OPENGL 1 79 | 80 | #endif /* _SDL_config_amiga_h */ 81 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_cpuinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_cpuinfo.h 25 | * CPU feature detection for SDL 26 | */ 27 | 28 | #ifndef _SDL_cpuinfo_h 29 | #define _SDL_cpuinfo_h 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** This function returns true if the CPU has the RDTSC instruction */ 40 | extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); 41 | 42 | /** This function returns true if the CPU has MMX features */ 43 | extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); 44 | 45 | /** This function returns true if the CPU has MMX Ext. features */ 46 | extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); 47 | 48 | /** This function returns true if the CPU has 3DNow features */ 49 | extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); 50 | 51 | /** This function returns true if the CPU has 3DNow! Ext. features */ 52 | extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); 53 | 54 | /** This function returns true if the CPU has SSE features */ 55 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); 56 | 57 | /** This function returns true if the CPU has SSE2 features */ 58 | extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); 59 | 60 | /** This function returns true if the CPU has AltiVec features */ 61 | extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* _SDL_cpuinfo_h */ 70 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | autom4te.cache/ 3 | config.log 4 | config.status 5 | lib3ds-1.3.0/3ds-utils.spec 6 | lib3ds-1.3.0/Makefile 7 | lib3ds-1.3.0/autom4te.cache/ 8 | lib3ds-1.3.0/config.h 9 | lib3ds-1.3.0/config.log 10 | lib3ds-1.3.0/config.status 11 | lib3ds-1.3.0/lib3ds-config 12 | lib3ds-1.3.0/lib3ds.spec 13 | lib3ds-1.3.0/lib3ds/.deps/ 14 | lib3ds-1.3.0/lib3ds/Makefile 15 | lib3ds-1.3.0/libtool 16 | lib3ds-1.3.0/tools/.deps/ 17 | lib3ds-1.3.0/tools/Makefile 18 | renderer-2.1c.tar.gz 19 | src/.deps/ 20 | src/Makefile 21 | src/config.h 22 | lib3ds-1.3.0/lib3ds/.libs/ 23 | lib3ds-1.3.0/lib3ds/atmosphere.lo 24 | lib3ds-1.3.0/lib3ds/atmosphere.o 25 | lib3ds-1.3.0/lib3ds/background.lo 26 | lib3ds-1.3.0/lib3ds/background.o 27 | lib3ds-1.3.0/lib3ds/camera.lo 28 | lib3ds-1.3.0/lib3ds/camera.o 29 | lib3ds-1.3.0/lib3ds/chunk.lo 30 | lib3ds-1.3.0/lib3ds/chunk.o 31 | lib3ds-1.3.0/lib3ds/ease.lo 32 | lib3ds-1.3.0/lib3ds/ease.o 33 | lib3ds-1.3.0/lib3ds/file.lo 34 | lib3ds-1.3.0/lib3ds/file.o 35 | lib3ds-1.3.0/lib3ds/io.lo 36 | lib3ds-1.3.0/lib3ds/io.o 37 | lib3ds-1.3.0/lib3ds/lib3ds.la 38 | lib3ds-1.3.0/lib3ds/light.lo 39 | lib3ds-1.3.0/lib3ds/light.o 40 | lib3ds-1.3.0/lib3ds/material.lo 41 | lib3ds-1.3.0/lib3ds/material.o 42 | lib3ds-1.3.0/lib3ds/matrix.lo 43 | lib3ds-1.3.0/lib3ds/matrix.o 44 | lib3ds-1.3.0/lib3ds/mesh.lo 45 | lib3ds-1.3.0/lib3ds/mesh.o 46 | lib3ds-1.3.0/lib3ds/node.lo 47 | lib3ds-1.3.0/lib3ds/node.o 48 | lib3ds-1.3.0/lib3ds/quat.lo 49 | lib3ds-1.3.0/lib3ds/quat.o 50 | lib3ds-1.3.0/lib3ds/shadow.lo 51 | lib3ds-1.3.0/lib3ds/shadow.o 52 | lib3ds-1.3.0/lib3ds/tcb.lo 53 | lib3ds-1.3.0/lib3ds/tcb.o 54 | lib3ds-1.3.0/lib3ds/tracks.lo 55 | lib3ds-1.3.0/lib3ds/tracks.o 56 | lib3ds-1.3.0/lib3ds/vector.lo 57 | lib3ds-1.3.0/lib3ds/vector.o 58 | lib3ds-1.3.0/lib3ds/viewport.lo 59 | lib3ds-1.3.0/lib3ds/viewport.o 60 | lib3ds-1.3.0/stamp-h1 61 | lib3ds-1.3.0/tools/.libs/ 62 | lib3ds-1.3.0/tools/3dsdump 63 | lib3ds-1.3.0/tools/3dsdump.o 64 | src/common/stamp-h1 65 | src/renderer 66 | src/renderer-renderer.o 67 | src/showShadowMap 68 | src/showShadowMap-showShadowMap.o 69 | contrib/renderer.intel* 70 | src/renderer-Algebra.o 71 | src/renderer-Base3d.o 72 | src/renderer-Camera.o 73 | src/renderer-Keyboard.o 74 | src/renderer-Light.o 75 | src/renderer-Object3D.o 76 | src/renderer-Scene.o 77 | src/renderer-Screen.o 78 | src/renderer-Wu.o 79 | src/showShadowMap-Keyboard.o 80 | src/renderer-BVH.o 81 | src/renderer-Loader.o 82 | src/stamp-h1 83 | tags 84 | src/renderer-Rasterizers.o 85 | src/renderer-Raytracer.o 86 | src/renderer-MLAA.o 87 | contrib/bits 88 | configure.lineno 89 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/null_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_null_mutex_H 30 | #define __TBB_null_mutex_H 31 | 32 | namespace tbb { 33 | 34 | //! A mutex which does nothing 35 | /** A null_mutex does no operation and simulates success. 36 | @ingroup synchronization */ 37 | class null_mutex { 38 | //! Deny assignment and copy construction 39 | null_mutex( const null_mutex& ); 40 | void operator=( const null_mutex& ); 41 | public: 42 | //! Represents acquisition of a mutex. 43 | class scoped_lock { 44 | public: 45 | scoped_lock() {} 46 | scoped_lock( null_mutex& ) {} 47 | ~scoped_lock() {} 48 | void acquire( null_mutex& ) {} 49 | bool try_acquire( null_mutex& ) { return true; } 50 | void release() {} 51 | }; 52 | 53 | null_mutex() {} 54 | 55 | // Mutex traits 56 | static const bool is_rw_mutex = false; 57 | static const bool is_recursive_mutex = true; 58 | static const bool is_fair_mutex = true; 59 | }; 60 | 61 | } 62 | 63 | #endif /* __TBB_null_mutex_H */ 64 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # The 3D Studio File Format Library 3 | # Copyright (C) 1996-2007 by Jan Eric Kyprianidis 4 | # All rights reserved. 5 | # 6 | # This program is free software; you can redistribute it and/or modify it 7 | # under the terms of the GNU Lesser General Public License as published by 8 | # the Free Software Foundation; either version 2.1 of the License, or (at 9 | # your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, but 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14 | # License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public License 17 | # along with this program; if not, write to the Free Software Foundation, 18 | # Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | # 20 | # $Id: Makefile.am,v 1.27 2007/06/20 09:05:29 jeh Exp $ 21 | # 22 | 23 | 24 | VERSION = @LIB3DS_VERSION@ 25 | 26 | ACLOCAL_AMFLAGS="-Im4" 27 | 28 | SUBDIRS = lib3ds tools 29 | 30 | bin_SCRIPTS = lib3ds-config 31 | 32 | AUTOMAKE_OPTIONS = 1.4 33 | 34 | man_MANS = \ 35 | lib3ds-config.1 36 | 37 | EXTRA_DIST = \ 38 | lib3ds.m4 \ 39 | lib3ds-config.1 \ 40 | AUTHORS \ 41 | COPYING \ 42 | ChangeLog \ 43 | INSTALL \ 44 | README \ 45 | TODO \ 46 | examples/3dsplay.c \ 47 | msvc8/lib3ds.sln \ 48 | msvc8/lib3ds.vcproj \ 49 | msvc8/lib3ds.rc \ 50 | msvc8/3dsdump.vcproj \ 51 | msvc8/3dsplay.vcproj 52 | 53 | m4datadir = $(datadir)/aclocal 54 | m4data_DATA = lib3ds.m4 55 | 56 | .PHONY: release snapshot 57 | 58 | release: 59 | rm -rf .deps */.deps 60 | $(MAKE) distcheck 61 | 62 | snapshot: 63 | $(MAKE) dist-zip distdir=$(PACKAGE)-`date +"%Y%m%d"` 64 | 65 | 66 | DIST_NAME = lib3ds-$(VERSION) 67 | DIST_DIR = /tmp/$(DIST_NAME) 68 | 69 | RPM_SOURCE_DIR = /tmp/rpmsource-$(DIST_NAME) 70 | RPM_BUILD_DIR = /tmp/rpmbuild-$(DIST_NAME) 71 | RPM_DEST_DIR = . 72 | 73 | 74 | rpm: $(DIST_NAME).tar.gz 75 | rm -rf $(RPM_SOURCE_DIR) 76 | rm -rf $(RPM_BUILD_DIR) 77 | mkdir -p $(RPM_SOURCE_DIR) 78 | mkdir -p $(RPM_BUILD_DIR) 79 | cp $(DIST_NAME).tar.gz $(RPM_SOURCE_DIR) 80 | 81 | rpmbuild -bb lib3ds.spec \ 82 | --define "_sourcedir ${RPM_SOURCE_DIR}" \ 83 | --define "_builddir ${RPM_BUILD_DIR}" \ 84 | --define "_rpmdir ${RPM_SOURCE_DIR}" 85 | 86 | mv ${RPM_SOURCE_DIR}/i386/lib3ds-*.rpm ${RPM_DEST_DIR} 87 | rm -rf ${RPM_SOURCE_DIR} ${RPM_BUILD_DIR} 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/Algebra.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __algebra_h__ 21 | #define __algebra_h__ 22 | 23 | #include "Types.h" 24 | #include "Base3d.h" 25 | 26 | struct Matrix3 { 27 | Vector3 _row1, _row2, _row3; 28 | Vector3 multiplyRightWith(const Vector3& r) const 29 | { 30 | coord xnew = _row1._x*r._x + _row1._y*r._y + _row1._z*r._z; 31 | coord ynew = _row2._x*r._x + _row2._y*r._y + _row2._z*r._z; 32 | coord znew = _row3._x*r._x + _row3._y*r._y + _row3._z*r._z; 33 | return Vector3(xnew, ynew, znew); 34 | } 35 | }; 36 | 37 | // Transform to any space 38 | inline Vector3 Transform(Vector3 worldPoint, const Vector3& origin, const Matrix3& mv) 39 | { 40 | worldPoint -= origin; // preparing for space 41 | return mv.multiplyRightWith(worldPoint); // xform to space 42 | } 43 | 44 | inline coord distancesq(const Vector3& a, const Vector3& b) 45 | { 46 | coord dx=a._x - b._x; 47 | coord dy=a._y - b._y; 48 | coord dz=a._z - b._z; 49 | return dx*dx + dy*dy + dz*dz; 50 | } 51 | 52 | inline coord distance(const Vector3& a, const Vector3& b) 53 | { 54 | coord dx=a._x - b._x; 55 | coord dy=a._y - b._y; 56 | coord dz=a._z - b._z; 57 | return sqrt(dx*dx + dy*dy + dz*dz); 58 | } 59 | 60 | inline Vector3 cross(const Vector3& l, const Vector3& r) 61 | { 62 | coord x,y,z; 63 | const coord &aax=l._x; 64 | const coord &aay=l._y; 65 | const coord &aaz=l._z; 66 | const coord &bbx=r._x; 67 | const coord &bby=r._y; 68 | const coord &bbz=r._z; 69 | x=aay*bbz-bby*aaz; 70 | y=bbx*aaz-aax*bbz; 71 | z=aax*bby-aay*bbx; 72 | return Vector3(x,y,z); 73 | } 74 | 75 | inline coord dot(const Vector3& l, const Vector3& r) 76 | { 77 | return l._x*r._x +l._y*r._y +l._z*r._z; 78 | } 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds-config.1: -------------------------------------------------------------------------------- 1 | .TH lib3ds 1 "16 Jun 2001" 1.3.0 2 | .SH NAME 3 | lib3ds-config - script to get information about the installed version of lib3ds 4 | .SH SYNOPSIS 5 | .B lib3ds-config 6 | [\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cflags] 7 | .SH DESCRIPTION 8 | .PP 9 | \fIlib3ds-config\fP is a tool that is used to configure to determine 10 | the compiler and linker flags that should be used to compile and link 11 | programs that use \fIlib3ds\fP. It is also used internally to the .m4 12 | macros for GNU autoconf that are included with \fIlib3ds\fP. 13 | . 14 | .SH OPTIONS 15 | .l 16 | \fIlib3ds-config\fP accepts the following options: 17 | .TP 8 18 | .B \-\-version 19 | Print the currently installed version of \fIlib3ds\fP on the standard 20 | output. 21 | .TP 8 22 | .B \-\-libs 23 | Print the linker flags that are necessary to link a \fIlib3ds\fP 24 | program. 25 | .TP 8 26 | .B \-\-cflags 27 | Print the compiler flags that are necessary to compile a \fIlib3ds\fP 28 | program. 29 | .TP 8 30 | .B \-\-prefix=PREFIX 31 | If specified, use PREFIX instead of the installation prefix that 32 | \fIlib3ds\fP was built with when computing the output for the 33 | \-\-cflags and \-\-libs options. This option is also used for the exec 34 | prefix if \-\-exec\-prefix was not specified. This option must be 35 | specified before any \-\-libs or \-\-cflags options. 36 | .TP 8 37 | .B \-\-exec\-prefix=PREFIX 38 | If specified, use PREFIX instead of the installation exec prefix that 39 | \fIlib3ds\fP was built with when computing the output for the 40 | \-\-cflags and \-\-libs options. This option must be specified before 41 | any \-\-libs or \-\-cflags options. 42 | .SH COPYRIGHT 43 | .PP 44 | This program is free software; you can redistribute it and/or modify 45 | it under the terms of the GNU Lesser General Public License as published by 46 | the Free Software Foundation; either version 2.1 of the License, or (at 47 | your option) any later version. 48 | .PP 49 | This program is distributed in the hope that it will be useful, but 50 | WITHOUT ANY WARRANTY; without even the implied warranty of 51 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 52 | Lesser General Public License for more details. 53 | .PP 54 | You should have received a copy of the GNU Lesser General Public License 55 | along with this program; if not, write to the Free Software 56 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 57 | .SH AUTHOR 58 | This manpage is an almost word-for-word copy of the gtk-config 59 | manpage, written by Owen Taylor. It was modified by Marcelo 60 | E. Magallon , for the Debian GNU/Linux system 61 | (but may be used by others). 62 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/light.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_LIGHT_H 3 | #define INCLUDED_LIB3DS_LIGHT_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: light.h,v 1.13 2007/06/20 17:04:08 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * Light 36 | * \ingroup light 37 | */ 38 | struct Lib3dsLight { 39 | Lib3dsLight *next; 40 | char name[64]; 41 | Lib3dsDword object_flags; /*< @see Lib3dsObjectFlags */ 42 | Lib3dsBool spot_light; 43 | Lib3dsBool see_cone; 44 | Lib3dsRgb color; 45 | Lib3dsVector position; 46 | Lib3dsVector spot; 47 | Lib3dsFloat roll; 48 | Lib3dsBool off; 49 | Lib3dsFloat outer_range; 50 | Lib3dsFloat inner_range; 51 | Lib3dsFloat multiplier; 52 | /*const char** excludes;*/ 53 | Lib3dsFloat attenuation; 54 | Lib3dsBool rectangular_spot; 55 | Lib3dsBool shadowed; 56 | Lib3dsFloat shadow_bias; 57 | Lib3dsFloat shadow_filter; 58 | Lib3dsIntw shadow_size; 59 | Lib3dsFloat spot_aspect; 60 | Lib3dsBool use_projector; 61 | char projector[64]; 62 | Lib3dsIntd spot_overshoot; 63 | Lib3dsBool ray_shadows; 64 | Lib3dsFloat ray_bias; 65 | Lib3dsFloat hot_spot; 66 | Lib3dsFloat fall_off; 67 | }; 68 | 69 | extern LIB3DSAPI Lib3dsLight* lib3ds_light_new(const char *name); 70 | extern LIB3DSAPI void lib3ds_light_free(Lib3dsLight *mesh); 71 | extern LIB3DSAPI void lib3ds_light_dump(Lib3dsLight *light); 72 | extern LIB3DSAPI Lib3dsBool lib3ds_light_read(Lib3dsLight *light, Lib3dsIo *io); 73 | extern LIB3DSAPI Lib3dsBool lib3ds_light_write(Lib3dsLight *light, Lib3dsIo *io); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | #endif 79 | 80 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds-config.1.in: -------------------------------------------------------------------------------- 1 | .TH lib3ds 1 "16 Jun 2001" @LIB3DS_VERSION@ 2 | .SH NAME 3 | lib3ds-config - script to get information about the installed version of lib3ds 4 | .SH SYNOPSIS 5 | .B lib3ds-config 6 | [\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cflags] 7 | .SH DESCRIPTION 8 | .PP 9 | \fIlib3ds-config\fP is a tool that is used to configure to determine 10 | the compiler and linker flags that should be used to compile and link 11 | programs that use \fIlib3ds\fP. It is also used internally to the .m4 12 | macros for GNU autoconf that are included with \fIlib3ds\fP. 13 | . 14 | .SH OPTIONS 15 | .l 16 | \fIlib3ds-config\fP accepts the following options: 17 | .TP 8 18 | .B \-\-version 19 | Print the currently installed version of \fIlib3ds\fP on the standard 20 | output. 21 | .TP 8 22 | .B \-\-libs 23 | Print the linker flags that are necessary to link a \fIlib3ds\fP 24 | program. 25 | .TP 8 26 | .B \-\-cflags 27 | Print the compiler flags that are necessary to compile a \fIlib3ds\fP 28 | program. 29 | .TP 8 30 | .B \-\-prefix=PREFIX 31 | If specified, use PREFIX instead of the installation prefix that 32 | \fIlib3ds\fP was built with when computing the output for the 33 | \-\-cflags and \-\-libs options. This option is also used for the exec 34 | prefix if \-\-exec\-prefix was not specified. This option must be 35 | specified before any \-\-libs or \-\-cflags options. 36 | .TP 8 37 | .B \-\-exec\-prefix=PREFIX 38 | If specified, use PREFIX instead of the installation exec prefix that 39 | \fIlib3ds\fP was built with when computing the output for the 40 | \-\-cflags and \-\-libs options. This option must be specified before 41 | any \-\-libs or \-\-cflags options. 42 | .SH COPYRIGHT 43 | .PP 44 | This program is free software; you can redistribute it and/or modify 45 | it under the terms of the GNU Lesser General Public License as published by 46 | the Free Software Foundation; either version 2.1 of the License, or (at 47 | your option) any later version. 48 | .PP 49 | This program is distributed in the hope that it will be useful, but 50 | WITHOUT ANY WARRANTY; without even the implied warranty of 51 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 52 | Lesser General Public License for more details. 53 | .PP 54 | You should have received a copy of the GNU Lesser General Public License 55 | along with this program; if not, write to the Free Software 56 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 57 | .SH AUTHOR 58 | This manpage is an almost word-for-word copy of the gtk-config 59 | manpage, written by Owen Taylor. It was modified by Marcelo 60 | E. Magallon , for the Debian GNU/Linux system 61 | (but may be used by others). 62 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/null_rw_mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_null_rw_mutex_H 30 | #define __TBB_null_rw_mutex_H 31 | 32 | namespace tbb { 33 | 34 | //! A rw mutex which does nothing 35 | /** A null_rw_mutex is a rw mutex that does nothing and simulates successful operation. 36 | @ingroup synchronization */ 37 | class null_rw_mutex { 38 | //! Deny assignment and copy construction 39 | null_rw_mutex( const null_rw_mutex& ); 40 | void operator=( const null_rw_mutex& ); 41 | public: 42 | //! Represents acquisition of a mutex. 43 | class scoped_lock { 44 | public: 45 | scoped_lock() {} 46 | scoped_lock( null_rw_mutex& , bool = true ) {} 47 | ~scoped_lock() {} 48 | void acquire( null_rw_mutex& , bool = true ) {} 49 | bool upgrade_to_writer() { return true; } 50 | bool downgrade_to_reader() { return true; } 51 | bool try_acquire( null_rw_mutex& , bool = true ) { return true; } 52 | void release() {} 53 | }; 54 | 55 | null_rw_mutex() {} 56 | 57 | // Mutex traits 58 | static const bool is_rw_mutex = true; 59 | static const bool is_recursive_mutex = true; 60 | static const bool is_fair_mutex = true; 61 | }; 62 | 63 | } 64 | 65 | #endif /* __TBB_null_rw_mutex_H */ 66 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/vector.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_VECTOR_H 3 | #define INCLUDED_LIB3DS_VECTOR_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: vector.h,v 1.7 2007/06/14 09:59:10 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | extern LIB3DSAPI void lib3ds_vector_zero(Lib3dsVector c); 35 | extern LIB3DSAPI void lib3ds_vector_copy(Lib3dsVector dest, Lib3dsVector src); 36 | extern LIB3DSAPI void lib3ds_vector_neg(Lib3dsVector c); 37 | extern LIB3DSAPI void lib3ds_vector_add(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b); 38 | extern LIB3DSAPI void lib3ds_vector_sub(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b); 39 | extern LIB3DSAPI void lib3ds_vector_scalar(Lib3dsVector c, Lib3dsFloat k); 40 | extern LIB3DSAPI void lib3ds_vector_cross(Lib3dsVector c, Lib3dsVector a, Lib3dsVector b); 41 | extern LIB3DSAPI Lib3dsFloat lib3ds_vector_dot(Lib3dsVector a, Lib3dsVector b); 42 | extern LIB3DSAPI Lib3dsFloat lib3ds_vector_squared(Lib3dsVector c); 43 | extern LIB3DSAPI Lib3dsFloat lib3ds_vector_length(Lib3dsVector c); 44 | extern LIB3DSAPI void lib3ds_vector_normalize(Lib3dsVector c); 45 | extern LIB3DSAPI void lib3ds_vector_normal(Lib3dsVector n, Lib3dsVector a, 46 | Lib3dsVector b, Lib3dsVector c); 47 | extern LIB3DSAPI void lib3ds_vector_transform(Lib3dsVector c, Lib3dsMatrix m, Lib3dsVector a); 48 | extern LIB3DSAPI void lib3ds_vector_cubic(Lib3dsVector c, Lib3dsVector a, Lib3dsVector p, 49 | Lib3dsVector q, Lib3dsVector b, Lib3dsFloat t); 50 | extern LIB3DSAPI void lib3ds_vector_min(Lib3dsVector c, Lib3dsVector a); 51 | extern LIB3DSAPI void lib3ds_vector_max(Lib3dsVector c, Lib3dsVector a); 52 | extern LIB3DSAPI void lib3ds_vector_dump(Lib3dsVector c); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/quat.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_QUAT_H 3 | #define INCLUDED_LIB3DS_QUAT_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: quat.h,v 1.7 2007/06/14 09:59:10 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | extern LIB3DSAPI void lib3ds_quat_zero(Lib3dsQuat c); 35 | extern LIB3DSAPI void lib3ds_quat_identity(Lib3dsQuat c); 36 | extern LIB3DSAPI void lib3ds_quat_copy(Lib3dsQuat dest, Lib3dsQuat src); 37 | extern LIB3DSAPI void lib3ds_quat_axis_angle(Lib3dsQuat c, Lib3dsVector axis, Lib3dsFloat angle); 38 | extern LIB3DSAPI void lib3ds_quat_neg(Lib3dsQuat c); 39 | extern LIB3DSAPI void lib3ds_quat_abs(Lib3dsQuat c); 40 | extern LIB3DSAPI void lib3ds_quat_cnj(Lib3dsQuat c); 41 | extern LIB3DSAPI void lib3ds_quat_mul(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b); 42 | extern LIB3DSAPI void lib3ds_quat_scalar(Lib3dsQuat c, Lib3dsFloat k); 43 | extern LIB3DSAPI void lib3ds_quat_normalize(Lib3dsQuat c); 44 | extern LIB3DSAPI void lib3ds_quat_inv(Lib3dsQuat c); 45 | extern LIB3DSAPI Lib3dsFloat lib3ds_quat_dot(Lib3dsQuat a, Lib3dsQuat b); 46 | extern LIB3DSAPI Lib3dsFloat lib3ds_quat_squared(Lib3dsQuat c); 47 | extern LIB3DSAPI Lib3dsFloat lib3ds_quat_length(Lib3dsQuat c); 48 | extern LIB3DSAPI void lib3ds_quat_ln(Lib3dsQuat c); 49 | extern LIB3DSAPI void lib3ds_quat_ln_dif(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b); 50 | extern LIB3DSAPI void lib3ds_quat_exp(Lib3dsQuat c); 51 | extern LIB3DSAPI void lib3ds_quat_slerp(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat b, Lib3dsFloat t); 52 | extern LIB3DSAPI void lib3ds_quat_squad(Lib3dsQuat c, Lib3dsQuat a, Lib3dsQuat p, Lib3dsQuat q, 53 | Lib3dsQuat b, Lib3dsFloat t); 54 | extern LIB3DSAPI void lib3ds_quat_tangent(Lib3dsQuat c, Lib3dsQuat p, Lib3dsQuat q, Lib3dsQuat n); 55 | extern LIB3DSAPI void lib3ds_quat_dump(Lib3dsQuat q); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/tbbmalloc_proxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | /* 30 | Replacing the standard memory allocation routines in Microsoft* C/C++ RTL 31 | (malloc/free, global new/delete, etc.) with the TBB memory allocator. 32 | 33 | Include the following header to a source of any binary which is loaded during 34 | application startup 35 | 36 | #include "tbb/tbbmalloc_proxy.h" 37 | 38 | or add following parameters to the linker options for the binary which is 39 | loaded during application startup. It can be either exe-file or dll. 40 | 41 | For win32 42 | tbbmalloc_proxy.lib /INCLUDE:"___TBB_malloc_proxy" 43 | win64 44 | tbbmalloc_proxy.lib /INCLUDE:"__TBB_malloc_proxy" 45 | */ 46 | 47 | #ifndef __TBB_tbbmalloc_proxy_H 48 | #define __TBB_tbbmalloc_proxy_H 49 | 50 | #if _MSC_VER 51 | 52 | #ifdef _DEBUG 53 | #pragma comment(lib, "tbbmalloc_proxy_debug.lib") 54 | #else 55 | #pragma comment(lib, "tbbmalloc_proxy.lib") 56 | #endif 57 | 58 | #if defined(_WIN64) 59 | #pragma comment(linker, "/include:__TBB_malloc_proxy") 60 | #else 61 | #pragma comment(linker, "/include:___TBB_malloc_proxy") 62 | #endif 63 | 64 | #else 65 | /* Primarily to support MinGW */ 66 | 67 | extern "C" void __TBB_malloc_proxy(); 68 | struct __TBB_malloc_proxy_caller { 69 | __TBB_malloc_proxy_caller() { __TBB_malloc_proxy(); } 70 | } volatile __TBB_malloc_proxy_helper_object; 71 | 72 | #endif // _MSC_VER 73 | 74 | #endif //__TBB_tbbmalloc_proxy_H 75 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/task_scheduler_observer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_task_scheduler_observer_H 30 | #define __TBB_task_scheduler_observer_H 31 | 32 | #include "atomic.h" 33 | 34 | #if __TBB_SCHEDULER_OBSERVER 35 | 36 | namespace tbb { 37 | 38 | namespace internal { 39 | 40 | class observer_proxy; 41 | 42 | class task_scheduler_observer_v3 { 43 | friend class observer_proxy; 44 | observer_proxy* my_proxy; 45 | atomic my_busy_count; 46 | public: 47 | //! Enable or disable observation 48 | void __TBB_EXPORTED_METHOD observe( bool state=true ); 49 | 50 | //! True if observation is enables; false otherwise. 51 | bool is_observing() const {return my_proxy!=NULL;} 52 | 53 | //! Construct observer with observation disabled. 54 | task_scheduler_observer_v3() : my_proxy(NULL) {my_busy_count=0;} 55 | 56 | //! Called by thread before first steal since observation became enabled 57 | virtual void on_scheduler_entry( bool /*is_worker*/ ) {} 58 | 59 | //! Called by thread when it no longer takes part in task stealing. 60 | virtual void on_scheduler_exit( bool /*is_worker*/ ) {} 61 | 62 | //! Destructor 63 | virtual ~task_scheduler_observer_v3() {observe(false);} 64 | }; 65 | 66 | } // namespace internal 67 | 68 | typedef internal::task_scheduler_observer_v3 task_scheduler_observer; 69 | 70 | } // namespace tbb 71 | 72 | #endif /* __TBB_SCHEDULER_OBSERVER */ 73 | 74 | #endif /* __TBB_task_scheduler_observer_H */ 75 | -------------------------------------------------------------------------------- /ac-macros/ax_openmp.m4: -------------------------------------------------------------------------------- 1 | dnl @synopsis AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) 2 | dnl 3 | dnl @summary determine how to compile programs using OpenMP 4 | dnl 5 | dnl This macro tries to find out how to compile programs that use 6 | dnl OpenMP a standard API and set of compiler directives for parallel 7 | dnl programming (see http://www-unix.mcs/) 8 | dnl 9 | dnl On success, it sets the 10 | dnl OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS output variable to 11 | dnl the flag (e.g. -omp) used both to compile *and* link OpenMP 12 | dnl programs in the current language. 13 | dnl 14 | dnl NOTE: You are assumed to not only compile your program with these 15 | dnl flags, but also link it with them as well. 16 | dnl 17 | dnl If you want to compile everything with OpenMP, you should set: 18 | dnl 19 | dnl CFLAGS="$CFLAGS $OPENMP_CFLAGS" 20 | dnl #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" 21 | dnl #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" 22 | dnl 23 | dnl (depending on the selected language). 24 | dnl 25 | dnl The user can override the default choice by setting the 26 | dnl corresponding environment variable (e.g. OPENMP_CFLAGS). 27 | dnl 28 | dnl ACTION-IF-FOUND is a list of shell commands to run if an OpenMP 29 | dnl flag is found, and ACTION-IF-NOT-FOUND is a list of commands to run 30 | dnl it if it is not found. If ACTION-IF-FOUND is not specified, the 31 | dnl default action will define HAVE_OPENMP. 32 | dnl 33 | dnl @category InstalledPackages 34 | dnl @author Steven G. Johnson 35 | dnl @version 2006-01-24 36 | dnl @license GPLWithACException 37 | 38 | AC_DEFUN([AX_OPENMP], [ 39 | AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX 40 | 41 | AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS 42 | ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown 43 | # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), 44 | # -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none 45 | ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" 46 | if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then 47 | ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" 48 | fi 49 | for ax_openmp_flag in $ax_openmp_flags; do 50 | case $ax_openmp_flag in 51 | none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; 52 | *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; 53 | esac 54 | AC_TRY_LINK_FUNC(omp_set_num_threads, 55 | [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) 56 | done 57 | []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS 58 | ]) 59 | if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then 60 | m4_default([$2],:) 61 | else 62 | if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then 63 | OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp 64 | fi 65 | m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) 66 | fi 67 | ])dnl AX_OPENMP 68 | -------------------------------------------------------------------------------- /src/Scene.h: -------------------------------------------------------------------------------- 1 | /* 2 | * renderer - A simple implementation of polygon-based 3D algorithms. 3 | * Copyright (C) 2004 Thanassis Tsiodras (ttsiodras@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __scene_h__ 21 | #define __scene_h__ 22 | 23 | #include 24 | 25 | #include "Base3d.h" 26 | #include "BVH.h" 27 | 28 | struct Light; 29 | struct Screen; 30 | struct Camera; 31 | 32 | struct Scene { 33 | static const coord MaxCoordAfterRescale; 34 | 35 | std::vector _vertices; 36 | std::vector _triangles; 37 | std::vector _lights; 38 | 39 | // Bounding Volume Hierarchy 40 | BVHNode *_pSceneBVH; 41 | 42 | // Cache-friendly version of the Bounding Volume Hierarchy data 43 | // (32 bytes per CacheFriendlyBVHNode, i.e. one CPU cache line) 44 | unsigned _triIndexListNo; 45 | int *_triIndexList; 46 | unsigned _pCFBVH_No; 47 | CacheFriendlyBVHNode *_pCFBVH; 48 | 49 | Scene() 50 | : 51 | _pSceneBVH(NULL), 52 | _triIndexListNo(0), 53 | _triIndexList(NULL), 54 | _pCFBVH_No(0), 55 | _pCFBVH(NULL) 56 | {} 57 | 58 | // Load object 59 | void load(const char *filename); 60 | 61 | // Update triangle normals 62 | void fix_normals(void); 63 | 64 | // Cache-friendly version of the Bounding Volume Hierarchy data 65 | // (creation functions) 66 | void PopulateCacheFriendlyBVH( 67 | Triangle *pFirstTriangle, 68 | BVHNode *root, 69 | unsigned& idxBoxes, 70 | unsigned& idxTriList); 71 | void CreateCFBVH(); 72 | 73 | // Creates BVH and Cache-friendly version of BVH 74 | void UpdateBoundingVolumeHierarchy(const char *filename, bool forceRecalc=false); 75 | 76 | void renderPoints(const Camera&, Screen&, bool asTriangles = true); 77 | void renderWireframe(const Camera&, Screen&); 78 | void renderAmbient(const Camera&, Screen&); 79 | void renderGouraud(const Camera&, Screen&); 80 | void renderPhong(const Camera&, Screen&); 81 | void renderPhongAndShadowed(const Camera&, Screen&); 82 | void renderPhongAndSoftShadowed(const Camera&, Screen&); 83 | 84 | // Since it may be aborted for taking too long, this returns "boolCompletedOK" 85 | bool renderRaytracer(Camera&, Screen&, bool antiAlias = false); 86 | }; 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_version.h 24 | * This header defines the current SDL version 25 | */ 26 | 27 | #ifndef _SDL_version_h 28 | #define _SDL_version_h 29 | 30 | #include "SDL_stdinc.h" 31 | 32 | #include "begin_code.h" 33 | /* Set up for C function definitions, even when using C++ */ 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /** @name Version Number 39 | * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL 40 | */ 41 | /*@{*/ 42 | #define SDL_MAJOR_VERSION 1 43 | #define SDL_MINOR_VERSION 2 44 | #define SDL_PATCHLEVEL 14 45 | /*@}*/ 46 | 47 | typedef struct SDL_version { 48 | Uint8 major; 49 | Uint8 minor; 50 | Uint8 patch; 51 | } SDL_version; 52 | 53 | /** 54 | * This macro can be used to fill a version structure with the compile-time 55 | * version of the SDL library. 56 | */ 57 | #define SDL_VERSION(X) \ 58 | { \ 59 | (X)->major = SDL_MAJOR_VERSION; \ 60 | (X)->minor = SDL_MINOR_VERSION; \ 61 | (X)->patch = SDL_PATCHLEVEL; \ 62 | } 63 | 64 | /** This macro turns the version numbers into a numeric value: 65 | * (1,2,3) -> (1203) 66 | * This assumes that there will never be more than 100 patchlevels 67 | */ 68 | #define SDL_VERSIONNUM(X, Y, Z) \ 69 | ((X)*1000 + (Y)*100 + (Z)) 70 | 71 | /** This is the version number macro for the current SDL version */ 72 | #define SDL_COMPILEDVERSION \ 73 | SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) 74 | 75 | /** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ 76 | #define SDL_VERSION_ATLEAST(X, Y, Z) \ 77 | (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) 78 | 79 | /** This function gets the version of the dynamically linked SDL library. 80 | * it should NOT be used to fill a version structure, instead you should 81 | * use the SDL_Version() macro. 82 | */ 83 | extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); 84 | 85 | /* Ends C function definitions when using C++ */ 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #include "close_code.h" 90 | 91 | #endif /* _SDL_version_h */ 92 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/tbb.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_tbb_H 30 | #define __TBB_tbb_H 31 | 32 | /** 33 | This header bulk-includes declarations or definitions of all the functionality 34 | provided by TBB (save for malloc dependent headers). 35 | 36 | If you use only a few TBB constructs, consider including specific headers only. 37 | Any header listed below can be included independently of others. 38 | **/ 39 | 40 | #include "aligned_space.h" 41 | #include "atomic.h" 42 | #include "blocked_range.h" 43 | #include "blocked_range2d.h" 44 | #include "blocked_range3d.h" 45 | #include "cache_aligned_allocator.h" 46 | #include "concurrent_hash_map.h" 47 | #include "concurrent_queue.h" 48 | #include "concurrent_vector.h" 49 | #include "enumerable_thread_specific.h" 50 | #include "mutex.h" 51 | #include "null_mutex.h" 52 | #include "null_rw_mutex.h" 53 | #include "parallel_do.h" 54 | #include "parallel_for.h" 55 | #include "parallel_for_each.h" 56 | #include "parallel_invoke.h" 57 | #include "parallel_reduce.h" 58 | #include "parallel_scan.h" 59 | #include "parallel_sort.h" 60 | #include "partitioner.h" 61 | #include "pipeline.h" 62 | #include "queuing_mutex.h" 63 | #include "queuing_rw_mutex.h" 64 | #include "recursive_mutex.h" 65 | #include "spin_mutex.h" 66 | #include "spin_rw_mutex.h" 67 | #include "task.h" 68 | #include "task_group.h" 69 | #include "task_scheduler_init.h" 70 | #include "task_scheduler_observer.h" 71 | #include "tbb_allocator.h" 72 | #include "tbb_exception.h" 73 | #include "tbb_thread.h" 74 | #include "tick_count.h" 75 | 76 | #endif /* __TBB_tbb_H */ 77 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/combinable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_combinable_H 30 | #define __TBB_combinable_H 31 | 32 | #include "tbb/enumerable_thread_specific.h" 33 | #include "tbb/cache_aligned_allocator.h" 34 | 35 | namespace tbb { 36 | /** \name combinable 37 | **/ 38 | //@{ 39 | //! Thread-local storage with optional reduction 40 | /** @ingroup containers */ 41 | template 42 | class combinable { 43 | private: 44 | typedef typename tbb::cache_aligned_allocator my_alloc; 45 | 46 | typedef typename tbb::enumerable_thread_specific my_ets_type; 47 | my_ets_type my_ets; 48 | 49 | public: 50 | 51 | combinable() { } 52 | 53 | template 54 | combinable( finit _finit) : my_ets(_finit) { } 55 | 56 | //! destructor 57 | ~combinable() { 58 | } 59 | 60 | combinable(const combinable& other) : my_ets(other.my_ets) { } 61 | 62 | combinable & operator=( const combinable & other) { my_ets = other.my_ets; return *this; } 63 | 64 | void clear() { my_ets.clear(); } 65 | 66 | T& local() { return my_ets.local(); } 67 | 68 | T& local(bool & exists) { return my_ets.local(exists); } 69 | 70 | template< typename FCombine> 71 | T combine(FCombine fcombine) { return my_ets.combine(fcombine); } 72 | 73 | template 74 | void combine_each(FCombine fcombine) { my_ets.combine_each(fcombine); } 75 | 76 | }; 77 | } // namespace tbb 78 | #endif /* __TBB_combinable_H */ 79 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_loadso.h 24 | * System dependent library loading routines 25 | */ 26 | 27 | /** @file SDL_loadso.h 28 | * Some things to keep in mind: 29 | * - These functions only work on C function names. Other languages may 30 | * have name mangling and intrinsic language support that varies from 31 | * compiler to compiler. 32 | * - Make sure you declare your function pointers with the same calling 33 | * convention as the actual library function. Your code will crash 34 | * mysteriously if you do not do this. 35 | * - Avoid namespace collisions. If you load a symbol from the library, 36 | * it is not defined whether or not it goes into the global symbol 37 | * namespace for the application. If it does and it conflicts with 38 | * symbols in your code or other shared libraries, you will not get 39 | * the results you expect. :) 40 | */ 41 | 42 | 43 | #ifndef _SDL_loadso_h 44 | #define _SDL_loadso_h 45 | 46 | #include "SDL_stdinc.h" 47 | #include "SDL_error.h" 48 | 49 | #include "begin_code.h" 50 | /* Set up for C function definitions, even when using C++ */ 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | /** 56 | * This function dynamically loads a shared object and returns a pointer 57 | * to the object handle (or NULL if there was an error). 58 | * The 'sofile' parameter is a system dependent name of the object file. 59 | */ 60 | extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); 61 | 62 | /** 63 | * Given an object handle, this function looks up the address of the 64 | * named function in the shared object and returns it. This address 65 | * is no longer valid after calling SDL_UnloadObject(). 66 | */ 67 | extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); 68 | 69 | /** Unload a shared object from memory */ 70 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 71 | 72 | /* Ends C function definitions when using C++ */ 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | #include "close_code.h" 77 | 78 | #endif /* _SDL_loadso_h */ 79 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/atmosphere.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_ATMOSPHERE_H 3 | #define INCLUDED_LIB3DS_ATMOSPHERE_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: atmosphere.h,v 1.8 2007/06/20 17:04:08 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * Fog atmosphere settings 36 | * \ingroup atmosphere 37 | */ 38 | typedef struct Lib3dsFog { 39 | Lib3dsBool use; 40 | Lib3dsRgb col; 41 | Lib3dsBool fog_background; 42 | Lib3dsFloat near_plane; 43 | Lib3dsFloat near_density; 44 | Lib3dsFloat far_plane; 45 | Lib3dsFloat far_density; 46 | } Lib3dsFog; 47 | 48 | /** 49 | * Layer fog atmosphere flags 50 | * \ingroup atmosphere 51 | */ 52 | typedef enum Lib3dsLayerFogFlags { 53 | LIB3DS_BOTTOM_FALL_OFF =0x00000001, 54 | LIB3DS_TOP_FALL_OFF =0x00000002, 55 | LIB3DS_FOG_BACKGROUND =0x00100000 56 | } Lib3dsLayerFogFlags; 57 | 58 | /** 59 | * Layer fog atmosphere settings 60 | * \ingroup atmosphere 61 | */ 62 | typedef struct Lib3dsLayerFog { 63 | Lib3dsBool use; 64 | Lib3dsDword flags; 65 | Lib3dsRgb col; 66 | Lib3dsFloat near_y; 67 | Lib3dsFloat far_y; 68 | Lib3dsFloat density; 69 | } Lib3dsLayerFog; 70 | 71 | /** 72 | * Distance cue atmosphere settings 73 | * \ingroup atmosphere 74 | */ 75 | typedef struct Lib3dsDistanceCue { 76 | Lib3dsBool use; 77 | Lib3dsBool cue_background; 78 | Lib3dsFloat near_plane; 79 | Lib3dsFloat near_dimming; 80 | Lib3dsFloat far_plane; 81 | Lib3dsFloat far_dimming; 82 | } Lib3dsDistanceCue; 83 | 84 | /** 85 | * Atmosphere settings 86 | * \ingroup atmosphere 87 | */ 88 | struct Lib3dsAtmosphere { 89 | Lib3dsFog fog; 90 | Lib3dsLayerFog layer_fog; 91 | Lib3dsDistanceCue dist_cue; 92 | }; 93 | 94 | extern LIB3DSAPI Lib3dsBool lib3ds_atmosphere_read(Lib3dsAtmosphere *atmosphere, Lib3dsIo *io); 95 | extern LIB3DSAPI Lib3dsBool lib3ds_atmosphere_write(Lib3dsAtmosphere *atmosphere, Lib3dsIo *io); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | #endif 101 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl AM_PATH_LIB3DS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) 3 | dnl 4 | AC_DEFUN([AM_PATH_LIB3DS], 5 | [ 6 | 7 | AC_ARG_WITH(lib3ds-prefix,[ --with-lib3ds-prefix=PFX Prefix where lib3ds is installed (optional)], 8 | lib3ds_config_prefix="$withval", lib3ds_config_prefix="") 9 | AC_ARG_WITH(lib3ds-exec-prefix,[ --with-lib3ds-exec-prefix=PFX Exec prefix where lib3ds is installed (optional)], 10 | lib3ds_config_exec_prefix="$withval", lib3ds_config_exec_prefix="") 11 | 12 | if test x$lib3ds_config_exec_prefix != x ; then 13 | lib3ds_config_args="$lib3ds_config_args --exec-prefix=$lib3ds_config_exec_prefix" 14 | if test x${LIB3DS_CONFIG+set} != xset ; then 15 | LIB3DS_CONFIG=$lib3ds_config_exec_prefix/bin/lib3ds-config 16 | fi 17 | fi 18 | if test x$lib3ds_config_prefix != x ; then 19 | lib3ds_config_args="$lib3ds_config_args --prefix=$lib3ds_config_prefix" 20 | if test x${LIB3DS_CONFIG+set} != xset ; then 21 | LIB3DS_CONFIG=$lib3ds_config_prefix/bin/lib3ds-config 22 | fi 23 | fi 24 | 25 | AC_PATH_PROG(LIB3DS_CONFIG, lib3ds-config, no) 26 | lib3ds_version_min=$1 27 | 28 | AC_MSG_CHECKING(for Lib3ds - version >= $lib3ds_version_min) 29 | no_lib3ds="" 30 | if test "$LIB3DS_CONFIG" = "no" ; then 31 | no_lib3ds=yes 32 | else 33 | LIB3DS_CFLAGS=`$LIB3DS_CONFIG --cflags` 34 | LIB3DS_LIBS=`$LIB3DS_CONFIG --libs` 35 | lib3ds_version=`$LIB3DS_CONFIG --version` 36 | 37 | lib3ds_major_version=`echo $lib3ds_version | \ 38 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 39 | lib3ds_minor_version=`echo $lib3ds_version | \ 40 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 41 | lib3ds_micro_version=`echo $lib3ds_version | \ 42 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 43 | 44 | lib3ds_major_min=`echo $lib3ds_version_min | \ 45 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` 46 | lib3ds_minor_min=`echo $lib3ds_version_min | \ 47 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` 48 | lib3ds_micro_min=`echo $lib3ds_version_min | \ 49 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` 50 | 51 | lib3ds_version_proper=`expr \ 52 | $lib3ds_major_version \> $lib3ds_major_min \| \ 53 | $lib3ds_major_version \= $lib3ds_major_min \& \ 54 | $lib3ds_minor_version \> $lib3ds_minor_min \| \ 55 | $lib3ds_major_version \= $lib3ds_major_min \& \ 56 | $lib3ds_minor_version \= $lib3ds_minor_min \& \ 57 | $lib3ds_micro_version \>= $lib3ds_micro_min ` 58 | 59 | if test "$lib3ds_version_proper" = "1" ; then 60 | AC_MSG_RESULT([$lib3ds_major_version.$lib3ds_minor_version.$lib3ds_micro_version]) 61 | else 62 | AC_MSG_RESULT(no) 63 | no_lib3ds=yes 64 | fi 65 | fi 66 | 67 | if test "x$no_lib3ds" = x ; then 68 | ifelse([$2], , :, [$2]) 69 | else 70 | LIB3DS_CFLAGS="" 71 | LIB3DS_LIBS="" 72 | ifelse([$3], , :, [$3]) 73 | fi 74 | 75 | AC_SUBST(LIB3DS_CFLAGS) 76 | AC_SUBST(LIB3DS_LIBS) 77 | ]) 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/parallel_for_each.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_parallel_for_each_H 30 | #define __TBB_parallel_for_each_H 31 | 32 | #include "parallel_do.h" 33 | 34 | namespace tbb { 35 | 36 | //! @cond INTERNAL 37 | namespace internal { 38 | // The class calls user function in operator() 39 | template 40 | class parallel_for_each_body : internal::no_assign { 41 | Function &my_func; 42 | public: 43 | parallel_for_each_body(Function &_func) : my_func(_func) {} 44 | parallel_for_each_body(const parallel_for_each_body &_caller) : my_func(_caller.my_func) {} 45 | 46 | void operator() ( typename std::iterator_traits::value_type value ) const { 47 | my_func(value); 48 | } 49 | }; 50 | } // namespace internal 51 | //! @endcond 52 | 53 | /** \name parallel_for_each 54 | **/ 55 | //@{ 56 | //! Calls function f for all items from [first, last) interval using user-supplied context 57 | /** @ingroup algorithms */ 58 | template 59 | Function parallel_for_each(InputIterator first, InputIterator last, Function f, task_group_context &context) { 60 | internal::parallel_for_each_body body(f); 61 | 62 | tbb::parallel_do (first, last, body, context); 63 | return f; 64 | } 65 | 66 | //! Uses default context 67 | template 68 | Function parallel_for_each(InputIterator first, InputIterator last, Function f) { 69 | internal::parallel_for_each_body body(f); 70 | 71 | tbb::parallel_do (first, last, body); 72 | return f; 73 | } 74 | 75 | //@} 76 | 77 | } // namespace 78 | 79 | #endif /* __TBB_parallel_for_each_H */ 80 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/matrix.h: -------------------------------------------------------------------------------- 1 | /* -*- c -*- */ 2 | #ifndef INCLUDED_LIB3DS_MATRIX_H 3 | #define INCLUDED_LIB3DS_MATRIX_H 4 | /* 5 | * The 3D Studio File Format Library 6 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 7 | * All rights reserved. 8 | * 9 | * This program is free software; you can redistribute it and/or modify it 10 | * under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or (at 12 | * your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | * License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software Foundation, 21 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * 23 | * $Id: matrix.h,v 1.8 2007/06/18 06:11:32 jeh Exp $ 24 | */ 25 | 26 | #ifndef INCLUDED_LIB3DS_TYPES_H 27 | #include 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | extern LIB3DSAPI void lib3ds_matrix_zero(Lib3dsMatrix m); 35 | extern LIB3DSAPI void lib3ds_matrix_identity(Lib3dsMatrix m); 36 | extern LIB3DSAPI void lib3ds_matrix_copy(Lib3dsMatrix dest, Lib3dsMatrix src); 37 | extern LIB3DSAPI void lib3ds_matrix_neg(Lib3dsMatrix m); 38 | extern LIB3DSAPI void lib3ds_matrix_abs(Lib3dsMatrix m); 39 | extern LIB3DSAPI void lib3ds_matrix_transpose(Lib3dsMatrix m); 40 | extern LIB3DSAPI void _lib3ds_matrix_add(Lib3dsMatrix m, Lib3dsMatrix a, Lib3dsMatrix b); 41 | extern LIB3DSAPI void _lib3ds_matrix_sub(Lib3dsMatrix m, Lib3dsMatrix a, Lib3dsMatrix b); 42 | extern LIB3DSAPI void lib3ds_matrix_mult(Lib3dsMatrix m, Lib3dsMatrix n); 43 | extern LIB3DSAPI void lib3ds_matrix_scalar(Lib3dsMatrix m, Lib3dsFloat k); 44 | extern LIB3DSAPI Lib3dsFloat lib3ds_matrix_det(Lib3dsMatrix m); 45 | extern LIB3DSAPI void lib3ds_matrix_adjoint(Lib3dsMatrix m); 46 | extern LIB3DSAPI Lib3dsBool lib3ds_matrix_inv(Lib3dsMatrix m); 47 | extern LIB3DSAPI void lib3ds_matrix_translate_xyz(Lib3dsMatrix m, Lib3dsFloat x, Lib3dsFloat y, Lib3dsFloat z); 48 | extern LIB3DSAPI void lib3ds_matrix_translate(Lib3dsMatrix m, Lib3dsVector t); 49 | extern LIB3DSAPI void lib3ds_matrix_scale_xyz(Lib3dsMatrix m, Lib3dsFloat x, Lib3dsFloat y, Lib3dsFloat z); 50 | extern LIB3DSAPI void lib3ds_matrix_scale(Lib3dsMatrix m, Lib3dsVector s); 51 | extern LIB3DSAPI void lib3ds_matrix_rotate_x(Lib3dsMatrix m, Lib3dsFloat phi); 52 | extern LIB3DSAPI void lib3ds_matrix_rotate_y(Lib3dsMatrix m, Lib3dsFloat phi); 53 | extern LIB3DSAPI void lib3ds_matrix_rotate_z(Lib3dsMatrix m, Lib3dsFloat phi); 54 | extern LIB3DSAPI void lib3ds_matrix_rotate(Lib3dsMatrix m, Lib3dsQuat q); 55 | extern LIB3DSAPI void lib3ds_matrix_rotate_axis(Lib3dsMatrix m, Lib3dsVector axis, Lib3dsFloat angle); 56 | extern LIB3DSAPI void lib3ds_matrix_camera(Lib3dsMatrix matrix, Lib3dsVector pos, Lib3dsVector tgt, Lib3dsFloat roll); 57 | extern LIB3DSAPI void lib3ds_matrix_dump(Lib3dsMatrix matrix); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_platform.h 24 | * Try to get a standard set of platform defines 25 | */ 26 | 27 | #ifndef _SDL_platform_h 28 | #define _SDL_platform_h 29 | 30 | #if defined(_AIX) 31 | #undef __AIX__ 32 | #define __AIX__ 1 33 | #endif 34 | #if defined(__BEOS__) 35 | #undef __BEOS__ 36 | #define __BEOS__ 1 37 | #endif 38 | #if defined(__HAIKU__) 39 | #undef __HAIKU__ 40 | #define __HAIKU__ 1 41 | #endif 42 | #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) 43 | #undef __BSDI__ 44 | #define __BSDI__ 1 45 | #endif 46 | #if defined(_arch_dreamcast) 47 | #undef __DREAMCAST__ 48 | #define __DREAMCAST__ 1 49 | #endif 50 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) 51 | #undef __FREEBSD__ 52 | #define __FREEBSD__ 1 53 | #endif 54 | #if defined(__HAIKU__) 55 | #undef __HAIKU__ 56 | #define __HAIKU__ 1 57 | #endif 58 | #if defined(hpux) || defined(__hpux) || defined(__hpux__) 59 | #undef __HPUX__ 60 | #define __HPUX__ 1 61 | #endif 62 | #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) 63 | #undef __IRIX__ 64 | #define __IRIX__ 1 65 | #endif 66 | #if defined(linux) || defined(__linux) || defined(__linux__) 67 | #undef __LINUX__ 68 | #define __LINUX__ 1 69 | #endif 70 | #if defined(__APPLE__) 71 | #undef __MACOSX__ 72 | #define __MACOSX__ 1 73 | #elif defined(macintosh) 74 | #undef __MACOS__ 75 | #define __MACOS__ 1 76 | #endif 77 | #if defined(__NetBSD__) 78 | #undef __NETBSD__ 79 | #define __NETBSD__ 1 80 | #endif 81 | #if defined(__OpenBSD__) 82 | #undef __OPENBSD__ 83 | #define __OPENBSD__ 1 84 | #endif 85 | #if defined(__OS2__) 86 | #undef __OS2__ 87 | #define __OS2__ 1 88 | #endif 89 | #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) 90 | #undef __OSF__ 91 | #define __OSF__ 1 92 | #endif 93 | #if defined(__QNXNTO__) 94 | #undef __QNXNTO__ 95 | #define __QNXNTO__ 1 96 | #endif 97 | #if defined(riscos) || defined(__riscos) || defined(__riscos__) 98 | #undef __RISCOS__ 99 | #define __RISCOS__ 1 100 | #endif 101 | #if defined(__SVR4) 102 | #undef __SOLARIS__ 103 | #define __SOLARIS__ 1 104 | #endif 105 | #if defined(WIN32) || defined(_WIN32) 106 | #undef __WIN32__ 107 | #define __WIN32__ 1 108 | #endif 109 | 110 | #endif /* _SDL_platform_h */ 111 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_config_dreamcast.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_dreamcast_h 24 | #define _SDL_config_dreamcast_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This is a set of defines to configure the SDL features */ 29 | 30 | typedef signed char int8_t; 31 | typedef unsigned char uint8_t; 32 | typedef signed short int16_t; 33 | typedef unsigned short uint16_t; 34 | typedef signed int int32_t; 35 | typedef unsigned int uint32_t; 36 | typedef signed long long int64_t; 37 | typedef unsigned long long uint64_t; 38 | typedef unsigned long uintptr_t; 39 | #define SDL_HAS_64BIT_TYPE 1 40 | 41 | /* Useful headers */ 42 | #define HAVE_SYS_TYPES_H 1 43 | #define HAVE_STDIO_H 1 44 | #define STDC_HEADERS 1 45 | #define HAVE_STRING_H 1 46 | #define HAVE_CTYPE_H 1 47 | 48 | /* C library functions */ 49 | #define HAVE_MALLOC 1 50 | #define HAVE_CALLOC 1 51 | #define HAVE_REALLOC 1 52 | #define HAVE_FREE 1 53 | #define HAVE_ALLOCA 1 54 | #define HAVE_GETENV 1 55 | #define HAVE_PUTENV 1 56 | #define HAVE_QSORT 1 57 | #define HAVE_ABS 1 58 | #define HAVE_BCOPY 1 59 | #define HAVE_MEMSET 1 60 | #define HAVE_MEMCPY 1 61 | #define HAVE_MEMMOVE 1 62 | #define HAVE_MEMCMP 1 63 | #define HAVE_STRLEN 1 64 | #define HAVE_STRDUP 1 65 | #define HAVE_INDEX 1 66 | #define HAVE_RINDEX 1 67 | #define HAVE_STRCHR 1 68 | #define HAVE_STRRCHR 1 69 | #define HAVE_STRSTR 1 70 | #define HAVE_STRTOL 1 71 | #define HAVE_STRTOD 1 72 | #define HAVE_ATOI 1 73 | #define HAVE_ATOF 1 74 | #define HAVE_STRCMP 1 75 | #define HAVE_STRNCMP 1 76 | #define HAVE_STRICMP 1 77 | #define HAVE_STRCASECMP 1 78 | #define HAVE_SSCANF 1 79 | #define HAVE_SNPRINTF 1 80 | #define HAVE_VSNPRINTF 1 81 | 82 | /* Enable various audio drivers */ 83 | #define SDL_AUDIO_DRIVER_DC 1 84 | #define SDL_AUDIO_DRIVER_DISK 1 85 | #define SDL_AUDIO_DRIVER_DUMMY 1 86 | 87 | /* Enable various cdrom drivers */ 88 | #define SDL_CDROM_DC 1 89 | 90 | /* Enable various input drivers */ 91 | #define SDL_JOYSTICK_DC 1 92 | 93 | /* Enable various shared object loading systems */ 94 | #define SDL_LOADSO_DUMMY 1 95 | 96 | /* Enable various threading systems */ 97 | #define SDL_THREAD_DC 1 98 | 99 | /* Enable various timer systems */ 100 | #define SDL_TIMER_DC 1 101 | 102 | /* Enable various video drivers */ 103 | #define SDL_VIDEO_DRIVER_DC 1 104 | #define SDL_VIDEO_DRIVER_DUMMY 1 105 | 106 | #endif /* _SDL_config_dreamcast_h */ 107 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_config_macos.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_macos_h 24 | #define _SDL_config_macos_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This is a set of defines to configure the SDL features */ 29 | 30 | #include 31 | 32 | typedef SInt8 int8_t; 33 | typedef UInt8 uint8_t; 34 | typedef SInt16 int16_t; 35 | typedef UInt16 uint16_t; 36 | typedef SInt32 int32_t; 37 | typedef UInt32 uint32_t; 38 | typedef SInt64 int64_t; 39 | typedef UInt64 uint64_t; 40 | typedef unsigned long uintptr_t; 41 | 42 | #define SDL_HAS_64BIT_TYPE 1 43 | 44 | /* Useful headers */ 45 | #define HAVE_STDIO_H 1 46 | #define STDC_HEADERS 1 47 | #define HAVE_STRING_H 1 48 | #define HAVE_CTYPE_H 1 49 | #define HAVE_MATH_H 1 50 | #define HAVE_SIGNAL_H 1 51 | 52 | /* C library functions */ 53 | #define HAVE_MALLOC 1 54 | #define HAVE_CALLOC 1 55 | #define HAVE_REALLOC 1 56 | #define HAVE_FREE 1 57 | #define HAVE_ALLOCA 1 58 | #define HAVE_ABS 1 59 | #define HAVE_MEMSET 1 60 | #define HAVE_MEMCPY 1 61 | #define HAVE_MEMMOVE 1 62 | #define HAVE_MEMCMP 1 63 | #define HAVE_STRLEN 1 64 | #define HAVE_STRCHR 1 65 | #define HAVE_STRRCHR 1 66 | #define HAVE_STRSTR 1 67 | #define HAVE_ITOA 1 68 | #define HAVE_STRTOL 1 69 | #define HAVE_STRTOD 1 70 | #define HAVE_ATOI 1 71 | #define HAVE_ATOF 1 72 | #define HAVE_STRCMP 1 73 | #define HAVE_STRNCMP 1 74 | #define HAVE_SSCANF 1 75 | 76 | /* Enable various audio drivers */ 77 | #define SDL_AUDIO_DRIVER_SNDMGR 1 78 | #define SDL_AUDIO_DRIVER_DISK 1 79 | #define SDL_AUDIO_DRIVER_DUMMY 1 80 | 81 | /* Enable various cdrom drivers */ 82 | #if TARGET_API_MAC_CARBON 83 | #define SDL_CDROM_DUMMY 1 84 | #else 85 | #define SDL_CDROM_MACOS 1 86 | #endif 87 | 88 | /* Enable various input drivers */ 89 | #if TARGET_API_MAC_CARBON 90 | #define SDL_JOYSTICK_DUMMY 1 91 | #else 92 | #define SDL_JOYSTICK_MACOS 1 93 | #endif 94 | 95 | /* Enable various shared object loading systems */ 96 | #define SDL_LOADSO_MACOS 1 97 | 98 | /* Enable various threading systems */ 99 | #define SDL_THREADS_DISABLED 1 100 | 101 | /* Enable various timer systems */ 102 | #define SDL_TIMER_MACOS 1 103 | 104 | /* Enable various video drivers */ 105 | #define SDL_VIDEO_DRIVER_DUMMY 1 106 | #define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 107 | #define SDL_VIDEO_DRIVER_TOOLBOX 1 108 | 109 | /* Enable OpenGL support */ 110 | #define SDL_VIDEO_OPENGL 1 111 | 112 | #endif /* _SDL_config_macos_h */ 113 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/machine/linux_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_machine_H 30 | #error Do not include this file directly; include tbb_machine.h instead 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | // Definition of __TBB_Yield() 38 | #define __TBB_Yield() sched_yield() 39 | 40 | /* Futex definitions */ 41 | #include 42 | 43 | #if defined(SYS_futex) 44 | 45 | #define __TBB_USE_FUTEX 1 46 | #include 47 | #include 48 | // Unfortunately, some versions of Linux do not have a header that defines FUTEX_WAIT and FUTEX_WAKE. 49 | 50 | #ifdef FUTEX_WAIT 51 | #define __TBB_FUTEX_WAIT FUTEX_WAIT 52 | #else 53 | #define __TBB_FUTEX_WAIT 0 54 | #endif 55 | 56 | #ifdef FUTEX_WAKE 57 | #define __TBB_FUTEX_WAKE FUTEX_WAKE 58 | #else 59 | #define __TBB_FUTEX_WAKE 1 60 | #endif 61 | 62 | #ifndef __TBB_ASSERT 63 | #error machine specific headers must be included after tbb_stddef.h 64 | #endif 65 | 66 | namespace tbb { 67 | 68 | namespace internal { 69 | 70 | inline int futex_wait( void *futex, int comparand ) { 71 | int r = ::syscall( SYS_futex,futex,__TBB_FUTEX_WAIT,comparand,NULL,NULL,0 ); 72 | #if TBB_USE_ASSERT 73 | int e = errno; 74 | __TBB_ASSERT( r==0||r==EWOULDBLOCK||(r==-1&&(e==EAGAIN||e==EINTR)), "futex_wait failed." ); 75 | #endif /* TBB_USE_ASSERT */ 76 | return r; 77 | } 78 | 79 | inline int futex_wakeup_one( void *futex ) { 80 | int r = ::syscall( SYS_futex,futex,__TBB_FUTEX_WAKE,1,NULL,NULL,0 ); 81 | __TBB_ASSERT( r==0||r==1, "futex_wakeup_one: more than one thread woken up?" ); 82 | return r; 83 | } 84 | 85 | inline int futex_wakeup_all( void *futex ) { 86 | int r = ::syscall( SYS_futex,futex,__TBB_FUTEX_WAKE,INT_MAX,NULL,NULL,0 ); 87 | __TBB_ASSERT( r>=0, "futex_wakeup_all: error in waking up threads" ); 88 | return r; 89 | } 90 | 91 | } /* namespace internal */ 92 | 93 | } /* namespace tbb */ 94 | 95 | #endif /* SYS_futex */ 96 | -------------------------------------------------------------------------------- /ac-macros/ax_check_linker_flags.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.nongnu.org/autoconf-archive/ax_check_linker_flags.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check whether the given linker FLAGS work with the current language's 12 | # linker, or whether they give an error. 13 | # 14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 15 | # success/failure. 16 | # 17 | # NOTE: Based on AX_CHECK_COMPILER_FLAGS. 18 | # 19 | # LICENSE 20 | # 21 | # Copyright (c) 2009 Mike Frysinger 22 | # Copyright (c) 2009 Steven G. Johnson 23 | # Copyright (c) 2009 Matteo Frigo 24 | # 25 | # This program is free software: you can redistribute it and/or modify it 26 | # under the terms of the GNU General Public License as published by the 27 | # Free Software Foundation, either version 3 of the License, or (at your 28 | # option) any later version. 29 | # 30 | # This program is distributed in the hope that it will be useful, but 31 | # WITHOUT ANY WARRANTY; without even the implied warranty of 32 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 33 | # Public License for more details. 34 | # 35 | # You should have received a copy of the GNU General Public License along 36 | # with this program. If not, see . 37 | # 38 | # As a special exception, the respective Autoconf Macro's copyright owner 39 | # gives unlimited permission to copy, distribute and modify the configure 40 | # scripts that are the output of Autoconf when processing the Macro. You 41 | # need not follow the terms of the GNU General Public License when using 42 | # or distributing such scripts, even though portions of the text of the 43 | # Macro appear in them. The GNU General Public License (GPL) does govern 44 | # all other use of the material that constitutes the Autoconf Macro. 45 | # 46 | # This special exception to the GPL applies to versions of the Autoconf 47 | # Macro released by the Autoconf Archive. When you make and distribute a 48 | # modified version of the Autoconf Macro, you may extend this special 49 | # exception to the GPL to apply to your modified version as well. 50 | 51 | #serial 5 52 | 53 | AC_DEFUN([AX_CHECK_LINKER_FLAGS], 54 | [AC_MSG_CHECKING([whether the linker accepts $1]) 55 | dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: 56 | AS_LITERAL_IF([$1], 57 | [AC_CACHE_VAL(AS_TR_SH(ax_cv_linker_flags_[$1]), [ 58 | ax_save_FLAGS=$LDFLAGS 59 | LDFLAGS="$1" 60 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], 61 | AS_TR_SH(ax_cv_linker_flags_[$1])=yes, 62 | AS_TR_SH(ax_cv_linker_flags_[$1])=no) 63 | LDFLAGS=$ax_save_FLAGS])], 64 | [ax_save_FLAGS=$LDFLAGS 65 | LDFLAGS="$1" 66 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], 67 | eval AS_TR_SH(ax_cv_linker_flags_[$1])=yes, 68 | eval AS_TR_SH(ax_cv_linker_flags_[$1])=no) 69 | LDFLAGS=$ax_save_FLAGS]) 70 | eval ax_check_linker_flags=$AS_TR_SH(ax_cv_linker_flags_[$1]) 71 | AC_MSG_RESULT($ax_check_linker_flags) 72 | if test "x$ax_check_linker_flags" = xyes; then 73 | m4_default([$2], :) 74 | else 75 | m4_default([$3], :) 76 | fi 77 | ])dnl AX_CHECK_LINKER_FLAGS 78 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_main.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_main_h 24 | #define _SDL_main_h 25 | 26 | #include "SDL_stdinc.h" 27 | 28 | /** @file SDL_main.h 29 | * Redefine main() on Win32 and MacOS so that it is called by winmain.c 30 | */ 31 | 32 | #if defined(__WIN32__) || \ 33 | (defined(__MWERKS__) && !defined(__BEOS__)) || \ 34 | defined(__MACOS__) || defined(__MACOSX__) || \ 35 | defined(__SYMBIAN32__) || defined(QWS) 36 | 37 | #ifdef __cplusplus 38 | #define C_LINKAGE "C" 39 | #else 40 | #define C_LINKAGE 41 | #endif /* __cplusplus */ 42 | 43 | /** The application's main() function must be called with C linkage, 44 | * and should be declared like this: 45 | * @code 46 | * #ifdef __cplusplus 47 | * extern "C" 48 | * #endif 49 | * int main(int argc, char *argv[]) 50 | * { 51 | * } 52 | * @endcode 53 | */ 54 | #define main SDL_main 55 | 56 | /** The prototype for the application's main() function */ 57 | extern C_LINKAGE int SDL_main(int argc, char *argv[]); 58 | 59 | 60 | /** @name From the SDL library code -- needed for registering the app on Win32 */ 61 | /*@{*/ 62 | #ifdef __WIN32__ 63 | 64 | #include "begin_code.h" 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /** This should be called from your WinMain() function, if any */ 70 | extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); 71 | /** This can also be called, but is no longer necessary */ 72 | extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); 73 | /** This can also be called, but is no longer necessary (SDL_Quit calls it) */ 74 | extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | #include "close_code.h" 79 | #endif 80 | /*@}*/ 81 | 82 | /** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ 83 | /*@{*/ 84 | #if defined(__MACOS__) 85 | 86 | #include "begin_code.h" 87 | #ifdef __cplusplus 88 | extern "C" { 89 | #endif 90 | 91 | /** Forward declaration so we don't need to include QuickDraw.h */ 92 | struct QDGlobals; 93 | 94 | /** This should be called from your main() function, if any */ 95 | extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | #include "close_code.h" 101 | #endif 102 | /*@}*/ 103 | 104 | #endif /* Need to redefine main()? */ 105 | 106 | #endif /* _SDL_main_h */ 107 | -------------------------------------------------------------------------------- /src/config.h.in: -------------------------------------------------------------------------------- 1 | /* src/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define this to use freeze-frame in raytracing mode . */ 4 | #undef HANDLERAYTRACER 5 | 6 | /* Define to 1 if you have the `atexit' function. */ 7 | #undef HAVE_ATEXIT 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_GETOPT_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_INTTYPES_H 14 | 15 | /* Define to 1 if you have the `stdc++' library (-lstdc++). */ 16 | #undef HAVE_LIBSTDC__ 17 | 18 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 19 | to 0 otherwise. */ 20 | #undef HAVE_MALLOC 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #undef HAVE_MEMORY_H 24 | 25 | /* Define to 1 if you have the `memset' function. */ 26 | #undef HAVE_MEMSET 27 | 28 | /* Define to 1 if you have the `sqrt' function. */ 29 | #undef HAVE_SQRT 30 | 31 | /* Define to 1 if stdbool.h conforms to C99. */ 32 | #undef HAVE_STDBOOL_H 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #undef HAVE_STDINT_H 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #undef HAVE_STDLIB_H 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #undef HAVE_STRINGS_H 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #undef HAVE_STRING_H 45 | 46 | /* Define to 1 if you have the `strrchr' function. */ 47 | #undef HAVE_STRRCHR 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #undef HAVE_SYS_STAT_H 51 | 52 | /* Define to 1 if you have the header file. */ 53 | #undef HAVE_SYS_TYPES_H 54 | 55 | /* Define to 1 if you have the header file. */ 56 | #undef HAVE_UNISTD_H 57 | 58 | /* Define to 1 if the system has the type `_Bool'. */ 59 | #undef HAVE__BOOL 60 | 61 | /* Define this to use Intel SSE implementation of MLAA. */ 62 | #undef MLAA_ENABLED 63 | 64 | /* Name of package */ 65 | #undef PACKAGE 66 | 67 | /* Define to the address where bug reports for this package should be sent. */ 68 | #undef PACKAGE_BUGREPORT 69 | 70 | /* Define to the full name of this package. */ 71 | #undef PACKAGE_NAME 72 | 73 | /* Define to the full name and version of this package. */ 74 | #undef PACKAGE_STRING 75 | 76 | /* Define to the one symbol short name of this package. */ 77 | #undef PACKAGE_TARNAME 78 | 79 | /* Define to the home page for this package. */ 80 | #undef PACKAGE_URL 81 | 82 | /* Define to the version of this package. */ 83 | #undef PACKAGE_VERSION 84 | 85 | /* Define this to use SSE intrinsics. */ 86 | #undef SIMD_SSE 87 | 88 | /* Define this to use SSE2 intrinsics. */ 89 | #undef SIMD_SSE2 90 | 91 | /* Define to 1 if you have the ANSI C header files. */ 92 | #undef STDC_HEADERS 93 | 94 | /* Define this to use OpenMP. */ 95 | #undef USE_OPENMP 96 | 97 | /* Define this to use Intel TBB. */ 98 | #undef USE_TBB 99 | 100 | /* Version number of package */ 101 | #undef VERSION 102 | 103 | /* Define to empty if `const' does not conform to ANSI C. */ 104 | #undef const 105 | 106 | /* Define to `__inline__' or `__inline' if that's what the C compiler 107 | calls it, or to nothing if 'inline' is not supported under any name. */ 108 | #ifndef __cplusplus 109 | #undef inline 110 | #endif 111 | 112 | /* Define to rpl_malloc if the replacement function should be used. */ 113 | #undef malloc 114 | 115 | /* Define to `unsigned int' if does not define. */ 116 | #undef size_t 117 | -------------------------------------------------------------------------------- /ac-macros/ax_check_compiler_flags.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_check_compiler_flags.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check whether the given compiler FLAGS work with the current language's 12 | # compiler, or whether they give an error. (Warnings, however, are 13 | # ignored.) 14 | # 15 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 16 | # success/failure. 17 | # 18 | # LICENSE 19 | # 20 | # Copyright (c) 2009 Steven G. Johnson 21 | # Copyright (c) 2009 Matteo Frigo 22 | # 23 | # This program is free software: you can redistribute it and/or modify it 24 | # under the terms of the GNU General Public License as published by the 25 | # Free Software Foundation, either version 3 of the License, or (at your 26 | # option) any later version. 27 | # 28 | # This program is distributed in the hope that it will be useful, but 29 | # WITHOUT ANY WARRANTY; without even the implied warranty of 30 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 31 | # Public License for more details. 32 | # 33 | # You should have received a copy of the GNU General Public License along 34 | # with this program. If not, see . 35 | # 36 | # As a special exception, the respective Autoconf Macro's copyright owner 37 | # gives unlimited permission to copy, distribute and modify the configure 38 | # scripts that are the output of Autoconf when processing the Macro. You 39 | # need not follow the terms of the GNU General Public License when using 40 | # or distributing such scripts, even though portions of the text of the 41 | # Macro appear in them. The GNU General Public License (GPL) does govern 42 | # all other use of the material that constitutes the Autoconf Macro. 43 | # 44 | # This special exception to the GPL applies to versions of the Autoconf 45 | # Macro released by the Autoconf Archive. When you make and distribute a 46 | # modified version of the Autoconf Macro, you may extend this special 47 | # exception to the GPL to apply to your modified version as well. 48 | 49 | #serial 9 50 | 51 | AC_DEFUN([AX_CHECK_COMPILER_FLAGS], 52 | [AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX 53 | AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1]) 54 | dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: 55 | AS_LITERAL_IF([$1], 56 | [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [ 57 | ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS 58 | _AC_LANG_PREFIX[]FLAGS="$1" 59 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], 60 | AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, 61 | AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) 62 | _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])], 63 | [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS 64 | _AC_LANG_PREFIX[]FLAGS="$1" 65 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], 66 | eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes, 67 | eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no) 68 | _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS]) 69 | eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]) 70 | AC_MSG_RESULT($ax_check_compiler_flags) 71 | if test "x$ax_check_compiler_flags" = xyes; then 72 | m4_default([$2], :) 73 | else 74 | m4_default([$3], :) 75 | fi 76 | ])dnl AX_CHECK_COMPILER_FLAGS 77 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_config_nds.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_nds_h 24 | #define _SDL_config_nds_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This is a set of defines to configure the SDL features */ 29 | 30 | /* General platform specific identifiers */ 31 | #include "SDL_platform.h" 32 | 33 | /* C datatypes */ 34 | #define SDL_HAS_64BIT_TYPE 1 35 | 36 | /* Endianness */ 37 | #define SDL_BYTEORDER 1234 38 | 39 | /* Useful headers */ 40 | #define HAVE_ALLOCA_H 1 41 | #define HAVE_SYS_TYPES_H 1 42 | #define HAVE_STDIO_H 1 43 | #define STDC_HEADERS 1 44 | #define HAVE_STDLIB_H 1 45 | #define HAVE_STDARG_H 1 46 | #define HAVE_MALLOC_H 1 47 | #define HAVE_STRING_H 1 48 | #define HAVE_INTTYPES_H 1 49 | #define HAVE_STDINT_H 1 50 | #define HAVE_CTYPE_H 1 51 | #define HAVE_MATH_H 1 52 | #define HAVE_ICONV_H 1 53 | #define HAVE_SIGNAL_H 1 54 | 55 | /* C library functions */ 56 | #define HAVE_MALLOC 1 57 | #define HAVE_CALLOC 1 58 | #define HAVE_REALLOC 1 59 | #define HAVE_FREE 1 60 | #define HAVE_ALLOCA 1 61 | #define HAVE_GETENV 1 62 | #define HAVE_PUTENV 1 63 | #define HAVE_UNSETENV 1 64 | #define HAVE_QSORT 1 65 | #define HAVE_ABS 1 66 | #define HAVE_BCOPY 1 67 | #define HAVE_MEMSET 1 68 | #define HAVE_MEMCPY 1 69 | #define HAVE_MEMMOVE 1 70 | #define HAVE_STRLEN 1 71 | #define HAVE_STRLCPY 1 72 | #define HAVE_STRLCAT 1 73 | #define HAVE_STRDUP 1 74 | #define HAVE_STRCHR 1 75 | #define HAVE_STRRCHR 1 76 | #define HAVE_STRSTR 1 77 | #define HAVE_STRTOL 1 78 | #define HAVE_STRTOUL 1 79 | #define HAVE_STRTOLL 1 80 | #define HAVE_STRTOULL 1 81 | #define HAVE_ATOI 1 82 | #define HAVE_ATOF 1 83 | #define HAVE_STRCMP 1 84 | #define HAVE_STRNCMP 1 85 | #define HAVE_STRCASECMP 1 86 | #define HAVE_STRNCASECMP 1 87 | #define HAVE_SSCANF 1 88 | #define HAVE_SNPRINTF 1 89 | #define HAVE_VSNPRINTF 1 90 | #define HAVE_SETJMP 1 91 | 92 | /* Enable various audio drivers */ 93 | #define SDL_AUDIO_DRIVER_NDS 1 94 | #define SDL_AUDIO_DRIVER_DUMMY 1 95 | 96 | /* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ 97 | #define SDL_CDROM_DISABLED 1 98 | 99 | /* Enable various input drivers */ 100 | #define SDL_JOYSTICK_NDS 1 101 | 102 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 103 | #define SDL_LOADSO_DISABLED 1 104 | 105 | /* Enable the stub thread support (src/thread/generic/\*.c) */ 106 | #define SDL_THREADS_DISABLED 1 107 | 108 | /* Enable various timer systems */ 109 | #define SDL_TIMER_NDS 1 110 | 111 | /* Enable various video drivers */ 112 | #define SDL_VIDEO_DRIVER_NDS 1 113 | #define SDL_VIDEO_DRIVER_DUMMY 1 114 | 115 | #endif /* _SDL_config_nds_h */ 116 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/_tbb_windef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_tbb_windef_H 30 | #error Do not #include this file directly. Use "#include tbb/tbb_stddef.h" instead. 31 | #endif /* __TBB_tbb_windef_H */ 32 | 33 | // Check that the target Windows version has all API calls requried for TBB. 34 | // Do not increase the version in condition beyond 0x0500 without prior discussion! 35 | #if defined(_WIN32_WINNT) && _WIN32_WINNT<0x0400 36 | #error TBB is unable to run on old Windows versions; _WIN32_WINNT must be 0x0400 or greater. 37 | #endif 38 | 39 | #if !defined(_MT) 40 | #error TBB requires linkage with multithreaded C/C++ runtime library. \ 41 | Choose multithreaded DLL runtime in project settings, or use /MD[d] compiler switch. 42 | #elif !defined(_DLL) 43 | #pragma message("Warning: Using TBB together with static C/C++ runtime library is not recommended. " \ 44 | "Consider switching your project to multithreaded DLL runtime used by TBB.") 45 | #endif 46 | 47 | // Workaround for the problem with MVSC headers failing to define namespace std 48 | namespace std { 49 | using ::size_t; using ::ptrdiff_t; 50 | } 51 | 52 | #define __TBB_STRING_AUX(x) #x 53 | #define __TBB_STRING(x) __TBB_STRING_AUX(x) 54 | 55 | // Default setting of TBB_USE_DEBUG 56 | #ifdef TBB_USE_DEBUG 57 | # if TBB_USE_DEBUG 58 | # if !defined(_DEBUG) 59 | # pragma message(__FILE__ "(" __TBB_STRING(__LINE__) ") : Warning: Recommend using /MDd if compiling with TBB_USE_DEBUG!=0") 60 | # endif 61 | # else 62 | # if defined(_DEBUG) 63 | # pragma message(__FILE__ "(" __TBB_STRING(__LINE__) ") : Warning: Recommend using /MD if compiling with TBB_USE_DEBUG==0") 64 | # endif 65 | # endif 66 | #else 67 | # ifdef _DEBUG 68 | # define TBB_USE_DEBUG 1 69 | # endif 70 | #endif 71 | 72 | #if __TBB_BUILD && !defined(__TBB_NO_IMPLICIT_LINKAGE) 73 | #define __TBB_NO_IMPLICIT_LINKAGE 1 74 | #endif 75 | 76 | #if _MSC_VER 77 | #if !__TBB_NO_IMPLICIT_LINKAGE 78 | #ifdef _DEBUG 79 | #pragma comment(lib, "tbb_debug.lib") 80 | #else 81 | #pragma comment(lib, "tbb.lib") 82 | #endif 83 | #endif 84 | #endif 85 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL.h 24 | * Main include header for the SDL library 25 | */ 26 | 27 | #ifndef _SDL_H 28 | #define _SDL_H 29 | 30 | #include "SDL_main.h" 31 | #include "SDL_stdinc.h" 32 | #include "SDL_audio.h" 33 | #include "SDL_cdrom.h" 34 | #include "SDL_cpuinfo.h" 35 | #include "SDL_endian.h" 36 | #include "SDL_error.h" 37 | #include "SDL_events.h" 38 | #include "SDL_loadso.h" 39 | #include "SDL_mutex.h" 40 | #include "SDL_rwops.h" 41 | #include "SDL_thread.h" 42 | #include "SDL_timer.h" 43 | #include "SDL_video.h" 44 | #include "SDL_version.h" 45 | 46 | #include "begin_code.h" 47 | /* Set up for C function definitions, even when using C++ */ 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /** @file SDL.h 53 | * @note As of version 0.5, SDL is loaded dynamically into the application 54 | */ 55 | 56 | /** @name SDL_INIT Flags 57 | * These are the flags which may be passed to SDL_Init() -- you should 58 | * specify the subsystems which you will be using in your application. 59 | */ 60 | /*@{*/ 61 | #define SDL_INIT_TIMER 0x00000001 62 | #define SDL_INIT_AUDIO 0x00000010 63 | #define SDL_INIT_VIDEO 0x00000020 64 | #define SDL_INIT_CDROM 0x00000100 65 | #define SDL_INIT_JOYSTICK 0x00000200 66 | #define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ 67 | #define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ 68 | #define SDL_INIT_EVERYTHING 0x0000FFFF 69 | /*@}*/ 70 | 71 | /** This function loads the SDL dynamically linked library and initializes 72 | * the subsystems specified by 'flags' (and those satisfying dependencies) 73 | * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup 74 | * signal handlers for some commonly ignored fatal signals (like SIGSEGV) 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); 77 | 78 | /** This function initializes specific SDL subsystems */ 79 | extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); 80 | 81 | /** This function cleans up specific SDL subsystems */ 82 | extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); 83 | 84 | /** This function returns mask of the specified subsystems which have 85 | * been initialized. 86 | * If 'flags' is 0, it returns a mask of all initialized subsystems. 87 | */ 88 | extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); 89 | 90 | /** This function cleans up all initialized subsystems and unloads the 91 | * dynamically linked library. You should call it upon all exit conditions. 92 | */ 93 | extern DECLSPEC void SDLCALL SDL_Quit(void); 94 | 95 | /* Ends C function definitions when using C++ */ 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | #include "close_code.h" 100 | 101 | #endif /* _SDL_H */ 102 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libtbb/tbb/blocked_range2d.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2005-2009 Intel Corporation. All Rights Reserved. 3 | 4 | This file is part of Threading Building Blocks. 5 | 6 | Threading Building Blocks is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License 8 | version 2 as published by the Free Software Foundation. 9 | 10 | Threading Building Blocks is distributed in the hope that it will be 11 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty 12 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Threading Building Blocks; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | As a special exception, you may use this file as part of a free software 20 | library without restriction. Specifically, if other files instantiate 21 | templates or use macros or inline functions from this file, or you compile 22 | this file and link it with other files to produce an executable, this 23 | file does not by itself cause the resulting executable to be covered by 24 | the GNU General Public License. This exception does not however 25 | invalidate any other reasons why the executable file might be covered by 26 | the GNU General Public License. 27 | */ 28 | 29 | #ifndef __TBB_blocked_range2d_H 30 | #define __TBB_blocked_range2d_H 31 | 32 | #include "tbb_stddef.h" 33 | #include "blocked_range.h" 34 | 35 | namespace tbb { 36 | 37 | //! A 2-dimensional range that models the Range concept. 38 | /** @ingroup algorithms */ 39 | template 40 | class blocked_range2d { 41 | public: 42 | //! Type for size of an iteation range 43 | typedef blocked_range row_range_type; 44 | typedef blocked_range col_range_type; 45 | 46 | private: 47 | row_range_type my_rows; 48 | col_range_type my_cols; 49 | 50 | public: 51 | 52 | blocked_range2d( RowValue row_begin, RowValue row_end, typename row_range_type::size_type row_grainsize, 53 | ColValue col_begin, ColValue col_end, typename col_range_type::size_type col_grainsize ) : 54 | my_rows(row_begin,row_end,row_grainsize), 55 | my_cols(col_begin,col_end,col_grainsize) 56 | { 57 | } 58 | 59 | blocked_range2d( RowValue row_begin, RowValue row_end, 60 | ColValue col_begin, ColValue col_end ) : 61 | my_rows(row_begin,row_end), 62 | my_cols(col_begin,col_end) 63 | { 64 | } 65 | 66 | //! True if range is empty 67 | bool empty() const { 68 | // Yes, it is a logical OR here, not AND. 69 | return my_rows.empty() || my_cols.empty(); 70 | } 71 | 72 | //! True if range is divisible into two pieces. 73 | bool is_divisible() const { 74 | return my_rows.is_divisible() || my_cols.is_divisible(); 75 | } 76 | 77 | blocked_range2d( blocked_range2d& r, split ) : 78 | my_rows(r.my_rows), 79 | my_cols(r.my_cols) 80 | { 81 | if( my_rows.size()*double(my_cols.grainsize()) < my_cols.size()*double(my_rows.grainsize()) ) { 82 | my_cols.my_begin = col_range_type::do_split(r.my_cols); 83 | } else { 84 | my_rows.my_begin = row_range_type::do_split(r.my_rows); 85 | } 86 | } 87 | 88 | //! The rows of the iteration space 89 | const row_range_type& rows() const {return my_rows;} 90 | 91 | //! The columns of the iteration space 92 | const col_range_type& cols() const {return my_cols;} 93 | }; 94 | 95 | } // namespace tbb 96 | 97 | #endif /* __TBB_blocked_range2d_H */ 98 | -------------------------------------------------------------------------------- /VisualC/Renderer-2.x/libSDL/include/SDL_config_symbian.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /* 24 | 25 | Symbian version Markus Mertama 26 | 27 | */ 28 | 29 | 30 | #ifndef _SDL_CONFIG_SYMBIAN_H 31 | #define _SDL_CONFIG_SYMBIAN_H 32 | 33 | #include "SDL_platform.h" 34 | 35 | /* This is the minimal configuration that can be used to build SDL */ 36 | 37 | 38 | #include 39 | #include 40 | 41 | 42 | #ifdef __GCCE__ 43 | #define SYMBIAN32_GCCE 44 | #endif 45 | 46 | #ifndef _SIZE_T_DEFINED 47 | typedef unsigned int size_t; 48 | #endif 49 | 50 | #ifndef _INTPTR_T_DECLARED 51 | typedef unsigned int uintptr_t; 52 | #endif 53 | 54 | #ifndef _INT8_T_DECLARED 55 | typedef signed char int8_t; 56 | #endif 57 | 58 | #ifndef _UINT8_T_DECLARED 59 | typedef unsigned char uint8_t; 60 | #endif 61 | 62 | #ifndef _INT16_T_DECLARED 63 | typedef signed short int16_t; 64 | #endif 65 | 66 | #ifndef _UINT16_T_DECLARED 67 | typedef unsigned short uint16_t; 68 | #endif 69 | 70 | #ifndef _INT32_T_DECLARED 71 | typedef signed int int32_t; 72 | #endif 73 | 74 | #ifndef _UINT32_T_DECLARED 75 | typedef unsigned int uint32_t; 76 | #endif 77 | 78 | #ifndef _INT64_T_DECLARED 79 | typedef signed long long int64_t; 80 | #endif 81 | 82 | #ifndef _UINT64_T_DECLARED 83 | typedef unsigned long long uint64_t; 84 | #endif 85 | 86 | #define SDL_AUDIO_DRIVER_EPOCAUDIO 1 87 | 88 | 89 | /* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ 90 | #define SDL_CDROM_DISABLED 1 91 | 92 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 93 | #define SDL_JOYSTICK_DISABLED 1 94 | 95 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 96 | #define SDL_LOADSO_DISABLED 1 97 | 98 | #define SDL_THREAD_SYMBIAN 1 99 | 100 | #define SDL_VIDEO_DRIVER_EPOC 1 101 | 102 | #define SDL_VIDEO_OPENGL 0 103 | 104 | #define SDL_HAS_64BIT_TYPE 1 105 | 106 | #define HAVE_LIBC 1 107 | #define HAVE_STDIO_H 1 108 | #define STDC_HEADERS 1 109 | #define HAVE_STRING_H 1 110 | #define HAVE_CTYPE_H 1 111 | #define HAVE_MATH_H 1 112 | 113 | #define HAVE_MALLOC 1 114 | #define HAVE_CALLOC 1 115 | #define HAVE_REALLOC 1 116 | #define HAVE_FREE 1 117 | /*#define HAVE_ALLOCA 1*/ 118 | #define HAVE_QSORT 1 119 | #define HAVE_ABS 1 120 | #define HAVE_MEMSET 1 121 | #define HAVE_MEMCPY 1 122 | #define HAVE_MEMMOVE 1 123 | #define HAVE_MEMCMP 1 124 | #define HAVE_STRLEN 1 125 | #define HAVE__STRUPR 1 126 | #define HAVE_STRCHR 1 127 | #define HAVE_STRRCHR 1 128 | #define HAVE_STRSTR 1 129 | #define HAVE_ITOA 1 130 | #define HAVE_STRTOL 1 131 | #define HAVE_STRTOUL 1 132 | #define HAVE_STRTOLL 1 133 | #define HAVE_STRTOD 1 134 | #define HAVE_ATOI 1 135 | #define HAVE_ATOF 1 136 | #define HAVE_STRCMP 1 137 | #define HAVE_STRNCMP 1 138 | /*#define HAVE__STRICMP 1*/ 139 | #define HAVE__STRNICMP 1 140 | #define HAVE_SSCANF 1 141 | #define HAVE_STDARG_H 1 142 | #define HAVE_STDDEF_H 1 143 | 144 | 145 | 146 | #endif /* _SDL_CONFIG_SYMBIAN_H */ 147 | -------------------------------------------------------------------------------- /lib3ds-1.3.0/lib3ds/tcb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The 3D Studio File Format Library 3 | * Copyright (C) 1996-2007 by Jan Eric Kyprianidis 4 | * All rights reserved. 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 2.1 of the License, or (at 9 | * your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14 | * License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with this program; if not, write to the Free Software Foundation, 18 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | * 20 | * $Id: tcb.c,v 1.11 2007/06/15 09:33:19 jeh Exp $ 21 | */ 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | /*! 28 | * \defgroup tcb Tension/Continuity/Bias Splines 29 | */ 30 | 31 | 32 | /*! 33 | * \ingroup tcb 34 | */ 35 | void 36 | lib3ds_tcb(Lib3dsTcb *p, Lib3dsTcb *pc, Lib3dsTcb *c, Lib3dsTcb *nc, Lib3dsTcb *n, 37 | Lib3dsFloat *ksm, Lib3dsFloat *ksp, Lib3dsFloat *kdm, Lib3dsFloat *kdp) 38 | { 39 | Lib3dsFloat tm,cm,cp,bm,bp,tmcm,tmcp,cc; 40 | Lib3dsFloat dt,fp,fn; 41 | 42 | if (!pc) { 43 | pc=c; 44 | } 45 | if (!nc) { 46 | nc=c; 47 | } 48 | 49 | fp=fn=1.0f; 50 | if (p&&n) { 51 | dt=0.5f*(Lib3dsFloat)(pc->frame-p->frame+n->frame-nc->frame); 52 | fp=((Lib3dsFloat)(pc->frame-p->frame))/dt; 53 | fn=((Lib3dsFloat)(n->frame-nc->frame))/dt; 54 | cc=(Lib3dsFloat)fabs(c->cont); 55 | fp=fp+cc-cc*fp; 56 | fn=fn+cc-cc*fn; 57 | } 58 | 59 | cm=1.0f-c->cont; 60 | tm=0.5f*(1.0f-c->tens); 61 | cp=2.0f-cm; 62 | bm=1.0f-c->bias; 63 | bp=2.0f-bm; 64 | tmcm=tm*cm; 65 | tmcp=tm*cp; 66 | *ksm=tmcm*bp*fp; 67 | *ksp=tmcp*bm*fp; 68 | *kdm=tmcp*bp*fn; 69 | *kdp=tmcm*bm*fn; 70 | } 71 | 72 | 73 | /*! 74 | * \ingroup tcb 75 | */ 76 | Lib3dsBool 77 | lib3ds_tcb_read(Lib3dsTcb *tcb, Lib3dsIo *io) 78 | { 79 | Lib3dsWord flags; 80 | 81 | tcb->frame=lib3ds_io_read_intd(io); 82 | tcb->flags=flags=lib3ds_io_read_word(io); 83 | if (flags&LIB3DS_USE_TENSION) { 84 | tcb->tens=lib3ds_io_read_float(io); 85 | } 86 | if (flags&LIB3DS_USE_CONTINUITY) { 87 | tcb->cont=lib3ds_io_read_float(io); 88 | } 89 | if (flags&LIB3DS_USE_BIAS) { 90 | tcb->bias=lib3ds_io_read_float(io); 91 | } 92 | if (flags&LIB3DS_USE_EASE_TO) { 93 | tcb->ease_to=lib3ds_io_read_float(io); 94 | } 95 | if (flags&LIB3DS_USE_EASE_FROM) { 96 | tcb->ease_from=lib3ds_io_read_float(io); 97 | } 98 | if (lib3ds_io_error(io)) { 99 | return(LIB3DS_FALSE); 100 | } 101 | return(LIB3DS_TRUE); 102 | } 103 | 104 | 105 | /*! 106 | * \ingroup tcb 107 | */ 108 | Lib3dsBool 109 | lib3ds_tcb_write(Lib3dsTcb *tcb, Lib3dsIo *io) 110 | { 111 | lib3ds_io_write_intd(io, tcb->frame); 112 | lib3ds_io_write_word(io, tcb->flags); 113 | if (tcb->flags&LIB3DS_USE_TENSION) { 114 | lib3ds_io_write_float(io, tcb->tens); 115 | } 116 | if (tcb->flags&LIB3DS_USE_CONTINUITY) { 117 | lib3ds_io_write_float(io, tcb->cont); 118 | } 119 | if (tcb->flags&LIB3DS_USE_BIAS) { 120 | lib3ds_io_write_float(io, tcb->bias); 121 | } 122 | if (tcb->flags&LIB3DS_USE_EASE_TO) { 123 | lib3ds_io_write_float(io, tcb->ease_to); 124 | } 125 | if (tcb->flags&LIB3DS_USE_EASE_FROM) { 126 | lib3ds_io_write_float(io, tcb->ease_from); 127 | } 128 | if (lib3ds_io_error(io)) { 129 | return(LIB3DS_FALSE); 130 | } 131 | return(LIB3DS_TRUE); 132 | } 133 | 134 | 135 | 136 | 137 | --------------------------------------------------------------------------------