Fix line endings.

pull/629/head
Kim Kulling 2015-08-08 18:02:37 +02:00
parent 373f85ffaf
commit 524834c307
103 changed files with 15343 additions and 15343 deletions

View File

@ -1,23 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003 Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute, this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following: do so, all subject to the following:
The copyright notices in the Software and this entire statement, including The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer, the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by works are solely in the form of machine-executable object code generated by
a source language processor. a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.

View File

@ -1,99 +1,99 @@
#ifndef BOOST_FOREACH #ifndef BOOST_FOREACH
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// A stripped down version of FOREACH for // A stripped down version of FOREACH for
// illustration purposes. NOT FOR GENERAL USE. // illustration purposes. NOT FOR GENERAL USE.
// For a complete implementation, see BOOST_FOREACH at // For a complete implementation, see BOOST_FOREACH at
// http://boost-sandbox.sourceforge.net/vault/index.php?directory=eric_niebler // http://boost-sandbox.sourceforge.net/vault/index.php?directory=eric_niebler
// //
// Copyright 2004 Eric Niebler. // Copyright 2004 Eric Niebler.
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at // accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
// Adapted to Assimp November 29th, 2008 (Alexander Gessler). // Adapted to Assimp November 29th, 2008 (Alexander Gessler).
// Added code to handle both const and non-const iterators, simplified some // Added code to handle both const and non-const iterators, simplified some
// parts. // parts.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace boost {
namespace foreach_detail { namespace foreach_detail {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// auto_any // auto_any
struct auto_any_base struct auto_any_base
{ {
operator bool() const { return false; } operator bool() const { return false; }
}; };
template<typename T> template<typename T>
struct auto_any : auto_any_base struct auto_any : auto_any_base
{ {
auto_any(T const& t) : item(t) {} auto_any(T const& t) : item(t) {}
mutable T item; mutable T item;
}; };
template<typename T> template<typename T>
T& auto_any_cast(auto_any_base const& any) T& auto_any_cast(auto_any_base const& any)
{ {
return static_cast<auto_any<T> const&>(any).item; return static_cast<auto_any<T> const&>(any).item;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// FOREACH helper function // FOREACH helper function
template<typename T> template<typename T>
auto_any<typename T::const_iterator> begin(T const& t) auto_any<typename T::const_iterator> begin(T const& t)
{ {
return t.begin(); return t.begin();
} }
template<typename T> template<typename T>
auto_any<typename T::const_iterator> end(T const& t) auto_any<typename T::const_iterator> end(T const& t)
{ {
return t.end(); return t.end();
} }
// iterator // iterator
template<typename T> template<typename T>
bool done(auto_any_base const& cur, auto_any_base const& end, T&) bool done(auto_any_base const& cur, auto_any_base const& end, T&)
{ {
typedef typename T::iterator iter_type; typedef typename T::iterator iter_type;
return auto_any_cast<iter_type>(cur) == auto_any_cast<iter_type>(end); return auto_any_cast<iter_type>(cur) == auto_any_cast<iter_type>(end);
} }
template<typename T> template<typename T>
void next(auto_any_base const& cur, T&) void next(auto_any_base const& cur, T&)
{ {
++auto_any_cast<typename T::iterator>(cur); ++auto_any_cast<typename T::iterator>(cur);
} }
template<typename T> template<typename T>
typename T::reference deref(auto_any_base const& cur, T&) typename T::reference deref(auto_any_base const& cur, T&)
{ {
return *auto_any_cast<typename T::iterator>(cur); return *auto_any_cast<typename T::iterator>(cur);
} }
template<typename T> template<typename T>
typename T::const_reference deref(auto_any_base const& cur, const T&) typename T::const_reference deref(auto_any_base const& cur, const T&)
{ {
return *auto_any_cast<typename T::iterator>(cur); return *auto_any_cast<typename T::iterator>(cur);
} }
} // end foreach_detail } // end foreach_detail
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// FOREACH // FOREACH
#define BOOST_FOREACH(item, container) \ #define BOOST_FOREACH(item, container) \
if(boost::foreach_detail::auto_any_base const& foreach_magic_b = boost::foreach_detail::begin(container)) {} else \ if(boost::foreach_detail::auto_any_base const& foreach_magic_b = boost::foreach_detail::begin(container)) {} else \
if(boost::foreach_detail::auto_any_base const& foreach_magic_e = boost::foreach_detail::end(container)) {} else \ if(boost::foreach_detail::auto_any_base const& foreach_magic_e = boost::foreach_detail::end(container)) {} else \
for(;!boost::foreach_detail::done(foreach_magic_b,foreach_magic_e,container); boost::foreach_detail::next(foreach_magic_b,container)) \ for(;!boost::foreach_detail::done(foreach_magic_b,foreach_magic_e,container); boost::foreach_detail::next(foreach_magic_b,container)) \
if (bool ugly_and_unique_break = false) {} else \ if (bool ugly_and_unique_break = false) {} else \
for(item = boost::foreach_detail::deref(foreach_magic_b,container); !ugly_and_unique_break; ugly_and_unique_break = true) for(item = boost::foreach_detail::deref(foreach_magic_b,container); !ugly_and_unique_break; ugly_and_unique_break = true)
} // end boost } // end boost
#endif #endif

View File

@ -1,26 +1,26 @@
/// A quick replacement for boost::lexical_cast for all the Boost haters out there /// A quick replacement for boost::lexical_cast for all the Boost haters out there
#ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST #ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST
#define __AI_BOOST_WORKAROUND_LEXICAL_CAST #define __AI_BOOST_WORKAROUND_LEXICAL_CAST
#include <sstream> #include <sstream>
namespace boost namespace boost
{ {
/// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle /// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle
template <typename TargetType, typename SourceType> template <typename TargetType, typename SourceType>
TargetType lexical_cast( const SourceType& source) TargetType lexical_cast( const SourceType& source)
{ {
std::stringstream stream; std::stringstream stream;
TargetType result; TargetType result;
stream << source; stream << source;
stream >> result; stream >> result;
return result; return result;
} }
} // namespace boost } // namespace boost
#endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST #endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST

View File

@ -1,57 +1,57 @@
// please note that this replacement implementation does not // please note that this replacement implementation does not
// provide the performance benefit of the original, which // provide the performance benefit of the original, which
// makes only one allocation as opposed to two allocations // makes only one allocation as opposed to two allocations
// (smart pointer counter and payload) which are usually // (smart pointer counter and payload) which are usually
// required if object and smart pointer are constructed // required if object and smart pointer are constructed
// independently. // independently.
#ifndef INCLUDED_AI_BOOST_MAKE_SHARED #ifndef INCLUDED_AI_BOOST_MAKE_SHARED
#define INCLUDED_AI_BOOST_MAKE_SHARED #define INCLUDED_AI_BOOST_MAKE_SHARED
namespace boost { namespace boost {
template <typename T> template <typename T>
shared_ptr<T> make_shared() { shared_ptr<T> make_shared() {
return shared_ptr<T>(new T()); return shared_ptr<T>(new T());
} }
template <typename T, typename T0> template <typename T, typename T0>
shared_ptr<T> make_shared(const T0& t0) { shared_ptr<T> make_shared(const T0& t0) {
return shared_ptr<T>(new T(t0)); return shared_ptr<T>(new T(t0));
} }
template <typename T, typename T0,typename T1> template <typename T, typename T0,typename T1>
shared_ptr<T> make_shared(const T0& t0, const T1& t1) { shared_ptr<T> make_shared(const T0& t0, const T1& t1) {
return shared_ptr<T>(new T(t0,t1)); return shared_ptr<T>(new T(t0,t1));
} }
template <typename T, typename T0,typename T1,typename T2> template <typename T, typename T0,typename T1,typename T2>
shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2) { shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2) {
return shared_ptr<T>(new T(t0,t1,t2)); return shared_ptr<T>(new T(t0,t1,t2));
} }
template <typename T, typename T0,typename T1,typename T2,typename T3> template <typename T, typename T0,typename T1,typename T2,typename T3>
shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3) { shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3) {
return shared_ptr<T>(new T(t0,t1,t2,t3)); return shared_ptr<T>(new T(t0,t1,t2,t3));
} }
template <typename T, typename T0,typename T1,typename T2,typename T3, typename T4> template <typename T, typename T0,typename T1,typename T2,typename T3, typename T4>
shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4) { shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4) {
return shared_ptr<T>(new T(t0,t1,t2,t3,t4)); return shared_ptr<T>(new T(t0,t1,t2,t3,t4));
} }
template <typename T, typename T0,typename T1,typename T2,typename T3, typename T4, typename T5> template <typename T, typename T0,typename T1,typename T2,typename T3, typename T4, typename T5>
shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) { shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {
return shared_ptr<T>(new T(t0,t1,t2,t3,t4,t5)); return shared_ptr<T>(new T(t0,t1,t2,t3,t4,t5));
} }
template <typename T, typename T0,typename T1,typename T2,typename T3, typename T4, typename T5, typename T6> template <typename T, typename T0,typename T1,typename T2,typename T3, typename T4, typename T5, typename T6>
shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) { shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) {
return shared_ptr<T>(new T(t0,t1,t2,t3,t4,t5,t6)); return shared_ptr<T>(new T(t0,t1,t2,t3,t4,t5,t6));
} }
} }
#endif #endif

View File

@ -1,37 +1,37 @@
#ifndef BOOST_MATH_COMMON_FACTOR_RT_HPP #ifndef BOOST_MATH_COMMON_FACTOR_RT_HPP
#define BOOST_MATH_COMMON_FACTOR_RT_HPP #define BOOST_MATH_COMMON_FACTOR_RT_HPP
namespace boost { namespace boost {
namespace math { namespace math {
// TODO: use binary GCD for unsigned integers .... // TODO: use binary GCD for unsigned integers ....
template < typename IntegerType > template < typename IntegerType >
IntegerType gcd( IntegerType a, IntegerType b ) IntegerType gcd( IntegerType a, IntegerType b )
{ {
const IntegerType zero = (IntegerType)0; const IntegerType zero = (IntegerType)0;
while ( true ) while ( true )
{ {
if ( a == zero ) if ( a == zero )
return b; return b;
b %= a; b %= a;
if ( b == zero ) if ( b == zero )
return a; return a;
a %= b; a %= b;
} }
} }
template < typename IntegerType > template < typename IntegerType >
IntegerType lcm( IntegerType a, IntegerType b ) IntegerType lcm( IntegerType a, IntegerType b )
{ {
const IntegerType t = gcd (a,b); const IntegerType t = gcd (a,b);
if (!t)return t; if (!t)return t;
return a / t * b; return a / t * b;
} }
}} }}
#endif #endif

View File

@ -1,36 +1,36 @@
// Boost noncopyable.hpp header file --------------------------------------// // Boost noncopyable.hpp header file --------------------------------------//
// (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost // (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file // Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/utility for documentation. // See http://www.boost.org/libs/utility for documentation.
#ifndef BOOST_NONCOPYABLE_HPP_INCLUDED #ifndef BOOST_NONCOPYABLE_HPP_INCLUDED
#define BOOST_NONCOPYABLE_HPP_INCLUDED #define BOOST_NONCOPYABLE_HPP_INCLUDED
namespace boost { namespace boost {
// Private copy constructor and copy assignment ensure classes derived from // Private copy constructor and copy assignment ensure classes derived from
// class noncopyable cannot be copied. // class noncopyable cannot be copied.
// Contributed by Dave Abrahams // Contributed by Dave Abrahams
namespace noncopyable_ // protection from unintended ADL namespace noncopyable_ // protection from unintended ADL
{ {
class noncopyable class noncopyable
{ {
protected: protected:
noncopyable() {} noncopyable() {}
~noncopyable() {} ~noncopyable() {}
private: // emphasize the following members are private private: // emphasize the following members are private
noncopyable( const noncopyable& ); noncopyable( const noncopyable& );
const noncopyable& operator=( const noncopyable& ); const noncopyable& operator=( const noncopyable& );
}; };
} }
typedef noncopyable_::noncopyable noncopyable; typedef noncopyable_::noncopyable noncopyable;
} // namespace boost } // namespace boost
#endif // BOOST_NONCOPYABLE_HPP_INCLUDED #endif // BOOST_NONCOPYABLE_HPP_INCLUDED

View File

@ -1,45 +1,45 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// (C) Copyright Ion Gaztanaga 2005. // (C) Copyright Ion Gaztanaga 2005.
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_POINTER_CAST_HPP #ifndef BOOST_POINTER_CAST_HPP
#define BOOST_POINTER_CAST_HPP #define BOOST_POINTER_CAST_HPP
namespace boost { namespace boost {
//static_pointer_cast overload for raw pointers //static_pointer_cast overload for raw pointers
template<class T, class U> template<class T, class U>
inline T* static_pointer_cast(U *ptr) inline T* static_pointer_cast(U *ptr)
{ {
return static_cast<T*>(ptr); return static_cast<T*>(ptr);
} }
//dynamic_pointer_cast overload for raw pointers //dynamic_pointer_cast overload for raw pointers
template<class T, class U> template<class T, class U>
inline T* dynamic_pointer_cast(U *ptr) inline T* dynamic_pointer_cast(U *ptr)
{ {
return dynamic_cast<T*>(ptr); return dynamic_cast<T*>(ptr);
} }
//const_pointer_cast overload for raw pointers //const_pointer_cast overload for raw pointers
template<class T, class U> template<class T, class U>
inline T* const_pointer_cast(U *ptr) inline T* const_pointer_cast(U *ptr)
{ {
return const_cast<T*>(ptr); return const_cast<T*>(ptr);
} }
//reinterpret_pointer_cast overload for raw pointers //reinterpret_pointer_cast overload for raw pointers
template<class T, class U> template<class T, class U>
inline T* reinterpret_pointer_cast(U *ptr) inline T* reinterpret_pointer_cast(U *ptr)
{ {
return reinterpret_cast<T*>(ptr); return reinterpret_cast<T*>(ptr);
} }
} // namespace boost } // namespace boost
#endif //BOOST_POINTER_CAST_HPP #endif //BOOST_POINTER_CAST_HPP

View File

@ -1,79 +1,79 @@
#ifndef __AI_BOOST_SCOPED_ARRAY_INCLUDED #ifndef __AI_BOOST_SCOPED_ARRAY_INCLUDED
#define __AI_BOOST_SCOPED_ARRAY_INCLUDED #define __AI_BOOST_SCOPED_ARRAY_INCLUDED
#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED #ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
namespace boost { namespace boost {
// small replacement for boost::scoped_array // small replacement for boost::scoped_array
template <class T> template <class T>
class scoped_array class scoped_array
{ {
public: public:
// provide a default construtctor // provide a default construtctor
scoped_array() scoped_array()
: ptr(0) : ptr(0)
{ {
} }
// construction from an existing heap object of type T // construction from an existing heap object of type T
scoped_array(T* _ptr) scoped_array(T* _ptr)
: ptr(_ptr) : ptr(_ptr)
{ {
} }
// automatic destruction of the wrapped object at the // automatic destruction of the wrapped object at the
// end of our lifetime // end of our lifetime
~scoped_array() ~scoped_array()
{ {
delete[] ptr; delete[] ptr;
} }
inline T* get() inline T* get()
{ {
return ptr; return ptr;
} }
inline T* operator-> () inline T* operator-> ()
{ {
return ptr; return ptr;
} }
inline void reset (T* t = 0) inline void reset (T* t = 0)
{ {
delete[] ptr; delete[] ptr;
ptr = t; ptr = t;
} }
T & operator[](std::ptrdiff_t i) const T & operator[](std::ptrdiff_t i) const
{ {
return ptr[i]; return ptr[i];
} }
void swap(scoped_array & b) void swap(scoped_array & b)
{ {
std::swap(ptr, b.ptr); std::swap(ptr, b.ptr);
} }
private: private:
// encapsulated object pointer // encapsulated object pointer
T* ptr; T* ptr;
}; };
template<class T> template<class T>
inline void swap(scoped_array<T> & a, scoped_array<T> & b) inline void swap(scoped_array<T> & a, scoped_array<T> & b)
{ {
a.swap(b); a.swap(b);
} }
} // end of namespace boost } // end of namespace boost
#else #else
# error "scoped_array.h was already included" # error "scoped_array.h was already included"
#endif #endif
#endif // __AI_BOOST_SCOPED_ARRAY_INCLUDED #endif // __AI_BOOST_SCOPED_ARRAY_INCLUDED

View File

@ -1,79 +1,79 @@
#ifndef __AI_BOOST_SCOPED_PTR_INCLUDED #ifndef __AI_BOOST_SCOPED_PTR_INCLUDED
#define __AI_BOOST_SCOPED_PTR_INCLUDED #define __AI_BOOST_SCOPED_PTR_INCLUDED
#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
namespace boost { namespace boost {
// small replacement for boost::scoped_ptr // small replacement for boost::scoped_ptr
template <class T> template <class T>
class scoped_ptr class scoped_ptr
{ {
public: public:
// provide a default construtctor // provide a default construtctor
scoped_ptr() scoped_ptr()
: ptr(0) : ptr(0)
{ {
} }
// construction from an existing heap object of type T // construction from an existing heap object of type T
scoped_ptr(T* _ptr) scoped_ptr(T* _ptr)
: ptr(_ptr) : ptr(_ptr)
{ {
} }
// automatic destruction of the wrapped object at the // automatic destruction of the wrapped object at the
// end of our lifetime // end of our lifetime
~scoped_ptr() ~scoped_ptr()
{ {
delete ptr; delete ptr;
} }
inline T* get() const inline T* get() const
{ {
return ptr; return ptr;
} }
inline operator T*() inline operator T*()
{ {
return ptr; return ptr;
} }
inline T* operator-> () inline T* operator-> ()
{ {
return ptr; return ptr;
} }
inline void reset (T* t = 0) inline void reset (T* t = 0)
{ {
delete ptr; delete ptr;
ptr = t; ptr = t;
} }
void swap(scoped_ptr & b) void swap(scoped_ptr & b)
{ {
std::swap(ptr, b.ptr); std::swap(ptr, b.ptr);
} }
private: private:
// encapsulated object pointer // encapsulated object pointer
T* ptr; T* ptr;
}; };
template<class T> template<class T>
inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b) inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b)
{ {
a.swap(b); a.swap(b);
} }
} // end of namespace boost } // end of namespace boost
#else #else
# error "scoped_ptr.h was already included" # error "scoped_ptr.h was already included"
#endif #endif
#endif // __AI_BOOST_SCOPED_PTR_INCLUDED #endif // __AI_BOOST_SCOPED_PTR_INCLUDED

View File

@ -1,228 +1,228 @@
#ifndef INCLUDED_AI_BOOST_SHARED_ARRAY #ifndef INCLUDED_AI_BOOST_SHARED_ARRAY
#define INCLUDED_AI_BOOST_SHARED_ARRAY #define INCLUDED_AI_BOOST_SHARED_ARRAY
#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED #ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
// ------------------------------ // ------------------------------
// Internal stub // Internal stub
namespace boost { namespace boost {
namespace array_detail { namespace array_detail {
class controller { class controller {
public: public:
controller() controller()
: cnt(1) : cnt(1)
{} {}
public: public:
template <typename T> template <typename T>
controller* decref(T* pt) { controller* decref(T* pt) {
if (--cnt <= 0) { if (--cnt <= 0) {
delete this; delete this;
delete[] pt; delete[] pt;
} }
return NULL; return NULL;
} }
controller* incref() { controller* incref() {
++cnt; ++cnt;
return this; return this;
} }
long get() const { long get() const {
return cnt; return cnt;
} }
private: private:
long cnt; long cnt;
}; };
struct empty {}; struct empty {};
template <typename DEST, typename SRC> template <typename DEST, typename SRC>
struct is_convertible_stub { struct is_convertible_stub {
struct yes {char s[1];}; struct yes {char s[1];};
struct no {char s[2];}; struct no {char s[2];};
static yes foo(DEST*); static yes foo(DEST*);
static no foo(...); static no foo(...);
enum {result = (sizeof(foo((SRC*)0)) == sizeof(yes) ? 1 : 0)}; enum {result = (sizeof(foo((SRC*)0)) == sizeof(yes) ? 1 : 0)};
}; };
template <bool> struct enable_if {}; template <bool> struct enable_if {};
template <> struct enable_if<true> { template <> struct enable_if<true> {
typedef empty result; typedef empty result;
}; };
template <typename DEST, typename SRC> template <typename DEST, typename SRC>
struct is_convertible : public enable_if<is_convertible_stub<DEST,SRC>::result > { struct is_convertible : public enable_if<is_convertible_stub<DEST,SRC>::result > {
}; };
} }
// ------------------------------ // ------------------------------
// Small replacement for boost::shared_array, not threadsafe because no // Small replacement for boost::shared_array, not threadsafe because no
// atomic reference counter is in use. // atomic reference counter is in use.
// ------------------------------ // ------------------------------
template <class T> template <class T>
class shared_array class shared_array
{ {
template <typename TT> friend class shared_array; template <typename TT> friend class shared_array;
template<class TT> friend bool operator== (const shared_array<TT>& a, const shared_array<TT>& b); template<class TT> friend bool operator== (const shared_array<TT>& a, const shared_array<TT>& b);
template<class TT> friend bool operator!= (const shared_array<TT>& a, const shared_array<TT>& b); template<class TT> friend bool operator!= (const shared_array<TT>& a, const shared_array<TT>& b);
template<class TT> friend bool operator< (const shared_array<TT>& a, const shared_array<TT>& b); template<class TT> friend bool operator< (const shared_array<TT>& a, const shared_array<TT>& b);
public: public:
typedef T element_type; typedef T element_type;
public: public:
// provide a default constructor // provide a default constructor
shared_array() shared_array()
: ptr() : ptr()
, ctr(NULL) , ctr(NULL)
{ {
} }
// construction from an existing object of type T // construction from an existing object of type T
explicit shared_array(T* ptr) explicit shared_array(T* ptr)
: ptr(ptr) : ptr(ptr)
, ctr(ptr ? new array_detail::controller() : NULL) , ctr(ptr ? new array_detail::controller() : NULL)
{ {
} }
shared_array(const shared_array& r) shared_array(const shared_array& r)
: ptr(r.ptr) : ptr(r.ptr)
, ctr(r.ctr ? r.ctr->incref() : NULL) , ctr(r.ctr ? r.ctr->incref() : NULL)
{ {
} }
template <typename Y> template <typename Y>
shared_array(const shared_array<Y>& r,typename detail::is_convertible<T,Y>::result = detail::empty()) shared_array(const shared_array<Y>& r,typename detail::is_convertible<T,Y>::result = detail::empty())
: ptr(r.ptr) : ptr(r.ptr)
, ctr(r.ctr ? r.ctr->incref() : NULL) , ctr(r.ctr ? r.ctr->incref() : NULL)
{ {
} }
// automatic destruction of the wrapped object when all // automatic destruction of the wrapped object when all
// references are freed. // references are freed.
~shared_array() { ~shared_array() {
if (ctr) { if (ctr) {
ctr = ctr->decref(ptr); ctr = ctr->decref(ptr);
} }
} }
shared_array& operator=(const shared_array& r) { shared_array& operator=(const shared_array& r) {
if (this == &r) { if (this == &r) {
return *this; return *this;
} }
if (ctr) { if (ctr) {
ctr->decref(ptr); ctr->decref(ptr);
} }
ptr = r.ptr; ptr = r.ptr;
ctr = ptr?r.ctr->incref():NULL; ctr = ptr?r.ctr->incref():NULL;
return *this; return *this;
} }
template <typename Y> template <typename Y>
shared_array& operator=(const shared_array<Y>& r) { shared_array& operator=(const shared_array<Y>& r) {
if (this == &r) { if (this == &r) {
return *this; return *this;
} }
if (ctr) { if (ctr) {
ctr->decref(ptr); ctr->decref(ptr);
} }
ptr = r.ptr; ptr = r.ptr;
ctr = ptr?r.ctr->incref():NULL; ctr = ptr?r.ctr->incref():NULL;
return *this; return *this;
} }
// pointer access // pointer access
inline operator T*() { inline operator T*() {
return ptr; return ptr;
} }
inline T* operator-> () const { inline T* operator-> () const {
return ptr; return ptr;
} }
// standard semantics // standard semantics
inline T* get() { inline T* get() {
return ptr; return ptr;
} }
T& operator[] (std::ptrdiff_t index) const { T& operator[] (std::ptrdiff_t index) const {
return ptr[index]; return ptr[index];
} }
inline const T* get() const { inline const T* get() const {
return ptr; return ptr;
} }
inline operator bool () const { inline operator bool () const {
return ptr != NULL; return ptr != NULL;
} }
inline bool unique() const { inline bool unique() const {
return use_count() == 1; return use_count() == 1;
} }
inline long use_count() const { inline long use_count() const {
return ctr->get(); return ctr->get();
} }
inline void reset (T* t = 0) { inline void reset (T* t = 0) {
if (ctr) { if (ctr) {
ctr->decref(ptr); ctr->decref(ptr);
} }
ptr = t; ptr = t;
ctr = ptr?new array_detail::controller():NULL; ctr = ptr?new array_detail::controller():NULL;
} }
void swap(shared_array & b) { void swap(shared_array & b) {
std::swap(ptr, b.ptr); std::swap(ptr, b.ptr);
std::swap(ctr, b.ctr); std::swap(ctr, b.ctr);
} }
private: private:
// encapsulated object pointer // encapsulated object pointer
T* ptr; T* ptr;
// control block // control block
array_detail::controller* ctr; array_detail::controller* ctr;
}; };
template<class T> template<class T>
inline void swap(shared_array<T> & a, shared_array<T> & b) inline void swap(shared_array<T> & a, shared_array<T> & b)
{ {
a.swap(b); a.swap(b);
} }
template<class T> template<class T>
bool operator== (const shared_array<T>& a, const shared_array<T>& b) { bool operator== (const shared_array<T>& a, const shared_array<T>& b) {
return a.ptr == b.ptr; return a.ptr == b.ptr;
} }
template<class T> template<class T>
bool operator!= (const shared_array<T>& a, const shared_array<T>& b) { bool operator!= (const shared_array<T>& a, const shared_array<T>& b) {
return a.ptr != b.ptr; return a.ptr != b.ptr;
} }
template<class T> template<class T>
bool operator< (const shared_array<T>& a, const shared_array<T>& b) { bool operator< (const shared_array<T>& a, const shared_array<T>& b) {
return a.ptr < b.ptr; return a.ptr < b.ptr;
} }
} // end of namespace boost } // end of namespace boost
#else #else
# error "shared_array.h was already included" # error "shared_array.h was already included"
#endif #endif
#endif // INCLUDED_AI_BOOST_SHARED_ARRAY #endif // INCLUDED_AI_BOOST_SHARED_ARRAY

View File

@ -1,20 +1,20 @@
#ifndef AI_BOOST_STATIC_ASSERT_INCLUDED #ifndef AI_BOOST_STATIC_ASSERT_INCLUDED
#define AI_BOOST_STATIC_ASSERT_INCLUDED #define AI_BOOST_STATIC_ASSERT_INCLUDED
#ifndef BOOST_STATIC_ASSERT #ifndef BOOST_STATIC_ASSERT
namespace boost { namespace boost {
namespace detail { namespace detail {
template <bool b> class static_assertion_failure; template <bool b> class static_assertion_failure;
template <> class static_assertion_failure<true> {}; template <> class static_assertion_failure<true> {};
} }
} }
#define BOOST_STATIC_ASSERT(eval) \ #define BOOST_STATIC_ASSERT(eval) \
{boost::detail::static_assertion_failure<(eval)> assert_dummy;(void)assert_dummy;} {boost::detail::static_assertion_failure<(eval)> assert_dummy;(void)assert_dummy;}
#endif #endif
#endif // !! AI_BOOST_STATIC_ASSERT_INCLUDED #endif // !! AI_BOOST_STATIC_ASSERT_INCLUDED

View File

@ -1,283 +1,283 @@
// A very small replacement for boost::tuple // A very small replacement for boost::tuple
// (c) Alexander Gessler, 2008 [alexander.gessler@gmx.net] // (c) Alexander Gessler, 2008 [alexander.gessler@gmx.net]
#ifndef BOOST_TUPLE_INCLUDED #ifndef BOOST_TUPLE_INCLUDED
#define BOOST_TUPLE_INCLUDED #define BOOST_TUPLE_INCLUDED
namespace boost { namespace boost {
namespace detail { namespace detail {
// Represents an empty tuple slot (up to 5 supported) // Represents an empty tuple slot (up to 5 supported)
struct nulltype {}; struct nulltype {};
// For readable error messages // For readable error messages
struct tuple_component_idx_out_of_bounds; struct tuple_component_idx_out_of_bounds;
// To share some code for the const/nonconst versions of the getters // To share some code for the const/nonconst versions of the getters
template <bool b, typename T> template <bool b, typename T>
struct ConstIf { struct ConstIf {
typedef T t; typedef T t;
}; };
template <typename T> template <typename T>
struct ConstIf<true,T> { struct ConstIf<true,T> {
typedef const T t; typedef const T t;
}; };
// Predeclare some stuff // Predeclare some stuff
template <typename, unsigned, typename, bool, unsigned> struct value_getter; template <typename, unsigned, typename, bool, unsigned> struct value_getter;
// Helper to obtain the type of a tuple element // Helper to obtain the type of a tuple element
template <typename T, unsigned NIDX, typename TNEXT, unsigned N /*= 0*/> template <typename T, unsigned NIDX, typename TNEXT, unsigned N /*= 0*/>
struct type_getter { struct type_getter {
typedef type_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,N> next_elem_getter; typedef type_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,N> next_elem_getter;
typedef typename next_elem_getter::type type; typedef typename next_elem_getter::type type;
}; };
template <typename T, unsigned NIDX, typename TNEXT > template <typename T, unsigned NIDX, typename TNEXT >
struct type_getter <T,NIDX,TNEXT,NIDX> { struct type_getter <T,NIDX,TNEXT,NIDX> {
typedef T type; typedef T type;
}; };
// Base class for all explicit specializations of list_elem // Base class for all explicit specializations of list_elem
template <typename T, unsigned NIDX, typename TNEXT > template <typename T, unsigned NIDX, typename TNEXT >
struct list_elem_base { struct list_elem_base {
// Store template parameters // Store template parameters
typedef TNEXT next_type; typedef TNEXT next_type;
typedef T type; typedef T type;
static const unsigned nidx = NIDX; static const unsigned nidx = NIDX;
}; };
// Represents an element in the tuple component list // Represents an element in the tuple component list
template <typename T, unsigned NIDX, typename TNEXT > template <typename T, unsigned NIDX, typename TNEXT >
struct list_elem : list_elem_base<T,NIDX,TNEXT>{ struct list_elem : list_elem_base<T,NIDX,TNEXT>{
// Real members // Real members
T me; T me;
TNEXT next; TNEXT next;
// Get the value of a specific tuple element // Get the value of a specific tuple element
template <unsigned N> template <unsigned N>
typename type_getter<T,NIDX,TNEXT,N>::type& get () { typename type_getter<T,NIDX,TNEXT,N>::type& get () {
value_getter <T,NIDX,TNEXT,false,N> s; value_getter <T,NIDX,TNEXT,false,N> s;
return s(*this); return s(*this);
} }
// Get the value of a specific tuple element // Get the value of a specific tuple element
template <unsigned N> template <unsigned N>
const typename type_getter<T,NIDX,TNEXT,N>::type& get () const { const typename type_getter<T,NIDX,TNEXT,N>::type& get () const {
value_getter <T,NIDX,TNEXT,true,N> s; value_getter <T,NIDX,TNEXT,true,N> s;
return s(*this); return s(*this);
} }
// Explicit cast // Explicit cast
template <typename T2, typename TNEXT2 > template <typename T2, typename TNEXT2 >
operator list_elem<T2,NIDX,TNEXT2> () const { operator list_elem<T2,NIDX,TNEXT2> () const {
list_elem<T2,NIDX,TNEXT2> ret; list_elem<T2,NIDX,TNEXT2> ret;
ret.me = (T2)me; ret.me = (T2)me;
ret.next = next; ret.next = next;
return ret; return ret;
} }
// Recursively compare two elements (last element returns always true) // Recursively compare two elements (last element returns always true)
bool operator == (const list_elem& s) const { bool operator == (const list_elem& s) const {
return (me == s.me && next == s.next); return (me == s.me && next == s.next);
} }
}; };
// Represents a non-used tuple element - the very last element processed // Represents a non-used tuple element - the very last element processed
template <typename TNEXT, unsigned NIDX > template <typename TNEXT, unsigned NIDX >
struct list_elem<nulltype,NIDX,TNEXT> : list_elem_base<nulltype,NIDX,TNEXT> { struct list_elem<nulltype,NIDX,TNEXT> : list_elem_base<nulltype,NIDX,TNEXT> {
template <unsigned N, bool IS_CONST = true> struct value_getter { template <unsigned N, bool IS_CONST = true> struct value_getter {
/* just dummy members to produce readable error messages */ /* just dummy members to produce readable error messages */
tuple_component_idx_out_of_bounds operator () (typename ConstIf<IS_CONST,list_elem>::t& me); tuple_component_idx_out_of_bounds operator () (typename ConstIf<IS_CONST,list_elem>::t& me);
}; };
template <unsigned N> struct type_getter { template <unsigned N> struct type_getter {
/* just dummy members to produce readable error messages */ /* just dummy members to produce readable error messages */
typedef tuple_component_idx_out_of_bounds type; typedef tuple_component_idx_out_of_bounds type;
}; };
// dummy // dummy
list_elem& operator = (const list_elem& /*other*/) { list_elem& operator = (const list_elem& /*other*/) {
return *this; return *this;
} }
// dummy // dummy
bool operator == (const list_elem& other) { bool operator == (const list_elem& other) {
return true; return true;
} }
}; };
// Represents the absolute end of the list // Represents the absolute end of the list
typedef list_elem<nulltype,0,int> list_end; typedef list_elem<nulltype,0,int> list_end;
// Helper obtain to query the value of a tuple element // Helper obtain to query the value of a tuple element
// NOTE: This can't be a nested class as the compiler won't accept a full or // NOTE: This can't be a nested class as the compiler won't accept a full or
// partial specialization of a nested class of a non-specialized template // partial specialization of a nested class of a non-specialized template
template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST, unsigned N> template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST, unsigned N>
struct value_getter { struct value_getter {
// calling list_elem // calling list_elem
typedef list_elem<T,NIDX,TNEXT> outer_elem; typedef list_elem<T,NIDX,TNEXT> outer_elem;
// typedef for the getter for next element // typedef for the getter for next element
typedef value_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type, typedef value_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,
IS_CONST, N> next_value_getter; IS_CONST, N> next_value_getter;
typename ConstIf<IS_CONST,typename type_getter<T,NIDX,TNEXT,N>::type>::t& typename ConstIf<IS_CONST,typename type_getter<T,NIDX,TNEXT,N>::type>::t&
operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) { operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
next_value_getter s; next_value_getter s;
return s(me.next); return s(me.next);
} }
}; };
template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST> template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST>
struct value_getter <T,NIDX,TNEXT,IS_CONST,NIDX> { struct value_getter <T,NIDX,TNEXT,IS_CONST,NIDX> {
typedef list_elem<T,NIDX,TNEXT> outer_elem; typedef list_elem<T,NIDX,TNEXT> outer_elem;
typename ConstIf<IS_CONST,T>::t& operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) { typename ConstIf<IS_CONST,T>::t& operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
return me.me; return me.me;
} }
}; };
} }
// A very minimal implementation for up to 5 elements // A very minimal implementation for up to 5 elements
template <typename T0 = detail::nulltype, template <typename T0 = detail::nulltype,
typename T1 = detail::nulltype, typename T1 = detail::nulltype,
typename T2 = detail::nulltype, typename T2 = detail::nulltype,
typename T3 = detail::nulltype, typename T3 = detail::nulltype,
typename T4 = detail::nulltype> typename T4 = detail::nulltype>
class tuple { class tuple {
template <typename T0b, template <typename T0b,
typename T1b, typename T1b,
typename T2b, typename T2b,
typename T3b, typename T3b,
typename T4b > typename T4b >
friend class tuple; friend class tuple;
private: private:
typedef detail::list_elem<T0,0, typedef detail::list_elem<T0,0,
detail::list_elem<T1,1, detail::list_elem<T1,1,
detail::list_elem<T2,2, detail::list_elem<T2,2,
detail::list_elem<T3,3, detail::list_elem<T3,3,
detail::list_elem<T4,4, detail::list_elem<T4,4,
detail::list_end > > > > > very_long; detail::list_end > > > > > very_long;
very_long m; very_long m;
public: public:
// Get a specific tuple element // Get a specific tuple element
template <unsigned N> template <unsigned N>
typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () { typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () {
return m.template get<N>(); return m.template get<N>();
} }
// ... and the const version // ... and the const version
template <unsigned N> template <unsigned N>
const typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () const { const typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () const {
return m.template get<N>(); return m.template get<N>();
} }
// comparison operators // comparison operators
bool operator== (const tuple& other) const { bool operator== (const tuple& other) const {
return m == other.m; return m == other.m;
} }
// ... and the other way round // ... and the other way round
bool operator!= (const tuple& other) const { bool operator!= (const tuple& other) const {
return !(m == other.m); return !(m == other.m);
} }
// cast to another tuple - all single elements must be convertible // cast to another tuple - all single elements must be convertible
template <typename T0b, typename T1b,typename T2b,typename T3b, typename T4b> template <typename T0b, typename T1b,typename T2b,typename T3b, typename T4b>
operator tuple <T0b,T1b,T2b,T3b,T4b> () const { operator tuple <T0b,T1b,T2b,T3b,T4b> () const {
tuple <T0b,T1b,T2b,T3b,T4b> s; tuple <T0b,T1b,T2b,T3b,T4b> s;
s.m = (typename tuple <T0b,T1b,T2b,T3b,T4b>::very_long)m; s.m = (typename tuple <T0b,T1b,T2b,T3b,T4b>::very_long)m;
return s; return s;
} }
}; };
// Another way to access an element ... // Another way to access an element ...
template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4> template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4>
inline typename tuple<T0,T1,T2,T3,T4>::very_long::template type_getter<N>::type& get ( inline typename tuple<T0,T1,T2,T3,T4>::very_long::template type_getter<N>::type& get (
tuple<T0,T1,T2,T3,T4>& m) { tuple<T0,T1,T2,T3,T4>& m) {
return m.template get<N>(); return m.template get<N>();
} }
// ... and the const version // ... and the const version
template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4> template <unsigned N,typename T0,typename T1,typename T2,typename T3,typename T4>
inline const typename tuple<T0,T1,T2,T3,T4>::very_long::template type_getter<N>::type& get ( inline const typename tuple<T0,T1,T2,T3,T4>::very_long::template type_getter<N>::type& get (
const tuple<T0,T1,T2,T3,T4>& m) { const tuple<T0,T1,T2,T3,T4>& m) {
return m.template get<N>(); return m.template get<N>();
} }
// Constructs a tuple with 5 elements // Constructs a tuple with 5 elements
template <typename T0,typename T1,typename T2,typename T3,typename T4> template <typename T0,typename T1,typename T2,typename T3,typename T4>
inline tuple <T0,T1,T2,T3,T4> make_tuple (const T0& t0, inline tuple <T0,T1,T2,T3,T4> make_tuple (const T0& t0,
const T1& t1,const T2& t2,const T3& t3,const T4& t4) { const T1& t1,const T2& t2,const T3& t3,const T4& t4) {
tuple <T0,T1,T2,T3,T4> t; tuple <T0,T1,T2,T3,T4> t;
t.template get<0>() = t0; t.template get<0>() = t0;
t.template get<1>() = t1; t.template get<1>() = t1;
t.template get<2>() = t2; t.template get<2>() = t2;
t.template get<3>() = t3; t.template get<3>() = t3;
t.template get<4>() = t4; t.template get<4>() = t4;
return t; return t;
} }
// Constructs a tuple with 4 elements // Constructs a tuple with 4 elements
template <typename T0,typename T1,typename T2,typename T3> template <typename T0,typename T1,typename T2,typename T3>
inline tuple <T0,T1,T2,T3> make_tuple (const T0& t0, inline tuple <T0,T1,T2,T3> make_tuple (const T0& t0,
const T1& t1,const T2& t2,const T3& t3) { const T1& t1,const T2& t2,const T3& t3) {
tuple <T0,T1,T2,T3> t; tuple <T0,T1,T2,T3> t;
t.template get<0>() = t0; t.template get<0>() = t0;
t.template get<1>() = t1; t.template get<1>() = t1;
t.template get<2>() = t2; t.template get<2>() = t2;
t.template get<3>() = t3; t.template get<3>() = t3;
return t; return t;
} }
// Constructs a tuple with 3 elements // Constructs a tuple with 3 elements
template <typename T0,typename T1,typename T2> template <typename T0,typename T1,typename T2>
inline tuple <T0,T1,T2> make_tuple (const T0& t0, inline tuple <T0,T1,T2> make_tuple (const T0& t0,
const T1& t1,const T2& t2) { const T1& t1,const T2& t2) {
tuple <T0,T1,T2> t; tuple <T0,T1,T2> t;
t.template get<0>() = t0; t.template get<0>() = t0;
t.template get<1>() = t1; t.template get<1>() = t1;
t.template get<2>() = t2; t.template get<2>() = t2;
return t; return t;
} }
// Constructs a tuple with 2 elements // Constructs a tuple with 2 elements
template <typename T0,typename T1> template <typename T0,typename T1>
inline tuple <T0,T1> make_tuple (const T0& t0, inline tuple <T0,T1> make_tuple (const T0& t0,
const T1& t1) { const T1& t1) {
tuple <T0,T1> t; tuple <T0,T1> t;
t.template get<0>() = t0; t.template get<0>() = t0;
t.template get<1>() = t1; t.template get<1>() = t1;
return t; return t;
} }
// Constructs a tuple with 1 elements (well ...) // Constructs a tuple with 1 elements (well ...)
template <typename T0> template <typename T0>
inline tuple <T0> make_tuple (const T0& t0) { inline tuple <T0> make_tuple (const T0& t0) {
tuple <T0> t; tuple <T0> t;
t.template get<0>() = t0; t.template get<0>() = t0;
return t; return t;
} }
// Constructs a tuple with 0 elements (well ...) // Constructs a tuple with 0 elements (well ...)
inline tuple <> make_tuple () { inline tuple <> make_tuple () {
tuple <> t; tuple <> t;
return t; return t;
} }
} }
#endif // !! BOOST_TUPLE_INCLUDED #endif // !! BOOST_TUPLE_INCLUDED

View File

@ -1,14 +1,14 @@
//{{NO_DEPENDENCIES}} //{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file. // Microsoft Visual C++ generated include file.
// Used by assimp.rc // Used by assimp.rc
// Nächste Standardwerte für neue Objekte // Nächste Standardwerte für neue Objekte
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif

View File

@ -1,29 +1,29 @@
The Clipper code library, the "Software" (that includes Delphi, C++ & C# The Clipper code library, the "Software" (that includes Delphi, C++ & C#
source code, accompanying samples and documentation), has been released source code, accompanying samples and documentation), has been released
under the following license, terms and conditions: under the following license, terms and conditions:
Boost Software License - Version 1.0 - August 17th, 2003 Boost Software License - Version 1.0 - August 17th, 2003
http://www.boost.org/LICENSE_1_0.txt http://www.boost.org/LICENSE_1_0.txt
Permission is hereby granted, free of charge, to any person or organization Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute, this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following: do so, all subject to the following:
The copyright notices in the Software and this entire statement, including The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer, the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by works are solely in the form of machine-executable object code generated by
a source language processor. a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@ -1,306 +1,306 @@
/******************************************************************************* /*******************************************************************************
* * * *
* Author : Angus Johnson * * Author : Angus Johnson *
* Version : 4.8.8 * * Version : 4.8.8 *
* Date : 30 August 2012 * * Date : 30 August 2012 *
* Website : http://www.angusj.com * * Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2012 * * Copyright : Angus Johnson 2010-2012 *
* * * *
* License: * * License: *
* Use, modification & distribution is subject to Boost Software License Ver 1. * * Use, modification & distribution is subject to Boost Software License Ver 1. *
* http://www.boost.org/LICENSE_1_0.txt * * http://www.boost.org/LICENSE_1_0.txt *
* * * *
* Attributions: * * Attributions: *
* The code in this library is an extension of Bala Vatti's clipping algorithm: * * The code in this library is an extension of Bala Vatti's clipping algorithm: *
* "A generic solution to polygon clipping" * * "A generic solution to polygon clipping" *
* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. * * Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
* http://portal.acm.org/citation.cfm?id=129906 * * http://portal.acm.org/citation.cfm?id=129906 *
* * * *
* Computer graphics and geometric modeling: implementation and algorithms * * Computer graphics and geometric modeling: implementation and algorithms *
* By Max K. Agoston * * By Max K. Agoston *
* Springer; 1 edition (January 4, 2005) * * Springer; 1 edition (January 4, 2005) *
* http://books.google.com/books?q=vatti+clipping+agoston * * http://books.google.com/books?q=vatti+clipping+agoston *
* * * *
* See also: * * See also: *
* "Polygon Offsetting by Computing Winding Numbers" * * "Polygon Offsetting by Computing Winding Numbers" *
* Paper no. DETC2005-85513 pp. 565-575 * * Paper no. DETC2005-85513 pp. 565-575 *
* ASME 2005 International Design Engineering Technical Conferences * * ASME 2005 International Design Engineering Technical Conferences *
* and Computers and Information in Engineering Conference (IDETC/CIE2005) * * and Computers and Information in Engineering Conference (IDETC/CIE2005) *
* September 24–28, 2005 , Long Beach, California, USA * * September 24–28, 2005 , Long Beach, California, USA *
* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf * * http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf *
* * * *
*******************************************************************************/ *******************************************************************************/
#ifndef clipper_hpp #ifndef clipper_hpp
#define clipper_hpp #define clipper_hpp
#include <vector> #include <vector>
#include <stdexcept> #include <stdexcept>
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
#include <ostream> #include <ostream>
namespace ClipperLib { namespace ClipperLib {
enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor }; enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };
enum PolyType { ptSubject, ptClip }; enum PolyType { ptSubject, ptClip };
//By far the most widely used winding rules for polygon filling are //By far the most widely used winding rules for polygon filling are
//EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32) //EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32)
//Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL) //Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL)
//see http://glprogramming.com/red/chapter11.html //see http://glprogramming.com/red/chapter11.html
enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative }; enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
typedef signed long long long64; typedef signed long long long64;
typedef unsigned long long ulong64; typedef unsigned long long ulong64;
struct IntPoint { struct IntPoint {
public: public:
long64 X; long64 X;
long64 Y; long64 Y;
IntPoint(long64 x = 0, long64 y = 0): X(x), Y(y) {}; IntPoint(long64 x = 0, long64 y = 0): X(x), Y(y) {};
friend std::ostream& operator <<(std::ostream &s, IntPoint &p); friend std::ostream& operator <<(std::ostream &s, IntPoint &p);
}; };
typedef std::vector< IntPoint > Polygon; typedef std::vector< IntPoint > Polygon;
typedef std::vector< Polygon > Polygons; typedef std::vector< Polygon > Polygons;
std::ostream& operator <<(std::ostream &s, Polygon &p); std::ostream& operator <<(std::ostream &s, Polygon &p);
std::ostream& operator <<(std::ostream &s, Polygons &p); std::ostream& operator <<(std::ostream &s, Polygons &p);
struct ExPolygon { struct ExPolygon {
Polygon outer; Polygon outer;
Polygons holes; Polygons holes;
}; };
typedef std::vector< ExPolygon > ExPolygons; typedef std::vector< ExPolygon > ExPolygons;
enum JoinType { jtSquare, jtRound, jtMiter }; enum JoinType { jtSquare, jtRound, jtMiter };
bool Orientation(const Polygon &poly); bool Orientation(const Polygon &poly);
double Area(const Polygon &poly); double Area(const Polygon &poly);
void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys, void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
double delta, JoinType jointype = jtSquare, double MiterLimit = 2); double delta, JoinType jointype = jtSquare, double MiterLimit = 2);
void SimplifyPolygon(const Polygon &in_poly, Polygons &out_polys, PolyFillType fillType = pftEvenOdd); void SimplifyPolygon(const Polygon &in_poly, Polygons &out_polys, PolyFillType fillType = pftEvenOdd);
void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys, PolyFillType fillType = pftEvenOdd); void SimplifyPolygons(const Polygons &in_polys, Polygons &out_polys, PolyFillType fillType = pftEvenOdd);
void SimplifyPolygons(Polygons &polys, PolyFillType fillType = pftEvenOdd); void SimplifyPolygons(Polygons &polys, PolyFillType fillType = pftEvenOdd);
void ReversePolygon(Polygon& p); void ReversePolygon(Polygon& p);
void ReversePolygons(Polygons& p); void ReversePolygons(Polygons& p);
//used internally ... //used internally ...
enum EdgeSide { esNeither = 0, esLeft = 1, esRight = 2, esBoth = 3 }; enum EdgeSide { esNeither = 0, esLeft = 1, esRight = 2, esBoth = 3 };
enum IntersectProtects { ipNone = 0, ipLeft = 1, ipRight = 2, ipBoth = 3 }; enum IntersectProtects { ipNone = 0, ipLeft = 1, ipRight = 2, ipBoth = 3 };
struct TEdge { struct TEdge {
long64 xbot; long64 xbot;
long64 ybot; long64 ybot;
long64 xcurr; long64 xcurr;
long64 ycurr; long64 ycurr;
long64 xtop; long64 xtop;
long64 ytop; long64 ytop;
double dx; double dx;
long64 tmpX; long64 tmpX;
PolyType polyType; PolyType polyType;
EdgeSide side; EdgeSide side;
int windDelta; //1 or -1 depending on winding direction int windDelta; //1 or -1 depending on winding direction
int windCnt; int windCnt;
int windCnt2; //winding count of the opposite polytype int windCnt2; //winding count of the opposite polytype
int outIdx; int outIdx;
TEdge *next; TEdge *next;
TEdge *prev; TEdge *prev;
TEdge *nextInLML; TEdge *nextInLML;
TEdge *nextInAEL; TEdge *nextInAEL;
TEdge *prevInAEL; TEdge *prevInAEL;
TEdge *nextInSEL; TEdge *nextInSEL;
TEdge *prevInSEL; TEdge *prevInSEL;
}; };
struct IntersectNode { struct IntersectNode {
TEdge *edge1; TEdge *edge1;
TEdge *edge2; TEdge *edge2;
IntPoint pt; IntPoint pt;
IntersectNode *next; IntersectNode *next;
}; };
struct LocalMinima { struct LocalMinima {
long64 Y; long64 Y;
TEdge *leftBound; TEdge *leftBound;
TEdge *rightBound; TEdge *rightBound;
LocalMinima *next; LocalMinima *next;
}; };
struct Scanbeam { struct Scanbeam {
long64 Y; long64 Y;
Scanbeam *next; Scanbeam *next;
}; };
struct OutPt; //forward declaration struct OutPt; //forward declaration
struct OutRec { struct OutRec {
int idx; int idx;
bool isHole; bool isHole;
OutRec *FirstLeft; OutRec *FirstLeft;
OutRec *AppendLink; OutRec *AppendLink;
OutPt *pts; OutPt *pts;
OutPt *bottomPt; OutPt *bottomPt;
OutPt *bottomFlag; OutPt *bottomFlag;
EdgeSide sides; EdgeSide sides;
}; };
struct OutPt { struct OutPt {
int idx; int idx;
IntPoint pt; IntPoint pt;
OutPt *next; OutPt *next;
OutPt *prev; OutPt *prev;
}; };
struct JoinRec { struct JoinRec {
IntPoint pt1a; IntPoint pt1a;
IntPoint pt1b; IntPoint pt1b;
int poly1Idx; int poly1Idx;
IntPoint pt2a; IntPoint pt2a;
IntPoint pt2b; IntPoint pt2b;
int poly2Idx; int poly2Idx;
}; };
struct HorzJoinRec { struct HorzJoinRec {
TEdge *edge; TEdge *edge;
int savedIdx; int savedIdx;
}; };
struct IntRect { long64 left; long64 top; long64 right; long64 bottom; }; struct IntRect { long64 left; long64 top; long64 right; long64 bottom; };
typedef std::vector < OutRec* > PolyOutList; typedef std::vector < OutRec* > PolyOutList;
typedef std::vector < TEdge* > EdgeList; typedef std::vector < TEdge* > EdgeList;
typedef std::vector < JoinRec* > JoinList; typedef std::vector < JoinRec* > JoinList;
typedef std::vector < HorzJoinRec* > HorzJoinList; typedef std::vector < HorzJoinRec* > HorzJoinList;
//ClipperBase is the ancestor to the Clipper class. It should not be //ClipperBase is the ancestor to the Clipper class. It should not be
//instantiated directly. This class simply abstracts the conversion of sets of //instantiated directly. This class simply abstracts the conversion of sets of
//polygon coordinates into edge objects that are stored in a LocalMinima list. //polygon coordinates into edge objects that are stored in a LocalMinima list.
class ClipperBase class ClipperBase
{ {
public: public:
ClipperBase(); ClipperBase();
virtual ~ClipperBase(); virtual ~ClipperBase();
bool AddPolygon(const Polygon &pg, PolyType polyType); bool AddPolygon(const Polygon &pg, PolyType polyType);
bool AddPolygons( const Polygons &ppg, PolyType polyType); bool AddPolygons( const Polygons &ppg, PolyType polyType);
virtual void Clear(); virtual void Clear();
IntRect GetBounds(); IntRect GetBounds();
protected: protected:
void DisposeLocalMinimaList(); void DisposeLocalMinimaList();
TEdge* AddBoundsToLML(TEdge *e); TEdge* AddBoundsToLML(TEdge *e);
void PopLocalMinima(); void PopLocalMinima();
virtual void Reset(); virtual void Reset();
void InsertLocalMinima(LocalMinima *newLm); void InsertLocalMinima(LocalMinima *newLm);
LocalMinima *m_CurrentLM; LocalMinima *m_CurrentLM;
LocalMinima *m_MinimaList; LocalMinima *m_MinimaList;
bool m_UseFullRange; bool m_UseFullRange;
EdgeList m_edges; EdgeList m_edges;
}; };
class Clipper : public virtual ClipperBase class Clipper : public virtual ClipperBase
{ {
public: public:
Clipper(); Clipper();
~Clipper(); ~Clipper();
bool Execute(ClipType clipType, bool Execute(ClipType clipType,
Polygons &solution, Polygons &solution,
PolyFillType subjFillType = pftEvenOdd, PolyFillType subjFillType = pftEvenOdd,
PolyFillType clipFillType = pftEvenOdd); PolyFillType clipFillType = pftEvenOdd);
bool Execute(ClipType clipType, bool Execute(ClipType clipType,
ExPolygons &solution, ExPolygons &solution,
PolyFillType subjFillType = pftEvenOdd, PolyFillType subjFillType = pftEvenOdd,
PolyFillType clipFillType = pftEvenOdd); PolyFillType clipFillType = pftEvenOdd);
void Clear(); void Clear();
bool ReverseSolution() {return m_ReverseOutput;}; bool ReverseSolution() {return m_ReverseOutput;};
void ReverseSolution(bool value) {m_ReverseOutput = value;}; void ReverseSolution(bool value) {m_ReverseOutput = value;};
protected: protected:
void Reset(); void Reset();
virtual bool ExecuteInternal(bool fixHoleLinkages); virtual bool ExecuteInternal(bool fixHoleLinkages);
private: private:
PolyOutList m_PolyOuts; PolyOutList m_PolyOuts;
JoinList m_Joins; JoinList m_Joins;
HorzJoinList m_HorizJoins; HorzJoinList m_HorizJoins;
ClipType m_ClipType; ClipType m_ClipType;
Scanbeam *m_Scanbeam; Scanbeam *m_Scanbeam;
TEdge *m_ActiveEdges; TEdge *m_ActiveEdges;
TEdge *m_SortedEdges; TEdge *m_SortedEdges;
IntersectNode *m_IntersectNodes; IntersectNode *m_IntersectNodes;
bool m_ExecuteLocked; bool m_ExecuteLocked;
PolyFillType m_ClipFillType; PolyFillType m_ClipFillType;
PolyFillType m_SubjFillType; PolyFillType m_SubjFillType;
bool m_ReverseOutput; bool m_ReverseOutput;
void DisposeScanbeamList(); void DisposeScanbeamList();
void SetWindingCount(TEdge& edge); void SetWindingCount(TEdge& edge);
bool IsEvenOddFillType(const TEdge& edge) const; bool IsEvenOddFillType(const TEdge& edge) const;
bool IsEvenOddAltFillType(const TEdge& edge) const; bool IsEvenOddAltFillType(const TEdge& edge) const;
void InsertScanbeam(const long64 Y); void InsertScanbeam(const long64 Y);
long64 PopScanbeam(); long64 PopScanbeam();
void InsertLocalMinimaIntoAEL(const long64 botY); void InsertLocalMinimaIntoAEL(const long64 botY);
void InsertEdgeIntoAEL(TEdge *edge); void InsertEdgeIntoAEL(TEdge *edge);
void AddEdgeToSEL(TEdge *edge); void AddEdgeToSEL(TEdge *edge);
void CopyAELToSEL(); void CopyAELToSEL();
void DeleteFromSEL(TEdge *e); void DeleteFromSEL(TEdge *e);
void DeleteFromAEL(TEdge *e); void DeleteFromAEL(TEdge *e);
void UpdateEdgeIntoAEL(TEdge *&e); void UpdateEdgeIntoAEL(TEdge *&e);
void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2); void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2);
bool IsContributing(const TEdge& edge) const; bool IsContributing(const TEdge& edge) const;
bool IsTopHorz(const long64 XPos); bool IsTopHorz(const long64 XPos);
void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2); void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
void DoMaxima(TEdge *e, long64 topY); void DoMaxima(TEdge *e, long64 topY);
void ProcessHorizontals(); void ProcessHorizontals();
void ProcessHorizontal(TEdge *horzEdge); void ProcessHorizontal(TEdge *horzEdge);
void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt); void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
void AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt); void AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
void AppendPolygon(TEdge *e1, TEdge *e2); void AppendPolygon(TEdge *e1, TEdge *e2);
void DoEdge1(TEdge *edge1, TEdge *edge2, const IntPoint &pt); void DoEdge1(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
void DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt); void DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
void DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt); void DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
void IntersectEdges(TEdge *e1, TEdge *e2, void IntersectEdges(TEdge *e1, TEdge *e2,
const IntPoint &pt, IntersectProtects protects); const IntPoint &pt, IntersectProtects protects);
OutRec* CreateOutRec(); OutRec* CreateOutRec();
void AddOutPt(TEdge *e, const IntPoint &pt); void AddOutPt(TEdge *e, const IntPoint &pt);
void DisposeBottomPt(OutRec &outRec); void DisposeBottomPt(OutRec &outRec);
void DisposeAllPolyPts(); void DisposeAllPolyPts();
void DisposeOutRec(PolyOutList::size_type index); void DisposeOutRec(PolyOutList::size_type index);
bool ProcessIntersections(const long64 botY, const long64 topY); bool ProcessIntersections(const long64 botY, const long64 topY);
void AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt); void AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt);
void BuildIntersectList(const long64 botY, const long64 topY); void BuildIntersectList(const long64 botY, const long64 topY);
void ProcessIntersectList(); void ProcessIntersectList();
void ProcessEdgesAtTopOfScanbeam(const long64 topY); void ProcessEdgesAtTopOfScanbeam(const long64 topY);
void BuildResult(Polygons& polys); void BuildResult(Polygons& polys);
void BuildResultEx(ExPolygons& polys); void BuildResultEx(ExPolygons& polys);
void SetHoleState(TEdge *e, OutRec *OutRec); void SetHoleState(TEdge *e, OutRec *OutRec);
void DisposeIntersectNodes(); void DisposeIntersectNodes();
bool FixupIntersections(); bool FixupIntersections();
void FixupOutPolygon(OutRec &outRec); void FixupOutPolygon(OutRec &outRec);
bool IsHole(TEdge *e); bool IsHole(TEdge *e);
void FixHoleLinkage(OutRec *outRec); void FixHoleLinkage(OutRec *outRec);
void CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2); void CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2);
void CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2); void CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2);
void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1); void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1);
void ClearJoins(); void ClearJoins();
void AddHorzJoin(TEdge *e, int idx); void AddHorzJoin(TEdge *e, int idx);
void ClearHorzJoins(); void ClearHorzJoins();
void JoinCommonEdges(bool fixHoleLinkages); void JoinCommonEdges(bool fixHoleLinkages);
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
class clipperException : public std::exception class clipperException : public std::exception
{ {
public: public:
clipperException(const char* description): m_descr(description) {} clipperException(const char* description): m_descr(description) {}
virtual ~clipperException() throw() {} virtual ~clipperException() throw() {}
virtual const char* what() const throw() {return m_descr.c_str();} virtual const char* what() const throw() {return m_descr.c_str();}
private: private:
std::string m_descr; std::string m_descr;
}; };
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
} //ClipperLib namespace } //ClipperLib namespace
#endif //clipper_hpp #endif //clipper_hpp

File diff suppressed because it is too large Load Diff

View File

@ -1,73 +1,73 @@
// Copyright (C) 2002-2005 Nikolaus Gebhardt // Copyright (C) 2002-2005 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_HEAPSORT_H_INCLUDED__ #ifndef __IRR_HEAPSORT_H_INCLUDED__
#define __IRR_HEAPSORT_H_INCLUDED__ #define __IRR_HEAPSORT_H_INCLUDED__
#include "irrTypes.h" #include "irrTypes.h"
namespace irr namespace irr
{ {
namespace core namespace core
{ {
//! Sinks an element into the heap. //! Sinks an element into the heap.
template<class T> template<class T>
inline void heapsink(T*array, s32 element, s32 max) inline void heapsink(T*array, s32 element, s32 max)
{ {
while ((element<<1) < max) // there is a left child while ((element<<1) < max) // there is a left child
{ {
s32 j = (element<<1); s32 j = (element<<1);
if (j+1 < max && array[j] < array[j+1]) if (j+1 < max && array[j] < array[j+1])
j = j+1; // take right child j = j+1; // take right child
if (array[element] < array[j]) if (array[element] < array[j])
{ {
T t = array[j]; // swap elements T t = array[j]; // swap elements
array[j] = array[element]; array[j] = array[element];
array[element] = t; array[element] = t;
element = j; element = j;
} }
else else
return; return;
} }
} }
//! Sorts an array with size 'size' using heapsort. //! Sorts an array with size 'size' using heapsort.
template<class T> template<class T>
inline void heapsort(T* array_, s32 size) inline void heapsort(T* array_, s32 size)
{ {
// for heapsink we pretent this is not c++, where // for heapsink we pretent this is not c++, where
// arrays start with index 0. So we decrease the array pointer, // arrays start with index 0. So we decrease the array pointer,
// the maximum always +2 and the element always +1 // the maximum always +2 and the element always +1
T* virtualArray = array_ - 1; T* virtualArray = array_ - 1;
s32 virtualSize = size + 2; s32 virtualSize = size + 2;
s32 i; s32 i;
// build heap // build heap
for (i=((size-1)/2); i>=0; --i) for (i=((size-1)/2); i>=0; --i)
heapsink(virtualArray, i+1, virtualSize-1); heapsink(virtualArray, i+1, virtualSize-1);
// sort array // sort array
for (i=size-1; i>=0; --i) for (i=size-1; i>=0; --i)
{ {
T t = array_[0]; T t = array_[0];
array_[0] = array_[i]; array_[0] = array_[i];
array_[i] = t; array_[i] = t;
heapsink(virtualArray, 1, i + 1); heapsink(virtualArray, 1, i + 1);
} }
} }
} // end namespace core } // end namespace core
} // end namespace irr } // end namespace irr
#endif #endif

View File

@ -1,444 +1,444 @@
// Copyright (C) 2002-2005 Nikolaus Gebhardt // Copyright (C) 2002-2005 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" and the "irrXML" project. // This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h // For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
#ifndef __IRR_ARRAY_H_INCLUDED__ #ifndef __IRR_ARRAY_H_INCLUDED__
#define __IRR_ARRAY_H_INCLUDED__ #define __IRR_ARRAY_H_INCLUDED__
#include "irrTypes.h" #include "irrTypes.h"
#include "heapsort.h" #include "heapsort.h"
namespace irr namespace irr
{ {
namespace core namespace core
{ {
//! Self reallocating template array (like stl vector) with additional features. //! Self reallocating template array (like stl vector) with additional features.
/** Some features are: Heap sorting, binary search methods, easier debugging. /** Some features are: Heap sorting, binary search methods, easier debugging.
*/ */
template <class T> template <class T>
class array class array
{ {
public: public:
array() array()
: data(0), allocated(0), used(0), : data(0), allocated(0), used(0),
free_when_destroyed(true), is_sorted(true) free_when_destroyed(true), is_sorted(true)
{ {
} }
//! Constructs a array and allocates an initial chunk of memory. //! Constructs a array and allocates an initial chunk of memory.
//! \param start_count: Amount of elements to allocate. //! \param start_count: Amount of elements to allocate.
array(u32 start_count) array(u32 start_count)
: data(0), allocated(0), used(0), : data(0), allocated(0), used(0),
free_when_destroyed(true), is_sorted(true) free_when_destroyed(true), is_sorted(true)
{ {
reallocate(start_count); reallocate(start_count);
} }
//! Copy constructor //! Copy constructor
array(const array<T>& other) array(const array<T>& other)
: data(0) : data(0)
{ {
*this = other; *this = other;
} }
//! Destructor. Frees allocated memory, if set_free_when_destroyed //! Destructor. Frees allocated memory, if set_free_when_destroyed
//! was not set to false by the user before. //! was not set to false by the user before.
~array() ~array()
{ {
if (free_when_destroyed) if (free_when_destroyed)
delete [] data; delete [] data;
} }
//! Reallocates the array, make it bigger or smaller. //! Reallocates the array, make it bigger or smaller.
//! \param new_size: New size of array. //! \param new_size: New size of array.
void reallocate(u32 new_size) void reallocate(u32 new_size)
{ {
T* old_data = data; T* old_data = data;
data = new T[new_size]; data = new T[new_size];
allocated = new_size; allocated = new_size;
s32 end = used < new_size ? used : new_size; s32 end = used < new_size ? used : new_size;
for (s32 i=0; i<end; ++i) for (s32 i=0; i<end; ++i)
data[i] = old_data[i]; data[i] = old_data[i];
if (allocated < used) if (allocated < used)
used = allocated; used = allocated;
delete [] old_data; delete [] old_data;
} }
//! Adds an element at back of array. If the array is to small to //! Adds an element at back of array. If the array is to small to
//! add this new element, the array is made bigger. //! add this new element, the array is made bigger.
//! \param element: Element to add at the back of the array. //! \param element: Element to add at the back of the array.
void push_back(const T& element) void push_back(const T& element)
{ {
if (used + 1 > allocated) if (used + 1 > allocated)
{ {
// reallocate(used * 2 +1); // reallocate(used * 2 +1);
// this doesn't work if the element is in the same array. So // this doesn't work if the element is in the same array. So
// we'll copy the element first to be sure we'll get no data // we'll copy the element first to be sure we'll get no data
// corruption // corruption
T e; T e;
e = element; // copy element e = element; // copy element
reallocate(used * 2 +1); // increase data block reallocate(used * 2 +1); // increase data block
data[used++] = e; // push_back data[used++] = e; // push_back
is_sorted = false; is_sorted = false;
return; return;
} }
data[used++] = element; data[used++] = element;
is_sorted = false; is_sorted = false;
} }
//! Adds an element at the front of the array. If the array is to small to //! Adds an element at the front of the array. If the array is to small to
//! add this new element, the array is made bigger. Please note that this //! add this new element, the array is made bigger. Please note that this
//! is slow, because the whole array needs to be copied for this. //! is slow, because the whole array needs to be copied for this.
//! \param element: Element to add at the back of the array. //! \param element: Element to add at the back of the array.
void push_front(const T& element) void push_front(const T& element)
{ {
if (used + 1 > allocated) if (used + 1 > allocated)
reallocate(used * 2 +1); reallocate(used * 2 +1);
for (int i=(int)used; i>0; --i) for (int i=(int)used; i>0; --i)
data[i] = data[i-1]; data[i] = data[i-1];
data[0] = element; data[0] = element;
is_sorted = false; is_sorted = false;
++used; ++used;
} }
//! Insert item into array at specified position. Please use this //! Insert item into array at specified position. Please use this
//! only if you know what you are doing (possible performance loss). //! only if you know what you are doing (possible performance loss).
//! The preferred method of adding elements should be push_back(). //! The preferred method of adding elements should be push_back().
//! \param element: Element to be inserted //! \param element: Element to be inserted
//! \param index: Where position to insert the new element. //! \param index: Where position to insert the new element.
void insert(const T& element, u32 index=0) void insert(const T& element, u32 index=0)
{ {
_IRR_DEBUG_BREAK_IF(index>used) // access violation _IRR_DEBUG_BREAK_IF(index>used) // access violation
if (used + 1 > allocated) if (used + 1 > allocated)
reallocate(used * 2 +1); reallocate(used * 2 +1);
for (u32 i=used++; i>index; i--) for (u32 i=used++; i>index; i--)
data[i] = data[i-1]; data[i] = data[i-1];
data[index] = element; data[index] = element;
is_sorted = false; is_sorted = false;
} }
//! Clears the array and deletes all allocated memory. //! Clears the array and deletes all allocated memory.
void clear() void clear()
{ {
delete [] data; delete [] data;
data = 0; data = 0;
used = 0; used = 0;
allocated = 0; allocated = 0;
is_sorted = true; is_sorted = true;
} }
//! Sets pointer to new array, using this as new workspace. //! Sets pointer to new array, using this as new workspace.
//! \param newPointer: Pointer to new array of elements. //! \param newPointer: Pointer to new array of elements.
//! \param size: Size of the new array. //! \param size: Size of the new array.
void set_pointer(T* newPointer, u32 size) void set_pointer(T* newPointer, u32 size)
{ {
delete [] data; delete [] data;
data = newPointer; data = newPointer;
allocated = size; allocated = size;
used = size; used = size;
is_sorted = false; is_sorted = false;
} }
//! Sets if the array should delete the memory it used. //! Sets if the array should delete the memory it used.
//! \param f: If true, the array frees the allocated memory in its //! \param f: If true, the array frees the allocated memory in its
//! destructor, otherwise not. The default is true. //! destructor, otherwise not. The default is true.
void set_free_when_destroyed(bool f) void set_free_when_destroyed(bool f)
{ {
free_when_destroyed = f; free_when_destroyed = f;
} }
//! Sets the size of the array. //! Sets the size of the array.
//! \param usedNow: Amount of elements now used. //! \param usedNow: Amount of elements now used.
void set_used(u32 usedNow) void set_used(u32 usedNow)
{ {
if (allocated < usedNow) if (allocated < usedNow)
reallocate(usedNow); reallocate(usedNow);
used = usedNow; used = usedNow;
} }
//! Assignement operator //! Assignement operator
void operator=(const array<T>& other) void operator=(const array<T>& other)
{ {
if (data) if (data)
delete [] data; delete [] data;
//if (allocated < other.allocated) //if (allocated < other.allocated)
if (other.allocated == 0) if (other.allocated == 0)
data = 0; data = 0;
else else
data = new T[other.allocated]; data = new T[other.allocated];
used = other.used; used = other.used;
free_when_destroyed = other.free_when_destroyed; free_when_destroyed = other.free_when_destroyed;
is_sorted = other.is_sorted; is_sorted = other.is_sorted;
allocated = other.allocated; allocated = other.allocated;
for (u32 i=0; i<other.used; ++i) for (u32 i=0; i<other.used; ++i)
data[i] = other.data[i]; data[i] = other.data[i];
} }
//! Direct access operator //! Direct access operator
T& operator [](u32 index) T& operator [](u32 index)
{ {
_IRR_DEBUG_BREAK_IF(index>=used) // access violation _IRR_DEBUG_BREAK_IF(index>=used) // access violation
return data[index]; return data[index];
} }
//! Direct access operator //! Direct access operator
const T& operator [](u32 index) const const T& operator [](u32 index) const
{ {
_IRR_DEBUG_BREAK_IF(index>=used) // access violation _IRR_DEBUG_BREAK_IF(index>=used) // access violation
return data[index]; return data[index];
} }
//! Gets last frame //! Gets last frame
const T& getLast() const const T& getLast() const
{ {
_IRR_DEBUG_BREAK_IF(!used) // access violation _IRR_DEBUG_BREAK_IF(!used) // access violation
return data[used-1]; return data[used-1];
} }
//! Gets last frame //! Gets last frame
T& getLast() T& getLast()
{ {
_IRR_DEBUG_BREAK_IF(!used) // access violation _IRR_DEBUG_BREAK_IF(!used) // access violation
return data[used-1]; return data[used-1];
} }
//! Returns a pointer to the array. //! Returns a pointer to the array.
//! \return Pointer to the array. //! \return Pointer to the array.
T* pointer() T* pointer()
{ {
return data; return data;
} }
//! Returns a const pointer to the array. //! Returns a const pointer to the array.
//! \return Pointer to the array. //! \return Pointer to the array.
const T* const_pointer() const const T* const_pointer() const
{ {
return data; return data;
} }
//! Returns size of used array. //! Returns size of used array.
//! \return Size of elements in the array. //! \return Size of elements in the array.
u32 size() const u32 size() const
{ {
return used; return used;
} }
//! Returns amount memory allocated. //! Returns amount memory allocated.
//! \return Returns amount of memory allocated. The amount of bytes //! \return Returns amount of memory allocated. The amount of bytes
//! allocated would be allocated_size() * sizeof(ElementsUsed); //! allocated would be allocated_size() * sizeof(ElementsUsed);
u32 allocated_size() const u32 allocated_size() const
{ {
return allocated; return allocated;
} }
//! Returns true if array is empty //! Returns true if array is empty
//! \return True if the array is empty, false if not. //! \return True if the array is empty, false if not.
bool empty() const bool empty() const
{ {
return used == 0; return used == 0;
} }
//! Sorts the array using heapsort. There is no additional memory waste and //! Sorts the array using heapsort. There is no additional memory waste and
//! the algorithm performs (O) n log n in worst case. //! the algorithm performs (O) n log n in worst case.
void sort() void sort()
{ {
if (is_sorted || used<2) if (is_sorted || used<2)
return; return;
heapsort(data, used); heapsort(data, used);
is_sorted = true; is_sorted = true;
} }
//! Performs a binary search for an element, returns -1 if not found. //! Performs a binary search for an element, returns -1 if not found.
//! The array will be sorted before the binary search if it is not //! The array will be sorted before the binary search if it is not
//! already sorted. //! already sorted.
//! \param element: Element to search for. //! \param element: Element to search for.
//! \return Returns position of the searched element if it was found, //! \return Returns position of the searched element if it was found,
//! otherwise -1 is returned. //! otherwise -1 is returned.
s32 binary_search(const T& element) s32 binary_search(const T& element)
{ {
return binary_search(element, 0, used-1); return binary_search(element, 0, used-1);
} }
//! Performs a binary search for an element, returns -1 if not found. //! Performs a binary search for an element, returns -1 if not found.
//! The array will be sorted before the binary search if it is not //! The array will be sorted before the binary search if it is not
//! already sorted. //! already sorted.
//! \param element: Element to search for. //! \param element: Element to search for.
//! \param left: First left index //! \param left: First left index
//! \param right: Last right index. //! \param right: Last right index.
//! \return Returns position of the searched element if it was found, //! \return Returns position of the searched element if it was found,
//! otherwise -1 is returned. //! otherwise -1 is returned.
s32 binary_search(const T& element, s32 left, s32 right) s32 binary_search(const T& element, s32 left, s32 right)
{ {
if (!used) if (!used)
return -1; return -1;
sort(); sort();
s32 m; s32 m;
do do
{ {
m = (left+right)>>1; m = (left+right)>>1;
if (element < data[m]) if (element < data[m])
right = m - 1; right = m - 1;
else else
left = m + 1; left = m + 1;
} while((element < data[m] || data[m] < element) && left<=right); } while((element < data[m] || data[m] < element) && left<=right);
// this last line equals to: // this last line equals to:
// " while((element != array[m]) && left<=right);" // " while((element != array[m]) && left<=right);"
// but we only want to use the '<' operator. // but we only want to use the '<' operator.
// the same in next line, it is "(element == array[m])" // the same in next line, it is "(element == array[m])"
if (!(element < data[m]) && !(data[m] < element)) if (!(element < data[m]) && !(data[m] < element))
return m; return m;
return -1; return -1;
} }
//! Finds an element in linear time, which is very slow. Use //! Finds an element in linear time, which is very slow. Use
//! binary_search for faster finding. Only works if =operator is implemented. //! binary_search for faster finding. Only works if =operator is implemented.
//! \param element: Element to search for. //! \param element: Element to search for.
//! \return Returns position of the searched element if it was found, //! \return Returns position of the searched element if it was found,
//! otherwise -1 is returned. //! otherwise -1 is returned.
s32 linear_search(T& element) s32 linear_search(T& element)
{ {
for (u32 i=0; i<used; ++i) for (u32 i=0; i<used; ++i)
if (!(element < data[i]) && !(data[i] < element)) if (!(element < data[i]) && !(data[i] < element))
return (s32)i; return (s32)i;
return -1; return -1;
} }
//! Finds an element in linear time, which is very slow. Use //! Finds an element in linear time, which is very slow. Use
//! binary_search for faster finding. Only works if =operator is implemented. //! binary_search for faster finding. Only works if =operator is implemented.
//! \param element: Element to search for. //! \param element: Element to search for.
//! \return Returns position of the searched element if it was found, //! \return Returns position of the searched element if it was found,
//! otherwise -1 is returned. //! otherwise -1 is returned.
s32 linear_reverse_search(T& element) s32 linear_reverse_search(T& element)
{ {
for (s32 i=used-1; i>=0; --i) for (s32 i=used-1; i>=0; --i)
if (data[i] == element) if (data[i] == element)
return (s32)i; return (s32)i;
return -1; return -1;
} }
//! Erases an element from the array. May be slow, because all elements //! Erases an element from the array. May be slow, because all elements
//! following after the erased element have to be copied. //! following after the erased element have to be copied.
//! \param index: Index of element to be erased. //! \param index: Index of element to be erased.
void erase(u32 index) void erase(u32 index)
{ {
_IRR_DEBUG_BREAK_IF(index>=used || index<0) // access violation _IRR_DEBUG_BREAK_IF(index>=used || index<0) // access violation
for (u32 i=index+1; i<used; ++i) for (u32 i=index+1; i<used; ++i)
data[i-1] = data[i]; data[i-1] = data[i];
--used; --used;
} }
//! Erases some elements from the array. may be slow, because all elements //! Erases some elements from the array. may be slow, because all elements
//! following after the erased element have to be copied. //! following after the erased element have to be copied.
//! \param index: Index of the first element to be erased. //! \param index: Index of the first element to be erased.
//! \param count: Amount of elements to be erased. //! \param count: Amount of elements to be erased.
void erase(u32 index, s32 count) void erase(u32 index, s32 count)
{ {
_IRR_DEBUG_BREAK_IF(index>=used || index<0 || count<1 || index+count>used) // access violation _IRR_DEBUG_BREAK_IF(index>=used || index<0 || count<1 || index+count>used) // access violation
for (u32 i=index+count; i<used; ++i) for (u32 i=index+count; i<used; ++i)
data[i-count] = data[i]; data[i-count] = data[i];
used-= count; used-= count;
} }
//! Sets if the array is sorted //! Sets if the array is sorted
void set_sorted(bool _is_sorted) void set_sorted(bool _is_sorted)
{ {
is_sorted = _is_sorted; is_sorted = _is_sorted;
} }
private: private:
T* data; T* data;
u32 allocated; u32 allocated;
u32 used; u32 used;
bool free_when_destroyed; bool free_when_destroyed;
bool is_sorted; bool is_sorted;
}; };
} // end namespace core } // end namespace core
} // end namespace irr } // end namespace irr
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,108 +1,108 @@
// Copyright (C) 2002-2005 Nikolaus Gebhardt // Copyright (C) 2002-2005 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_TYPES_H_INCLUDED__ #ifndef __IRR_TYPES_H_INCLUDED__
#define __IRR_TYPES_H_INCLUDED__ #define __IRR_TYPES_H_INCLUDED__
namespace irr namespace irr
{ {
//! 8 bit unsigned variable. //! 8 bit unsigned variable.
/** This is a typedef for unsigned char, it ensures portability of the engine. */ /** This is a typedef for unsigned char, it ensures portability of the engine. */
typedef unsigned char u8; typedef unsigned char u8;
//! 8 bit signed variable. //! 8 bit signed variable.
/** This is a typedef for signed char, it ensures portability of the engine. */ /** This is a typedef for signed char, it ensures portability of the engine. */
typedef signed char s8; typedef signed char s8;
//! 8 bit character variable. //! 8 bit character variable.
/** This is a typedef for char, it ensures portability of the engine. */ /** This is a typedef for char, it ensures portability of the engine. */
typedef char c8; typedef char c8;
//! 16 bit unsigned variable. //! 16 bit unsigned variable.
/** This is a typedef for unsigned short, it ensures portability of the engine. */ /** This is a typedef for unsigned short, it ensures portability of the engine. */
typedef unsigned short u16; typedef unsigned short u16;
//! 16 bit signed variable. //! 16 bit signed variable.
/** This is a typedef for signed short, it ensures portability of the engine. */ /** This is a typedef for signed short, it ensures portability of the engine. */
typedef signed short s16; typedef signed short s16;
//! 32 bit unsigned variable. //! 32 bit unsigned variable.
/** This is a typedef for unsigned int, it ensures portability of the engine. */ /** This is a typedef for unsigned int, it ensures portability of the engine. */
typedef unsigned int u32; typedef unsigned int u32;
//! 32 bit signed variable. //! 32 bit signed variable.
/** This is a typedef for signed int, it ensures portability of the engine. */ /** This is a typedef for signed int, it ensures portability of the engine. */
typedef signed int s32; typedef signed int s32;
// 64 bit signed variable. // 64 bit signed variable.
// This is a typedef for __int64, it ensures portability of the engine. // This is a typedef for __int64, it ensures portability of the engine.
// This type is currently not used by the engine and not supported by compilers // This type is currently not used by the engine and not supported by compilers
// other than Microsoft Compilers, so it is outcommented. // other than Microsoft Compilers, so it is outcommented.
//typedef __int64 s64; //typedef __int64 s64;
//! 32 bit floating point variable. //! 32 bit floating point variable.
/** This is a typedef for float, it ensures portability of the engine. */ /** This is a typedef for float, it ensures portability of the engine. */
typedef float f32; typedef float f32;
//! 64 bit floating point variable. //! 64 bit floating point variable.
/** This is a typedef for double, it ensures portability of the engine. */ /** This is a typedef for double, it ensures portability of the engine. */
typedef double f64; typedef double f64;
} // end namespace } // end namespace
// define the wchar_t type if not already built in. // define the wchar_t type if not already built in.
#ifdef _MSC_VER #ifdef _MSC_VER
#ifndef _WCHAR_T_DEFINED #ifndef _WCHAR_T_DEFINED
//! A 16 bit wide character type. //! A 16 bit wide character type.
/** /**
Defines the wchar_t-type. Defines the wchar_t-type.
In VS6, its not possible to tell In VS6, its not possible to tell
the standard compiler to treat wchar_t as a built-in type, and the standard compiler to treat wchar_t as a built-in type, and
sometimes we just don't want to include the huge stdlib.h or wchar.h, sometimes we just don't want to include the huge stdlib.h or wchar.h,
so we'll use this. so we'll use this.
*/ */
typedef unsigned short wchar_t; typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED #define _WCHAR_T_DEFINED
#endif // wchar is not defined #endif // wchar is not defined
#endif // microsoft compiler #endif // microsoft compiler
//! define a break macro for debugging only in Win32 mode. //! define a break macro for debugging only in Win32 mode.
// WORKAROUND (assimp): remove __asm // WORKAROUND (assimp): remove __asm
#if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG) #if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG)
#if defined(_M_IX86) #if defined(_M_IX86)
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) /*if (_CONDITION_) {_asm int 3}*/ #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) /*if (_CONDITION_) {_asm int 3}*/
#else #else
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
#endif #endif
#else #else
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
#endif #endif
//! Defines a small statement to work around a microsoft compiler bug. //! Defines a small statement to work around a microsoft compiler bug.
/** The microsft compiler 7.0 - 7.1 has a bug: /** The microsft compiler 7.0 - 7.1 has a bug:
When you call unmanaged code that returns a bool type value of false from managed code, When you call unmanaged code that returns a bool type value of false from managed code,
the return value may appear as true. See the return value may appear as true. See
http://support.microsoft.com/default.aspx?kbid=823071 for details. http://support.microsoft.com/default.aspx?kbid=823071 for details.
Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/ Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/
// WORKAROUND (assimp): remove __asm // WORKAROUND (assimp): remove __asm
#if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400) #if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX /*__asm mov eax,100*/ #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX /*__asm mov eax,100*/
#else #else
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
#endif // _IRR_MANAGED_MARSHALLING_BUGFIX #endif // _IRR_MANAGED_MARSHALLING_BUGFIX
#endif // __IRR_TYPES_H_INCLUDED__ #endif // __IRR_TYPES_H_INCLUDED__

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
IrrXML IrrXML
Downloaded September 2008 Downloaded September 2008
- fixed a minor compiler warning (vs 2005, shift too large) - fixed a minor compiler warning (vs 2005, shift too large)
- fixed an issue regarding wchar_t/unsigned short - fixed an issue regarding wchar_t/unsigned short

View File

@ -1,105 +1,105 @@
/* /*
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/ * http://code.google.com/p/poly2tri/
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: * are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be * * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific * used to endorse or promote products derived from this software without specific
* prior written permission. * prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef UTILS_H #ifndef UTILS_H
#define UTILS_H #define UTILS_H
// Otherwise #defines like M_PI are undeclared under Visual Studio // Otherwise #defines like M_PI are undeclared under Visual Studio
#define _USE_MATH_DEFINES #define _USE_MATH_DEFINES
#include <exception> #include <exception>
#include <math.h> #include <math.h>
namespace p2t { namespace p2t {
const double PI_3div4 = 3 * M_PI / 4; const double PI_3div4 = 3 * M_PI / 4;
const double EPSILON = 1e-15; const double EPSILON = 1e-15;
enum Orientation { CW, CCW, COLLINEAR }; enum Orientation { CW, CCW, COLLINEAR };
/** /**
* Forumla to calculate signed area<br> * Forumla to calculate signed area<br>
* Positive if CCW<br> * Positive if CCW<br>
* Negative if CW<br> * Negative if CW<br>
* 0 if collinear<br> * 0 if collinear<br>
* <pre> * <pre>
* A[P1,P2,P3] = (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1) * A[P1,P2,P3] = (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
* = (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3) * = (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)
* </pre> * </pre>
*/ */
Orientation Orient2d(Point& pa, Point& pb, Point& pc) Orientation Orient2d(Point& pa, Point& pb, Point& pc)
{ {
double detleft = (pa.x - pc.x) * (pb.y - pc.y); double detleft = (pa.x - pc.x) * (pb.y - pc.y);
double detright = (pa.y - pc.y) * (pb.x - pc.x); double detright = (pa.y - pc.y) * (pb.x - pc.x);
double val = detleft - detright; double val = detleft - detright;
if (val > -EPSILON && val < EPSILON) { if (val > -EPSILON && val < EPSILON) {
return COLLINEAR; return COLLINEAR;
} else if (val > 0) { } else if (val > 0) {
return CCW; return CCW;
} }
return CW; return CW;
} }
bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd) bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd)
{ {
double pdx = pd.x; double pdx = pd.x;
double pdy = pd.y; double pdy = pd.y;
double adx = pa.x - pdx; double adx = pa.x - pdx;
double ady = pa.y - pdy; double ady = pa.y - pdy;
double bdx = pb.x - pdx; double bdx = pb.x - pdx;
double bdy = pb.y - pdy; double bdy = pb.y - pdy;
double adxbdy = adx * bdy; double adxbdy = adx * bdy;
double bdxady = bdx * ady; double bdxady = bdx * ady;
double oabd = adxbdy - bdxady; double oabd = adxbdy - bdxady;
if (oabd <= EPSILON) { if (oabd <= EPSILON) {
return false; return false;
} }
double cdx = pc.x - pdx; double cdx = pc.x - pdx;
double cdy = pc.y - pdy; double cdy = pc.y - pdy;
double cdxady = cdx * ady; double cdxady = cdx * ady;
double adxcdy = adx * cdy; double adxcdy = adx * cdy;
double ocad = cdxady - adxcdy; double ocad = cdxady - adxcdy;
if (ocad <= EPSILON) { if (ocad <= EPSILON) {
return false; return false;
} }
return true; return true;
} }
} }
#endif #endif

View File

@ -1,105 +1,105 @@
/* /*
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/ * http://code.google.com/p/poly2tri/
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: * are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be * * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific * used to endorse or promote products derived from this software without specific
* prior written permission. * prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef CDT_H #ifndef CDT_H
#define CDT_H #define CDT_H
#include "advancing_front.h" #include "advancing_front.h"
#include "sweep_context.h" #include "sweep_context.h"
#include "sweep.h" #include "sweep.h"
/** /**
* *
* @author Mason Green <mason.green@gmail.com> * @author Mason Green <mason.green@gmail.com>
* *
*/ */
namespace p2t { namespace p2t {
class CDT class CDT
{ {
public: public:
/** /**
* Constructor - add polyline with non repeating points * Constructor - add polyline with non repeating points
* *
* @param polyline * @param polyline
*/ */
CDT(std::vector<Point*> polyline); CDT(std::vector<Point*> polyline);
/** /**
* Destructor - clean up memory * Destructor - clean up memory
*/ */
~CDT(); ~CDT();
/** /**
* Add a hole * Add a hole
* *
* @param polyline * @param polyline
*/ */
void AddHole(std::vector<Point*> polyline); void AddHole(std::vector<Point*> polyline);
/** /**
* Add a steiner point * Add a steiner point
* *
* @param point * @param point
*/ */
void AddPoint(Point* point); void AddPoint(Point* point);
/** /**
* Triangulate - do this AFTER you've added the polyline, holes, and Steiner points * Triangulate - do this AFTER you've added the polyline, holes, and Steiner points
*/ */
void Triangulate(); void Triangulate();
/** /**
* Get CDT triangles * Get CDT triangles
*/ */
std::vector<Triangle*> GetTriangles(); std::vector<Triangle*> GetTriangles();
/** /**
* Get triangle map * Get triangle map
*/ */
std::list<Triangle*> GetMap(); std::list<Triangle*> GetMap();
private: private:
/** /**
* Internals * Internals
*/ */
SweepContext* sweep_context_; SweepContext* sweep_context_;
Sweep* sweep_; Sweep* sweep_;
}; };
} }
#endif #endif

View File

@ -1,186 +1,186 @@
/* /*
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
* http://code.google.com/p/poly2tri/ * http://code.google.com/p/poly2tri/
* *
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: * are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, * * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* * Neither the name of Poly2Tri nor the names of its contributors may be * * Neither the name of Poly2Tri nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific * used to endorse or promote products derived from this software without specific
* prior written permission. * prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef SWEEP_CONTEXT_H #ifndef SWEEP_CONTEXT_H
#define SWEEP_CONTEXT_H #define SWEEP_CONTEXT_H
#include <list> #include <list>
#include <vector> #include <vector>
#include <cstddef> #include <cstddef>
namespace p2t { namespace p2t {
// Inital triangle factor, seed triangle will extend 30% of // Inital triangle factor, seed triangle will extend 30% of
// PointSet width to both left and right. // PointSet width to both left and right.
const double kAlpha = 0.3; const double kAlpha = 0.3;
struct Point; struct Point;
class Triangle; class Triangle;
struct Node; struct Node;
struct Edge; struct Edge;
class AdvancingFront; class AdvancingFront;
class SweepContext { class SweepContext {
public: public:
/// Constructor /// Constructor
SweepContext(std::vector<Point*> polyline); SweepContext(std::vector<Point*> polyline);
/// Destructor /// Destructor
~SweepContext(); ~SweepContext();
void set_head(Point* p1); void set_head(Point* p1);
Point* head(); Point* head();
void set_tail(Point* p1); void set_tail(Point* p1);
Point* tail(); Point* tail();
int point_count(); int point_count();
Node& LocateNode(Point& point); Node& LocateNode(Point& point);
void RemoveNode(Node* node); void RemoveNode(Node* node);
void CreateAdvancingFront(std::vector<Node*> nodes); void CreateAdvancingFront(std::vector<Node*> nodes);
/// Try to map a node to all sides of this triangle that don't have a neighbor /// Try to map a node to all sides of this triangle that don't have a neighbor
void MapTriangleToNodes(Triangle& t); void MapTriangleToNodes(Triangle& t);
void AddToMap(Triangle* triangle); void AddToMap(Triangle* triangle);
Point* GetPoint(const int& index); Point* GetPoint(const int& index);
Point* GetPoints(); Point* GetPoints();
void RemoveFromMap(Triangle* triangle); void RemoveFromMap(Triangle* triangle);
void AddHole(std::vector<Point*> polyline); void AddHole(std::vector<Point*> polyline);
void AddPoint(Point* point); void AddPoint(Point* point);
AdvancingFront* front(); AdvancingFront* front();
void MeshClean(Triangle& triangle); void MeshClean(Triangle& triangle);
std::vector<Triangle*> GetTriangles(); std::vector<Triangle*> GetTriangles();
std::list<Triangle*> GetMap(); std::list<Triangle*> GetMap();
std::vector<Edge*> edge_list; std::vector<Edge*> edge_list;
struct Basin { struct Basin {
Node* left_node; Node* left_node;
Node* bottom_node; Node* bottom_node;
Node* right_node; Node* right_node;
double width; double width;
bool left_highest; bool left_highest;
Basin() : left_node(NULL), bottom_node(NULL), right_node(NULL), width(0.0), left_highest(false) Basin() : left_node(NULL), bottom_node(NULL), right_node(NULL), width(0.0), left_highest(false)
{ {
} }
void Clear() void Clear()
{ {
left_node = NULL; left_node = NULL;
bottom_node = NULL; bottom_node = NULL;
right_node = NULL; right_node = NULL;
width = 0.0; width = 0.0;
left_highest = false; left_highest = false;
} }
}; };
struct EdgeEvent { struct EdgeEvent {
Edge* constrained_edge; Edge* constrained_edge;
bool right; bool right;
EdgeEvent() : constrained_edge(NULL), right(false) EdgeEvent() : constrained_edge(NULL), right(false)
{ {
} }
}; };
Basin basin; Basin basin;
EdgeEvent edge_event; EdgeEvent edge_event;
private: private:
friend class Sweep; friend class Sweep;
std::vector<Triangle*> triangles_; std::vector<Triangle*> triangles_;
std::list<Triangle*> map_; std::list<Triangle*> map_;
std::vector<Point*> points_; std::vector<Point*> points_;
// Advancing front // Advancing front
AdvancingFront* front_; AdvancingFront* front_;
// head point used with advancing front // head point used with advancing front
Point* head_; Point* head_;
// tail point used with advancing front // tail point used with advancing front
Point* tail_; Point* tail_;
Node *af_head_, *af_middle_, *af_tail_; Node *af_head_, *af_middle_, *af_tail_;
void InitTriangulation(); void InitTriangulation();
void InitEdges(std::vector<Point*> polyline); void InitEdges(std::vector<Point*> polyline);
}; };
inline AdvancingFront* SweepContext::front() inline AdvancingFront* SweepContext::front()
{ {
return front_; return front_;
} }
inline int SweepContext::point_count() inline int SweepContext::point_count()
{ {
return points_.size(); return points_.size();
} }
inline void SweepContext::set_head(Point* p1) inline void SweepContext::set_head(Point* p1)
{ {
head_ = p1; head_ = p1;
} }
inline Point* SweepContext::head() inline Point* SweepContext::head()
{ {
return head_; return head_;
} }
inline void SweepContext::set_tail(Point* p1) inline void SweepContext::set_tail(Point* p1)
{ {
tail_ = p1; tail_ = p1;
} }
inline Point* SweepContext::tail() inline Point* SweepContext::tail()
{ {
return tail_; return tail_;
} }
} }
#endif #endif

View File

@ -1,75 +1,75 @@
diff -r 5de9623d6a50 poly2tri/common/shapes.h diff -r 5de9623d6a50 poly2tri/common/shapes.h
--- a/poly2tri/common/shapes.h Mon Aug 08 22:26:41 2011 -0400 --- a/poly2tri/common/shapes.h Mon Aug 08 22:26:41 2011 -0400
+++ b/poly2tri/common/shapes.h Tue Jan 17 02:36:52 2012 +0100 +++ b/poly2tri/common/shapes.h Tue Jan 17 02:36:52 2012 +0100
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
#include <vector> #include <vector>
#include <cstddef> #include <cstddef>
+#include <stdexcept> +#include <stdexcept>
#include <assert.h> #include <assert.h>
#include <cmath> #include <cmath>
@@ -136,7 +137,9 @@ @@ -136,7 +137,9 @@
p = &p2; p = &p2;
} else if (p1.x == p2.x) { } else if (p1.x == p2.x) {
// Repeat points // Repeat points
- assert(false); - assert(false);
+ // ASSIMP_CHANGE (aramis_acg) + // ASSIMP_CHANGE (aramis_acg)
+ throw std::runtime_error("repeat points"); + throw std::runtime_error("repeat points");
+ //assert(false); + //assert(false);
} }
} }
diff -r 5de9623d6a50 poly2tri/sweep/sweep.cc diff -r 5de9623d6a50 poly2tri/sweep/sweep.cc
--- a/poly2tri/sweep/sweep.cc Mon Aug 08 22:26:41 2011 -0400 --- a/poly2tri/sweep/sweep.cc Mon Aug 08 22:26:41 2011 -0400
+++ b/poly2tri/sweep/sweep.cc Tue Jan 17 02:36:52 2012 +0100 +++ b/poly2tri/sweep/sweep.cc Tue Jan 17 02:36:52 2012 +0100
@@ -113,6 +113,8 @@ @@ -113,6 +113,8 @@
Point* p1 = triangle->PointCCW(point); Point* p1 = triangle->PointCCW(point);
Orientation o1 = Orient2d(eq, *p1, ep); Orientation o1 = Orient2d(eq, *p1, ep);
if (o1 == COLLINEAR) { if (o1 == COLLINEAR) {
+ // ASSIMP_CHANGE (aramis_acg) + // ASSIMP_CHANGE (aramis_acg)
+ throw std::runtime_error("EdgeEvent - collinear points not supported"); + throw std::runtime_error("EdgeEvent - collinear points not supported");
if( triangle->Contains(&eq, p1)) { if( triangle->Contains(&eq, p1)) {
triangle->MarkConstrainedEdge(&eq, p1 ); triangle->MarkConstrainedEdge(&eq, p1 );
// We are modifying the constraint maybe it would be better to // We are modifying the constraint maybe it would be better to
@@ -121,8 +123,8 @@ @@ -121,8 +123,8 @@
triangle = &triangle->NeighborAcross(point); triangle = &triangle->NeighborAcross(point);
EdgeEvent( tcx, ep, *p1, triangle, *p1 ); EdgeEvent( tcx, ep, *p1, triangle, *p1 );
} else { } else {
+ // ASSIMP_CHANGE (aramis_acg) + // ASSIMP_CHANGE (aramis_acg)
std::runtime_error("EdgeEvent - collinear points not supported"); std::runtime_error("EdgeEvent - collinear points not supported");
- assert(0); - assert(0);
} }
return; return;
} }
@@ -130,6 +132,9 @@ @@ -130,6 +132,9 @@
Point* p2 = triangle->PointCW(point); Point* p2 = triangle->PointCW(point);
Orientation o2 = Orient2d(eq, *p2, ep); Orientation o2 = Orient2d(eq, *p2, ep);
if (o2 == COLLINEAR) { if (o2 == COLLINEAR) {
+ // ASSIMP_CHANGE (aramis_acg) + // ASSIMP_CHANGE (aramis_acg)
+ throw std::runtime_error("EdgeEvent - collinear points not supported"); + throw std::runtime_error("EdgeEvent - collinear points not supported");
+ +
if( triangle->Contains(&eq, p2)) { if( triangle->Contains(&eq, p2)) {
triangle->MarkConstrainedEdge(&eq, p2 ); triangle->MarkConstrainedEdge(&eq, p2 );
// We are modifying the constraint maybe it would be better to // We are modifying the constraint maybe it would be better to
@@ -138,8 +143,8 @@ @@ -138,8 +143,8 @@
triangle = &triangle->NeighborAcross(point); triangle = &triangle->NeighborAcross(point);
EdgeEvent( tcx, ep, *p2, triangle, *p2 ); EdgeEvent( tcx, ep, *p2, triangle, *p2 );
} else { } else {
- std::runtime_error("EdgeEvent - collinear points not supported"); - std::runtime_error("EdgeEvent - collinear points not supported");
- assert(0); - assert(0);
+ // ASSIMP_CHANGE (aramis_acg) + // ASSIMP_CHANGE (aramis_acg)
+ throw std::runtime_error("EdgeEvent - collinear points not supported"); + throw std::runtime_error("EdgeEvent - collinear points not supported");
} }
return; return;
} }
@@ -712,7 +717,8 @@ @@ -712,7 +717,8 @@
return *ot.PointCW(op); return *ot.PointCW(op);
} else{ } else{
//throw new RuntimeException("[Unsupported] Opposing point on constrained edge"); //throw new RuntimeException("[Unsupported] Opposing point on constrained edge");
- assert(0); - assert(0);
+ // ASSIMP_CHANGE (aramis_acg) + // ASSIMP_CHANGE (aramis_acg)
+ throw std::runtime_error("[Unsupported] Opposing point on constrained edge"); + throw std::runtime_error("[Unsupported] Opposing point on constrained edge");
} }
} }

View File

@ -1,132 +1,132 @@
/* crypt.h -- base code for crypt/uncrypt ZIPfile /* crypt.h -- base code for crypt/uncrypt ZIPfile
Version 1.01e, February 12th, 2005 Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2005 Gilles Vollant
This code is a modified version of crypting code in Infozip distribution This code is a modified version of crypting code in Infozip distribution
The encryption/decryption parts of this source code (as opposed to the The encryption/decryption parts of this source code (as opposed to the
non-echoing password parts) were originally written in Europe. The non-echoing password parts) were originally written in Europe. The
whole source package can be freely distributed, including from the USA. whole source package can be freely distributed, including from the USA.
(Prior to January 2000, re-export from the US was a violation of US law.) (Prior to January 2000, re-export from the US was a violation of US law.)
This encryption code is a direct transcription of the algorithm from This encryption code is a direct transcription of the algorithm from
Roger Schlafly, described by Phil Katz in the file appnote.txt. This Roger Schlafly, described by Phil Katz in the file appnote.txt. This
file (appnote.txt) is distributed with the PKZIP program (even in the file (appnote.txt) is distributed with the PKZIP program (even in the
version without encryption capabilities). version without encryption capabilities).
If you don't need crypting in your application, just define symbols If you don't need crypting in your application, just define symbols
NOCRYPT and NOUNCRYPT. NOCRYPT and NOUNCRYPT.
This code support the "Traditional PKWARE Encryption". This code support the "Traditional PKWARE Encryption".
The new AES encryption added on Zip format by Winzip (see the page The new AES encryption added on Zip format by Winzip (see the page
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
Encryption is not supported. Encryption is not supported.
*/ */
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
/*********************************************************************** /***********************************************************************
* Return the next byte in the pseudo-random sequence * Return the next byte in the pseudo-random sequence
*/ */
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
{ {
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem * unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */ * with any known compiler so far, though */
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
} }
/*********************************************************************** /***********************************************************************
* Update the encryption keys with the next byte of plain text * Update the encryption keys with the next byte of plain text
*/ */
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
{ {
(*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{ {
register int keyshift = (int)((*(pkeys+1)) >> 24); register int keyshift = (int)((*(pkeys+1)) >> 24);
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
} }
return c; return c;
} }
/*********************************************************************** /***********************************************************************
* Initialize the encryption keys and the random header according to * Initialize the encryption keys and the random header according to
* the given password. * the given password.
*/ */
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
{ {
*(pkeys+0) = 305419896L; *(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L; *(pkeys+1) = 591751049L;
*(pkeys+2) = 878082192L; *(pkeys+2) = 878082192L;
while (*passwd != '\0') { while (*passwd != '\0') {
update_keys(pkeys,pcrc_32_tab,(int)*passwd); update_keys(pkeys,pcrc_32_tab,(int)*passwd);
passwd++; passwd++;
} }
} }
#define zdecode(pkeys,pcrc_32_tab,c) \ #define zdecode(pkeys,pcrc_32_tab,c) \
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
#define zencode(pkeys,pcrc_32_tab,c,t) \ #define zencode(pkeys,pcrc_32_tab,c,t) \
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
#define RAND_HEAD_LEN 12 #define RAND_HEAD_LEN 12
/* "last resort" source for second part of crypt seed pattern */ /* "last resort" source for second part of crypt seed pattern */
# ifndef ZCR_SEED2 # ifndef ZCR_SEED2
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # define ZCR_SEED2 3141592654UL /* use PI as default pattern */
# endif # endif
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
const char *passwd; /* password string */ const char *passwd; /* password string */
unsigned char *buf; /* where to write header */ unsigned char *buf; /* where to write header */
int bufSize; int bufSize;
unsigned long* pkeys; unsigned long* pkeys;
const unsigned long* pcrc_32_tab; const unsigned long* pcrc_32_tab;
unsigned long crcForCrypting; unsigned long crcForCrypting;
{ {
int n; /* index in random header */ int n; /* index in random header */
int t; /* temporary */ int t; /* temporary */
int c; /* random byte */ int c; /* random byte */
unsigned char header[RAND_HEAD_LEN-2]; /* random header */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */
static unsigned calls = 0; /* ensure different random header each time */ static unsigned calls = 0; /* ensure different random header each time */
if (bufSize<RAND_HEAD_LEN) if (bufSize<RAND_HEAD_LEN)
return 0; return 0;
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
* output of rand() to get less predictability, since rand() is * output of rand() to get less predictability, since rand() is
* often poorly implemented. * often poorly implemented.
*/ */
if (++calls == 1) if (++calls == 1)
{ {
srand((unsigned)(time(NULL) ^ ZCR_SEED2)); srand((unsigned)(time(NULL) ^ ZCR_SEED2));
} }
init_keys(passwd, pkeys, pcrc_32_tab); init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++) for (n = 0; n < RAND_HEAD_LEN-2; n++)
{ {
c = (rand() >> 7) & 0xff; c = (rand() >> 7) & 0xff;
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
} }
/* Encrypt random header (last two bytes is high word of crc) */ /* Encrypt random header (last two bytes is high word of crc) */
init_keys(passwd, pkeys, pcrc_32_tab); init_keys(passwd, pkeys, pcrc_32_tab);
for (n = 0; n < RAND_HEAD_LEN-2; n++) for (n = 0; n < RAND_HEAD_LEN-2; n++)
{ {
buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
} }
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
return n; return n;
} }
#endif #endif

View File

@ -1,181 +1,181 @@
/* ioapi.c -- IO base function header for compress/uncompress .zip /* ioapi.c -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API files using zlib + zip or unzip API
Version 1.01e, February 12th, 2005 Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2005 Gilles Vollant
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
# ifdef ASSIMP_BUILD_NO_OWN_ZLIB # ifdef ASSIMP_BUILD_NO_OWN_ZLIB
# include <zlib.h> # include <zlib.h>
# else # else
# include "../zlib/zlib.h" # include "../zlib/zlib.h"
# endif # endif
#include "ioapi.h" #include "ioapi.h"
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
#ifndef SEEK_CUR #ifndef SEEK_CUR
#define SEEK_CUR 1 #define SEEK_CUR 1
#endif #endif
#ifndef SEEK_END #ifndef SEEK_END
#define SEEK_END 2 #define SEEK_END 2
#endif #endif
#ifndef SEEK_SET #ifndef SEEK_SET
#define SEEK_SET 0 #define SEEK_SET 0
#endif #endif
voidpf ZCALLBACK fopen_file_func ( voidpf ZCALLBACK fopen_file_func (
voidpf opaque, voidpf opaque,
const char* filename, const char* filename,
int mode); int mode);
uLong ZCALLBACK fread_file_func ( uLong ZCALLBACK fread_file_func (
voidpf opaque, voidpf opaque,
voidpf stream, voidpf stream,
void* buf, void* buf,
uLong size); uLong size);
uLong ZCALLBACK fwrite_file_func ( uLong ZCALLBACK fwrite_file_func (
voidpf opaque, voidpf opaque,
voidpf stream, voidpf stream,
const void* buf, const void* buf,
uLong size); uLong size);
long ZCALLBACK ftell_file_func ( long ZCALLBACK ftell_file_func (
voidpf opaque, voidpf opaque,
voidpf stream); voidpf stream);
long ZCALLBACK fseek_file_func ( long ZCALLBACK fseek_file_func (
voidpf opaque, voidpf opaque,
voidpf stream, voidpf stream,
uLong offset, uLong offset,
int origin); int origin);
int ZCALLBACK fclose_file_func ( int ZCALLBACK fclose_file_func (
voidpf opaque, voidpf opaque,
voidpf stream); voidpf stream);
int ZCALLBACK ferror_file_func ( int ZCALLBACK ferror_file_func (
voidpf opaque, voidpf opaque,
voidpf stream); voidpf stream);
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
voidpf opaque; voidpf opaque;
const char* filename; const char* filename;
int mode; int mode;
{ {
FILE* file = NULL; FILE* file = NULL;
const char* mode_fopen = NULL; const char* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb"; mode_fopen = "rb";
else else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING) if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
mode_fopen = "r+b"; mode_fopen = "r+b";
else else
if (mode & ZLIB_FILEFUNC_MODE_CREATE) if (mode & ZLIB_FILEFUNC_MODE_CREATE)
mode_fopen = "wb"; mode_fopen = "wb";
if ((filename!=NULL) && (mode_fopen != NULL)) if ((filename!=NULL) && (mode_fopen != NULL))
file = fopen(filename, mode_fopen); file = fopen(filename, mode_fopen);
return file; return file;
} }
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
voidpf opaque; voidpf opaque;
voidpf stream; voidpf stream;
void* buf; void* buf;
uLong size; uLong size;
{ {
uLong ret; uLong ret;
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
return ret; return ret;
} }
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
voidpf opaque; voidpf opaque;
voidpf stream; voidpf stream;
const void* buf; const void* buf;
uLong size; uLong size;
{ {
uLong ret; uLong ret;
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
return ret; return ret;
} }
long ZCALLBACK ftell_file_func (opaque, stream) long ZCALLBACK ftell_file_func (opaque, stream)
voidpf opaque; voidpf opaque;
voidpf stream; voidpf stream;
{ {
long ret; long ret;
ret = ftell((FILE *)stream); ret = ftell((FILE *)stream);
return ret; return ret;
} }
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
voidpf opaque; voidpf opaque;
voidpf stream; voidpf stream;
uLong offset; uLong offset;
int origin; int origin;
{ {
int fseek_origin=0; int fseek_origin=0;
long ret; long ret;
switch (origin) switch (origin)
{ {
case ZLIB_FILEFUNC_SEEK_CUR : case ZLIB_FILEFUNC_SEEK_CUR :
fseek_origin = SEEK_CUR; fseek_origin = SEEK_CUR;
break; break;
case ZLIB_FILEFUNC_SEEK_END : case ZLIB_FILEFUNC_SEEK_END :
fseek_origin = SEEK_END; fseek_origin = SEEK_END;
break; break;
case ZLIB_FILEFUNC_SEEK_SET : case ZLIB_FILEFUNC_SEEK_SET :
fseek_origin = SEEK_SET; fseek_origin = SEEK_SET;
break; break;
default: return -1; default: return -1;
} }
ret = 0; ret = 0;
fseek((FILE *)stream, offset, fseek_origin); fseek((FILE *)stream, offset, fseek_origin);
return ret; return ret;
} }
int ZCALLBACK fclose_file_func (opaque, stream) int ZCALLBACK fclose_file_func (opaque, stream)
voidpf opaque; voidpf opaque;
voidpf stream; voidpf stream;
{ {
int ret; int ret;
ret = fclose((FILE *)stream); ret = fclose((FILE *)stream);
return ret; return ret;
} }
int ZCALLBACK ferror_file_func (opaque, stream) int ZCALLBACK ferror_file_func (opaque, stream)
voidpf opaque; voidpf opaque;
voidpf stream; voidpf stream;
{ {
int ret; int ret;
ret = ferror((FILE *)stream); ret = ferror((FILE *)stream);
return ret; return ret;
} }
void fill_fopen_filefunc (pzlib_filefunc_def) void fill_fopen_filefunc (pzlib_filefunc_def)
zlib_filefunc_def* pzlib_filefunc_def; zlib_filefunc_def* pzlib_filefunc_def;
{ {
pzlib_filefunc_def->zopen_file = fopen_file_func; pzlib_filefunc_def->zopen_file = fopen_file_func;
pzlib_filefunc_def->zread_file = fread_file_func; pzlib_filefunc_def->zread_file = fread_file_func;
pzlib_filefunc_def->zwrite_file = fwrite_file_func; pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell_file = ftell_file_func; pzlib_filefunc_def->ztell_file = ftell_file_func;
pzlib_filefunc_def->zseek_file = fseek_file_func; pzlib_filefunc_def->zseek_file = fseek_file_func;
pzlib_filefunc_def->zclose_file = fclose_file_func; pzlib_filefunc_def->zclose_file = fclose_file_func;
pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL; pzlib_filefunc_def->opaque = NULL;
} }

View File

@ -1,75 +1,75 @@
/* ioapi.h -- IO base function header for compress/uncompress .zip /* ioapi.h -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API files using zlib + zip or unzip API
Version 1.01e, February 12th, 2005 Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2005 Gilles Vollant
*/ */
#ifndef _ZLIBIOAPI_H #ifndef _ZLIBIOAPI_H
#define _ZLIBIOAPI_H #define _ZLIBIOAPI_H
#define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_CUR (1)
#define ZLIB_FILEFUNC_SEEK_END (2) #define ZLIB_FILEFUNC_SEEK_END (2)
#define ZLIB_FILEFUNC_SEEK_SET (0) #define ZLIB_FILEFUNC_SEEK_SET (0)
#define ZLIB_FILEFUNC_MODE_READ (1) #define ZLIB_FILEFUNC_MODE_READ (1)
#define ZLIB_FILEFUNC_MODE_WRITE (2) #define ZLIB_FILEFUNC_MODE_WRITE (2)
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
#define ZLIB_FILEFUNC_MODE_EXISTING (4) #define ZLIB_FILEFUNC_MODE_EXISTING (4)
#define ZLIB_FILEFUNC_MODE_CREATE (8) #define ZLIB_FILEFUNC_MODE_CREATE (8)
#ifndef ZCALLBACK #ifndef ZCALLBACK
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) #if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
#define ZCALLBACK CALLBACK #define ZCALLBACK CALLBACK
#else #else
#define ZCALLBACK #define ZCALLBACK
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode); typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode);
typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size); typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size);
typedef uLong (ZCALLBACK *write_file_func)(voidpf opaque, voidpf stream, const void* buf, uLong size); typedef uLong (ZCALLBACK *write_file_func)(voidpf opaque, voidpf stream, const void* buf, uLong size);
typedef long (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream); typedef long (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream);
typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin); typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin);
typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream); typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream);
typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream); typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream);
typedef struct zlib_filefunc_def_s typedef struct zlib_filefunc_def_s
{ {
open_file_func zopen_file; open_file_func zopen_file;
read_file_func zread_file; read_file_func zread_file;
write_file_func zwrite_file; write_file_func zwrite_file;
tell_file_func ztell_file; tell_file_func ztell_file;
seek_file_func zseek_file; seek_file_func zseek_file;
close_file_func zclose_file; close_file_func zclose_file;
testerror_file_func zerror_file; testerror_file_func zerror_file;
voidpf opaque; voidpf opaque;
} zlib_filefunc_def; } zlib_filefunc_def;
void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def); void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def);
#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) #define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) #define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) #define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) #define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) #define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) #define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,358 +1,358 @@
/* unzip.h -- IO for uncompress .zip files using zlib /* unzip.h -- IO for uncompress .zip files using zlib
Version 1.01e, February 12th, 2005 Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2005 Gilles Vollant
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
WinZip, InfoZip tools and compatible. WinZip, InfoZip tools and compatible.
Multi volume ZipFile (span) are not supported. Multi volume ZipFile (span) are not supported.
Encryption compatible with pkzip 2.04g only supported Encryption compatible with pkzip 2.04g only supported
Old compressions used by old PKZip 1.x are not supported Old compressions used by old PKZip 1.x are not supported
I WAIT FEEDBACK at mail info@winimage.com I WAIT FEEDBACK at mail info@winimage.com
Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
Condition of use and distribution are the same than zlib : Condition of use and distribution are the same than zlib :
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
arising from the use of this software. arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions: freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not 1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be in a product, an acknowledgment in the product documentation would be
appreciated but is not required. appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be 2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software. misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
*/ */
/* for more info about .ZIP format, see /* for more info about .ZIP format, see
http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
http://www.info-zip.org/pub/infozip/doc/ http://www.info-zip.org/pub/infozip/doc/
PkWare has also a specification at : PkWare has also a specification at :
ftp://ftp.pkware.com/probdesc.zip ftp://ftp.pkware.com/probdesc.zip
*/ */
#ifndef _unz_H #ifndef _unz_H
#define _unz_H #define _unz_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef _ZLIB_H #ifndef _ZLIB_H
# ifdef ASSIMP_BUILD_NO_OWN_ZLIB # ifdef ASSIMP_BUILD_NO_OWN_ZLIB
# include <zlib.h> # include <zlib.h>
# else # else
# include "../zlib/zlib.h" # include "../zlib/zlib.h"
# endif # endif
#endif #endif
#ifndef _ZLIBIOAPI_H #ifndef _ZLIBIOAPI_H
#include "ioapi.h" #include "ioapi.h"
#endif #endif
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted /* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */ from (void*) without cast */
typedef struct TagunzFile__ { int unused; } unzFile__; typedef struct TagunzFile__ { int unused; } unzFile__;
typedef unzFile__ *unzFile; typedef unzFile__ *unzFile;
#else #else
typedef voidp unzFile; typedef voidp unzFile;
#endif #endif
#define UNZ_OK (0) #define UNZ_OK (0)
#define UNZ_END_OF_LIST_OF_FILE (-100) #define UNZ_END_OF_LIST_OF_FILE (-100)
#define UNZ_ERRNO (Z_ERRNO) #define UNZ_ERRNO (Z_ERRNO)
#define UNZ_EOF (0) #define UNZ_EOF (0)
#define UNZ_PARAMERROR (-102) #define UNZ_PARAMERROR (-102)
#define UNZ_BADZIPFILE (-103) #define UNZ_BADZIPFILE (-103)
#define UNZ_INTERNALERROR (-104) #define UNZ_INTERNALERROR (-104)
#define UNZ_CRCERROR (-105) #define UNZ_CRCERROR (-105)
/* tm_unz contain date/time info */ /* tm_unz contain date/time info */
typedef struct tm_unz_s typedef struct tm_unz_s
{ {
uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_sec; /* seconds after the minute - [0,59] */
uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */
uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_hour; /* hours since midnight - [0,23] */
uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mday; /* day of the month - [1,31] */
uInt tm_mon; /* months since January - [0,11] */ uInt tm_mon; /* months since January - [0,11] */
uInt tm_year; /* years - [1980..2044] */ uInt tm_year; /* years - [1980..2044] */
} tm_unz; } tm_unz;
/* unz_global_info structure contain global data about the ZIPfile /* unz_global_info structure contain global data about the ZIPfile
These data comes from the end of central dir */ These data comes from the end of central dir */
typedef struct unz_global_info_s typedef struct unz_global_info_s
{ {
uLong number_entry; /* total number of entries in uLong number_entry; /* total number of entries in
the central dir on this disk */ the central dir on this disk */
uLong size_comment; /* size of the global comment of the zipfile */ uLong size_comment; /* size of the global comment of the zipfile */
} unz_global_info; } unz_global_info;
/* unz_file_info contain information about a file in the zipfile */ /* unz_file_info contain information about a file in the zipfile */
typedef struct unz_file_info_s typedef struct unz_file_info_s
{ {
uLong version; /* version made by 2 bytes */ uLong version; /* version made by 2 bytes */
uLong version_needed; /* version needed to extract 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */
uLong flag; /* general purpose bit flag 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */
uLong compression_method; /* compression method 2 bytes */ uLong compression_method; /* compression method 2 bytes */
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
uLong crc; /* crc-32 4 bytes */ uLong crc; /* crc-32 4 bytes */
uLong compressed_size; /* compressed size 4 bytes */ uLong compressed_size; /* compressed size 4 bytes */
uLong uncompressed_size; /* uncompressed size 4 bytes */ uLong uncompressed_size; /* uncompressed size 4 bytes */
uLong size_filename; /* filename length 2 bytes */ uLong size_filename; /* filename length 2 bytes */
uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */
uLong size_file_comment; /* file comment length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */
uLong disk_num_start; /* disk number start 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */
uLong internal_fa; /* internal file attributes 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */ uLong external_fa; /* external file attributes 4 bytes */
tm_unz tmu_date; tm_unz tmu_date;
} unz_file_info; } unz_file_info;
extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, extern int ZEXPORT unzStringFileNameCompare (const char* fileName1,
const char* fileName2, const char* fileName2,
int iCaseSensitivity); int iCaseSensitivity);
/* /*
Compare two filename (fileName1,fileName2). Compare two filename (fileName1,fileName2).
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
or strcasecmp) or strcasecmp)
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
(like 1 on Unix, 2 on Windows) (like 1 on Unix, 2 on Windows)
*/ */
extern unzFile ZEXPORT unzOpen (const char *path); extern unzFile ZEXPORT unzOpen (const char *path);
/* /*
Open a Zip file. path contain the full pathname (by example, Open a Zip file. path contain the full pathname (by example,
on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
"zlib/zlib113.zip". "zlib/zlib113.zip".
If the zipfile cannot be opened (file don't exist or in not valid), the If the zipfile cannot be opened (file don't exist or in not valid), the
return value is NULL. return value is NULL.
Else, the return value is a unzFile Handle, usable with other function Else, the return value is a unzFile Handle, usable with other function
of this unzip package. of this unzip package.
*/ */
extern unzFile ZEXPORT unzOpen2 (const char *path, extern unzFile ZEXPORT unzOpen2 (const char *path,
zlib_filefunc_def* pzlib_filefunc_def); zlib_filefunc_def* pzlib_filefunc_def);
/* /*
Open a Zip file, like unzOpen, but provide a set of file low level API Open a Zip file, like unzOpen, but provide a set of file low level API
for read/write the zip file (see ioapi.h) for read/write the zip file (see ioapi.h)
*/ */
extern int ZEXPORT unzClose (unzFile file); extern int ZEXPORT unzClose (unzFile file);
/* /*
Close a ZipFile opened with unzipOpen. Close a ZipFile opened with unzipOpen.
If there is files inside the .Zip opened with unzOpenCurrentFile (see later), If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
these files MUST be closed with unzipCloseCurrentFile before call unzipClose. these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
return UNZ_OK if there is no problem. */ return UNZ_OK if there is no problem. */
extern int ZEXPORT unzGetGlobalInfo (unzFile file, extern int ZEXPORT unzGetGlobalInfo (unzFile file,
unz_global_info *pglobal_info); unz_global_info *pglobal_info);
/* /*
Write info about the ZipFile in the *pglobal_info structure. Write info about the ZipFile in the *pglobal_info structure.
No preparation of the structure is needed No preparation of the structure is needed
return UNZ_OK if there is no problem. */ return UNZ_OK if there is no problem. */
extern int ZEXPORT unzGetGlobalComment (unzFile file, extern int ZEXPORT unzGetGlobalComment (unzFile file,
char *szComment, char *szComment,
uLong uSizeBuf); uLong uSizeBuf);
/* /*
Get the global comment string of the ZipFile, in the szComment buffer. Get the global comment string of the ZipFile, in the szComment buffer.
uSizeBuf is the size of the szComment buffer. uSizeBuf is the size of the szComment buffer.
return the number of byte copied or an error code <0 return the number of byte copied or an error code <0
*/ */
/***************************************************************************/ /***************************************************************************/
/* Unzip package allow you browse the directory of the zipfile */ /* Unzip package allow you browse the directory of the zipfile */
extern int ZEXPORT unzGoToFirstFile (unzFile file); extern int ZEXPORT unzGoToFirstFile (unzFile file);
/* /*
Set the current file of the zipfile to the first file. Set the current file of the zipfile to the first file.
return UNZ_OK if there is no problem return UNZ_OK if there is no problem
*/ */
extern int ZEXPORT unzGoToNextFile (unzFile file); extern int ZEXPORT unzGoToNextFile (unzFile file);
/* /*
Set the current file of the zipfile to the next file. Set the current file of the zipfile to the next file.
return UNZ_OK if there is no problem return UNZ_OK if there is no problem
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
*/ */
extern int ZEXPORT unzLocateFile (unzFile file, extern int ZEXPORT unzLocateFile (unzFile file,
const char *szFileName, const char *szFileName,
int iCaseSensitivity); int iCaseSensitivity);
/* /*
Try locate the file szFileName in the zipfile. Try locate the file szFileName in the zipfile.
For the iCaseSensitivity signification, see unzStringFileNameCompare For the iCaseSensitivity signification, see unzStringFileNameCompare
return value : return value :
UNZ_OK if the file is found. It becomes the current file. UNZ_OK if the file is found. It becomes the current file.
UNZ_END_OF_LIST_OF_FILE if the file is not found UNZ_END_OF_LIST_OF_FILE if the file is not found
*/ */
/* ****************************************** */ /* ****************************************** */
/* Ryan supplied functions */ /* Ryan supplied functions */
/* unz_file_info contain information about a file in the zipfile */ /* unz_file_info contain information about a file in the zipfile */
typedef struct unz_file_pos_s typedef struct unz_file_pos_s
{ {
uLong pos_in_zip_directory; /* offset in zip file directory */ uLong pos_in_zip_directory; /* offset in zip file directory */
uLong num_of_file; /* # of file */ uLong num_of_file; /* # of file */
} unz_file_pos; } unz_file_pos;
extern int ZEXPORT unzGetFilePos( extern int ZEXPORT unzGetFilePos(
unzFile file, unzFile file,
unz_file_pos* file_pos); unz_file_pos* file_pos);
extern int ZEXPORT unzGoToFilePos( extern int ZEXPORT unzGoToFilePos(
unzFile file, unzFile file,
unz_file_pos* file_pos); unz_file_pos* file_pos);
/* ****************************************** */ /* ****************************************** */
extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
unz_file_info *pfile_info, unz_file_info *pfile_info,
char *szFileName, char *szFileName,
uLong fileNameBufferSize, uLong fileNameBufferSize,
void *extraField, void *extraField,
uLong extraFieldBufferSize, uLong extraFieldBufferSize,
char *szComment, char *szComment,
uLong commentBufferSize); uLong commentBufferSize);
/* /*
Get Info about the current file Get Info about the current file
if pfile_info!=NULL, the *pfile_info structure will contain somes info about if pfile_info!=NULL, the *pfile_info structure will contain somes info about
the current file the current file
if szFileName!=NULL, the filemane string will be copied in szFileName if szFileName!=NULL, the filemane string will be copied in szFileName
(fileNameBufferSize is the size of the buffer) (fileNameBufferSize is the size of the buffer)
if extraField!=NULL, the extra field information will be copied in extraField if extraField!=NULL, the extra field information will be copied in extraField
(extraFieldBufferSize is the size of the buffer). (extraFieldBufferSize is the size of the buffer).
This is the Central-header version of the extra field This is the Central-header version of the extra field
if szComment!=NULL, the comment string of the file will be copied in szComment if szComment!=NULL, the comment string of the file will be copied in szComment
(commentBufferSize is the size of the buffer) (commentBufferSize is the size of the buffer)
*/ */
/***************************************************************************/ /***************************************************************************/
/* for reading the content of the current zipfile, you can open it, read data /* for reading the content of the current zipfile, you can open it, read data
from it, and close it (you can close it before reading all the file) from it, and close it (you can close it before reading all the file)
*/ */
extern int ZEXPORT unzOpenCurrentFile (unzFile file); extern int ZEXPORT unzOpenCurrentFile (unzFile file);
/* /*
Open for reading data the current file in the zipfile. Open for reading data the current file in the zipfile.
If there is no error, the return value is UNZ_OK. If there is no error, the return value is UNZ_OK.
*/ */
extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file,
const char* password); const char* password);
/* /*
Open for reading data the current file in the zipfile. Open for reading data the current file in the zipfile.
password is a crypting password password is a crypting password
If there is no error, the return value is UNZ_OK. If there is no error, the return value is UNZ_OK.
*/ */
extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, extern int ZEXPORT unzOpenCurrentFile2 (unzFile file,
int* method, int* method,
int* level, int* level,
int raw); int raw);
/* /*
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
if raw==1 if raw==1
*method will receive method of compression, *level will receive level of *method will receive method of compression, *level will receive level of
compression compression
note : you can set level parameter as NULL (if you did not want known level, note : you can set level parameter as NULL (if you did not want known level,
but you CANNOT set method parameter as NULL but you CANNOT set method parameter as NULL
*/ */
extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, extern int ZEXPORT unzOpenCurrentFile3 (unzFile file,
int* method, int* method,
int* level, int* level,
int raw, int raw,
const char* password); const char* password);
/* /*
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
if raw==1 if raw==1
*method will receive method of compression, *level will receive level of *method will receive method of compression, *level will receive level of
compression compression
note : you can set level parameter as NULL (if you did not want known level, note : you can set level parameter as NULL (if you did not want known level,
but you CANNOT set method parameter as NULL but you CANNOT set method parameter as NULL
*/ */
extern int ZEXPORT unzCloseCurrentFile (unzFile file); extern int ZEXPORT unzCloseCurrentFile (unzFile file);
/* /*
Close the file in zip opened with unzOpenCurrentFile Close the file in zip opened with unzOpenCurrentFile
Return UNZ_CRCERROR if all the file was read but the CRC is not good Return UNZ_CRCERROR if all the file was read but the CRC is not good
*/ */
extern int ZEXPORT unzReadCurrentFile (unzFile file, extern int ZEXPORT unzReadCurrentFile (unzFile file,
voidp buf, voidp buf,
unsigned len); unsigned len);
/* /*
Read bytes from the current file (opened by unzOpenCurrentFile) Read bytes from the current file (opened by unzOpenCurrentFile)
buf contain buffer where data must be copied buf contain buffer where data must be copied
len the size of buf. len the size of buf.
return the number of byte copied if somes bytes are copied return the number of byte copied if somes bytes are copied
return 0 if the end of file was reached return 0 if the end of file was reached
return <0 with error code if there is an error return <0 with error code if there is an error
(UNZ_ERRNO for IO error, or zLib error for uncompress error) (UNZ_ERRNO for IO error, or zLib error for uncompress error)
*/ */
extern z_off_t ZEXPORT unztell (unzFile file); extern z_off_t ZEXPORT unztell (unzFile file);
/* /*
Give the current position in uncompressed data Give the current position in uncompressed data
*/ */
extern int ZEXPORT unzeof (unzFile file); extern int ZEXPORT unzeof (unzFile file);
/* /*
return 1 if the end of file was reached, 0 elsewhere return 1 if the end of file was reached, 0 elsewhere
*/ */
extern int ZEXPORT unzGetLocalExtrafield (unzFile file, extern int ZEXPORT unzGetLocalExtrafield (unzFile file,
voidp buf, voidp buf,
unsigned len); unsigned len);
/* /*
Read extra field from the current file (opened by unzOpenCurrentFile) Read extra field from the current file (opened by unzOpenCurrentFile)
This is the local-header version of the extra field (sometimes, there is This is the local-header version of the extra field (sometimes, there is
more info in the local-header version than in the central-header) more info in the local-header version than in the central-header)
if buf==NULL, it return the size of the local extra field if buf==NULL, it return the size of the local extra field
if buf!=NULL, len is the size of the buffer, the extra header is copied in if buf!=NULL, len is the size of the buffer, the extra header is copied in
buf. buf.
the return value is the number of bytes copied in buf, or (if <0) the return value is the number of bytes copied in buf, or (if <0)
the error code the error code
*/ */
/***************************************************************************/ /***************************************************************************/
/* Get the current file offset */ /* Get the current file offset */
extern uLong ZEXPORT unzGetOffset (unzFile file); extern uLong ZEXPORT unzGetOffset (unzFile file);
/* Set the current file offset */ /* Set the current file offset */
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _unz_H */ #endif /* _unz_H */

View File

@ -1,199 +1,199 @@
cmake_minimum_required(VERSION 2.4.4) cmake_minimum_required(VERSION 2.4.4)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
# CMake 3.0 changed the project command, setting policy CMP0048 reverts to the old behaviour. # CMake 3.0 changed the project command, setting policy CMP0048 reverts to the old behaviour.
# See http://www.cmake.org/cmake/help/v3.0/policy/CMP0048.html # See http://www.cmake.org/cmake/help/v3.0/policy/CMP0048.html
cmake_policy(PUSH) cmake_policy(PUSH)
if(CMAKE_MAJOR_VERSION GREATER 2) if(CMAKE_MAJOR_VERSION GREATER 2)
cmake_policy(SET CMP0048 OLD) cmake_policy(SET CMP0048 OLD)
endif() endif()
project(zlib C) project(zlib C)
cmake_policy(POP) cmake_policy(POP)
set(VERSION "1.2.8") set(VERSION "1.2.8")
option(ASM686 "Enable building i686 assembly implementation for zlib") option(ASM686 "Enable building i686 assembly implementation for zlib")
option(AMD64 "Enable building amd64 assembly implementation for zlib") option(AMD64 "Enable building amd64 assembly implementation for zlib")
#set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") #set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
#set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") #set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
#set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") #set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
#set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages") #set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
#set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") #set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
include(CheckTypeSize) include(CheckTypeSize)
include(CheckFunctionExists) include(CheckFunctionExists)
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
enable_testing() enable_testing()
check_include_file(sys/types.h HAVE_SYS_TYPES_H) check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H) check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H) check_include_file(stddef.h HAVE_STDDEF_H)
# #
# Check to see if we have large file support # Check to see if we have large file support
# #
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1) set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
# We add these other definitions here because CheckTypeSize.cmake # We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want # in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x. # compatibility with CMake 2.4.x.
if(HAVE_SYS_TYPES_H) if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H) list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif() endif()
if(HAVE_STDINT_H) if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H) list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif() endif()
if(HAVE_STDDEF_H) if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H) list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif() endif()
check_type_size(off64_t OFF64_T) check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T) if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1) add_definitions(-D_LARGEFILE64_SOURCE=1)
endif() endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
# #
# Check for fseeko # Check for fseeko
# #
check_function_exists(fseeko HAVE_FSEEKO) check_function_exists(fseeko HAVE_FSEEKO)
if(NOT HAVE_FSEEKO) if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO) add_definitions(-DNO_FSEEKO)
endif() endif()
# #
# Check for unistd.h # Check for unistd.h
# #
check_include_file(unistd.h Z_HAVE_UNISTD_H) check_include_file(unistd.h Z_HAVE_UNISTD_H)
if(MSVC) if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d") set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE) add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# If we're doing an out of source build and the user has a zconf.h # If we're doing an out of source build and the user has a zconf.h
# in their source tree... # in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
message(STATUS "Renaming") message(STATUS "Renaming")
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h") message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
message(STATUS "to 'zconf.h.included' because this file is included with zlib") message(STATUS "to 'zconf.h.included' because this file is included with zlib")
message(STATUS "but CMake generates it automatically in the build directory.") message(STATUS "but CMake generates it automatically in the build directory.")
file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included) file(RENAME ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.included)
endif() endif()
endif() endif()
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc) set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${ZLIB_PC} @ONLY) ${ZLIB_PC} @ONLY)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
#============================================================================ #============================================================================
# zlib # zlib
#============================================================================ #============================================================================
set(ZLIB_PUBLIC_HDRS set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf.h ${CMAKE_CURRENT_BINARY_DIR}/zconf.h
zlib.h zlib.h
) )
set(ZLIB_PRIVATE_HDRS set(ZLIB_PRIVATE_HDRS
crc32.h crc32.h
deflate.h deflate.h
gzguts.h gzguts.h
inffast.h inffast.h
inffixed.h inffixed.h
inflate.h inflate.h
inftrees.h inftrees.h
trees.h trees.h
zutil.h zutil.h
) )
set(ZLIB_SRCS set(ZLIB_SRCS
adler32.c adler32.c
compress.c compress.c
crc32.c crc32.c
deflate.c deflate.c
gzclose.c gzclose.c
gzlib.c gzlib.c
gzread.c gzread.c
gzwrite.c gzwrite.c
inflate.c inflate.c
infback.c infback.c
inftrees.c inftrees.c
inffast.c inffast.c
trees.c trees.c
uncompr.c uncompr.c
zutil.c zutil.c
) )
if(NOT MINGW) if(NOT MINGW)
set(ZLIB_DLL_SRCS set(ZLIB_DLL_SRCS
win32/zlib1.rc # If present will override custom build rule below. win32/zlib1.rc # If present will override custom build rule below.
) )
endif() endif()
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
if(ASM686) if(ASM686)
set(ZLIB_ASMS contrib/asm686/match.S) set(ZLIB_ASMS contrib/asm686/match.S)
elseif (AMD64) elseif (AMD64)
set(ZLIB_ASMS contrib/amd64/amd64-match.S) set(ZLIB_ASMS contrib/amd64/amd64-match.S)
endif () endif ()
if(ZLIB_ASMS) if(ZLIB_ASMS)
add_definitions(-DASMV) add_definitions(-DASMV)
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
endif() endif()
endif() endif()
if(MSVC) if(MSVC)
if(ASM686) if(ASM686)
ENABLE_LANGUAGE(ASM_MASM) ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS set(ZLIB_ASMS
contrib/masmx86/inffas32.asm contrib/masmx86/inffas32.asm
contrib/masmx86/match686.asm contrib/masmx86/match686.asm
) )
elseif (AMD64) elseif (AMD64)
ENABLE_LANGUAGE(ASM_MASM) ENABLE_LANGUAGE(ASM_MASM)
set(ZLIB_ASMS set(ZLIB_ASMS
contrib/masmx64/gvmat64.asm contrib/masmx64/gvmat64.asm
contrib/masmx64/inffasx64.asm contrib/masmx64/inffasx64.asm
) )
endif() endif()
if(ZLIB_ASMS) if(ZLIB_ASMS)
add_definitions(-DASMV -DASMINF) add_definitions(-DASMV -DASMINF)
endif() endif()
endif() endif()
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
if(MINGW) if(MINGW)
# This gets us DLL resource information when compiling on MinGW. # This gets us DLL resource information when compiling on MinGW.
if(NOT CMAKE_RC_COMPILER) if(NOT CMAKE_RC_COMPILER)
set(CMAKE_RC_COMPILER windres.exe) set(CMAKE_RC_COMPILER windres.exe)
endif() endif()
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
COMMAND ${CMAKE_RC_COMPILER} COMMAND ${CMAKE_RC_COMPILER}
-D GCC_WINDRES -D GCC_WINDRES
-I ${CMAKE_CURRENT_SOURCE_DIR} -I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${CMAKE_CURRENT_BINARY_DIR} -I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW) endif(MINGW)
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
INSTALL( TARGETS zlibstatic INSTALL( TARGETS zlibstatic
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR} RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
COMPONENT ${LIBASSIMP_COMPONENT}) COMPONENT ${LIBASSIMP_COMPONENT})

View File

@ -1,11 +1,11 @@
This is a heavily modified and shrinked version of zlib 1.2.3 This is a heavily modified and shrinked version of zlib 1.2.3
- Removed comments from zlib.h - Removed comments from zlib.h
- Removed gzip/zip archive I/O - Removed gzip/zip archive I/O
- Removed infback.c - Removed infback.c
- Added Assimp #idefs to exclude it if not needed - Added Assimp #idefs to exclude it if not needed
- Disabled debug macros in zutil.h - Disabled debug macros in zutil.h
Assimp itself does not use the compression part yet, so Assimp itself does not use the compression part yet, so
it needn't be compiled (trees.c, deflate.c, compress.c). it needn't be compiled (trees.c, deflate.c, compress.c).
Currently these units are just used by assimp_cmd. Currently these units are just used by assimp_cmd.

View File

@ -1,40 +1,40 @@
/* /*
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team Copyright (c) 2006-2012, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following with or without modification, are permitted provided that the following
conditions are met: conditions are met:
* Redistributions of source code must retain the above * Redistributions of source code must retain the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer. following disclaimer.
* Redistributions in binary form must reproduce the above * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other following disclaimer in the documentation and/or other
materials provided with the distribution. materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its * Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products contributors may be used to endorse or promote products
derived from this software without specific prior derived from this software without specific prior
written permission of the assimp team. written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 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, 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, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,22 @@
// =============================================================================== // ===============================================================================
// May be included multiple times - resets structure packing to the defaults // May be included multiple times - resets structure packing to the defaults
// for all supported compilers. Reverts the changes made by #include <pushpack1.h> // for all supported compilers. Reverts the changes made by #include <pushpack1.h>
// //
// Currently this works on the following compilers: // Currently this works on the following compilers:
// MSVC 7,8,9 // MSVC 7,8,9
// GCC // GCC
// BORLAND (complains about 'pack state changed but not reverted', but works) // BORLAND (complains about 'pack state changed but not reverted', but works)
// =============================================================================== // ===============================================================================
#ifndef AI_PUSHPACK_IS_DEFINED #ifndef AI_PUSHPACK_IS_DEFINED
# error pushpack1.h must be included after poppack1.h # error pushpack1.h must be included after poppack1.h
#endif #endif
// reset packing to the original value // reset packing to the original value
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
# pragma pack( pop ) # pragma pack( pop )
#endif #endif
#undef PACK_STRUCT #undef PACK_STRUCT
#undef AI_PUSHPACK_IS_DEFINED #undef AI_PUSHPACK_IS_DEFINED

File diff suppressed because it is too large Load Diff

View File

@ -1,92 +1,92 @@
/* /*
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team Copyright (c) 2006-2012, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the with or without modification, are permitted provided that the
following conditions are met: following conditions are met:
* Redistributions of source code must retain the above * Redistributions of source code must retain the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer. following disclaimer.
* Redistributions in binary form must reproduce the above * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other following disclaimer in the documentation and/or other
materials provided with the distribution. materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its * Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products contributors may be used to endorse or promote products
derived from this software without specific prior derived from this software without specific prior
written permission of the assimp team. written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 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, 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, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------- ----------------------------------------------------------------------
*/ */
/** @file Android implementation of IOSystem using the standard C file functions. /** @file Android implementation of IOSystem using the standard C file functions.
* Aimed to ease the acces to android assets */ * Aimed to ease the acces to android assets */
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) #if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
#ifndef AI_ANDROIDJNIIOSYSTEM_H_INC #ifndef AI_ANDROIDJNIIOSYSTEM_H_INC
#define AI_ANDROIDJNIIOSYSTEM_H_INC #define AI_ANDROIDJNIIOSYSTEM_H_INC
#include "../code/DefaultIOSystem.h" #include "../code/DefaultIOSystem.h"
#include <android/asset_manager.h> #include <android/asset_manager.h>
#include <android/asset_manager_jni.h> #include <android/asset_manager_jni.h>
#include <android/native_activity.h> #include <android/native_activity.h>
namespace Assimp { namespace Assimp {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** Android extension to DefaultIOSystem using the standard C file functions */ /** Android extension to DefaultIOSystem using the standard C file functions */
class AndroidJNIIOSystem : public DefaultIOSystem class AndroidJNIIOSystem : public DefaultIOSystem
{ {
public: public:
/** Initialize android activity data */ /** Initialize android activity data */
std::string mApkWorkspacePath; std::string mApkWorkspacePath;
AAssetManager* mApkAssetManager; AAssetManager* mApkAssetManager;
/** Constructor. */ /** Constructor. */
AndroidJNIIOSystem(ANativeActivity* activity); AndroidJNIIOSystem(ANativeActivity* activity);
/** Destructor. */ /** Destructor. */
~AndroidJNIIOSystem(); ~AndroidJNIIOSystem();
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Tests for the existence of a file at the given path. */ /** Tests for the existence of a file at the given path. */
bool Exists( const char* pFile) const; bool Exists( const char* pFile) const;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** Opens a file at the given path, with given mode */ /** Opens a file at the given path, with given mode */
IOStream* Open( const char* strFile, const char* strMode); IOStream* Open( const char* strFile, const char* strMode);
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Inits Android extractor // Inits Android extractor
void AndroidActivityInit(ANativeActivity* activity); void AndroidActivityInit(ANativeActivity* activity);
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Extracts android asset // Extracts android asset
bool AndroidExtractAsset(std::string name); bool AndroidExtractAsset(std::string name);
}; };
} //!ns Assimp } //!ns Assimp
#endif //AI_ANDROIDJNIIOSYSTEM_H_INC #endif //AI_ANDROIDJNIIOSYSTEM_H_INC
#endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) #endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)

View File

@ -1,16 +1,16 @@
How to build the Assimp installer using Inno Setup How to build the Assimp installer using Inno Setup
1) Get MS VC 2008 SP1 redist packages for x86 and amd64 and copy 'em right here. 1) Get MS VC 2008 SP1 redist packages for x86 and amd64 and copy 'em right here.
vcredist_x86.exe vcredist_x86.exe
vcredist_x64.exe vcredist_x64.exe
2) Get D3DCompiler_NN.dll and D3DX9_NN.dll from a) your system32 folder and b) your SysWOW64 folder. Copy all 4 here. Rename the 64 bit files to <originalname>_x64.dll. NN is the D3DX version targeted by your DX SDK. If it is not 42, you need to update the Inno setup script (script.iss) as well. If you don't have a 64 bit Windows, get the DLLs from somebody else. Please don't ask google because many DLL downloads are infected. 2) Get D3DCompiler_NN.dll and D3DX9_NN.dll from a) your system32 folder and b) your SysWOW64 folder. Copy all 4 here. Rename the 64 bit files to <originalname>_x64.dll. NN is the D3DX version targeted by your DX SDK. If it is not 42, you need to update the Inno setup script (script.iss) as well. If you don't have a 64 bit Windows, get the DLLs from somebody else. Please don't ask google because many DLL downloads are infected.
3) Build assimp, assimpcmd and assimpview for the 'release-dll' target and both the Win32 and x64 architectures. 3) Build assimp, assimpcmd and assimpview for the 'release-dll' target and both the Win32 and x64 architectures.
4) Get Inno Setup 4) Get Inno Setup
5) Compile, output is written to the 'out' folder. 5) Compile, output is written to the 'out' folder.

View File

@ -1,23 +1,23 @@
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
Open Asset Import Library (Assimp) SDK Installer Open Asset Import Library (Assimp) SDK Installer
Release Notes Release Notes
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
http://assimp.sf.net http://assimp.sf.net
Troubleshooting Troubleshooting
=============== ===============
1. Missing d3dx9_(some-number).dll? 1. Missing d3dx9_(some-number).dll?
Install the latest DirectX runtime or grab the file from somewhere (that's evil but mostly fine). Install the latest DirectX runtime or grab the file from somewhere (that's evil but mostly fine).
2. Application configuration not correct / missing msvcr***.dll? 2. Application configuration not correct / missing msvcr***.dll?
Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system) Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
3. assimp.exe not in PATH 3. assimp.exe not in PATH
Add it to PATH. That's not a bug, the installer does not alter the PATH. Add it to PATH. That's not a bug, the installer does not alter the PATH.
4. Crashes immediately 4. Crashes immediately
You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry. You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry.

View File

@ -1,32 +1,32 @@
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
Open Asset Import Library (Assimp) Viewer Installer Open Asset Import Library (Assimp) Viewer Installer
Release Notes Release Notes
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
http://assimp.sf.net http://assimp.sf.net
Known Bugs & Limitations Known Bugs & Limitations
======================== ========================
Viewer Viewer
- Normals appear flipped from time to time when either of the normals-related menu items was hit. - Normals appear flipped from time to time when either of the normals-related menu items was hit.
- Alpha-sorting is implemented, but still causes artifacts when models are moved quickly. - Alpha-sorting is implemented, but still causes artifacts when models are moved quickly.
- Several important texture file formats (such as GIF) are not supported. - Several important texture file formats (such as GIF) are not supported.
- HUD is blurred on the right side. ATI/AMD hardware only. - HUD is blurred on the right side. ATI/AMD hardware only.
Troubleshooting Troubleshooting
=============== ===============
1. Missing d3dx9_(number).dll? 1. Missing d3dx9_(number).dll?
Install the latest DirectX runtime or grab the file from somewhere (that's evil but mostly fine). Install the latest DirectX runtime or grab the file from somewhere (that's evil but mostly fine).
2. Application configuration not correct / missing msvcr***.dll? 2. Application configuration not correct / missing msvcr***.dll?
Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system) Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
3. assimp.exe not in PATH 3. assimp.exe not in PATH
Add it to PATH. That's not a bug, the installer does not alter the PATH. Add it to PATH. That's not a bug, the installer does not alter the PATH.
4. Crashes immediately 4. Crashes immediately
You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry. You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry.

View File

@ -1,29 +1,29 @@
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
Open Asset Import Library (Assimp) Tools/Binaries for Windows Open Asset Import Library (Assimp) Tools/Binaries for Windows
Release Notes Release Notes
------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------
Known Bugs & Limitations Known Bugs & Limitations
======================== ========================
Viewer Viewer
- For files more than one embedded texture, only the first is loaded. - For files more than one embedded texture, only the first is loaded.
- Normals appear flipped from time to time when either of the normals-related menu items was hit. - Normals appear flipped from time to time when either of the normals-related menu items was hit.
- Alpha-sorting is implemented, but still causes artifacts when models are moved quickly. - Alpha-sorting is implemented, but still causes artifacts when models are moved quickly.
- Several important texture file formats (such as GIF) are not supported. - Several important texture file formats (such as GIF) are not supported.
- HUD is blurred on the right side. ATI/AMD hardware only. - HUD is blurred on the right side. ATI/AMD hardware only.
Troubleshooting Troubleshooting
=============== ===============
1. Missing d3dx9_42.dll? 1. Missing d3dx9_42.dll?
Install the latest DirectX runtime or grab the file from somewhere (that's evil but mostly fine). Install the latest DirectX runtime or grab the file from somewhere (that's evil but mostly fine).
2. Application configuration not correct / missing msv*** DLLs? 2. Application configuration not correct / missing msv*** DLLs?
(Re)install Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system) (Re)install Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
3. Crashes immediately 3. Crashes immediately
You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry. You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry.

View File

@ -1,175 +1,175 @@
/* /*
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Open Asset Import Library (assimp) Open Asset Import Library (assimp)
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team Copyright (c) 2006-2012, assimp team
All rights reserved. All rights reserved.
Redistribution and use of this software in source and binary forms, Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following with or without modification, are permitted provided that the following
conditions are met: conditions are met:
* Redistributions of source code must retain the above * Redistributions of source code must retain the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer. following disclaimer.
* Redistributions in binary form must reproduce the above * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other following disclaimer in the documentation and/or other
materials provided with the distribution. materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its * Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products contributors may be used to endorse or promote products
derived from this software without specific prior derived from this software without specific prior
written permission of the assimp team. written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 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, 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, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
*/ */
/** @file Android extension of DefaultIOSystem using the standard C file functions */ /** @file Android extension of DefaultIOSystem using the standard C file functions */
#include <assimp/config.h> #include <assimp/config.h>
#include <android/api-level.h> #include <android/api-level.h>
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) #if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
#include <stdlib.h> #include <stdlib.h>
#include <android/log.h> #include <android/log.h>
#include <android/asset_manager.h> #include <android/asset_manager.h>
#include <android/asset_manager_jni.h> #include <android/asset_manager_jni.h>
#include <android/native_activity.h> #include <android/native_activity.h>
#include <assimp/ai_assert.h> #include <assimp/ai_assert.h>
#include <assimp/port/AndroidJNI/AndroidJNIIOSystem.h> #include <assimp/port/AndroidJNI/AndroidJNIIOSystem.h>
#include <code/DefaultIOStream.h> #include <code/DefaultIOStream.h>
#include <fstream> #include <fstream>
using namespace Assimp; using namespace Assimp;
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Constructor. // Constructor.
AndroidJNIIOSystem::AndroidJNIIOSystem(ANativeActivity* activity) AndroidJNIIOSystem::AndroidJNIIOSystem(ANativeActivity* activity)
{ {
AndroidActivityInit(activity); AndroidActivityInit(activity);
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Destructor. // Destructor.
AndroidJNIIOSystem::~AndroidJNIIOSystem() AndroidJNIIOSystem::~AndroidJNIIOSystem()
{ {
// nothing to do here // nothing to do here
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Tests for the existence of a file at the given path. // Tests for the existence of a file at the given path.
bool AndroidJNIIOSystem::Exists( const char* pFile) const bool AndroidJNIIOSystem::Exists( const char* pFile) const
{ {
AAsset* asset = AAssetManager_open(mApkAssetManager, pFile, AAsset* asset = AAssetManager_open(mApkAssetManager, pFile,
AASSET_MODE_UNKNOWN); AASSET_MODE_UNKNOWN);
FILE* file = ::fopen( (mApkWorkspacePath + getOsSeparator() + std::string(pFile)).c_str(), "rb"); FILE* file = ::fopen( (mApkWorkspacePath + getOsSeparator() + std::string(pFile)).c_str(), "rb");
if (!asset && !file) if (!asset && !file)
{ {
__android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset manager can not find: %s", pFile); __android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset manager can not find: %s", pFile);
return false; return false;
} }
__android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset exists"); __android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset exists");
if (file) if (file)
::fclose( file); ::fclose( file);
return true; return true;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Inits Android extractor // Inits Android extractor
void AndroidJNIIOSystem::AndroidActivityInit(ANativeActivity* activity) void AndroidJNIIOSystem::AndroidActivityInit(ANativeActivity* activity)
{ {
mApkWorkspacePath = activity->internalDataPath; mApkWorkspacePath = activity->internalDataPath;
mApkAssetManager = activity->assetManager; mApkAssetManager = activity->assetManager;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Extracts android asset // Extracts android asset
bool AndroidJNIIOSystem::AndroidExtractAsset(std::string name) bool AndroidJNIIOSystem::AndroidExtractAsset(std::string name)
{ {
std::string newPath = mApkWorkspacePath + getOsSeparator() + name; std::string newPath = mApkWorkspacePath + getOsSeparator() + name;
DefaultIOSystem io; DefaultIOSystem io;
// Do not extract if extracted already // Do not extract if extracted already
if ( io.Exists(newPath.c_str()) ) { if ( io.Exists(newPath.c_str()) ) {
__android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset already extracted"); __android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset already extracted");
return true; return true;
} }
// Open file // Open file
AAsset* asset = AAssetManager_open(mApkAssetManager, name.c_str(), AAsset* asset = AAssetManager_open(mApkAssetManager, name.c_str(),
AASSET_MODE_UNKNOWN); AASSET_MODE_UNKNOWN);
std::vector<char> assetContent; std::vector<char> assetContent;
if (asset != NULL) { if (asset != NULL) {
// Find size // Find size
off_t assetSize = AAsset_getLength(asset); off_t assetSize = AAsset_getLength(asset);
// Prepare input buffer // Prepare input buffer
assetContent.resize(assetSize); assetContent.resize(assetSize);
// Store input buffer // Store input buffer
AAsset_read(asset, &assetContent[0], assetSize); AAsset_read(asset, &assetContent[0], assetSize);
// Close // Close
AAsset_close(asset); AAsset_close(asset);
// Prepare output buffer // Prepare output buffer
std::ofstream assetExtracted(newPath.c_str(), std::ofstream assetExtracted(newPath.c_str(),
std::ios::out | std::ios::binary); std::ios::out | std::ios::binary);
if (!assetExtracted) { if (!assetExtracted) {
__android_log_print(ANDROID_LOG_ERROR, "assimp", __android_log_print(ANDROID_LOG_ERROR, "assimp",
"Can not open output file"); "Can not open output file");
} }
// Write output buffer into a file // Write output buffer into a file
assetExtracted.write(&assetContent[0], assetContent.size()); assetExtracted.write(&assetContent[0], assetContent.size());
assetExtracted.close(); assetExtracted.close();
__android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset extracted"); __android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset extracted");
} else { } else {
__android_log_print(ANDROID_LOG_ERROR, "assimp", "Asset not found: %s", name.c_str()); __android_log_print(ANDROID_LOG_ERROR, "assimp", "Asset not found: %s", name.c_str());
return false; return false;
} }
return true; return true;
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Open a new file with a given path. // Open a new file with a given path.
IOStream* AndroidJNIIOSystem::Open( const char* strFile, const char* strMode) IOStream* AndroidJNIIOSystem::Open( const char* strFile, const char* strMode)
{ {
ai_assert(NULL != strFile); ai_assert(NULL != strFile);
ai_assert(NULL != strMode); ai_assert(NULL != strMode);
std::string fullPath(mApkWorkspacePath + getOsSeparator() + std::string(strFile)); std::string fullPath(mApkWorkspacePath + getOsSeparator() + std::string(strFile));
if (Exists(strFile)) if (Exists(strFile))
AndroidExtractAsset(std::string(strFile)); AndroidExtractAsset(std::string(strFile));
FILE* file = ::fopen( fullPath.c_str(), strMode); FILE* file = ::fopen( fullPath.c_str(), strMode);
if( NULL == file) if( NULL == file)
return NULL; return NULL;
__android_log_print(ANDROID_LOG_ERROR, "assimp", "AndroidIOSystem: file %s opened", fullPath.c_str()); __android_log_print(ANDROID_LOG_ERROR, "assimp", "AndroidIOSystem: file %s opened", fullPath.c_str());
return new DefaultIOStream(file, fullPath); return new DefaultIOStream(file, fullPath);
} }
#undef PATHLIMIT #undef PATHLIMIT
#endif // __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT) #endif // __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)

View File

@ -1,6 +1,6 @@
This is a set of Delphi units for using the Assimp C DLL. This was created for use with Delphi 7, but should be usable as-is or with minimal modifications with later Delphi versions. This is a set of Delphi units for using the Assimp C DLL. This was created for use with Delphi 7, but should be usable as-is or with minimal modifications with later Delphi versions.
This set of headers is enough to load and display a model with external textures. Since I'm not familiar with animated models and some of the other functionality of the assimp library, I did not convert the headers for those features. This set of headers is enough to load and display a model with external textures. Since I'm not familiar with animated models and some of the other functionality of the assimp library, I did not convert the headers for those features.
See http://sourceforge.net/tracker/?func=detail&aid=3212646&group_id=226462&atid=1067634 for the original patch See http://sourceforge.net/tracker/?func=detail&aid=3212646&group_id=226462&atid=1067634 for the original patch

View File

@ -1,26 +1,26 @@
#ifndef __ILUT_CONFIG_H__ #ifndef __ILUT_CONFIG_H__
#define __ILUT_CONFIG_H__ #define __ILUT_CONFIG_H__
#define IL_USE_PRAGMA_LIBS #define IL_USE_PRAGMA_LIBS
// Supported APIs (ILUT) // Supported APIs (ILUT)
// //
// sorry just // sorry just
// cant get this one to work under windows // cant get this one to work under windows
// have disabled for the now // have disabled for the now
// //
// will look at it some more later // will look at it some more later
// //
// Kriss // Kriss
// //
#undef ILUT_USE_ALLEGRO #undef ILUT_USE_ALLEGRO
#undef ILUT_USE_DIRECTX8 #undef ILUT_USE_DIRECTX8
//#define ILUT_USE_DIRECTX9 //#define ILUT_USE_DIRECTX9
//#define ILUT_USE_DIRECTX10 //#define ILUT_USE_DIRECTX10
#define ILUT_USE_OPENGL #define ILUT_USE_OPENGL
//#define ILUT_USE_SDL //#define ILUT_USE_SDL
#define ILUT_USE_WIN32 #define ILUT_USE_WIN32
#endif//__ILUT_CONFIG_H__ #endif//__ILUT_CONFIG_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,18 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008. Downloaded 4th November 2008.
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "

View File

@ -1,18 +1,18 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "

View File

@ -1,15 +1,15 @@
Jeep designed, modelled and skinned by me, Psionic Jeep designed, modelled and skinned by me, Psionic
FREE for use however you like, credits are appreciated!!! FREE for use however you like, credits are appreciated!!!
It was modelled in Milkshape 3D and includes the MS3D files oriented for X or B3D format (BlitzBasic 3D), its 2032 polys with a 512x512 jpg texture map. There are two skin variations plus a UV template to help out if you want to create your own skin variations. It was modelled in Milkshape 3D and includes the MS3D files oriented for X or B3D format (BlitzBasic 3D), its 2032 polys with a 512x512 jpg texture map. There are two skin variations plus a UV template to help out if you want to create your own skin variations.
I'd love to see a few screenshots of it being used in-game so feel free to stop by my site and maybe drop by my forums and show us all what your doing with it!!!!!!! I'd love to see a few screenshots of it being used in-game so feel free to stop by my site and maybe drop by my forums and show us all what your doing with it!!!!!!!
Check out more of my work at:- Check out more of my work at:-
http://xu1productions.com/3dstudio/index.html - 3D Game Resources http://xu1productions.com/3dstudio/index.html - 3D Game Resources
http://www.psionicdesign.com - My Main 2D/3D Digital Art site http://www.psionicdesign.com - My Main 2D/3D Digital Art site
Psionic 2002 Psionic 2002

View File

@ -1,18 +1,18 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "

View File

@ -1,18 +1,18 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "

View File

@ -1,12 +1,12 @@
hello! hello!
fell free to use the object...so do what U want! fell free to use the object...so do what U want!
& sent me your pictures...:-) & sent me your pictures...:-)
for commercial use, contact me! for commercial use, contact me!
http://www.elektrobar.com/lux/ http://www.elektrobar.com/lux/
or mail to: or mail to:
lux@elektrobar.com lux@elektrobar.com
have fun.....VIRLUX have fun.....VIRLUX

View File

@ -1,25 +1,25 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "
INFO INFO
==== ====
CONVERTED FROM 3DS TO ASE WITH AC3D CONVERTED FROM 3DS TO ASE WITH AC3D

View File

@ -1,24 +1,24 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "
INFO INFO
==== ====
CONVERTED FROM 3DS TO ASE WITH AC3D CONVERTED FROM 3DS TO ASE WITH AC3D

View File

@ -1,51 +1,51 @@
Dwarf lowpoly model Pack Dwarf lowpoly model Pack
Copyright 2004, Psionic Design Copyright 2004, Psionic Design
e-mail: psionic@blueyonder.co.uk e-mail: psionic@blueyonder.co.uk
Used with permission. Used with permission.
INSTALLATION INSTRUCTIONS: INSTALLATION INSTRUCTIONS:
To install, simply unzip to your hard drive with the "Use Folder Names" option turned on. And that's it you're ready to go! To install, simply unzip to your hard drive with the "Use Folder Names" option turned on. And that's it you're ready to go!
USAGE INFORMATION: USAGE INFORMATION:
Each zip contains the models, textures and animation info for that particular format! Each zip contains the models, textures and animation info for that particular format!
Please Read the "animationinfo.txt" file included in each zip for the exact frames of animation to use Please Read the "animationinfo.txt" file included in each zip for the exact frames of animation to use
Credits to me "Psionic" are really appreciated but are not essential ;-) Credits to me "Psionic" are really appreciated but are not essential ;-)
Any questions, screenshots of him in use etc drop by my site or email me at:- Any questions, screenshots of him in use etc drop by my site or email me at:-
website: http://www.psionic3d.co.uk website: http://www.psionic3d.co.uk
email: psionic@blueyonder.co.uk email: psionic@blueyonder.co.uk
WHAT'S INCLUDED IN THE ZIP: WHAT'S INCLUDED IN THE ZIP:
ReadMe.txt - This file ReadMe.txt - This file
b3d.zip - Blitz 3D Format models and textures b3d.zip - Blitz 3D Format models and textures
ms3d.zip - Milkshape 3D Format models and textures ms3d.zip - Milkshape 3D Format models and textures
x.zip - DarkBasic Direct X 8 Format models and textures x.zip - DarkBasic Direct X 8 Format models and textures
RESTRICTIONS: RESTRICTIONS:
This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:- This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:-
**You may not sell/re-sell this model pack or claim it as your own. **You may not sell/re-sell this model pack or claim it as your own.
***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent. ***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
Psi Psi
http://www.psionic3d.co.uk http://www.psionic3d.co.uk

View File

@ -1,11 +1,11 @@
turtle1.b3d turtle1.b3d
Copyright 2004, Psionic Design Copyright 2004, Psionic Design
e-mail: psionic@blueyonder.co.uk e-mail: psionic@blueyonder.co.uk
Used with permission. Used with permission.
RESTRICTIONS: RESTRICTIONS:
This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:- This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:-
**You may not sell/re-sell this model pack or claim it as your own. **You may not sell/re-sell this model pack or claim it as your own.
***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent. ***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.

View File

@ -1,31 +1,31 @@
---------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------
TITLE : Bob, MD5 character source file TITLE : Bob, MD5 character source file
AUTHOR : Ken Beyer (kat) AUTHOR : Ken Beyer (kat)
EMAIL ADDRESS : info@katsbits.com EMAIL ADDRESS : info@katsbits.com
HOMEPAGE URL : http://www.katsbits.com HOMEPAGE URL : http://www.katsbits.com
MODEL NAME/s MODEL NAME/s
Zip file contains *.blend source file and TGA texture assets for MD5 format testing. Zip file contains *.blend source file and TGA texture assets for MD5 format testing.
Files and media are provided "as is" without any explicit or implied warranty of fuctionality. Files and media are provided "as is" without any explicit or implied warranty of fuctionality.
DISTRIBUTION DISTRIBUTION
Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution. Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution.
Commercial use is permitted with written licensed permission. Commercial use is permitted with written licensed permission.
---------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------
Files: Files:
- Bob.md5mesh - Bob.md5mesh
- Bob.md5anim - Bob.md5anim
- Bob.blend - Bob.blend
- ./*.png - ./*.png
Changes: Changes:
- converted all tga's to png, updated .blend and .md5mesh accordingly - converted all tga's to png, updated .blend and .md5mesh accordingly
- removed absolute texture paths from the md5mesh file - removed absolute texture paths from the md5mesh file
- minor downscaling of all textures to fit in less bytes - minor downscaling of all textures to fit in less bytes

View File

@ -1,23 +1,23 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "
INFO INFO
==== ====
COnverted from 3ds to DXF with Ac3D COnverted from 3ds to DXF with Ac3D

View File

@ -1,4 +1,4 @@
Good IFC test cases Good IFC test cases
=================== ===================
http://www.iai.fzk.de/www-extern/index.php?id=1135 http://www.iai.fzk.de/www-extern/index.php?id=1135

View File

@ -1,11 +1,11 @@
This skybox is basing on a skydome texture from This skybox is basing on a skydome texture from
http://mikepan.homeip.net/earth http://mikepan.homeip.net/earth
Downloaded November 22th, 08 Downloaded November 22th, 08
Distribution note: Distribution note:
"These royalty-free skydome textures work best when applied to a sphere or hemisphere" "These royalty-free skydome textures work best when applied to a sphere or hemisphere"
Thanks for your great work! Thanks for your great work!

View File

@ -1,31 +1,31 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
"These 3d models are contributed by John Hoffman and are based on "These 3d models are contributed by John Hoffman and are based on
characters from a cartoon show called "Jayce and the wheel warriors" characters from a cartoon show called "Jayce and the wheel warriors"
(except the marauder) John's site: http://www3.sympatico.ca/john.hoffman" (except the marauder) John's site: http://www3.sympatico.ca/john.hoffman"
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "
INFO INFO
==== ====
These files belong to the QuickDraw model in the LWS folder - they are referenced These files belong to the QuickDraw model in the LWS folder - they are referenced
and loaded into the LWS scene. and loaded into the LWS scene.

View File

@ -1,24 +1,24 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "
INFO INFO
==== ====
CONVERTED FROM 3DS TO LWO2 WITH AC3D CONVERTED FROM 3DS TO LWO2 WITH AC3D

View File

@ -1,15 +1,15 @@
From http://telias.free.fr From http://telias.free.fr
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, lightwave and md2 format. Also a great collection of textures to use in your favorite modelling and rendering program. Free the models is a site that offers free 3d models in 3ds, bryce, poser, lightwave and md2 format. Also a great collection of textures to use in your favorite modelling and rendering program.
All the content is free for any use. All the content is free for any use.
In the future more 3d formats will be added and some other sections such as wallpapers, 3d screensavers, 3d coding source code and tutorials. In the future more 3d formats will be added and some other sections such as wallpapers, 3d screensavers, 3d coding source code and tutorials.
" "
CHANGES: CHANGES:
Paths have been modified Paths have been modified

View File

@ -1,18 +1,18 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notice found on the page: Notice found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "

View File

@ -1,26 +1,26 @@
------------------------------------------------------------------------- -------------------------------------------------------------------------
TITLE : kt_kubalwagon TITLE : kt_kubalwagon
AUTHOR : ken 'kat' beyer AUTHOR : ken 'kat' beyer
EMAIL ADDRESS : cpdt@telinco.co.uk EMAIL ADDRESS : cpdt@telinco.co.uk
HOMEPAGE URL : http://www.quake3bits.co.uk HOMEPAGE URL : http://www.quake3bits.co.uk
NUMBER OF MODELS : 1 NUMBER OF MODELS : 1
SHADER SCRIPTS : yes - included SHADER SCRIPTS : yes - included
------------------ ------------------
* MODEL NAME/s * * MODEL NAME/s *
[model details below] [model details below]
european_fnt_v2.md3 european_fnt_v2.md3
euro_rnt_2.tga (alpha'd steering wheel) euro_rnt_2.tga (alpha'd steering wheel)
european_fnt.tga european_fnt.tga
------------------ ------------------
CREDITS CREDITS
ID software, eskimo roll, EMSIPE, QkenneyQ ID software, eskimo roll, EMSIPE, QkenneyQ
DISTRIBUTION DISTRIBUTION
as long as this readme is included...! as long as this readme is included...!
-------------------------------------------------------------------------- --------------------------------------------------------------------------

View File

@ -1,26 +1,26 @@
------------------------------------------------------------------------- -------------------------------------------------------------------------
TITLE : kt_watercan TITLE : kt_watercan
AUTHOR : ken 'kat' beyer AUTHOR : ken 'kat' beyer
EMAIL ADDRESS : cpdt@telinco.co.uk EMAIL ADDRESS : cpdt@telinco.co.uk
HOMEPAGE URL : http://www.quake3bits.co.uk HOMEPAGE URL : http://www.quake3bits.co.uk
NUMBER OF MODELS : 2 NUMBER OF MODELS : 2
SHADER SCRIPTS : n/a SHADER SCRIPTS : n/a
------------------ ------------------
* MODEL NAME/s * * MODEL NAME/s *
[model details below] [model details below]
watercan.md3 watercan.md3
watercan_dmg.md3 (dmg='damaged') watercan_dmg.md3 (dmg='damaged')
water_can.tga 256x128 water_can.tga 256x128
------------------ ------------------
CREDITS CREDITS
ID software, eskimo roll, EMSIPE, QkenneyQ ID software, eskimo roll, EMSIPE, QkenneyQ
DISTRIBUTION DISTRIBUTION
as long as this readme is included...! as long as this readme is included...!
-------------------------------------------------------------------------- --------------------------------------------------------------------------

View File

@ -1,8 +1,8 @@
License: Creative Commons License: Creative Commons
- Remix - Remix
- Share alike - Share alike
- Attribution Author: zphr (Christian Lenke) - Attribution Author: zphr (Christian Lenke)

View File

@ -1,31 +1,31 @@
---------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------
TITLE : Bob, MD5 character source file TITLE : Bob, MD5 character source file
AUTHOR : Ken Beyer (kat) AUTHOR : Ken Beyer (kat)
EMAIL ADDRESS : info@katsbits.com EMAIL ADDRESS : info@katsbits.com
HOMEPAGE URL : http://www.katsbits.com HOMEPAGE URL : http://www.katsbits.com
MODEL NAME/s MODEL NAME/s
Zip file contains *.blend source file and TGA texture assets for MD5 format testing. Zip file contains *.blend source file and TGA texture assets for MD5 format testing.
Files and media are provided "as is" without any explicit or implied warranty of fuctionality. Files and media are provided "as is" without any explicit or implied warranty of fuctionality.
DISTRIBUTION DISTRIBUTION
Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution. Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution.
Commercial use is permitted with written licensed permission. Commercial use is permitted with written licensed permission.
---------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------
Files: Files:
- Bob.md5mesh - Bob.md5mesh
- Bob.md5anim - Bob.md5anim
- Bob.blend - Bob.blend
- ./*.png - ./*.png
Changes: Changes:
- converted all tga's to png, updated .blend and .md5mesh accordingly - converted all tga's to png, updated .blend and .md5mesh accordingly
- removed absolute texture paths from the md5mesh file - removed absolute texture paths from the md5mesh file
- minor downscaling of all textures to fit in less bytes - minor downscaling of all textures to fit in less bytes

View File

@ -1,73 +1,73 @@
Title : G.I.Joe Skins Title : G.I.Joe Skins
Filename : joemodel.zip Filename : joemodel.zip
Version : 1 Version : 1
Date : 11/05/97 Date : 11/05/97
Author : Kenneth Whelan Author : Kenneth Whelan
Email : JWHELAN@pop.prodigy.net Email : JWHELAN@pop.prodigy.net
Credits : id software, Larry Hama, Steven Polge, and Rene Post for making Quake ME Credits : id software, Larry Hama, Steven Polge, and Rene Post for making Quake ME
Build time: ??? Time??? Build time: ??? Time???
Type of Mod Type of Mod
----------- -----------
Quake C : no Quake C : no
Sound : no Sound : no
MDL : Yes MDL : Yes
Format of QuakeC (if a Quake C Mod) Format of QuakeC (if a Quake C Mod)
----------------------------------- -----------------------------------
unified diff : no unified diff : no
context diff : no context diff : no
.qc files : no .qc files : no
progs.dat : no progs.dat : no
Description of the Modification Description of the Modification
------------------------------- -------------------------------
This is a new player.mdl for quake. It's main use is for bots. The Skins are Snake Eyes v4, Duke v3, Low-Light, This is a new player.mdl for quake. It's main use is for bots. The Skins are Snake Eyes v4, Duke v3, Low-Light,
Storm Shadow v2, Shockwave, Repeater, Gung-Ho, Shipwreck, Dusty v3, and Storm Shadow v2, Shockwave, Repeater, Gung-Ho, Shipwreck, Dusty v3, and
Tunnel Rat v2. Tunnel Rat v2.
Known bugs Known bugs
None that I know of. None that I know of.
How to Install the Modification How to Install the Modification
------------------------------- -------------------------------
First back up the current player.mdl(copy player.mdl player.bak). Just put First back up the current player.mdl(copy player.mdl player.bak). Just put
it in the progs dir in the hack your using, if any. it in the progs dir in the hack your using, if any.
Technical Details Technical Details
----------------- -----------------
can't think of any can't think of any
Author Information Author Information
------------------ ------------------
This is my first publicly distributed quake graphic change. This is my first publicly distributed quake graphic change.
I did it to get away from the stress of school. I did it to get away from the stress of school.
Copyright and Distribution Permissions Copyright and Distribution Permissions
-------------------------------------- --------------------------------------
You may distribute this Quake modification in any electronic format as long as You may distribute this Quake modification in any electronic format as long as
all the files in this archive remain intact and unmodified and are distributed all the files in this archive remain intact and unmodified and are distributed
together. together.
Availability Availability
------------ ------------
This modification is available from the following places: This modification is available from the following places:
http://www.yojoe.com/ http://www.yojoe.com/

View File

@ -1,33 +1,33 @@
Stegosaur Model Stegosaur Model
from the Free Models Project from the Free Models Project
www.oz.net/~simitar/model.html www.oz.net/~simitar/model.html
June 3, 1997 June 3, 1997
created by Sirius (Dillon Aumiller) created by Sirius (Dillon Aumiller)
E-mail: sirius25@hotmail.com E-mail: sirius25@hotmail.com
June 5, 1997 June 5, 1997
modified by The Serpent Lord (Seth Galbraith) modified by The Serpent Lord (Seth Galbraith)
E-mail: sgalbrai@linknet.kitsap.lib.wa.us E-mail: sgalbrai@linknet.kitsap.lib.wa.us
WWW: www.oz.net/~simitar WWW: www.oz.net/~simitar
This model can be used or modified for any purpose This model can be used or modified for any purpose
as long as this text document is included with it as long as this text document is included with it
and all modellers listed in this document are and all modellers listed in this document are
listed wherever credits are appropriate for that listed wherever credits are appropriate for that
purpose. purpose.
Help Wanted: Help Wanted:
The Free Models Project can use help with The Free Models Project can use help with
models and in other areas, such as legal boilerplate models and in other areas, such as legal boilerplate
for models. for models.
WWW: www.oz.net/~simitar/model.html WWW: www.oz.net/~simitar/model.html
E-mail: sgalbrai@linknet.kitsap.lib.wa.us E-mail: sgalbrai@linknet.kitsap.lib.wa.us

View File

@ -1,33 +1,33 @@
+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+) +)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)
teckmechbot animated .mdl teckmechbot animated .mdl
This model was created for the FMP, because I believe This model was created for the FMP, because I believe
that the FMP is a great concept !! that the FMP is a great concept !!
There is some movement in the model. There is some movement in the model.
The legs can be animated for walking, stomping, or running The legs can be animated for walking, stomping, or running
around ! around !
Ok, it's my first model, so I will work on less polygony Ok, it's my first model, so I will work on less polygony
in the future ;-) in the future ;-)
Created By: Curiel7 Created By: Curiel7
Contact: ebuy@optelnow.net (E-MAIL) Contact: ebuy@optelnow.net (E-MAIL)
Date Created: 7/07/2000 Date Created: 7/07/2000
====================================================== ======================================================
This model can be used or modified for any purpose This model can be used or modified for any purpose
as long as this text document is included with it as long as this text document is included with it
and all modelers listed in this document are and all modelers listed in this document are
listed wherever credits are appropriate for that listed wherever credits are appropriate for that
purpose. purpose.
The Free Models Project can use your help with The Free Models Project can use your help with
game-oriented models and other areas game-oriented models and other areas
WWW: http://www.planetquake.com/simitar WWW: http://www.planetquake.com/simitar
E-mail: sgalbrai@linknet.kitsap.lib.wa.us E-mail: sgalbrai@linknet.kitsap.lib.wa.us

View File

@ -1,4 +1,4 @@
teapot.nff, home4.nff - http://www.martinreddy.net/ukvrsig/wtk.html teapot.nff, home4.nff - http://www.martinreddy.net/ukvrsig/wtk.html
cokecan.nff -www.vrupl.evl.uic.edu/Eng591_Pages/cokecan.nff cokecan.nff -www.vrupl.evl.uic.edu/Eng591_Pages/cokecan.nff
TODO: License status to be confirmed TODO: License status to be confirmed

View File

@ -1,27 +1,27 @@
===================================================================== =====================================================================
From http://telias.free.fr From http://telias.free.fr
Model copyright: Elias Tsiantas Model copyright: Elias Tsiantas
===================================================================== =====================================================================
Downloaded 4th November 2008 (Obama ftw!). Downloaded 4th November 2008 (Obama ftw!).
Notices found on the page: Notices found on the page:
" "
Free the models is a site that offers free 3d models in 3ds, bryce, poser, Free the models is a site that offers free 3d models in 3ds, bryce, poser,
lightwave and md2 format. Also a great collection of textures to use in lightwave and md2 format. Also a great collection of textures to use in
your favorite modelling and rendering program. All the content is free your favorite modelling and rendering program. All the content is free
for any use. In the future more 3d formats will be added and some other for any use. In the future more 3d formats will be added and some other
sections such as wallpapers, 3d screensavers, 3d coding source code and sections such as wallpapers, 3d screensavers, 3d coding source code and
tutorials. tutorials.
" "
" "
'Free the models' is a site dedicated to provide free content for 3d applications and 3d/game engines. The license of the content is that what you download from here is one step away from public domain. So, everything you download from here is free for any use EXCEPT it cannot be included in another free web or cd collection and it cannot be sold. Otherwise you can use it in your commercial game, 3d application or render work. You don't have to provide credit but It would be nice if you do. 'Free the models' is a site dedicated to provide free content for 3d applications and 3d/game engines. The license of the content is that what you download from here is one step away from public domain. So, everything you download from here is free for any use EXCEPT it cannot be included in another free web or cd collection and it cannot be sold. Otherwise you can use it in your commercial game, 3d application or render work. You don't have to provide credit but It would be nice if you do.
" "
INFO INFO
==== ====
Converted from 3DS to OBJ with AC3D Converted from 3DS to OBJ with AC3D

View File

@ -1,4 +1,4 @@
Obj exported from Blender Obj exported from Blender
http://toychest.in.tum.de/wiki/projects:kuka_lwr http://toychest.in.tum.de/wiki/projects:kuka_lwr
License: Creative-Commons-by-Attribution-3.0 License: Creative-Commons-by-Attribution-3.0

View File

@ -1,3 +1,3 @@
These models are not generally redistributable under the terms of Assimp's BSD license. Usually, an additional requirement on the use of the data is imposed (i.e. no commercial use, need credits, some creative commons variants, ...). These models are not generally redistributable under the terms of Assimp's BSD license. Usually, an additional requirement on the use of the data is imposed (i.e. no commercial use, need credits, some creative commons variants, ...).
So, if you re-package Assimp for use in a 'clean' OSS package, consider removing this directory. So, if you re-package Assimp for use in a 'clean' OSS package, consider removing this directory.

View File

@ -1,51 +1,51 @@
Dwarf lowpoly model Pack Dwarf lowpoly model Pack
Copyright 2004, Psionic Design Copyright 2004, Psionic Design
e-mail: psionic@blueyonder.co.uk e-mail: psionic@blueyonder.co.uk
INSTALLATION INSTRUCTIONS: INSTALLATION INSTRUCTIONS:
To install, simply unzip to your hard drive with the "Use Folder Names" option turned on. And that's it you're ready to go! To install, simply unzip to your hard drive with the "Use Folder Names" option turned on. And that's it you're ready to go!
USAGE INFORMATION: USAGE INFORMATION:
Each zip contains the models, textures and animation info for that particular format! Each zip contains the models, textures and animation info for that particular format!
Please Read the "animationinfo.txt" file included in each zip for the exact frames of animation to use Please Read the "animationinfo.txt" file included in each zip for the exact frames of animation to use
Credits to me "Psionic" are really appreciated but are not essential ;-) Credits to me "Psionic" are really appreciated but are not essential ;-)
Any questions, screenshots of him in use etc drop by my site or email me at:- Any questions, screenshots of him in use etc drop by my site or email me at:-
website: http://www.psionic3d.co.uk website: http://www.psionic3d.co.uk
email: psionic@blueyonder.co.uk email: psionic@blueyonder.co.uk
WHAT'S INCLUDED IN THE ZIP: WHAT'S INCLUDED IN THE ZIP:
ReadMe.txt - This file ReadMe.txt - This file
b3d.zip - Blitz 3D Format models and textures b3d.zip - Blitz 3D Format models and textures
ms3d.zip - Milkshape 3D Format models and textures ms3d.zip - Milkshape 3D Format models and textures
x.zip - DarkBasic Direct X 8 Format models and textures x.zip - DarkBasic Direct X 8 Format models and textures
RESTRICTIONS: RESTRICTIONS:
This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:- This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:-
**You may not sell/re-sell this model pack or claim it as your own. **You may not sell/re-sell this model pack or claim it as your own.
***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent. ***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
Psi Psi
http://www.psionic3d.co.uk http://www.psionic3d.co.uk

View File

@ -1,11 +1,11 @@
All 'mirror' files are not absolutely correct. That's mainly All 'mirror' files are not absolutely correct. That's mainly
because it's difficult convert Max' handling of mirroring to because it's difficult convert Max' handling of mirroring to
our's. our's.
In other words: TO DO, but only if someone REALLY needs it. In other words: TO DO, but only if someone REALLY needs it.
------------------------------------------------------------- -------------------------------------------------------------
To see how it should look like - test/ReferenceImages To see how it should look like - test/ReferenceImages
Note that the viewer has no 'decal' texture mapping mode, so Note that the viewer has no 'decal' texture mapping mode, so
the usual clamping is used. the usual clamping is used.

View File

@ -1,3 +1,3 @@
"MotionCaptureROM.ase" - Free for any purpose. "MotionCaptureROM.ase" - Free for any purpose.
NOTE: The errors in the middle of the animation are caused by problems during recording, it's not an importer issue. NOTE: The errors in the middle of the animation are caused by problems during recording, it's not an importer issue.

View File

@ -1,3 +1,3 @@
HUMAN.blend (c) 2010, Tobias Rittig HUMAN.blend (c) 2010, Tobias Rittig
Redistribution and reuse allowed for any purpose, credits appreciated. Redistribution and reuse allowed for any purpose, credits appreciated.

View File

@ -1,50 +1,50 @@
http://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion http://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion
ReadmeFirst.txt ReadmeFirst.txt
================ ================
READMEFIRST v1.00 last update July 20, 2008 by B. Hahne READMEFIRST v1.00 last update July 20, 2008 by B. Hahne
This READMEFIRST file accompanies the cgspeed.com "BVH conversion" This READMEFIRST file accompanies the cgspeed.com "BVH conversion"
release of the Carnegie-Mellon University (CMU) Graphics Lab Motion release of the Carnegie-Mellon University (CMU) Graphics Lab Motion
Capture Database. See "Where to find stuff" at the bottom of this Capture Database. See "Where to find stuff" at the bottom of this
file for where to get the BVH conversion and/or the original CMU file for where to get the BVH conversion and/or the original CMU
dataset. dataset.
The original CMU motion capture database isn't in BVH format - it's The original CMU motion capture database isn't in BVH format - it's
in ASF/AMC format. This BVH conversion release was created by Bruce in ASF/AMC format. This BVH conversion release was created by Bruce
Hahne, a hobbyist animator, in the interest of making the data more Hahne, a hobbyist animator, in the interest of making the data more
available and easily usable by other animators. I presently (2008) available and easily usable by other animators. I presently (2008)
maintain the web site www.cgspeed.com, where this BVH conversion maintain the web site www.cgspeed.com, where this BVH conversion
release will be available or linked. release will be available or linked.
The emphasis on this release is to produce BVH files that can rapidly The emphasis on this release is to produce BVH files that can rapidly
be used in MotionBuilder for motion retargetting. The files are not be used in MotionBuilder for motion retargetting. The files are not
yet particularly Poser-friendly or DazStudio-friendly, due to yet particularly Poser-friendly or DazStudio-friendly, due to
incorrect assumptions that those programs have to make about the incorrect assumptions that those programs have to make about the
underlying joint rotation setup. underlying joint rotation setup.
[...] [...]
USAGE RIGHTS: USAGE RIGHTS:
CMU places no restrictions on the use of the original dataset, and I CMU places no restrictions on the use of the original dataset, and I
(Bruce) place no additional restrictions on the use of this particular (Bruce) place no additional restrictions on the use of this particular
BVH conversion. BVH conversion.
Here's the relevant paragraph from mocap.cs.cmu.edu: Here's the relevant paragraph from mocap.cs.cmu.edu:
Use this data! This data is free for use in research and commercial Use this data! This data is free for use in research and commercial
projects worldwide. If you publish results obtained using this data, projects worldwide. If you publish results obtained using this data,
we would appreciate it if you would send the citation to your we would appreciate it if you would send the citation to your
published paper to jkh+mocap@cs.cmu.edu, and also would add this text published paper to jkh+mocap@cs.cmu.edu, and also would add this text
to your acknowledgments section: "The data used in this project was to your acknowledgments section: "The data used in this project was
obtained from mocap.cs.cmu.edu. The database was created with funding obtained from mocap.cs.cmu.edu. The database was created with funding
from NSF EIA-0196217." from NSF EIA-0196217."
[...] [...]

View File

@ -1,16 +1,16 @@
From kwxport From kwxport
http://www.kwxport.org/ http://www.kwxport.org/
>> >>
The kW Xport plug-in source is released under the MIT license. The kW Xport plug-in source is released under the MIT license.
Basically, it means "feel free to use it; credit the source; don't sue me Basically, it means "feel free to use it; credit the source; don't sue me
if something goes wrong." if something goes wrong."
>> >>
MIT License MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,3 +1,3 @@
for dawfInCellar_ChildOfCellar & dawfInCellar_SameHierarchy: for dawfInCellar_ChildOfCellar & dawfInCellar_SameHierarchy:
the strange scalings of cellar and dwarf are intended. the strange scalings of cellar and dwarf are intended.

View File

@ -1,2 +1,2 @@
cellar.irrmesh - From irrlight/irrEdit. Irrlicht/irredit license (which?) cellar.irrmesh - From irrlight/irrEdit. Irrlicht/irredit license (which?)
Textures resized to 400*400, improved JPEG compression to make them smaller Textures resized to 400*400, improved JPEG compression to make them smaller

View File

@ -1,5 +1,5 @@
Wikipedia Commons, Wikipedia Commons,
downloaded November 25th 08 downloaded November 25th 08
http://upload.wikimedia.org/wikipedia/commons/0/01/Lambert-cylindrical-equal-area-projection.jpg http://upload.wikimedia.org/wikipedia/commons/0/01/Lambert-cylindrical-equal-area-projection.jpg

View File

@ -1,9 +1,9 @@
Source: Source:
Nasa, Monthly Global Images Nasa, Monthly Global Images
http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php
Downloaded November 24, 08. Downloaded November 24, 08.
Rescaled to 2048 * 1024 with GIMP Rescaled to 2048 * 1024 with GIMP

View File

@ -1,2 +1,2 @@
cgtextures.com - free, even for commercial use. See the licensing conditions and the FAQ the site for mroe details. cgtextures.com - free, even for commercial use. See the licensing conditions and the FAQ the site for mroe details.
Great source for free textures, btw! Great source for free textures, btw!

View File

@ -1,2 +1,2 @@
Regression file. Regression file.
by Tom Speed, see http://groups.google.com/group/bmx3d/browse_thread/thread/36db3b191f81be36 by Tom Speed, see http://groups.google.com/group/bmx3d/browse_thread/thread/36db3b191f81be36

View File

@ -1,24 +1,24 @@
From IRRLICHT/media From IRRLICHT/media
The Irrlicht Engine License The Irrlicht Engine License
=========================== ===========================
Copyright (C) 2002-2007 Nikolaus Gebhardt Copyright (C) 2002-2007 Nikolaus Gebhardt
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
arising from the use of this software. arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions: freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not 1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software claim that you wrote the original software. If you use this software
in a product, an acknowledgement in the product documentation would be in a product, an acknowledgement in the product documentation would be
appreciated but is not required. appreciated but is not required.
2. Altered source versions must be clearly marked as such, and must not be 2. Altered source versions must be clearly marked as such, and must not be
misrepresented as being the original software. misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.

View File

@ -1,24 +1,24 @@
From IRRLICHT/media From IRRLICHT/media
The Irrlicht Engine License The Irrlicht Engine License
=========================== ===========================
Copyright (C) 2002-2007 Nikolaus Gebhardt Copyright (C) 2002-2007 Nikolaus Gebhardt
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
arising from the use of this software. arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions: freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not 1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software claim that you wrote the original software. If you use this software
in a product, an acknowledgement in the product documentation would be in a product, an acknowledgement in the product documentation would be
appreciated but is not required. appreciated but is not required.
2. Altered source versions must be clearly marked as such, and must not be 2. Altered source versions must be clearly marked as such, and must not be
misrepresented as being the original software. misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.

View File

@ -1,6 +1,6 @@
My name: Grimmmy My name: Grimmmy
Hi everybody!!! Hi everybody!!!
This is my first published model so it isn't very good,but i'm still learning!.. This is my first published model so it isn't very good,but i'm still learning!..
This model is free for everybody,but credit will be nice! This model is free for everybody,but credit will be nice!
You may reach me at rojkov91@mail.ru You may reach me at rojkov91@mail.ru
P.S: Excuse my bad english P.S: Excuse my bad english

View File

@ -1,6 +1,6 @@
My name: Grimmmy My name: Grimmmy
Hi everybody!!! Hi everybody!!!
This is my first published model so it isn't very good,but i'm still learning!.. This is my first published model so it isn't very good,but i'm still learning!..
This model is free for everybody,but credit will be nice! This model is free for everybody,but credit will be nice!
You may reach me at rojkov91@mail.ru You may reach me at rojkov91@mail.ru
P.S: Excuse my bad english P.S: Excuse my bad english

View File

@ -1,15 +1,15 @@
Jeep designed, modelled and skinned by me, Psionic Jeep designed, modelled and skinned by me, Psionic
FREE for use however you like, credits are appreciated!!! FREE for use however you like, credits are appreciated!!!
It was modelled in Milkshape 3D and includes the MS3D files oriented for X or B3D format (BlitzBasic 3D), its 2032 polys with a 512x512 jpg texture map. There are two skin variations plus a UV template to help out if you want to create your own skin variations. It was modelled in Milkshape 3D and includes the MS3D files oriented for X or B3D format (BlitzBasic 3D), its 2032 polys with a 512x512 jpg texture map. There are two skin variations plus a UV template to help out if you want to create your own skin variations.
I'd love to see a few screenshots of it being used in-game so feel free to stop by my site and maybe drop by my forums and show us all what your doing with it!!!!!!! I'd love to see a few screenshots of it being used in-game so feel free to stop by my site and maybe drop by my forums and show us all what your doing with it!!!!!!!
Check out more of my work at:- Check out more of my work at:-
http://xu1productions.com/3dstudio/index.html - 3D Game Resources http://xu1productions.com/3dstudio/index.html - 3D Game Resources
http://www.psionicdesign.com - My Main 2D/3D Digital Art site http://www.psionicdesign.com - My Main 2D/3D Digital Art site
Psionic 2002 Psionic 2002

View File

@ -1,8 +1,8 @@
Source: the3darchive.com Source: the3darchive.com
Downloaded 4th November 08 (Obama ftw!) Downloaded 4th November 08 (Obama ftw!)
Copyright notice found on the page: Copyright notice found on the page:
Where do the models in the archive come from? Where do the models in the archive come from?
All 3D files available from the3darchive.com are from the public domain. All 3D files available from the3darchive.com are from the public domain.

View File

@ -1,8 +1,8 @@
Source: the3darchive.com Source: the3darchive.com
Downloaded 4th November 08 (Obama ftw!) Downloaded 4th November 08 (Obama ftw!)
Copyright notice found on the page: Copyright notice found on the page:
Where do the models in the archive come from? Where do the models in the archive come from?
All 3D files available from the3darchive.com are from the public domain. All 3D files available from the3darchive.com are from the public domain.

View File

@ -1,2 +1,2 @@
"MotionCaptureROM.ase" Recorded using ViconIQ. "MotionCaptureROM.ase" Recorded using ViconIQ.
Converted to VRML with 3DS Max 2008. Converted to VRML with 3DS Max 2008.

View File

@ -1,9 +1,9 @@
Zylinder animation: Zylinder animation:
Frame 1 - 10: Zylinder knickt ein, so dass der Knick in Richtung z+ zeigt. Frame 1 - 10: Zylinder knickt ein, so dass der Knick in Richtung z+ zeigt.
Frame 10 - 18: Zylinder-Spitze streckt sich in Richtung z-. Frame 10 - 18: Zylinder-Spitze streckt sich in Richtung z-.
Frame 18 - 24: Zylinder-Spitze bewegt sich zu Position in Richtung x+ Frame 18 - 24: Zylinder-Spitze bewegt sich zu Position in Richtung x+
Remarks: The exporter failed here for some reasons... although the mesh referres to four bones, only two of them are stored in the corresponding node hierarchy. So you have a mesh with 4 bones, a hirarchy with 2 nodes and a animation that affects only those two nodes. Remarks: The exporter failed here for some reasons... although the mesh referres to four bones, only two of them are stored in the corresponding node hierarchy. So you have a mesh with 4 bones, a hirarchy with 2 nodes and a animation that affects only those two nodes.
There is no timing given for the animation. You have to scale the animation manually. For this file, the timing seems to be 24 ticks per second. There is no timing given for the animation. You have to scale the animation manually. For this file, the timing seems to be 24 ticks per second.

View File

@ -1,16 +1,16 @@
From kwxport From kwxport
http://www.kwxport.org/ http://www.kwxport.org/
>> >>
The kW Xport plug-in source is released under the MIT license. The kW Xport plug-in source is released under the MIT license.
Basically, it means "feel free to use it; credit the source; don't sue me Basically, it means "feel free to use it; credit the source; don't sue me
if something goes wrong." if something goes wrong."
>> >>
MIT License MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Some files were not shown because too many files have changed in this diff Show More