mirror of
https://github.com/glest/glest-source.git
synced 2025-08-14 12:23:59 +02:00
- fix for compiling md5 files on windows
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/lpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.x/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;"../../source/win32_deps/curl-7.21.3/include";../../source/shared_lib/include/map;../../source/shared_lib/include/platform/miniupnpc;../../source/shared_lib/include/libircclient/include;../../source/shared_lib/include/feathery_ftp"
|
AdditionalIncludeDirectories="../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/lpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.x/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;"../../source/win32_deps/curl-7.21.3/include";../../source/shared_lib/include/map;../../source/shared_lib/include/platform/miniupnpc;../../source/shared_lib/include/libircclient/include;../../source/shared_lib/include/feathery_ftp;"../../source/win32_deps/glew-1.7.0/include";../../source/shared_lib/include/graphics/md5"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;STATICLIB"
|
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;STATICLIB"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="libstreflop.lib libcurl.lib"
|
AdditionalDependencies="libstreflop.lib libcurl.lib glew32s.lib"
|
||||||
AdditionalLibraryDirectories=".\;..\..\source\win32_deps\lib;../../source/win32_deps/libircclient/build/lib"
|
AdditionalLibraryDirectories=".\;..\..\source\win32_deps\lib;../../source/win32_deps/libircclient/build/lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="1"
|
FavorSizeOrSpeed="1"
|
||||||
WholeProgramOptimization="false"
|
WholeProgramOptimization="false"
|
||||||
AdditionalIncludeDirectories="../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/lpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.x/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;"../../source/win32_deps/curl-7.21.3/include";../../source/shared_lib/include/map;../../source/shared_lib/include/platform/miniupnpc;../../source/shared_lib/include/libircclient/include;../../source/shared_lib/include/feathery_ftp;"../../source/win32_deps/ftgl-2.1.3-rc5/src";"../../source/win32_deps/freetype-2.4.4/include";$(NOINHERIT)"
|
AdditionalIncludeDirectories="../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/lpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.x/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;"../../source/win32_deps/curl-7.21.3/include";../../source/shared_lib/include/map;../../source/shared_lib/include/platform/miniupnpc;../../source/shared_lib/include/libircclient/include;../../source/shared_lib/include/feathery_ftp;"../../source/win32_deps/ftgl-2.1.3-rc5/src";"../../source/win32_deps/freetype-2.4.4/include";"../../source/win32_deps/glew-1.7.0/include";../../source/shared_lib/include/graphics/md5;$(NOINHERIT)"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;USE_FTGL;TA3D_PLATFORM_MSVC;TA3D_PLATFORM_WINDOWS;STATICLIB"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;USE_FTGL;TA3D_PLATFORM_MSVC;TA3D_PLATFORM_WINDOWS;STATICLIB"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
ExceptionHandling="2"
|
ExceptionHandling="2"
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLibrarianTool"
|
Name="VCLibrarianTool"
|
||||||
AdditionalDependencies="libstreflop.lib libcurl.lib"
|
AdditionalDependencies="libstreflop.lib libcurl.lib glew32s.lib"
|
||||||
AdditionalLibraryDirectories=".\;..\..\source\win32_deps\lib;../../source/win32_deps/libircclient/build/lib"
|
AdditionalLibraryDirectories=".\;..\..\source\win32_deps\lib;../../source/win32_deps/libircclient/build/lib"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
@@ -380,6 +380,10 @@
|
|||||||
RelativePath="..\..\source\shared_lib\sources\streflop\Random.cpp"
|
RelativePath="..\..\source\shared_lib\sources\streflop\Random.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\source\shared_lib\sources\graphics\md5\ShaderManager.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\source\shared_lib\sources\streflop\SMath.cpp"
|
RelativePath="..\..\source\shared_lib\sources\streflop\SMath.cpp"
|
||||||
>
|
>
|
||||||
@@ -395,6 +399,10 @@
|
|||||||
<Filter
|
<Filter
|
||||||
Name="graphics"
|
Name="graphics"
|
||||||
>
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\source\shared_lib\sources\graphics\md5\ArbProgram.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\source\shared_lib\sources\graphics\BMPReader.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\BMPReader.cpp"
|
||||||
>
|
>
|
||||||
@@ -427,10 +435,18 @@
|
|||||||
RelativePath="..\..\source\shared_lib\sources\graphics\gl\font_textFTGL.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\gl\font_textFTGL.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\source\shared_lib\sources\graphics\md5\GlErrors.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\source\shared_lib\sources\graphics\graphics_interface.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\graphics_interface.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\source\shared_lib\sources\graphics\md5\Image.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\source\shared_lib\sources\graphics\ImageReaders.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\ImageReaders.cpp"
|
||||||
>
|
>
|
||||||
@@ -443,6 +459,14 @@
|
|||||||
RelativePath="..\..\source\shared_lib\sources\graphics\JPGReader.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\JPGReader.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\source\shared_lib\sources\graphics\md5\Md5Model.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\source\shared_lib\sources\graphics\md5\md5util.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\source\shared_lib\sources\graphics\model.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\model.cpp"
|
||||||
>
|
>
|
||||||
@@ -479,6 +503,10 @@
|
|||||||
RelativePath="..\..\source\shared_lib\sources\graphics\texture.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\texture.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\source\shared_lib\sources\graphics\md5\Texture.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\source\shared_lib\sources\graphics\texture_manager.cpp"
|
RelativePath="..\..\source\shared_lib\sources\graphics\texture_manager.cpp"
|
||||||
>
|
>
|
||||||
|
@@ -20,11 +20,14 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <memory>
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
|
#ifndef _WIN32
|
||||||
//#include <boost/shared_ptr.hpp>
|
//#include <boost/shared_ptr.hpp>
|
||||||
#include <tr1/memory>
|
#include <tr1/memory>
|
||||||
|
#endif
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -39,10 +42,16 @@ using std::cout;
|
|||||||
using std::endl;
|
using std::endl;
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
using std::tr1::shared_ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Shared { namespace Graphics { namespace md5 {
|
namespace Shared { namespace Graphics { namespace md5 {
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
//using boost::shared_ptr;
|
//using boost::shared_ptr;
|
||||||
using std::tr1::shared_ptr;
|
using std::tr1::shared_ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Image class diagram:
|
// Image class diagram:
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <memory>
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -40,7 +41,9 @@ using std::string;
|
|||||||
using std::vector;
|
using std::vector;
|
||||||
using std::map;
|
using std::map;
|
||||||
|
|
||||||
//using std::shared_ptr;
|
#ifdef _WIN32
|
||||||
|
using std::tr1::shared_ptr;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
class Md5Skeleton;
|
class Md5Skeleton;
|
||||||
|
@@ -23,7 +23,9 @@
|
|||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
#ifndef _WIN32
|
||||||
#include <GL/glext.h>
|
#include <GL/glext.h>
|
||||||
|
#endif
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@@ -18,7 +18,7 @@ namespace Shared { namespace Graphics { namespace md5 {
|
|||||||
|
|
||||||
class Md5Object;
|
class Md5Object;
|
||||||
|
|
||||||
class Real;
|
//class Real;
|
||||||
template <typename Real>
|
template <typename Real>
|
||||||
class Matrix4x4;
|
class Matrix4x4;
|
||||||
typedef Matrix4x4<float> Matrix4x4f;
|
typedef Matrix4x4<float> Matrix4x4f;
|
||||||
|
@@ -1347,7 +1347,7 @@ ImagePNG::ImagePNG (const ImageBuffer &ibuff)
|
|||||||
memcpy (sig, reinterpret_cast<const png_byte*>(ibuff.data ()), 8);
|
memcpy (sig, reinterpret_cast<const png_byte*>(ibuff.data ()), 8);
|
||||||
|
|
||||||
// Check for valid magic number
|
// Check for valid magic number
|
||||||
if (!png_check_sig (sig, 8))
|
if (!png_sig_cmp (sig, 0, 8))
|
||||||
throw ImageException ("Not a valid PNG file", _name);
|
throw ImageException ("Not a valid PNG file", _name);
|
||||||
|
|
||||||
// Create PNG read struct
|
// Create PNG read struct
|
||||||
@@ -1381,7 +1381,7 @@ ImagePNG::ImagePNG (const ImageBuffer &ibuff)
|
|||||||
// Convert 1-2-4 bits grayscale images to 8 bits
|
// Convert 1-2-4 bits grayscale images to 8 bits
|
||||||
// grayscale.
|
// grayscale.
|
||||||
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
|
if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
|
||||||
png_set_gray_1_2_4_to_8 (png_ptr);
|
png_set_expand_gray_1_2_4_to_8(png_ptr);
|
||||||
|
|
||||||
if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
|
if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
|
||||||
png_set_tRNS_to_alpha (png_ptr);
|
png_set_tRNS_to_alpha (png_ptr);
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "Texture.h"
|
#include "Texture.h"
|
||||||
#include "ArbProgram.h"
|
#include "ArbProgram.h"
|
||||||
#include "Shader.h"
|
#include "ShaderManager.h"
|
||||||
#include "Md5Model.h"
|
#include "Md5Model.h"
|
||||||
|
|
||||||
namespace Shared { namespace Graphics { namespace md5 {
|
namespace Shared { namespace Graphics { namespace md5 {
|
||||||
@@ -666,19 +666,15 @@ Md5Mesh::computeWeightTangents (Md5Skeleton *skel)
|
|||||||
// Compute mesh bounding box for a given skeleton.
|
// Compute mesh bounding box for a given skeleton.
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
void
|
void Md5Mesh::computeBoundingBox (Md5Skeleton *skel) {
|
||||||
Md5Mesh::computeBoundingBox (Md5Skeleton *skel)
|
Vector3f maxValue(-99999.0f, -99999.0f, -99999.0f);
|
||||||
{
|
Vector3f minValue( 99999.0f, 99999.0f, 99999.0f);
|
||||||
Vector3f max (-99999.0f, -99999.0f, -99999.0f);
|
|
||||||
Vector3f min ( 99999.0f, 99999.0f, 99999.0f);
|
|
||||||
|
|
||||||
for (int i = 0; i < _numVerts; ++i)
|
for (int i = 0; i < _numVerts; ++i) {
|
||||||
{
|
|
||||||
Vector3f finalVertex = kZeroVectorf;
|
Vector3f finalVertex = kZeroVectorf;
|
||||||
|
|
||||||
// Calculate final vertex to draw with weights
|
// Calculate final vertex to draw with weights
|
||||||
for (int j = 0; j < _verts[i]->countWeight; ++j)
|
for (int j = 0; j < _verts[i]->countWeight; ++j) {
|
||||||
{
|
|
||||||
const Md5Weight_t *pWeight
|
const Md5Weight_t *pWeight
|
||||||
= _weights[_verts[i]->startWeight + j].get ();
|
= _weights[_verts[i]->startWeight + j].get ();
|
||||||
const Md5Joint_t *pJoint
|
const Md5Joint_t *pJoint
|
||||||
@@ -692,30 +688,29 @@ Md5Mesh::computeBoundingBox (Md5Skeleton *skel)
|
|||||||
finalVertex += (pJoint->pos + wv) * pWeight->bias;
|
finalVertex += (pJoint->pos + wv) * pWeight->bias;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (finalVertex._x > max._x)
|
if (finalVertex._x > maxValue._x)
|
||||||
max._x = finalVertex._x;
|
maxValue._x = finalVertex._x;
|
||||||
|
|
||||||
if (finalVertex._x < min._x)
|
if (finalVertex._x < minValue._x)
|
||||||
min._x = finalVertex._x;
|
minValue._x = finalVertex._x;
|
||||||
|
|
||||||
if (finalVertex._y > max._y)
|
if (finalVertex._y > maxValue._y)
|
||||||
max._y = finalVertex._y;
|
maxValue._y = finalVertex._y;
|
||||||
|
|
||||||
if (finalVertex._y < min._y)
|
if (finalVertex._y < minValue._y)
|
||||||
min._y = finalVertex._y;
|
minValue._y = finalVertex._y;
|
||||||
|
|
||||||
if (finalVertex._z > max._z)
|
if (finalVertex._z > maxValue._z)
|
||||||
max._z = finalVertex._z;
|
maxValue._z = finalVertex._z;
|
||||||
|
|
||||||
if (finalVertex._z < min._z)
|
if (finalVertex._z < minValue._z)
|
||||||
min._z = finalVertex._z;
|
minValue._z = finalVertex._z;
|
||||||
}
|
}
|
||||||
|
|
||||||
_boundingBox.min = min;
|
_boundingBox.min = minValue;
|
||||||
_boundingBox.max = max;
|
_boundingBox.max = maxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// Md5Mesh::preRenderVertexArrays
|
// Md5Mesh::preRenderVertexArrays
|
||||||
//
|
//
|
||||||
@@ -1265,38 +1260,35 @@ Md5Model::anim (const string &name) const
|
|||||||
// Compute model's bounding box in bind-pose.
|
// Compute model's bounding box in bind-pose.
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
void
|
void Md5Model::computeBindPoseBoundingBox() {
|
||||||
Md5Model::computeBindPoseBoundingBox ()
|
Vector3f maxValue(-99999.0f, -99999.0f, -99999.0f);
|
||||||
{
|
Vector3f minValue( 99999.0f, 99999.0f, 99999.0f);
|
||||||
Vector3f max (-99999.0f, -99999.0f, -99999.0f);
|
|
||||||
Vector3f min ( 99999.0f, 99999.0f, 99999.0f);
|
|
||||||
|
|
||||||
// Get the min and the max from all mesh bounding boxes
|
// Get the min and the max from all mesh bounding boxes
|
||||||
for (int i = 0; i < _numMeshes; ++i)
|
for (int i = 0; i < _numMeshes; ++i) {
|
||||||
{
|
|
||||||
const BoundingBox_t &meshBox = _meshes[i]->boundingBox ();
|
const BoundingBox_t &meshBox = _meshes[i]->boundingBox ();
|
||||||
|
|
||||||
if (meshBox.max._x > max._x)
|
if (meshBox.max._x > maxValue._x)
|
||||||
max._x = meshBox.max._x;
|
maxValue._x = meshBox.max._x;
|
||||||
|
|
||||||
if (meshBox.min._x < min._x)
|
if (meshBox.min._x < minValue._x)
|
||||||
min._x = meshBox.min._x;
|
minValue._x = meshBox.min._x;
|
||||||
|
|
||||||
if (meshBox.max._y > max._y)
|
if (meshBox.max._y > maxValue._y)
|
||||||
max._y = meshBox.max._y;
|
maxValue._y = meshBox.max._y;
|
||||||
|
|
||||||
if (meshBox.min._y < min._y)
|
if (meshBox.min._y < minValue._y)
|
||||||
min._y = meshBox.min._y;
|
minValue._y = meshBox.min._y;
|
||||||
|
|
||||||
if (meshBox.max._z > max._z)
|
if (meshBox.max._z > maxValue._z)
|
||||||
max._z = meshBox.max._z;
|
maxValue._z = meshBox.max._z;
|
||||||
|
|
||||||
if (meshBox.min._z < min._z)
|
if (meshBox.min._z < minValue._z)
|
||||||
min._z = meshBox.min._z;
|
minValue._z = meshBox.min._z;
|
||||||
}
|
}
|
||||||
|
|
||||||
_bindPoseBox.min = min;
|
_bindPoseBox.min = minValue;
|
||||||
_bindPoseBox.max = max;
|
_bindPoseBox.max = maxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include "Shader.h"
|
#include "ShaderManager.h"
|
||||||
#include "GlErrors.h"
|
#include "GlErrors.h"
|
||||||
|
|
||||||
namespace Shared { namespace Graphics { namespace md5 {
|
namespace Shared { namespace Graphics { namespace md5 {
|
@@ -26,7 +26,7 @@
|
|||||||
#include "Md5Model.h"
|
#include "Md5Model.h"
|
||||||
#include "TextureManager.h"
|
#include "TextureManager.h"
|
||||||
#include "ArbProgram.h"
|
#include "ArbProgram.h"
|
||||||
#include "Shader.h"
|
#include "ShaderManager.h"
|
||||||
#include "md5util.h"
|
#include "md5util.h"
|
||||||
|
|
||||||
namespace Shared { namespace Graphics { namespace md5 {
|
namespace Shared { namespace Graphics { namespace md5 {
|
||||||
|
Reference in New Issue
Block a user