Merge branch 'master' of https://github.com/assimp/assimp
Signed-off-by: Kim Kulling <kim.kulling@googlemail.com> Conflicts: code/ObjFileParser.cpp
This commit is contained in:
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "BaseImporter.h"
|
||||
#include "FileSystemFilter.h"
|
||||
#include "Importer.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "../include/assimp/scene.h"
|
||||
#include "../include/assimp/Importer.hpp"
|
||||
#include "../include/assimp/postprocess.h"
|
||||
|
||||
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "Bitmap.h"
|
||||
#include "../include/assimp/texture.h"
|
||||
#include "../include/assimp/IOStream.hpp"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -23,38 +23,38 @@ following conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Helper class tp perform various byte oder swappings
|
||||
/** @file Helper class tp perform various byte oder swappings
|
||||
(e.g. little to big endian) */
|
||||
#ifndef AI_BYTESWAP_H_INC
|
||||
#define AI_BYTESWAP_H_INC
|
||||
#ifndef AI_BYTESWAPPER_H_INC
|
||||
#define AI_BYTESWAPPER_H_INC
|
||||
|
||||
#include "../include/assimp/ai_assert.h"
|
||||
#include "../include/assimp/types.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#if _MSC_VER >= 1400
|
||||
#if _MSC_VER >= 1400
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
namespace Assimp {
|
||||
// --------------------------------------------------------------------------------------
|
||||
/** Defines some useful byte order swap routines.
|
||||
*
|
||||
*
|
||||
* This is required to read big-endian model formats on little-endian machines,
|
||||
* and vice versa. Direct use of this class is DEPRECATED. Use #StreamReader instead. */
|
||||
// --------------------------------------------------------------------------------------
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
// ----------------------------------------------------------------------
|
||||
//! Templatized ByteSwap
|
||||
//! \returns param tOut as swapped
|
||||
template<typename Type>
|
||||
template<typename Type>
|
||||
static inline Type Swapped(Type tOut)
|
||||
{
|
||||
return _swapper<Type,sizeof(Type)>()(tOut);
|
||||
@@ -180,28 +180,28 @@ private:
|
||||
|
||||
template <typename T> struct ByteSwap::_swapper<T,2> {
|
||||
T operator() (T tOut) {
|
||||
Swap2(&tOut);
|
||||
Swap2(&tOut);
|
||||
return tOut;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> struct ByteSwap::_swapper<T,4> {
|
||||
T operator() (T tOut) {
|
||||
Swap4(&tOut);
|
||||
Swap4(&tOut);
|
||||
return tOut;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> struct ByteSwap::_swapper<T,8> {
|
||||
T operator() (T tOut) {
|
||||
Swap8(&tOut);
|
||||
Swap8(&tOut);
|
||||
return tOut;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// ByteSwap macros for BigEndian/LittleEndian support
|
||||
// ByteSwap macros for BigEndian/LittleEndian support
|
||||
// --------------------------------------------------------------------------------------
|
||||
#if (defined AI_BUILD_BIG_ENDIAN)
|
||||
# define AI_LE(t) (t)
|
||||
@@ -250,7 +250,7 @@ struct ByteSwapper {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
template <typename T>
|
||||
struct ByteSwapper<T,false> {
|
||||
void operator() (T*) {
|
||||
}
|
||||
@@ -272,7 +272,7 @@ struct Getter {
|
||||
}
|
||||
};
|
||||
|
||||
template <bool SwapEndianess, typename T>
|
||||
template <bool SwapEndianess, typename T>
|
||||
struct Getter<SwapEndianess,T,false> {
|
||||
|
||||
void operator() (T* inout, bool /*le*/) {
|
||||
@@ -283,4 +283,4 @@ struct Getter<SwapEndianess,T,false> {
|
||||
} // end Intern
|
||||
} // end Assimp
|
||||
|
||||
#endif //!! AI_BYTESWAP_H_INC
|
||||
#endif //!! AI_BYTESWAPPER_H_INC
|
||||
@@ -98,7 +98,7 @@ SET( Common_SRCS
|
||||
ScenePrivate.h
|
||||
PostStepRegistry.cpp
|
||||
ImporterRegistry.cpp
|
||||
ByteSwap.h
|
||||
ByteSwapper.h
|
||||
DefaultProgressHandler.h
|
||||
DefaultIOStream.cpp
|
||||
DefaultIOStream.h
|
||||
|
||||
@@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -23,16 +23,16 @@ following conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "../include/assimp/defs.h"
|
||||
#include <stdint.h>
|
||||
#include "Exceptional.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
namespace Assimp {
|
||||
namespace FBX {
|
||||
@@ -58,7 +58,7 @@ namespace FBX {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Token::Token(const char* sbegin, const char* send, TokenType type, unsigned int offset)
|
||||
:
|
||||
:
|
||||
#ifdef DEBUG
|
||||
contents(sbegin, static_cast<size_t>(send-sbegin)),
|
||||
#endif
|
||||
@@ -108,7 +108,7 @@ uint32_t ReadWord(const char* input, const char*& cursor, const char* end)
|
||||
{
|
||||
if(Offset(cursor, end) < 4) {
|
||||
TokenizeError("cannot ReadWord, out of bounds",input, cursor);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t word = *reinterpret_cast<const uint32_t*>(cursor);
|
||||
AI_SWAP4(word);
|
||||
@@ -124,7 +124,7 @@ uint8_t ReadByte(const char* input, const char*& cursor, const char* end)
|
||||
{
|
||||
if(Offset(cursor, end) < 1) {
|
||||
TokenizeError("cannot ReadByte, out of bounds",input, cursor);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t word = *reinterpret_cast<const uint8_t*>(cursor);
|
||||
++cursor;
|
||||
@@ -134,14 +134,14 @@ uint8_t ReadByte(const char* input, const char*& cursor, const char* end)
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
unsigned int ReadString(const char*& sbegin_out, const char*& send_out, const char* input, const char*& cursor, const char* end,
|
||||
unsigned int ReadString(const char*& sbegin_out, const char*& send_out, const char* input, const char*& cursor, const char* end,
|
||||
bool long_length = false,
|
||||
bool allow_null = false)
|
||||
{
|
||||
const uint32_t len_len = long_length ? 4 : 1;
|
||||
if(Offset(cursor, end) < len_len) {
|
||||
TokenizeError("cannot ReadString, out of bounds reading length",input, cursor);
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t length = long_length ? ReadWord(input, cursor, end) : ReadByte(input, cursor, end);
|
||||
|
||||
@@ -172,7 +172,7 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input,
|
||||
{
|
||||
if(Offset(cursor, end) < 1) {
|
||||
TokenizeError("cannot ReadData, out of bounds reading length",input, cursor);
|
||||
}
|
||||
}
|
||||
|
||||
const char type = *cursor;
|
||||
sbegin_out = cursor++;
|
||||
@@ -211,14 +211,14 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input,
|
||||
// note: do not write cursor += ReadWord(...cursor) as this would be UB
|
||||
|
||||
// raw binary data
|
||||
case 'R':
|
||||
case 'R':
|
||||
{
|
||||
const uint32_t length = ReadWord(input, cursor, end);
|
||||
cursor += length;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'b':
|
||||
case 'b':
|
||||
// TODO: what is the 'b' type code? Right now we just skip over it /
|
||||
// take the full range we could get
|
||||
cursor = end;
|
||||
@@ -229,7 +229,7 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input,
|
||||
case 'd':
|
||||
case 'l':
|
||||
case 'i': {
|
||||
|
||||
|
||||
const uint32_t length = ReadWord(input, cursor, end);
|
||||
const uint32_t encoding = ReadWord(input, cursor, end);
|
||||
|
||||
@@ -259,7 +259,7 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input,
|
||||
}
|
||||
}
|
||||
// zip/deflate algorithm (encoding==1)? take given length. anything else? die
|
||||
else if (encoding != 1) {
|
||||
else if (encoding != 1) {
|
||||
TokenizeError("cannot ReadData, unknown encoding",input, cursor);
|
||||
}
|
||||
cursor += comp_len;
|
||||
@@ -279,7 +279,7 @@ void ReadData(const char*& sbegin_out, const char*& send_out, const char* input,
|
||||
|
||||
if(cursor > end) {
|
||||
TokenizeError("cannot ReadData, the remaining size is too small for the data type: " + std::string(&type, 1),input, cursor);
|
||||
}
|
||||
}
|
||||
|
||||
// the type code is contained in the returned range
|
||||
send_out = cursor;
|
||||
@@ -291,10 +291,10 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor,
|
||||
{
|
||||
// the first word contains the offset at which this block ends
|
||||
const uint32_t end_offset = ReadWord(input, cursor, end);
|
||||
|
||||
|
||||
// we may get 0 if reading reached the end of the file -
|
||||
// fbx files have a mysterious extra footer which I don't know
|
||||
// how to extract any information from, but at least it always
|
||||
// fbx files have a mysterious extra footer which I don't know
|
||||
// how to extract any information from, but at least it always
|
||||
// starts with a 0.
|
||||
if(!end_offset) {
|
||||
return false;
|
||||
|
||||
@@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -23,16 +23,16 @@ following conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -59,7 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "ParsingUtils.h"
|
||||
#include "fast_atof.h"
|
||||
#include <boost/foreach.hpp>
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
using namespace Assimp;
|
||||
using namespace Assimp::FBX;
|
||||
@@ -189,7 +189,7 @@ Scope::Scope(Parser& parser,bool topLevel)
|
||||
TokenPtr t = parser.CurrentToken();
|
||||
if (t->Type() != TokenType_OPEN_BRACKET) {
|
||||
ParseError("expected open bracket",t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TokenPtr n = parser.AdvanceToNextToken();
|
||||
@@ -384,7 +384,7 @@ float ParseTokenAsFloat(const Token& t, const char*& err_out)
|
||||
}
|
||||
|
||||
// need to copy the input string to a temporary buffer
|
||||
// first - next in the fbx token stream comes ',',
|
||||
// first - next in the fbx token stream comes ',',
|
||||
// which fast_atof could interpret as decimal point.
|
||||
#define MAX_FLOAT_LENGTH 31
|
||||
char temp[MAX_FLOAT_LENGTH + 1];
|
||||
@@ -515,7 +515,7 @@ namespace {
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// read the type code and element count of a binary data array and stop there
|
||||
void ReadBinaryDataArrayHead(const char*& data, const char* end, char& type, uint32_t& count,
|
||||
void ReadBinaryDataArrayHead(const char*& data, const char* end, char& type, uint32_t& count,
|
||||
const Element& el)
|
||||
{
|
||||
if (static_cast<size_t>(end-data) < 5) {
|
||||
@@ -536,8 +536,8 @@ void ReadBinaryDataArrayHead(const char*& data, const char* end, char& type, uin
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// read binary data array, assume cursor points to the 'compression mode' field (i.e. behind the header)
|
||||
void ReadBinaryDataArray(char type, uint32_t count, const char*& data, const char* end,
|
||||
std::vector<char>& buff,
|
||||
void ReadBinaryDataArray(char type, uint32_t count, const char*& data, const char* end,
|
||||
std::vector<char>& buff,
|
||||
const Element& /*el*/)
|
||||
{
|
||||
BE_NCONST uint32_t encmode = SafeParse<uint32_t>(data, end);
|
||||
@@ -581,7 +581,7 @@ void ReadBinaryDataArray(char type, uint32_t count, const char*& data, const cha
|
||||
else if(encmode == 1) {
|
||||
// zlib/deflate, next comes ZIP head (0x78 0x01)
|
||||
// see http://www.ietf.org/rfc/rfc1950.txt
|
||||
|
||||
|
||||
z_stream zstream;
|
||||
zstream.opaque = Z_NULL;
|
||||
zstream.zalloc = Z_NULL;
|
||||
@@ -631,7 +631,7 @@ void ParseVectorDataArray(std::vector<aiVector3D>& out, const Element& el)
|
||||
if(tok.empty()) {
|
||||
ParseError("unexpected empty element",&el);
|
||||
}
|
||||
|
||||
|
||||
if(tok[0]->IsBinary()) {
|
||||
const char* data = tok[0]->begin(), *end = tok[0]->end();
|
||||
|
||||
@@ -653,7 +653,7 @@ void ParseVectorDataArray(std::vector<aiVector3D>& out, const Element& el)
|
||||
|
||||
std::vector<char> buff;
|
||||
ReadBinaryDataArray(type, count, data, end, buff, el);
|
||||
|
||||
|
||||
ai_assert(data == end);
|
||||
ai_assert(buff.size() == count * (type == 'd' ? 8 : 4));
|
||||
|
||||
@@ -1095,7 +1095,7 @@ void ParseVectorDataArray(std::vector<uint64_t>& out, const Element& el)
|
||||
|
||||
for (TokenList::const_iterator it = a.Tokens().begin(), end = a.Tokens().end(); it != end; ) {
|
||||
const uint64_t ival = ParseTokenAsID(**it++);
|
||||
|
||||
|
||||
out.push_back(ival);
|
||||
}
|
||||
}
|
||||
@@ -1211,7 +1211,7 @@ std::string ParseTokenAsString(const Token& t)
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// extract a required element from a scope, abort if the element cannot be found
|
||||
const Element& GetRequiredElement(const Scope& sc, const std::string& index, const Element* element /*= NULL*/)
|
||||
const Element& GetRequiredElement(const Scope& sc, const std::string& index, const Element* element /*= NULL*/)
|
||||
{
|
||||
const Element* el = sc[index];
|
||||
if(!el) {
|
||||
@@ -1249,7 +1249,7 @@ const Token& GetRequiredToken(const Element& el, unsigned int index)
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// wrapper around ParseTokenAsID() with ParseError handling
|
||||
uint64_t ParseTokenAsID(const Token& t)
|
||||
uint64_t ParseTokenAsID(const Token& t)
|
||||
{
|
||||
const char* err;
|
||||
const uint64_t i = ParseTokenAsID(t,err);
|
||||
@@ -1316,4 +1316,3 @@ int64_t ParseTokenAsInt64(const Token& t)
|
||||
} // !Assimp
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
// Definitions for the Interchange File Format (IFF)
|
||||
// Alexander Gessler, 2006
|
||||
// Adapted to Assimp August 2008
|
||||
@@ -7,7 +5,7 @@
|
||||
#ifndef AI_IFF_H_INCLUDED
|
||||
#define AI_IFF_H_INCLUDED
|
||||
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
namespace Assimp {
|
||||
namespace IFF {
|
||||
@@ -81,12 +79,12 @@ inline SubChunkHeader LoadSubChunk(uint8_t*& outFile)
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//! Read the file header and return the type of the file and its size
|
||||
//! @param outFile Pointer to the file data. The buffer must at
|
||||
//! @param outFile Pointer to the file data. The buffer must at
|
||||
//! least be 12 bytes large.
|
||||
//! @param fileType Receives the type of the file
|
||||
//! @return 0 if everything was OK, otherwise an error message
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
inline const char* ReadHeader(uint8_t* outFile, uint32_t& fileType)
|
||||
inline const char* ReadHeader(uint8_t* outFile, uint32_t& fileType)
|
||||
{
|
||||
ChunkHeader head = LoadChunk(outFile);
|
||||
if(AI_IFF_FOURCC_FORM != head.type)
|
||||
|
||||
@@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "LWOLoader.h"
|
||||
#include "StringComparison.h"
|
||||
#include "SGSpatialSort.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "ProcessHelper.h"
|
||||
#include "ConvertToLHProcess.h"
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// internal headers
|
||||
#include "LWOLoader.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/** @file Implementation of the MD2 importer class */
|
||||
#include "MD2Loader.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "MD2NormalTable.h" // shouldn't be included by other units
|
||||
#include "../include/assimp/DefaultLogger.hpp"
|
||||
#include "../include/assimp/Importer.hpp"
|
||||
|
||||
@@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -23,16 +23,16 @@ following conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "../include/assimp/types.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
#include "MD2FileData.h"
|
||||
struct aiNode;
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Returns whether the class can handle the format of the given file.
|
||||
/** Returns whether the class can handle the format of the given file.
|
||||
* See BaseImporter::CanRead() for details. */
|
||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||
bool checkSig) const;
|
||||
@@ -91,10 +91,10 @@ protected:
|
||||
const aiImporterDesc* GetInfo () const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Imports the given file into the given scene structure.
|
||||
/** Imports the given file into the given scene structure.
|
||||
* See BaseImporter::InternReadFile() for details
|
||||
*/
|
||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||
IOSystem* pIOHandler);
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef ASSIMP_BUILD_NO_MD3_IMPORTER
|
||||
|
||||
#include "MD3Loader.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "SceneCombiner.h"
|
||||
#include "GenericProperty.h"
|
||||
#include "RemoveComments.h"
|
||||
|
||||
@@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -23,16 +23,16 @@ following conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define AI_MD3LOADER_H_INCLUDED
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "MD3FileData.h"
|
||||
#include "StringComparison.h"
|
||||
#include "../include/assimp/types.h"
|
||||
@@ -99,7 +99,7 @@ enum ShaderCullMode
|
||||
enum BlendFunc
|
||||
{
|
||||
BLEND_NONE,
|
||||
BLEND_GL_ONE,
|
||||
BLEND_GL_ONE,
|
||||
BLEND_GL_ZERO,
|
||||
BLEND_GL_DST_COLOR,
|
||||
BLEND_GL_ONE_MINUS_DST_COLOR,
|
||||
@@ -114,7 +114,7 @@ enum AlphaTestFunc
|
||||
{
|
||||
AT_NONE,
|
||||
AT_GT0,
|
||||
AT_LT128,
|
||||
AT_LT128,
|
||||
AT_GE128
|
||||
};
|
||||
|
||||
@@ -223,7 +223,7 @@ public:
|
||||
public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Returns whether the class can handle the format of the given file.
|
||||
/** Returns whether the class can handle the format of the given file.
|
||||
* See BaseImporter::CanRead() for details. */
|
||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||
bool checkSig) const;
|
||||
@@ -245,10 +245,10 @@ protected:
|
||||
const aiImporterDesc* GetInfo () const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Imports the given file into the given scene structure.
|
||||
/** Imports the given file into the given scene structure.
|
||||
* See BaseImporter::InternReadFile() for details
|
||||
*/
|
||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||
IOSystem* pIOHandler);
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -281,7 +281,7 @@ protected:
|
||||
* @param[in] header_path Base path specified in MD3 header
|
||||
* @param[out] out Receives the converted output string
|
||||
*/
|
||||
void ConvertPath(const char* texture_name, const char* header_path,
|
||||
void ConvertPath(const char* texture_name, const char* header_path,
|
||||
std::string& out) const;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -23,23 +23,23 @@ following conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file MDCLoader.h
|
||||
* @brief Definition of the MDC importer class.
|
||||
* @brief Definition of the MDC importer class.
|
||||
*/
|
||||
#ifndef AI_MDCLOADER_H_INCLUDED
|
||||
#define AI_MDCLOADER_H_INCLUDED
|
||||
@@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "BaseImporter.h"
|
||||
#include "MDCFileData.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
namespace Assimp {
|
||||
using namespace MDC;
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
public:
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Returns whether the class can handle the format of the given file.
|
||||
/** Returns whether the class can handle the format of the given file.
|
||||
* See BaseImporter::CanRead() for details. */
|
||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||
bool checkSig) const;
|
||||
@@ -87,7 +87,7 @@ protected:
|
||||
const aiImporterDesc* GetInfo () const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Imports the given file into the given scene structure.
|
||||
/** Imports the given file into the given scene structure.
|
||||
* See BaseImporter::InternReadFile() for details
|
||||
*/
|
||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||
@@ -125,4 +125,3 @@ protected:
|
||||
} // end of namespace Assimp
|
||||
|
||||
#endif // AI_3DSIMPORTER_H_INC
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ Open Asset Import Library (assimp)
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -23,16 +23,16 @@ following conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/**
|
||||
* @file MDLFileData.h
|
||||
* @brief Definition of in-memory structures for the MDL file format.
|
||||
* @brief Definition of in-memory structures for the MDL file format.
|
||||
*
|
||||
* The specification has been taken from various sources on the internet.
|
||||
* - http://tfc.duke.free.fr/coding/mdl-specs-en.html
|
||||
@@ -52,7 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_MDLFILEHELPER_H_INC
|
||||
#define AI_MDLFILEHELPER_H_INC
|
||||
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "./../include/assimp/anim.h"
|
||||
#include "./../include/assimp/mesh.h"
|
||||
#include "./../include/assimp/Compiler/pushpack1.h"
|
||||
@@ -99,13 +99,13 @@ namespace MDL {
|
||||
# define AI_MDL_MAX_FRAMES 256
|
||||
#endif
|
||||
#if (!defined AI_MDL_MAX_UVS)
|
||||
# define AI_MDL_MAX_UVS 1024
|
||||
# define AI_MDL_MAX_UVS 1024
|
||||
#endif
|
||||
#if (!defined AI_MDL_MAX_VERTS)
|
||||
# define AI_MDL_MAX_VERTS 1024
|
||||
#endif
|
||||
#if (!defined AI_MDL_MAX_TRIANGLES)
|
||||
# define AI_MDL_MAX_TRIANGLES 2048
|
||||
# define AI_MDL_MAX_TRIANGLES 2048
|
||||
#endif
|
||||
|
||||
// material key that is set for dummy materials that are
|
||||
@@ -121,47 +121,47 @@ namespace MDL {
|
||||
struct Header
|
||||
{
|
||||
//! magic number: "IDPO"
|
||||
uint32_t ident;
|
||||
uint32_t ident;
|
||||
|
||||
//! version number: 6
|
||||
int32_t version;
|
||||
int32_t version;
|
||||
|
||||
//! scale factors for each axis
|
||||
aiVector3D scale;
|
||||
aiVector3D scale;
|
||||
|
||||
//! translation factors for each axis
|
||||
aiVector3D translate;
|
||||
aiVector3D translate;
|
||||
|
||||
//! bounding radius of the mesh
|
||||
float boundingradius;
|
||||
|
||||
|
||||
//! Position of the viewer's exe. Ignored
|
||||
aiVector3D vEyePos;
|
||||
|
||||
//! Number of textures
|
||||
int32_t num_skins;
|
||||
int32_t num_skins;
|
||||
|
||||
//! Texture width in pixels
|
||||
int32_t skinwidth;
|
||||
|
||||
//! Texture height in pixels
|
||||
int32_t skinheight;
|
||||
int32_t skinheight;
|
||||
|
||||
//! Number of vertices contained in the file
|
||||
int32_t num_verts;
|
||||
int32_t num_verts;
|
||||
|
||||
//! Number of triangles contained in the file
|
||||
int32_t num_tris;
|
||||
int32_t num_tris;
|
||||
|
||||
//! Number of frames contained in the file
|
||||
int32_t num_frames;
|
||||
int32_t num_frames;
|
||||
|
||||
//! 0 = synchron, 1 = random . Ignored
|
||||
//! (MDLn formats: number of texture coordinates)
|
||||
int32_t synctype;
|
||||
int32_t synctype;
|
||||
|
||||
//! State flag
|
||||
int32_t flags;
|
||||
int32_t flags;
|
||||
|
||||
//! Could be the total size of the file (and not a float)
|
||||
float size;
|
||||
@@ -175,10 +175,10 @@ struct Header
|
||||
struct Header_MDL7
|
||||
{
|
||||
//! magic number: "MDL7"
|
||||
char ident[4];
|
||||
char ident[4];
|
||||
|
||||
//! Version number. Ignored
|
||||
int32_t version;
|
||||
int32_t version;
|
||||
|
||||
//! Number of bones in file
|
||||
uint32_t bones_num;
|
||||
@@ -187,13 +187,13 @@ struct Header_MDL7
|
||||
uint32_t groups_num;
|
||||
|
||||
//! Size of data in the file
|
||||
uint32_t data_size;
|
||||
uint32_t data_size;
|
||||
|
||||
//! Ignored. Used to store entity specific information
|
||||
int32_t entlump_size;
|
||||
int32_t entlump_size;
|
||||
|
||||
//! Ignored. Used to store MED related data
|
||||
int32_t medlump_size;
|
||||
int32_t medlump_size;
|
||||
|
||||
//! Size of the Bone_MDL7 data structure used in the file
|
||||
uint16_t bone_stc_size;
|
||||
@@ -237,7 +237,7 @@ struct Bone_MDL7
|
||||
//! Index of the parent bone of *this* bone. 0xffff means:
|
||||
//! "hey, I have no parent, I'm an orphan"
|
||||
uint16_t parent_index;
|
||||
uint8_t _unused_[2];
|
||||
uint8_t _unused_[2];
|
||||
|
||||
//! Relative position of the bone (relative to the
|
||||
//! parent bone)
|
||||
@@ -270,21 +270,21 @@ struct Bone_MDL7
|
||||
struct Group_MDL7
|
||||
{
|
||||
//! = '1' -> triangle based Mesh
|
||||
unsigned char typ;
|
||||
unsigned char typ;
|
||||
|
||||
int8_t deformers;
|
||||
int8_t max_weights;
|
||||
int8_t _unused_;
|
||||
|
||||
//! size of data for this group in bytes ( MD7_GROUP stc. included).
|
||||
int32_t groupdata_size;
|
||||
int32_t groupdata_size;
|
||||
char name[AI_MDL7_MAX_GROUPNAMESIZE];
|
||||
|
||||
//! Number of skins
|
||||
int32_t numskins;
|
||||
|
||||
//! Number of texture coordinates
|
||||
int32_t num_stpts;
|
||||
int32_t num_stpts;
|
||||
|
||||
//! Number of triangles
|
||||
int32_t numtris;
|
||||
@@ -327,7 +327,7 @@ struct Deformer_MDL7
|
||||
struct DeformerElement_MDL7
|
||||
{
|
||||
//! bei deformer_typ==0 (==bones) element_index == bone index
|
||||
int32_t element_index;
|
||||
int32_t element_index;
|
||||
char element_name[AI_MDL7_MAX_BONENAMESIZE];
|
||||
int32_t weights;
|
||||
} PACK_STRUCT;
|
||||
@@ -340,7 +340,7 @@ struct DeformerElement_MDL7
|
||||
struct DeformerWeight_MDL7
|
||||
{
|
||||
//! for deformer_typ==0 (==bones) index == vertex index
|
||||
int32_t index;
|
||||
int32_t index;
|
||||
float weight;
|
||||
} PACK_STRUCT;
|
||||
|
||||
@@ -364,19 +364,19 @@ struct ColorValue_MDL7
|
||||
struct Material_MDL7
|
||||
{
|
||||
//! Diffuse base color of the material
|
||||
ColorValue_MDL7 Diffuse;
|
||||
ColorValue_MDL7 Diffuse;
|
||||
|
||||
//! Ambient base color of the material
|
||||
ColorValue_MDL7 Ambient;
|
||||
ColorValue_MDL7 Ambient;
|
||||
|
||||
//! Specular base color of the material
|
||||
ColorValue_MDL7 Specular;
|
||||
ColorValue_MDL7 Specular;
|
||||
|
||||
//! Emissive base color of the material
|
||||
ColorValue_MDL7 Emissive;
|
||||
ColorValue_MDL7 Emissive;
|
||||
|
||||
//! Phong power
|
||||
float Power;
|
||||
float Power;
|
||||
} PACK_STRUCT;
|
||||
|
||||
|
||||
@@ -391,16 +391,16 @@ struct Skin
|
||||
//! fore the size of the data to skip:
|
||||
//-------------------------------------------------------
|
||||
//! 2 for 565 RGB,
|
||||
//! 3 for 4444 ARGB,
|
||||
//! 10 for 565 mipmapped,
|
||||
//! 3 for 4444 ARGB,
|
||||
//! 10 for 565 mipmapped,
|
||||
//! 11 for 4444 mipmapped (bpp = 2),
|
||||
//! 12 for 888 RGB mipmapped (bpp = 3),
|
||||
//! 12 for 888 RGB mipmapped (bpp = 3),
|
||||
//! 13 for 8888 ARGB mipmapped (bpp = 4)
|
||||
//-------------------------------------------------------
|
||||
int32_t group;
|
||||
int32_t group;
|
||||
|
||||
//! Texture data
|
||||
uint8_t *data;
|
||||
uint8_t *data;
|
||||
} PACK_STRUCT;
|
||||
|
||||
|
||||
@@ -411,8 +411,8 @@ struct Skin
|
||||
*/
|
||||
struct Skin_MDL5
|
||||
{
|
||||
int32_t size, width, height;
|
||||
uint8_t *data;
|
||||
int32_t size, width, height;
|
||||
uint8_t *data;
|
||||
} PACK_STRUCT;
|
||||
|
||||
// maximum length of texture file name
|
||||
@@ -430,7 +430,7 @@ struct Skin_MDL7
|
||||
int8_t _unused_[3];
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
char texture_name[AI_MDL7_MAX_TEXNAMESIZE];
|
||||
char texture_name[AI_MDL7_MAX_TEXNAMESIZE];
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -463,16 +463,16 @@ struct ARGB4
|
||||
struct GroupSkin
|
||||
{
|
||||
//! 0 = single (Skin), 1 = group (GroupSkin)
|
||||
int32_t group;
|
||||
int32_t group;
|
||||
|
||||
//! Number of images
|
||||
int32_t nb;
|
||||
int32_t nb;
|
||||
|
||||
//! Time for each image
|
||||
float *time;
|
||||
float *time;
|
||||
|
||||
//! Data of each image
|
||||
uint8_t **data;
|
||||
uint8_t **data;
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -498,10 +498,10 @@ struct TexCoord
|
||||
struct TexCoord_MDL3
|
||||
{
|
||||
//! position, horizontally in range 0..skinwidth-1
|
||||
int16_t u;
|
||||
int16_t u;
|
||||
|
||||
//! position, vertically in range 0..skinheight-1
|
||||
int16_t v;
|
||||
int16_t v;
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -511,10 +511,10 @@ struct TexCoord_MDL3
|
||||
struct TexCoord_MDL7
|
||||
{
|
||||
//! position, horizontally in range 0..1
|
||||
float u;
|
||||
float u;
|
||||
|
||||
//! position, vertically in range 0..1
|
||||
float v;
|
||||
float v;
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -527,10 +527,10 @@ struct TexCoord_MDL7
|
||||
struct SkinSet_MDL7
|
||||
{
|
||||
//! Index into the UV coordinate list
|
||||
uint16_t st_index[3]; // size 6
|
||||
uint16_t st_index[3]; // size 6
|
||||
|
||||
//! Material index
|
||||
int32_t material; // size 4
|
||||
int32_t material; // size 4
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -540,10 +540,10 @@ struct SkinSet_MDL7
|
||||
struct Triangle
|
||||
{
|
||||
//! 0 = backface, 1 = frontface
|
||||
int32_t facesfront;
|
||||
int32_t facesfront;
|
||||
|
||||
//! Vertex indices
|
||||
int32_t vertex[3];
|
||||
int32_t vertex[3];
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -556,7 +556,7 @@ struct Triangle_MDL3
|
||||
uint16_t index_xyz[3];
|
||||
|
||||
//! Index of 3 skin vertices in range 0..numskinverts
|
||||
uint16_t index_uv[3];
|
||||
uint16_t index_uv[3];
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -570,17 +570,17 @@ struct Triangle_MDL7
|
||||
|
||||
//! Two skinsets. The second will be used for multi-texturing
|
||||
SkinSet_MDL7 skinsets[2];
|
||||
} PACK_STRUCT;
|
||||
} PACK_STRUCT;
|
||||
|
||||
#if (!defined AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV)
|
||||
# define AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV (6+sizeof(SkinSet_MDL7)-sizeof(uint32_t))
|
||||
#endif
|
||||
#endif
|
||||
#if (!defined AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV_WITH_MATINDEX)
|
||||
# define AI_MDL7_TRIANGLE_STD_SIZE_ONE_UV_WITH_MATINDEX (6+sizeof(SkinSet_MDL7))
|
||||
#endif
|
||||
#endif
|
||||
#if (!defined AI_MDL7_TRIANGLE_STD_SIZE_TWO_UV)
|
||||
# define AI_MDL7_TRIANGLE_STD_SIZE_TWO_UV (6+2*sizeof(SkinSet_MDL7))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Helper constants for Triangle::facesfront
|
||||
#if (!defined AI_MDL_BACKFACE)
|
||||
@@ -634,10 +634,10 @@ struct Vertex_MDL7
|
||||
struct BoneTransform_MDL7
|
||||
{
|
||||
//! 4*3
|
||||
float m [4*4];
|
||||
float m [4*4];
|
||||
|
||||
//! the index of this vertex, 0.. header::bones_num - 1
|
||||
uint16_t bone_index;
|
||||
uint16_t bone_index;
|
||||
|
||||
//! I HATE 3DGS AND THE SILLY DEVELOPER WHO DESIGNED
|
||||
//! THIS STUPID FILE FORMAT!
|
||||
@@ -655,8 +655,8 @@ struct BoneTransform_MDL7
|
||||
struct Frame_MDL7
|
||||
{
|
||||
char frame_name[AI_MDL7_MAX_FRAMENAMESIZE];
|
||||
uint32_t vertices_count;
|
||||
uint32_t transmatrix_count;
|
||||
uint32_t vertices_count;
|
||||
uint32_t transmatrix_count;
|
||||
};
|
||||
|
||||
|
||||
@@ -667,16 +667,16 @@ struct Frame_MDL7
|
||||
struct SimpleFrame
|
||||
{
|
||||
//! Minimum vertex of the bounding box
|
||||
Vertex bboxmin;
|
||||
Vertex bboxmin;
|
||||
|
||||
//! Maximum vertex of the bounding box
|
||||
Vertex bboxmax;
|
||||
Vertex bboxmax;
|
||||
|
||||
//! Name of the frame
|
||||
char name[16];
|
||||
|
||||
//! Vertex list of the frame
|
||||
Vertex *verts;
|
||||
Vertex *verts;
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -686,10 +686,10 @@ struct SimpleFrame
|
||||
struct Frame
|
||||
{
|
||||
//! 0 = simple frame, !0 = group frame
|
||||
int32_t type;
|
||||
int32_t type;
|
||||
|
||||
//! Frame data
|
||||
SimpleFrame frame;
|
||||
SimpleFrame frame;
|
||||
} PACK_STRUCT;
|
||||
|
||||
|
||||
@@ -697,16 +697,16 @@ struct Frame
|
||||
struct SimpleFrame_MDLn_SP
|
||||
{
|
||||
//! Minimum vertex of the bounding box
|
||||
Vertex_MDL4 bboxmin;
|
||||
Vertex_MDL4 bboxmin;
|
||||
|
||||
//! Maximum vertex of the bounding box
|
||||
Vertex_MDL4 bboxmax;
|
||||
Vertex_MDL4 bboxmax;
|
||||
|
||||
//! Name of the frame
|
||||
char name[16];
|
||||
|
||||
//! Vertex list of the frame
|
||||
Vertex_MDL4 *verts;
|
||||
Vertex_MDL4 *verts;
|
||||
} PACK_STRUCT;
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -716,19 +716,19 @@ struct SimpleFrame_MDLn_SP
|
||||
struct GroupFrame
|
||||
{
|
||||
//! 0 = simple frame, !0 = group frame
|
||||
int32_t type;
|
||||
int32_t type;
|
||||
|
||||
//! Minimum vertex for all single frames
|
||||
Vertex min;
|
||||
Vertex min;
|
||||
|
||||
//! Maximum vertex for all single frames
|
||||
Vertex max;
|
||||
Vertex max;
|
||||
|
||||
//! Time for all single frames
|
||||
float *time;
|
||||
float *time;
|
||||
|
||||
//! List of single frames
|
||||
SimpleFrame *frames;
|
||||
SimpleFrame *frames;
|
||||
} PACK_STRUCT;
|
||||
|
||||
#include "./../include/assimp/Compiler/poppack1.h"
|
||||
@@ -752,7 +752,7 @@ struct IntFace_MDL7
|
||||
|
||||
//! Material index (maximally two channels, which are joined later)
|
||||
unsigned int iMatIndex[2];
|
||||
};
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
/** \struct IntMaterial_MDL7
|
||||
@@ -812,7 +812,7 @@ struct IntBone_MDL7 : aiBone
|
||||
struct IntFrameInfo_MDL7
|
||||
{
|
||||
//! Construction from an existing frame header
|
||||
IntFrameInfo_MDL7(BE_NCONST MDL::Frame_MDL7* _pcFrame,unsigned int _iIndex)
|
||||
IntFrameInfo_MDL7(BE_NCONST MDL::Frame_MDL7* _pcFrame,unsigned int _iIndex)
|
||||
: iIndex(_iIndex)
|
||||
, pcFrame(_pcFrame)
|
||||
{}
|
||||
@@ -821,7 +821,7 @@ struct IntFrameInfo_MDL7
|
||||
unsigned int iIndex;
|
||||
|
||||
//! Points to the header of the frame
|
||||
BE_NCONST MDL::Frame_MDL7* pcFrame;
|
||||
BE_NCONST MDL::Frame_MDL7* pcFrame;
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -829,7 +829,7 @@ struct IntFrameInfo_MDL7
|
||||
struct IntGroupInfo_MDL7
|
||||
{
|
||||
//! Default constructor
|
||||
IntGroupInfo_MDL7()
|
||||
IntGroupInfo_MDL7()
|
||||
: iIndex(0)
|
||||
, pcGroup(NULL)
|
||||
, pcGroupUVs(NULL)
|
||||
@@ -847,13 +847,13 @@ struct IntGroupInfo_MDL7
|
||||
unsigned int iIndex;
|
||||
|
||||
//! Points to the header of the group
|
||||
BE_NCONST MDL::Group_MDL7* pcGroup;
|
||||
BE_NCONST MDL::Group_MDL7* pcGroup;
|
||||
|
||||
//! Points to the beginning of the uv coordinate section
|
||||
BE_NCONST MDL::TexCoord_MDL7* pcGroupUVs;
|
||||
BE_NCONST MDL::TexCoord_MDL7* pcGroupUVs;
|
||||
|
||||
//! Points to the beginning of the triangle section
|
||||
MDL::Triangle_MDL7* pcGroupTris;
|
||||
MDL::Triangle_MDL7* pcGroupTris;
|
||||
|
||||
//! Points to the beginning of the vertex section
|
||||
BE_NCONST MDL::Vertex_MDL7* pcGroupVerts;
|
||||
@@ -868,16 +868,16 @@ struct IntGroupData_MDL7
|
||||
{}
|
||||
|
||||
//! Array of faces that belong to the group
|
||||
MDL::IntFace_MDL7* pcFaces;
|
||||
MDL::IntFace_MDL7* pcFaces;
|
||||
|
||||
//! Array of vertex positions
|
||||
std::vector<aiVector3D> vPositions;
|
||||
std::vector<aiVector3D> vPositions;
|
||||
|
||||
//! Array of vertex normals
|
||||
std::vector<aiVector3D> vNormals;
|
||||
std::vector<aiVector3D> vNormals;
|
||||
|
||||
//! Array of bones indices
|
||||
std::vector<unsigned int> aiBones;
|
||||
std::vector<unsigned int> aiBones;
|
||||
|
||||
//! First UV coordinate set
|
||||
std::vector<aiVector3D> vTextureCoords1;
|
||||
@@ -895,7 +895,7 @@ struct IntGroupData_MDL7
|
||||
struct IntSharedData_MDL7
|
||||
{
|
||||
//! Default constructor
|
||||
IntSharedData_MDL7()
|
||||
IntSharedData_MDL7()
|
||||
{
|
||||
abNeedMaterials.reserve(10);
|
||||
}
|
||||
@@ -929,7 +929,7 @@ struct IntSharedData_MDL7
|
||||
//! Contains input data for GenerateOutputMeshes_3DGS_MDL7
|
||||
struct IntSplitGroupData_MDL7
|
||||
{
|
||||
//! Construction from a given shared data set
|
||||
//! Construction from a given shared data set
|
||||
IntSplitGroupData_MDL7(IntSharedData_MDL7& _shared,
|
||||
std::vector<aiMesh*>& _avOutList)
|
||||
|
||||
@@ -955,7 +955,7 @@ struct IntSplitGroupData_MDL7
|
||||
//! Shared data for all groups of the model
|
||||
IntSharedData_MDL7& shared;
|
||||
|
||||
//! List of meshes
|
||||
//! List of meshes
|
||||
std::vector<aiMesh*>& avOutList;
|
||||
};
|
||||
|
||||
|
||||
@@ -48,11 +48,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "ObjFileData.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include "../include/assimp/types.h"
|
||||
#include "DefaultIOSystem.h"
|
||||
#include "BaseImporter.h"
|
||||
#include "../include/assimp/DefaultLogger.hpp"
|
||||
#include "../include/assimp/material.h"
|
||||
#include "../include/assimp/Importer.hpp"
|
||||
#include "DefaultIOSystem.h"
|
||||
#include "BaseImporter.h"
|
||||
#include "../include/assimp/DefaultLogger.hpp"
|
||||
#include "../include/assimp/material.h"
|
||||
#include "../include/assimp/Importer.hpp"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
@@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "PlyLoader.h"
|
||||
#include "fast_atof.h"
|
||||
#include "../include/assimp/DefaultLogger.hpp"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
@@ -45,6 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "Q3BSPZipArchive.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include "../include/assimp/ai_assert.h"
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "../include/assimp/Exporter.hpp"
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include "Exceptional.h"
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
|
||||
using namespace Assimp;
|
||||
namespace Assimp {
|
||||
|
||||
@@ -7,8 +7,8 @@ Copyright (c) 2006-2012, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -25,16 +25,16 @@ conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_STREAMREADER_H_INCLUDED
|
||||
#define AI_STREAMREADER_H_INCLUDED
|
||||
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "Exceptional.h"
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "../include/assimp/IOStream.hpp"
|
||||
@@ -54,12 +54,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
namespace Assimp {
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
/** Wrapper class around IOStream to allow for consistent reading of binary data in both
|
||||
* little and big endian format. Don't attempt to instance the template directly. Use
|
||||
* StreamReaderLE to read from a little-endian stream and StreamReaderBE to read from a
|
||||
* BE stream. The class expects that the endianess of any input data is known at
|
||||
/** Wrapper class around IOStream to allow for consistent reading of binary data in both
|
||||
* little and big endian format. Don't attempt to instance the template directly. Use
|
||||
* StreamReaderLE to read from a little-endian stream and StreamReaderBE to read from a
|
||||
* BE stream. The class expects that the endianess of any input data is known at
|
||||
* compile-time, which should usually be true (#BaseImporter::ConvertToUTF8 implements
|
||||
* runtime endianess conversions for text files).
|
||||
* runtime endianess conversions for text files).
|
||||
*
|
||||
* XXX switch from unsigned int for size types to size_t? or ptrdiff_t?*/
|
||||
// --------------------------------------------------------------------------------------------
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
// FIXME: use these data types throughout the whole library,
|
||||
// then change them to 64 bit values :-)
|
||||
|
||||
|
||||
typedef int diff;
|
||||
typedef unsigned int pos;
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
/** Construction from a given stream with a well-defined endianess.
|
||||
*
|
||||
*
|
||||
* The StreamReader holds a permanent strong reference to the
|
||||
* stream, which is released upon destruction.
|
||||
* @param stream Input stream. The stream is not restarted if
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
: stream(stream)
|
||||
, le(le)
|
||||
{
|
||||
ai_assert(stream);
|
||||
ai_assert(stream);
|
||||
InternBegin();
|
||||
}
|
||||
|
||||
@@ -213,8 +213,8 @@ public:
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
/** Set current file pointer (Get it from #GetPtr). This is if you
|
||||
* prefer to do pointer arithmetics on your own or want to copy
|
||||
* large chunks of data at once.
|
||||
* prefer to do pointer arithmetics on your own or want to copy
|
||||
* large chunks of data at once.
|
||||
* @param p The new pointer, which is validated against the size
|
||||
* limit and buffer boundaries. */
|
||||
void SetPtr(int8_t* p) {
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
/** Setup a temporary read limit
|
||||
*
|
||||
*
|
||||
* @param limit Maximum number of bytes to be read from
|
||||
* the beginning of the file. Specifying UINT_MAX
|
||||
* resets the limit to the original end of the stream. */
|
||||
@@ -285,7 +285,7 @@ public:
|
||||
/** overload operator>> and allow chaining of >> ops. */
|
||||
template <typename T>
|
||||
StreamReader& operator >> (T& f) {
|
||||
f = Get<T>();
|
||||
f = Get<T>();
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ private:
|
||||
memcpy (&f, current, sizeof(T));
|
||||
#else
|
||||
T f = *((const T*)current);
|
||||
#endif
|
||||
#endif
|
||||
Intern :: Getter<SwapEndianess,T,RuntimeSwitch>() (&f,le);
|
||||
|
||||
current += sizeof(T);
|
||||
|
||||
@@ -7,8 +7,8 @@ Copyright (c) 2006-2012, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
@@ -25,16 +25,16 @@ conditions are met:
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#ifndef AI_STREAMWRITER_H_INCLUDED
|
||||
#define AI_STREAMWRITER_H_INCLUDED
|
||||
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "../include/assimp/IOStream.hpp"
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
@@ -54,9 +54,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
namespace Assimp {
|
||||
|
||||
// --------------------------------------------------------------------------------------------
|
||||
/** Wrapper class around IOStream to allow for consistent writing of binary data in both
|
||||
* little and big endian format. Don't attempt to instance the template directly. Use
|
||||
* StreamWriterLE to read from a little-endian stream and StreamWriterBE to read from a
|
||||
/** Wrapper class around IOStream to allow for consistent writing of binary data in both
|
||||
* little and big endian format. Don't attempt to instance the template directly. Use
|
||||
* StreamWriterLE to read from a little-endian stream and StreamWriterBE to read from a
|
||||
* BE stream. Alternatively, there is StreamWriterAny if the endianess of the output
|
||||
* stream is to be determined at runtime.
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
/** Construction from a given stream with a well-defined endianess.
|
||||
*
|
||||
*
|
||||
* The StreamReader holds a permanent strong reference to the
|
||||
* stream, which is released upon destruction.
|
||||
* @param stream Input stream. The stream is not re-seeked and writing
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
, le(le)
|
||||
, cursor()
|
||||
{
|
||||
ai_assert(stream);
|
||||
ai_assert(stream);
|
||||
buffer.reserve(INITIAL_CAPACITY);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
/** overload operator<< and allow chaining of MM ops. */
|
||||
template <typename T>
|
||||
StreamWriter& operator << (T f) {
|
||||
Put(f);
|
||||
Put(f);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ private:
|
||||
template <typename T>
|
||||
void Put(T f) {
|
||||
Intern :: Getter<SwapEndianess,T,RuntimeSwitch>() (&f, le);
|
||||
|
||||
|
||||
if (cursor + sizeof(T) >= buffer.size()) {
|
||||
buffer.resize(cursor + sizeof(T));
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "Exceptional.h"
|
||||
#include <boost/format.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "ByteSwap.h"
|
||||
#include "ByteSwapper.h"
|
||||
#include "../include/assimp/DefaultLogger.hpp"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user