Fix line endings.
parent
373f85ffaf
commit
524834c307
|
@ -1,23 +1,23 @@
|
|||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
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
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
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
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
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
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
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
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
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
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
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
|
||||
DEALINGS IN THE SOFTWARE.
|
|
@ -1,99 +1,99 @@
|
|||
|
||||
#ifndef BOOST_FOREACH
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// A stripped down version of FOREACH for
|
||||
// illustration purposes. NOT FOR GENERAL USE.
|
||||
// For a complete implementation, see BOOST_FOREACH at
|
||||
// http://boost-sandbox.sourceforge.net/vault/index.php?directory=eric_niebler
|
||||
//
|
||||
// Copyright 2004 Eric Niebler.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Adapted to Assimp November 29th, 2008 (Alexander Gessler).
|
||||
// Added code to handle both const and non-const iterators, simplified some
|
||||
// parts.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace boost {
|
||||
namespace foreach_detail {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// auto_any
|
||||
|
||||
struct auto_any_base
|
||||
{
|
||||
operator bool() const { return false; }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct auto_any : auto_any_base
|
||||
{
|
||||
auto_any(T const& t) : item(t) {}
|
||||
mutable T item;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
T& auto_any_cast(auto_any_base const& any)
|
||||
{
|
||||
return static_cast<auto_any<T> const&>(any).item;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// FOREACH helper function
|
||||
|
||||
template<typename T>
|
||||
auto_any<typename T::const_iterator> begin(T const& t)
|
||||
{
|
||||
return t.begin();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
auto_any<typename T::const_iterator> end(T const& t)
|
||||
{
|
||||
return t.end();
|
||||
}
|
||||
|
||||
// iterator
|
||||
template<typename T>
|
||||
bool done(auto_any_base const& cur, auto_any_base const& end, T&)
|
||||
{
|
||||
typedef typename T::iterator iter_type;
|
||||
return auto_any_cast<iter_type>(cur) == auto_any_cast<iter_type>(end);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void next(auto_any_base const& cur, T&)
|
||||
{
|
||||
++auto_any_cast<typename T::iterator>(cur);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename T::reference deref(auto_any_base const& cur, T&)
|
||||
{
|
||||
return *auto_any_cast<typename T::iterator>(cur);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename T::const_reference deref(auto_any_base const& cur, const T&)
|
||||
{
|
||||
return *auto_any_cast<typename T::iterator>(cur);
|
||||
}
|
||||
|
||||
} // end foreach_detail
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// FOREACH
|
||||
|
||||
#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_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)) \
|
||||
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)
|
||||
|
||||
} // end boost
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_FOREACH
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// A stripped down version of FOREACH for
|
||||
// illustration purposes. NOT FOR GENERAL USE.
|
||||
// For a complete implementation, see BOOST_FOREACH at
|
||||
// http://boost-sandbox.sourceforge.net/vault/index.php?directory=eric_niebler
|
||||
//
|
||||
// Copyright 2004 Eric Niebler.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Adapted to Assimp November 29th, 2008 (Alexander Gessler).
|
||||
// Added code to handle both const and non-const iterators, simplified some
|
||||
// parts.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace boost {
|
||||
namespace foreach_detail {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// auto_any
|
||||
|
||||
struct auto_any_base
|
||||
{
|
||||
operator bool() const { return false; }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct auto_any : auto_any_base
|
||||
{
|
||||
auto_any(T const& t) : item(t) {}
|
||||
mutable T item;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
T& auto_any_cast(auto_any_base const& any)
|
||||
{
|
||||
return static_cast<auto_any<T> const&>(any).item;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// FOREACH helper function
|
||||
|
||||
template<typename T>
|
||||
auto_any<typename T::const_iterator> begin(T const& t)
|
||||
{
|
||||
return t.begin();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
auto_any<typename T::const_iterator> end(T const& t)
|
||||
{
|
||||
return t.end();
|
||||
}
|
||||
|
||||
// iterator
|
||||
template<typename T>
|
||||
bool done(auto_any_base const& cur, auto_any_base const& end, T&)
|
||||
{
|
||||
typedef typename T::iterator iter_type;
|
||||
return auto_any_cast<iter_type>(cur) == auto_any_cast<iter_type>(end);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void next(auto_any_base const& cur, T&)
|
||||
{
|
||||
++auto_any_cast<typename T::iterator>(cur);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename T::reference deref(auto_any_base const& cur, T&)
|
||||
{
|
||||
return *auto_any_cast<typename T::iterator>(cur);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
typename T::const_reference deref(auto_any_base const& cur, const T&)
|
||||
{
|
||||
return *auto_any_cast<typename T::iterator>(cur);
|
||||
}
|
||||
|
||||
} // end foreach_detail
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// FOREACH
|
||||
|
||||
#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_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)) \
|
||||
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)
|
||||
|
||||
} // end boost
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
/// A quick replacement for boost::lexical_cast for all the Boost haters out there
|
||||
|
||||
#ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST
|
||||
#define __AI_BOOST_WORKAROUND_LEXICAL_CAST
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
/// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle
|
||||
template <typename TargetType, typename SourceType>
|
||||
TargetType lexical_cast( const SourceType& source)
|
||||
{
|
||||
std::stringstream stream;
|
||||
TargetType result;
|
||||
|
||||
stream << source;
|
||||
stream >> result;
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST
|
||||
|
||||
/// A quick replacement for boost::lexical_cast for all the Boost haters out there
|
||||
|
||||
#ifndef __AI_BOOST_WORKAROUND_LEXICAL_CAST
|
||||
#define __AI_BOOST_WORKAROUND_LEXICAL_CAST
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
/// A quick replacement for boost::lexical_cast - should work for all types a stringstream can handle
|
||||
template <typename TargetType, typename SourceType>
|
||||
TargetType lexical_cast( const SourceType& source)
|
||||
{
|
||||
std::stringstream stream;
|
||||
TargetType result;
|
||||
|
||||
stream << source;
|
||||
stream >> result;
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // __AI_BOOST_WORKAROUND_LEXICAL_CAST
|
||||
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
|
||||
// please note that this replacement implementation does not
|
||||
// provide the performance benefit of the original, which
|
||||
// makes only one allocation as opposed to two allocations
|
||||
// (smart pointer counter and payload) which are usually
|
||||
// required if object and smart pointer are constructed
|
||||
// independently.
|
||||
|
||||
#ifndef INCLUDED_AI_BOOST_MAKE_SHARED
|
||||
#define INCLUDED_AI_BOOST_MAKE_SHARED
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T>
|
||||
shared_ptr<T> make_shared() {
|
||||
return shared_ptr<T>(new T());
|
||||
}
|
||||
|
||||
template <typename T, typename T0>
|
||||
shared_ptr<T> make_shared(const T0& t0) {
|
||||
return shared_ptr<T>(new T(t0));
|
||||
}
|
||||
|
||||
template <typename T, typename T0,typename T1>
|
||||
shared_ptr<T> make_shared(const T0& t0, const T1& t1) {
|
||||
return shared_ptr<T>(new T(t0,t1));
|
||||
}
|
||||
|
||||
template <typename T, typename T0,typename T1,typename T2>
|
||||
shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2) {
|
||||
return shared_ptr<T>(new T(t0,t1,t2));
|
||||
}
|
||||
|
||||
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) {
|
||||
return shared_ptr<T>(new T(t0,t1,t2,t3));
|
||||
}
|
||||
|
||||
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) {
|
||||
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>
|
||||
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));
|
||||
}
|
||||
|
||||
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) {
|
||||
return shared_ptr<T>(new T(t0,t1,t2,t3,t4,t5,t6));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// please note that this replacement implementation does not
|
||||
// provide the performance benefit of the original, which
|
||||
// makes only one allocation as opposed to two allocations
|
||||
// (smart pointer counter and payload) which are usually
|
||||
// required if object and smart pointer are constructed
|
||||
// independently.
|
||||
|
||||
#ifndef INCLUDED_AI_BOOST_MAKE_SHARED
|
||||
#define INCLUDED_AI_BOOST_MAKE_SHARED
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T>
|
||||
shared_ptr<T> make_shared() {
|
||||
return shared_ptr<T>(new T());
|
||||
}
|
||||
|
||||
template <typename T, typename T0>
|
||||
shared_ptr<T> make_shared(const T0& t0) {
|
||||
return shared_ptr<T>(new T(t0));
|
||||
}
|
||||
|
||||
template <typename T, typename T0,typename T1>
|
||||
shared_ptr<T> make_shared(const T0& t0, const T1& t1) {
|
||||
return shared_ptr<T>(new T(t0,t1));
|
||||
}
|
||||
|
||||
template <typename T, typename T0,typename T1,typename T2>
|
||||
shared_ptr<T> make_shared(const T0& t0, const T1& t1, const T2& t2) {
|
||||
return shared_ptr<T>(new T(t0,t1,t2));
|
||||
}
|
||||
|
||||
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) {
|
||||
return shared_ptr<T>(new T(t0,t1,t2,t3));
|
||||
}
|
||||
|
||||
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) {
|
||||
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>
|
||||
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));
|
||||
}
|
||||
|
||||
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) {
|
||||
return shared_ptr<T>(new T(t0,t1,t2,t3,t4,t5,t6));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
|
||||
|
||||
#ifndef BOOST_MATH_COMMON_FACTOR_RT_HPP
|
||||
#define BOOST_MATH_COMMON_FACTOR_RT_HPP
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace math {
|
||||
|
||||
// TODO: use binary GCD for unsigned integers ....
|
||||
template < typename IntegerType >
|
||||
IntegerType gcd( IntegerType a, IntegerType b )
|
||||
{
|
||||
const IntegerType zero = (IntegerType)0;
|
||||
while ( true )
|
||||
{
|
||||
if ( a == zero )
|
||||
return b;
|
||||
b %= a;
|
||||
|
||||
if ( b == zero )
|
||||
return a;
|
||||
a %= b;
|
||||
}
|
||||
}
|
||||
|
||||
template < typename IntegerType >
|
||||
IntegerType lcm( IntegerType a, IntegerType b )
|
||||
{
|
||||
const IntegerType t = gcd (a,b);
|
||||
if (!t)return t;
|
||||
return a / t * b;
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef BOOST_MATH_COMMON_FACTOR_RT_HPP
|
||||
#define BOOST_MATH_COMMON_FACTOR_RT_HPP
|
||||
|
||||
|
||||
namespace boost {
|
||||
namespace math {
|
||||
|
||||
// TODO: use binary GCD for unsigned integers ....
|
||||
template < typename IntegerType >
|
||||
IntegerType gcd( IntegerType a, IntegerType b )
|
||||
{
|
||||
const IntegerType zero = (IntegerType)0;
|
||||
while ( true )
|
||||
{
|
||||
if ( a == zero )
|
||||
return b;
|
||||
b %= a;
|
||||
|
||||
if ( b == zero )
|
||||
return a;
|
||||
a %= b;
|
||||
}
|
||||
}
|
||||
|
||||
template < typename IntegerType >
|
||||
IntegerType lcm( IntegerType a, IntegerType b )
|
||||
{
|
||||
const IntegerType t = gcd (a,b);
|
||||
if (!t)return t;
|
||||
return a / t * b;
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
// Boost noncopyable.hpp header file --------------------------------------//
|
||||
|
||||
// (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/utility for documentation.
|
||||
|
||||
#ifndef BOOST_NONCOPYABLE_HPP_INCLUDED
|
||||
#define BOOST_NONCOPYABLE_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
|
||||
// Private copy constructor and copy assignment ensure classes derived from
|
||||
// class noncopyable cannot be copied.
|
||||
|
||||
// Contributed by Dave Abrahams
|
||||
|
||||
namespace noncopyable_ // protection from unintended ADL
|
||||
{
|
||||
class noncopyable
|
||||
{
|
||||
protected:
|
||||
noncopyable() {}
|
||||
~noncopyable() {}
|
||||
private: // emphasize the following members are private
|
||||
noncopyable( const noncopyable& );
|
||||
const noncopyable& operator=( const noncopyable& );
|
||||
};
|
||||
}
|
||||
|
||||
typedef noncopyable_::noncopyable noncopyable;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_NONCOPYABLE_HPP_INCLUDED
|
||||
// Boost noncopyable.hpp header file --------------------------------------//
|
||||
|
||||
// (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/utility for documentation.
|
||||
|
||||
#ifndef BOOST_NONCOPYABLE_HPP_INCLUDED
|
||||
#define BOOST_NONCOPYABLE_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
|
||||
// Private copy constructor and copy assignment ensure classes derived from
|
||||
// class noncopyable cannot be copied.
|
||||
|
||||
// Contributed by Dave Abrahams
|
||||
|
||||
namespace noncopyable_ // protection from unintended ADL
|
||||
{
|
||||
class noncopyable
|
||||
{
|
||||
protected:
|
||||
noncopyable() {}
|
||||
~noncopyable() {}
|
||||
private: // emphasize the following members are private
|
||||
noncopyable( const noncopyable& );
|
||||
const noncopyable& operator=( const noncopyable& );
|
||||
};
|
||||
}
|
||||
|
||||
typedef noncopyable_::noncopyable noncopyable;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_NONCOPYABLE_HPP_INCLUDED
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_POINTER_CAST_HPP
|
||||
#define BOOST_POINTER_CAST_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
//static_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* static_pointer_cast(U *ptr)
|
||||
{
|
||||
return static_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
//dynamic_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* dynamic_pointer_cast(U *ptr)
|
||||
{
|
||||
return dynamic_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
//const_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* const_pointer_cast(U *ptr)
|
||||
{
|
||||
return const_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
//reinterpret_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* reinterpret_pointer_cast(U *ptr)
|
||||
{
|
||||
return reinterpret_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif //BOOST_POINTER_CAST_HPP
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_POINTER_CAST_HPP
|
||||
#define BOOST_POINTER_CAST_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
//static_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* static_pointer_cast(U *ptr)
|
||||
{
|
||||
return static_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
//dynamic_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* dynamic_pointer_cast(U *ptr)
|
||||
{
|
||||
return dynamic_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
//const_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* const_pointer_cast(U *ptr)
|
||||
{
|
||||
return const_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
//reinterpret_pointer_cast overload for raw pointers
|
||||
template<class T, class U>
|
||||
inline T* reinterpret_pointer_cast(U *ptr)
|
||||
{
|
||||
return reinterpret_cast<T*>(ptr);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif //BOOST_POINTER_CAST_HPP
|
||||
|
|
|
@ -1,79 +1,79 @@
|
|||
|
||||
#ifndef __AI_BOOST_SCOPED_ARRAY_INCLUDED
|
||||
#define __AI_BOOST_SCOPED_ARRAY_INCLUDED
|
||||
|
||||
#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
|
||||
// small replacement for boost::scoped_array
|
||||
template <class T>
|
||||
class scoped_array
|
||||
{
|
||||
public:
|
||||
|
||||
// provide a default construtctor
|
||||
scoped_array()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
// construction from an existing heap object of type T
|
||||
scoped_array(T* _ptr)
|
||||
: ptr(_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
// automatic destruction of the wrapped object at the
|
||||
// end of our lifetime
|
||||
~scoped_array()
|
||||
{
|
||||
delete[] ptr;
|
||||
}
|
||||
|
||||
inline T* get()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline T* operator-> ()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline void reset (T* t = 0)
|
||||
{
|
||||
delete[] ptr;
|
||||
ptr = t;
|
||||
}
|
||||
|
||||
T & operator[](std::ptrdiff_t i) const
|
||||
{
|
||||
return ptr[i];
|
||||
}
|
||||
|
||||
void swap(scoped_array & b)
|
||||
{
|
||||
std::swap(ptr, b.ptr);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// encapsulated object pointer
|
||||
T* ptr;
|
||||
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline void swap(scoped_array<T> & a, scoped_array<T> & b)
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
} // end of namespace boost
|
||||
|
||||
#else
|
||||
# error "scoped_array.h was already included"
|
||||
#endif
|
||||
#endif // __AI_BOOST_SCOPED_ARRAY_INCLUDED
|
||||
|
||||
|
||||
#ifndef __AI_BOOST_SCOPED_ARRAY_INCLUDED
|
||||
#define __AI_BOOST_SCOPED_ARRAY_INCLUDED
|
||||
|
||||
#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
|
||||
// small replacement for boost::scoped_array
|
||||
template <class T>
|
||||
class scoped_array
|
||||
{
|
||||
public:
|
||||
|
||||
// provide a default construtctor
|
||||
scoped_array()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
// construction from an existing heap object of type T
|
||||
scoped_array(T* _ptr)
|
||||
: ptr(_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
// automatic destruction of the wrapped object at the
|
||||
// end of our lifetime
|
||||
~scoped_array()
|
||||
{
|
||||
delete[] ptr;
|
||||
}
|
||||
|
||||
inline T* get()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline T* operator-> ()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline void reset (T* t = 0)
|
||||
{
|
||||
delete[] ptr;
|
||||
ptr = t;
|
||||
}
|
||||
|
||||
T & operator[](std::ptrdiff_t i) const
|
||||
{
|
||||
return ptr[i];
|
||||
}
|
||||
|
||||
void swap(scoped_array & b)
|
||||
{
|
||||
std::swap(ptr, b.ptr);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// encapsulated object pointer
|
||||
T* ptr;
|
||||
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline void swap(scoped_array<T> & a, scoped_array<T> & b)
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
} // end of namespace boost
|
||||
|
||||
#else
|
||||
# error "scoped_array.h was already included"
|
||||
#endif
|
||||
#endif // __AI_BOOST_SCOPED_ARRAY_INCLUDED
|
||||
|
||||
|
|
|
@ -1,79 +1,79 @@
|
|||
|
||||
#ifndef __AI_BOOST_SCOPED_PTR_INCLUDED
|
||||
#define __AI_BOOST_SCOPED_PTR_INCLUDED
|
||||
|
||||
#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
|
||||
// small replacement for boost::scoped_ptr
|
||||
template <class T>
|
||||
class scoped_ptr
|
||||
{
|
||||
public:
|
||||
|
||||
// provide a default construtctor
|
||||
scoped_ptr()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
// construction from an existing heap object of type T
|
||||
scoped_ptr(T* _ptr)
|
||||
: ptr(_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
// automatic destruction of the wrapped object at the
|
||||
// end of our lifetime
|
||||
~scoped_ptr()
|
||||
{
|
||||
delete ptr;
|
||||
}
|
||||
|
||||
inline T* get() const
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline operator T*()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline T* operator-> ()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline void reset (T* t = 0)
|
||||
{
|
||||
delete ptr;
|
||||
ptr = t;
|
||||
}
|
||||
|
||||
void swap(scoped_ptr & b)
|
||||
{
|
||||
std::swap(ptr, b.ptr);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// encapsulated object pointer
|
||||
T* ptr;
|
||||
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b)
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
} // end of namespace boost
|
||||
|
||||
#else
|
||||
# error "scoped_ptr.h was already included"
|
||||
#endif
|
||||
#endif // __AI_BOOST_SCOPED_PTR_INCLUDED
|
||||
|
||||
|
||||
#ifndef __AI_BOOST_SCOPED_PTR_INCLUDED
|
||||
#define __AI_BOOST_SCOPED_PTR_INCLUDED
|
||||
|
||||
#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
|
||||
// small replacement for boost::scoped_ptr
|
||||
template <class T>
|
||||
class scoped_ptr
|
||||
{
|
||||
public:
|
||||
|
||||
// provide a default construtctor
|
||||
scoped_ptr()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
// construction from an existing heap object of type T
|
||||
scoped_ptr(T* _ptr)
|
||||
: ptr(_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
// automatic destruction of the wrapped object at the
|
||||
// end of our lifetime
|
||||
~scoped_ptr()
|
||||
{
|
||||
delete ptr;
|
||||
}
|
||||
|
||||
inline T* get() const
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline operator T*()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline T* operator-> ()
|
||||
{
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline void reset (T* t = 0)
|
||||
{
|
||||
delete ptr;
|
||||
ptr = t;
|
||||
}
|
||||
|
||||
void swap(scoped_ptr & b)
|
||||
{
|
||||
std::swap(ptr, b.ptr);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// encapsulated object pointer
|
||||
T* ptr;
|
||||
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b)
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
} // end of namespace boost
|
||||
|
||||
#else
|
||||
# error "scoped_ptr.h was already included"
|
||||
#endif
|
||||
#endif // __AI_BOOST_SCOPED_PTR_INCLUDED
|
||||
|
||||
|
|
|
@ -1,228 +1,228 @@
|
|||
|
||||
#ifndef INCLUDED_AI_BOOST_SHARED_ARRAY
|
||||
#define INCLUDED_AI_BOOST_SHARED_ARRAY
|
||||
|
||||
#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
|
||||
|
||||
// ------------------------------
|
||||
// Internal stub
|
||||
namespace boost {
|
||||
namespace array_detail {
|
||||
class controller {
|
||||
public:
|
||||
|
||||
controller()
|
||||
: cnt(1)
|
||||
{}
|
||||
|
||||
public:
|
||||
|
||||
template <typename T>
|
||||
controller* decref(T* pt) {
|
||||
if (--cnt <= 0) {
|
||||
delete this;
|
||||
delete[] pt;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
controller* incref() {
|
||||
++cnt;
|
||||
return this;
|
||||
}
|
||||
|
||||
long get() const {
|
||||
return cnt;
|
||||
}
|
||||
|
||||
private:
|
||||
long cnt;
|
||||
};
|
||||
|
||||
struct empty {};
|
||||
|
||||
template <typename DEST, typename SRC>
|
||||
struct is_convertible_stub {
|
||||
|
||||
struct yes {char s[1];};
|
||||
struct no {char s[2];};
|
||||
|
||||
static yes foo(DEST*);
|
||||
static no foo(...);
|
||||
|
||||
enum {result = (sizeof(foo((SRC*)0)) == sizeof(yes) ? 1 : 0)};
|
||||
};
|
||||
|
||||
template <bool> struct enable_if {};
|
||||
template <> struct enable_if<true> {
|
||||
typedef empty result;
|
||||
};
|
||||
|
||||
template <typename DEST, typename SRC>
|
||||
struct is_convertible : public enable_if<is_convertible_stub<DEST,SRC>::result > {
|
||||
};
|
||||
}
|
||||
|
||||
// ------------------------------
|
||||
// Small replacement for boost::shared_array, not threadsafe because no
|
||||
// atomic reference counter is in use.
|
||||
// ------------------------------
|
||||
template <class T>
|
||||
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);
|
||||
|
||||
public:
|
||||
|
||||
typedef T element_type;
|
||||
|
||||
public:
|
||||
|
||||
// provide a default constructor
|
||||
shared_array()
|
||||
: ptr()
|
||||
, ctr(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
// construction from an existing object of type T
|
||||
explicit shared_array(T* ptr)
|
||||
: ptr(ptr)
|
||||
, ctr(ptr ? new array_detail::controller() : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
shared_array(const shared_array& r)
|
||||
: ptr(r.ptr)
|
||||
, ctr(r.ctr ? r.ctr->incref() : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Y>
|
||||
shared_array(const shared_array<Y>& r,typename detail::is_convertible<T,Y>::result = detail::empty())
|
||||
: ptr(r.ptr)
|
||||
, ctr(r.ctr ? r.ctr->incref() : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
// automatic destruction of the wrapped object when all
|
||||
// references are freed.
|
||||
~shared_array() {
|
||||
if (ctr) {
|
||||
ctr = ctr->decref(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
shared_array& operator=(const shared_array& r) {
|
||||
if (this == &r) {
|
||||
return *this;
|
||||
}
|
||||
if (ctr) {
|
||||
ctr->decref(ptr);
|
||||
}
|
||||
ptr = r.ptr;
|
||||
ctr = ptr?r.ctr->incref():NULL;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Y>
|
||||
shared_array& operator=(const shared_array<Y>& r) {
|
||||
if (this == &r) {
|
||||
return *this;
|
||||
}
|
||||
if (ctr) {
|
||||
ctr->decref(ptr);
|
||||
}
|
||||
ptr = r.ptr;
|
||||
ctr = ptr?r.ctr->incref():NULL;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// pointer access
|
||||
inline operator T*() {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline T* operator-> () const {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
// standard semantics
|
||||
inline T* get() {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
T& operator[] (std::ptrdiff_t index) const {
|
||||
return ptr[index];
|
||||
}
|
||||
|
||||
inline const T* get() const {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline operator bool () const {
|
||||
return ptr != NULL;
|
||||
}
|
||||
|
||||
inline bool unique() const {
|
||||
return use_count() == 1;
|
||||
}
|
||||
|
||||
inline long use_count() const {
|
||||
return ctr->get();
|
||||
}
|
||||
|
||||
inline void reset (T* t = 0) {
|
||||
if (ctr) {
|
||||
ctr->decref(ptr);
|
||||
}
|
||||
ptr = t;
|
||||
ctr = ptr?new array_detail::controller():NULL;
|
||||
}
|
||||
|
||||
void swap(shared_array & b) {
|
||||
std::swap(ptr, b.ptr);
|
||||
std::swap(ctr, b.ctr);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// encapsulated object pointer
|
||||
T* ptr;
|
||||
|
||||
// control block
|
||||
array_detail::controller* ctr;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline void swap(shared_array<T> & a, shared_array<T> & b)
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool operator== (const shared_array<T>& a, const shared_array<T>& b) {
|
||||
return a.ptr == b.ptr;
|
||||
}
|
||||
template<class T>
|
||||
bool operator!= (const shared_array<T>& a, const shared_array<T>& b) {
|
||||
return a.ptr != b.ptr;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool operator< (const shared_array<T>& a, const shared_array<T>& b) {
|
||||
return a.ptr < b.ptr;
|
||||
}
|
||||
|
||||
|
||||
} // end of namespace boost
|
||||
|
||||
#else
|
||||
# error "shared_array.h was already included"
|
||||
#endif
|
||||
#endif // INCLUDED_AI_BOOST_SHARED_ARRAY
|
||||
|
||||
#ifndef INCLUDED_AI_BOOST_SHARED_ARRAY
|
||||
#define INCLUDED_AI_BOOST_SHARED_ARRAY
|
||||
|
||||
#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
|
||||
|
||||
// ------------------------------
|
||||
// Internal stub
|
||||
namespace boost {
|
||||
namespace array_detail {
|
||||
class controller {
|
||||
public:
|
||||
|
||||
controller()
|
||||
: cnt(1)
|
||||
{}
|
||||
|
||||
public:
|
||||
|
||||
template <typename T>
|
||||
controller* decref(T* pt) {
|
||||
if (--cnt <= 0) {
|
||||
delete this;
|
||||
delete[] pt;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
controller* incref() {
|
||||
++cnt;
|
||||
return this;
|
||||
}
|
||||
|
||||
long get() const {
|
||||
return cnt;
|
||||
}
|
||||
|
||||
private:
|
||||
long cnt;
|
||||
};
|
||||
|
||||
struct empty {};
|
||||
|
||||
template <typename DEST, typename SRC>
|
||||
struct is_convertible_stub {
|
||||
|
||||
struct yes {char s[1];};
|
||||
struct no {char s[2];};
|
||||
|
||||
static yes foo(DEST*);
|
||||
static no foo(...);
|
||||
|
||||
enum {result = (sizeof(foo((SRC*)0)) == sizeof(yes) ? 1 : 0)};
|
||||
};
|
||||
|
||||
template <bool> struct enable_if {};
|
||||
template <> struct enable_if<true> {
|
||||
typedef empty result;
|
||||
};
|
||||
|
||||
template <typename DEST, typename SRC>
|
||||
struct is_convertible : public enable_if<is_convertible_stub<DEST,SRC>::result > {
|
||||
};
|
||||
}
|
||||
|
||||
// ------------------------------
|
||||
// Small replacement for boost::shared_array, not threadsafe because no
|
||||
// atomic reference counter is in use.
|
||||
// ------------------------------
|
||||
template <class T>
|
||||
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);
|
||||
|
||||
public:
|
||||
|
||||
typedef T element_type;
|
||||
|
||||
public:
|
||||
|
||||
// provide a default constructor
|
||||
shared_array()
|
||||
: ptr()
|
||||
, ctr(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
// construction from an existing object of type T
|
||||
explicit shared_array(T* ptr)
|
||||
: ptr(ptr)
|
||||
, ctr(ptr ? new array_detail::controller() : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
shared_array(const shared_array& r)
|
||||
: ptr(r.ptr)
|
||||
, ctr(r.ctr ? r.ctr->incref() : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename Y>
|
||||
shared_array(const shared_array<Y>& r,typename detail::is_convertible<T,Y>::result = detail::empty())
|
||||
: ptr(r.ptr)
|
||||
, ctr(r.ctr ? r.ctr->incref() : NULL)
|
||||
{
|
||||
}
|
||||
|
||||
// automatic destruction of the wrapped object when all
|
||||
// references are freed.
|
||||
~shared_array() {
|
||||
if (ctr) {
|
||||
ctr = ctr->decref(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
shared_array& operator=(const shared_array& r) {
|
||||
if (this == &r) {
|
||||
return *this;
|
||||
}
|
||||
if (ctr) {
|
||||
ctr->decref(ptr);
|
||||
}
|
||||
ptr = r.ptr;
|
||||
ctr = ptr?r.ctr->incref():NULL;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename Y>
|
||||
shared_array& operator=(const shared_array<Y>& r) {
|
||||
if (this == &r) {
|
||||
return *this;
|
||||
}
|
||||
if (ctr) {
|
||||
ctr->decref(ptr);
|
||||
}
|
||||
ptr = r.ptr;
|
||||
ctr = ptr?r.ctr->incref():NULL;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// pointer access
|
||||
inline operator T*() {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline T* operator-> () const {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
// standard semantics
|
||||
inline T* get() {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
T& operator[] (std::ptrdiff_t index) const {
|
||||
return ptr[index];
|
||||
}
|
||||
|
||||
inline const T* get() const {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
inline operator bool () const {
|
||||
return ptr != NULL;
|
||||
}
|
||||
|
||||
inline bool unique() const {
|
||||
return use_count() == 1;
|
||||
}
|
||||
|
||||
inline long use_count() const {
|
||||
return ctr->get();
|
||||
}
|
||||
|
||||
inline void reset (T* t = 0) {
|
||||
if (ctr) {
|
||||
ctr->decref(ptr);
|
||||
}
|
||||
ptr = t;
|
||||
ctr = ptr?new array_detail::controller():NULL;
|
||||
}
|
||||
|
||||
void swap(shared_array & b) {
|
||||
std::swap(ptr, b.ptr);
|
||||
std::swap(ctr, b.ctr);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// encapsulated object pointer
|
||||
T* ptr;
|
||||
|
||||
// control block
|
||||
array_detail::controller* ctr;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline void swap(shared_array<T> & a, shared_array<T> & b)
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool operator== (const shared_array<T>& a, const shared_array<T>& b) {
|
||||
return a.ptr == b.ptr;
|
||||
}
|
||||
template<class T>
|
||||
bool operator!= (const shared_array<T>& a, const shared_array<T>& b) {
|
||||
return a.ptr != b.ptr;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool operator< (const shared_array<T>& a, const shared_array<T>& b) {
|
||||
return a.ptr < b.ptr;
|
||||
}
|
||||
|
||||
|
||||
} // end of namespace boost
|
||||
|
||||
#else
|
||||
# error "shared_array.h was already included"
|
||||
#endif
|
||||
#endif // INCLUDED_AI_BOOST_SHARED_ARRAY
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
|
||||
#ifndef AI_BOOST_STATIC_ASSERT_INCLUDED
|
||||
#define AI_BOOST_STATIC_ASSERT_INCLUDED
|
||||
|
||||
#ifndef BOOST_STATIC_ASSERT
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
template <bool b> class static_assertion_failure;
|
||||
template <> class static_assertion_failure<true> {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define BOOST_STATIC_ASSERT(eval) \
|
||||
{boost::detail::static_assertion_failure<(eval)> assert_dummy;(void)assert_dummy;}
|
||||
|
||||
#endif
|
||||
#endif // !! AI_BOOST_STATIC_ASSERT_INCLUDED
|
||||
|
||||
#ifndef AI_BOOST_STATIC_ASSERT_INCLUDED
|
||||
#define AI_BOOST_STATIC_ASSERT_INCLUDED
|
||||
|
||||
#ifndef BOOST_STATIC_ASSERT
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
template <bool b> class static_assertion_failure;
|
||||
template <> class static_assertion_failure<true> {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define BOOST_STATIC_ASSERT(eval) \
|
||||
{boost::detail::static_assertion_failure<(eval)> assert_dummy;(void)assert_dummy;}
|
||||
|
||||
#endif
|
||||
#endif // !! AI_BOOST_STATIC_ASSERT_INCLUDED
|
||||
|
|
|
@ -1,283 +1,283 @@
|
|||
// A very small replacement for boost::tuple
|
||||
// (c) Alexander Gessler, 2008 [alexander.gessler@gmx.net]
|
||||
|
||||
#ifndef BOOST_TUPLE_INCLUDED
|
||||
#define BOOST_TUPLE_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
// Represents an empty tuple slot (up to 5 supported)
|
||||
struct nulltype {};
|
||||
|
||||
// For readable error messages
|
||||
struct tuple_component_idx_out_of_bounds;
|
||||
|
||||
// To share some code for the const/nonconst versions of the getters
|
||||
template <bool b, typename T>
|
||||
struct ConstIf {
|
||||
typedef T t;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct ConstIf<true,T> {
|
||||
typedef const T t;
|
||||
};
|
||||
|
||||
// Predeclare some stuff
|
||||
template <typename, unsigned, typename, bool, unsigned> struct value_getter;
|
||||
|
||||
// Helper to obtain the type of a tuple element
|
||||
template <typename T, unsigned NIDX, typename TNEXT, unsigned N /*= 0*/>
|
||||
struct type_getter {
|
||||
typedef type_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,N> next_elem_getter;
|
||||
typedef typename next_elem_getter::type type;
|
||||
};
|
||||
|
||||
template <typename T, unsigned NIDX, typename TNEXT >
|
||||
struct type_getter <T,NIDX,TNEXT,NIDX> {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
// Base class for all explicit specializations of list_elem
|
||||
template <typename T, unsigned NIDX, typename TNEXT >
|
||||
struct list_elem_base {
|
||||
|
||||
// Store template parameters
|
||||
typedef TNEXT next_type;
|
||||
typedef T type;
|
||||
|
||||
static const unsigned nidx = NIDX;
|
||||
};
|
||||
|
||||
// Represents an element in the tuple component list
|
||||
template <typename T, unsigned NIDX, typename TNEXT >
|
||||
struct list_elem : list_elem_base<T,NIDX,TNEXT>{
|
||||
|
||||
// Real members
|
||||
T me;
|
||||
TNEXT next;
|
||||
|
||||
// Get the value of a specific tuple element
|
||||
template <unsigned N>
|
||||
typename type_getter<T,NIDX,TNEXT,N>::type& get () {
|
||||
value_getter <T,NIDX,TNEXT,false,N> s;
|
||||
return s(*this);
|
||||
}
|
||||
|
||||
// Get the value of a specific tuple element
|
||||
template <unsigned N>
|
||||
const typename type_getter<T,NIDX,TNEXT,N>::type& get () const {
|
||||
value_getter <T,NIDX,TNEXT,true,N> s;
|
||||
return s(*this);
|
||||
}
|
||||
|
||||
// Explicit cast
|
||||
template <typename T2, typename TNEXT2 >
|
||||
operator list_elem<T2,NIDX,TNEXT2> () const {
|
||||
list_elem<T2,NIDX,TNEXT2> ret;
|
||||
ret.me = (T2)me;
|
||||
ret.next = next;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Recursively compare two elements (last element returns always true)
|
||||
bool operator == (const list_elem& s) const {
|
||||
return (me == s.me && next == s.next);
|
||||
}
|
||||
};
|
||||
|
||||
// Represents a non-used tuple element - the very last element processed
|
||||
template <typename TNEXT, unsigned NIDX >
|
||||
struct list_elem<nulltype,NIDX,TNEXT> : list_elem_base<nulltype,NIDX,TNEXT> {
|
||||
template <unsigned N, bool IS_CONST = true> struct value_getter {
|
||||
/* just dummy members to produce readable error messages */
|
||||
tuple_component_idx_out_of_bounds operator () (typename ConstIf<IS_CONST,list_elem>::t& me);
|
||||
};
|
||||
template <unsigned N> struct type_getter {
|
||||
/* just dummy members to produce readable error messages */
|
||||
typedef tuple_component_idx_out_of_bounds type;
|
||||
};
|
||||
|
||||
// dummy
|
||||
list_elem& operator = (const list_elem& /*other*/) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// dummy
|
||||
bool operator == (const list_elem& other) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Represents the absolute end of the list
|
||||
typedef list_elem<nulltype,0,int> list_end;
|
||||
|
||||
// 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
|
||||
// partial specialization of a nested class of a non-specialized template
|
||||
template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST, unsigned N>
|
||||
struct value_getter {
|
||||
|
||||
// calling list_elem
|
||||
typedef list_elem<T,NIDX,TNEXT> outer_elem;
|
||||
|
||||
// typedef for the getter for next element
|
||||
typedef value_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,
|
||||
IS_CONST, N> next_value_getter;
|
||||
|
||||
typename ConstIf<IS_CONST,typename type_getter<T,NIDX,TNEXT,N>::type>::t&
|
||||
operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
|
||||
|
||||
next_value_getter s;
|
||||
return s(me.next);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST>
|
||||
struct value_getter <T,NIDX,TNEXT,IS_CONST,NIDX> {
|
||||
typedef list_elem<T,NIDX,TNEXT> outer_elem;
|
||||
|
||||
typename ConstIf<IS_CONST,T>::t& operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
|
||||
return me.me;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// A very minimal implementation for up to 5 elements
|
||||
template <typename T0 = detail::nulltype,
|
||||
typename T1 = detail::nulltype,
|
||||
typename T2 = detail::nulltype,
|
||||
typename T3 = detail::nulltype,
|
||||
typename T4 = detail::nulltype>
|
||||
class tuple {
|
||||
|
||||
template <typename T0b,
|
||||
typename T1b,
|
||||
typename T2b,
|
||||
typename T3b,
|
||||
typename T4b >
|
||||
friend class tuple;
|
||||
|
||||
private:
|
||||
|
||||
typedef detail::list_elem<T0,0,
|
||||
detail::list_elem<T1,1,
|
||||
detail::list_elem<T2,2,
|
||||
detail::list_elem<T3,3,
|
||||
detail::list_elem<T4,4,
|
||||
detail::list_end > > > > > very_long;
|
||||
|
||||
very_long m;
|
||||
|
||||
public:
|
||||
|
||||
// Get a specific tuple element
|
||||
template <unsigned N>
|
||||
typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
// ... and the const version
|
||||
template <unsigned N>
|
||||
const typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () const {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
|
||||
// comparison operators
|
||||
bool operator== (const tuple& other) const {
|
||||
return m == other.m;
|
||||
}
|
||||
|
||||
// ... and the other way round
|
||||
bool operator!= (const tuple& other) const {
|
||||
return !(m == other.m);
|
||||
}
|
||||
|
||||
// cast to another tuple - all single elements must be convertible
|
||||
template <typename T0b, typename T1b,typename T2b,typename T3b, typename T4b>
|
||||
operator tuple <T0b,T1b,T2b,T3b,T4b> () const {
|
||||
tuple <T0b,T1b,T2b,T3b,T4b> s;
|
||||
s.m = (typename tuple <T0b,T1b,T2b,T3b,T4b>::very_long)m;
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
// Another way to access an element ...
|
||||
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 (
|
||||
tuple<T0,T1,T2,T3,T4>& m) {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
// ... and the const version
|
||||
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 (
|
||||
const tuple<T0,T1,T2,T3,T4>& m) {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
// Constructs a tuple with 5 elements
|
||||
template <typename T0,typename T1,typename T2,typename T3,typename T4>
|
||||
inline tuple <T0,T1,T2,T3,T4> make_tuple (const T0& t0,
|
||||
const T1& t1,const T2& t2,const T3& t3,const T4& t4) {
|
||||
|
||||
tuple <T0,T1,T2,T3,T4> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
t.template get<2>() = t2;
|
||||
t.template get<3>() = t3;
|
||||
t.template get<4>() = t4;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 4 elements
|
||||
template <typename T0,typename T1,typename T2,typename T3>
|
||||
inline tuple <T0,T1,T2,T3> make_tuple (const T0& t0,
|
||||
const T1& t1,const T2& t2,const T3& t3) {
|
||||
tuple <T0,T1,T2,T3> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
t.template get<2>() = t2;
|
||||
t.template get<3>() = t3;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 3 elements
|
||||
template <typename T0,typename T1,typename T2>
|
||||
inline tuple <T0,T1,T2> make_tuple (const T0& t0,
|
||||
const T1& t1,const T2& t2) {
|
||||
tuple <T0,T1,T2> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
t.template get<2>() = t2;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 2 elements
|
||||
template <typename T0,typename T1>
|
||||
inline tuple <T0,T1> make_tuple (const T0& t0,
|
||||
const T1& t1) {
|
||||
tuple <T0,T1> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 1 elements (well ...)
|
||||
template <typename T0>
|
||||
inline tuple <T0> make_tuple (const T0& t0) {
|
||||
tuple <T0> t;
|
||||
t.template get<0>() = t0;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 0 elements (well ...)
|
||||
inline tuple <> make_tuple () {
|
||||
tuple <> t;
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !! BOOST_TUPLE_INCLUDED
|
||||
// A very small replacement for boost::tuple
|
||||
// (c) Alexander Gessler, 2008 [alexander.gessler@gmx.net]
|
||||
|
||||
#ifndef BOOST_TUPLE_INCLUDED
|
||||
#define BOOST_TUPLE_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
// Represents an empty tuple slot (up to 5 supported)
|
||||
struct nulltype {};
|
||||
|
||||
// For readable error messages
|
||||
struct tuple_component_idx_out_of_bounds;
|
||||
|
||||
// To share some code for the const/nonconst versions of the getters
|
||||
template <bool b, typename T>
|
||||
struct ConstIf {
|
||||
typedef T t;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct ConstIf<true,T> {
|
||||
typedef const T t;
|
||||
};
|
||||
|
||||
// Predeclare some stuff
|
||||
template <typename, unsigned, typename, bool, unsigned> struct value_getter;
|
||||
|
||||
// Helper to obtain the type of a tuple element
|
||||
template <typename T, unsigned NIDX, typename TNEXT, unsigned N /*= 0*/>
|
||||
struct type_getter {
|
||||
typedef type_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,N> next_elem_getter;
|
||||
typedef typename next_elem_getter::type type;
|
||||
};
|
||||
|
||||
template <typename T, unsigned NIDX, typename TNEXT >
|
||||
struct type_getter <T,NIDX,TNEXT,NIDX> {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
// Base class for all explicit specializations of list_elem
|
||||
template <typename T, unsigned NIDX, typename TNEXT >
|
||||
struct list_elem_base {
|
||||
|
||||
// Store template parameters
|
||||
typedef TNEXT next_type;
|
||||
typedef T type;
|
||||
|
||||
static const unsigned nidx = NIDX;
|
||||
};
|
||||
|
||||
// Represents an element in the tuple component list
|
||||
template <typename T, unsigned NIDX, typename TNEXT >
|
||||
struct list_elem : list_elem_base<T,NIDX,TNEXT>{
|
||||
|
||||
// Real members
|
||||
T me;
|
||||
TNEXT next;
|
||||
|
||||
// Get the value of a specific tuple element
|
||||
template <unsigned N>
|
||||
typename type_getter<T,NIDX,TNEXT,N>::type& get () {
|
||||
value_getter <T,NIDX,TNEXT,false,N> s;
|
||||
return s(*this);
|
||||
}
|
||||
|
||||
// Get the value of a specific tuple element
|
||||
template <unsigned N>
|
||||
const typename type_getter<T,NIDX,TNEXT,N>::type& get () const {
|
||||
value_getter <T,NIDX,TNEXT,true,N> s;
|
||||
return s(*this);
|
||||
}
|
||||
|
||||
// Explicit cast
|
||||
template <typename T2, typename TNEXT2 >
|
||||
operator list_elem<T2,NIDX,TNEXT2> () const {
|
||||
list_elem<T2,NIDX,TNEXT2> ret;
|
||||
ret.me = (T2)me;
|
||||
ret.next = next;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Recursively compare two elements (last element returns always true)
|
||||
bool operator == (const list_elem& s) const {
|
||||
return (me == s.me && next == s.next);
|
||||
}
|
||||
};
|
||||
|
||||
// Represents a non-used tuple element - the very last element processed
|
||||
template <typename TNEXT, unsigned NIDX >
|
||||
struct list_elem<nulltype,NIDX,TNEXT> : list_elem_base<nulltype,NIDX,TNEXT> {
|
||||
template <unsigned N, bool IS_CONST = true> struct value_getter {
|
||||
/* just dummy members to produce readable error messages */
|
||||
tuple_component_idx_out_of_bounds operator () (typename ConstIf<IS_CONST,list_elem>::t& me);
|
||||
};
|
||||
template <unsigned N> struct type_getter {
|
||||
/* just dummy members to produce readable error messages */
|
||||
typedef tuple_component_idx_out_of_bounds type;
|
||||
};
|
||||
|
||||
// dummy
|
||||
list_elem& operator = (const list_elem& /*other*/) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// dummy
|
||||
bool operator == (const list_elem& other) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// Represents the absolute end of the list
|
||||
typedef list_elem<nulltype,0,int> list_end;
|
||||
|
||||
// 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
|
||||
// partial specialization of a nested class of a non-specialized template
|
||||
template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST, unsigned N>
|
||||
struct value_getter {
|
||||
|
||||
// calling list_elem
|
||||
typedef list_elem<T,NIDX,TNEXT> outer_elem;
|
||||
|
||||
// typedef for the getter for next element
|
||||
typedef value_getter<typename TNEXT::type,NIDX+1,typename TNEXT::next_type,
|
||||
IS_CONST, N> next_value_getter;
|
||||
|
||||
typename ConstIf<IS_CONST,typename type_getter<T,NIDX,TNEXT,N>::type>::t&
|
||||
operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
|
||||
|
||||
next_value_getter s;
|
||||
return s(me.next);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, unsigned NIDX, typename TNEXT, bool IS_CONST>
|
||||
struct value_getter <T,NIDX,TNEXT,IS_CONST,NIDX> {
|
||||
typedef list_elem<T,NIDX,TNEXT> outer_elem;
|
||||
|
||||
typename ConstIf<IS_CONST,T>::t& operator () (typename ConstIf<IS_CONST,outer_elem >::t& me) {
|
||||
return me.me;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// A very minimal implementation for up to 5 elements
|
||||
template <typename T0 = detail::nulltype,
|
||||
typename T1 = detail::nulltype,
|
||||
typename T2 = detail::nulltype,
|
||||
typename T3 = detail::nulltype,
|
||||
typename T4 = detail::nulltype>
|
||||
class tuple {
|
||||
|
||||
template <typename T0b,
|
||||
typename T1b,
|
||||
typename T2b,
|
||||
typename T3b,
|
||||
typename T4b >
|
||||
friend class tuple;
|
||||
|
||||
private:
|
||||
|
||||
typedef detail::list_elem<T0,0,
|
||||
detail::list_elem<T1,1,
|
||||
detail::list_elem<T2,2,
|
||||
detail::list_elem<T3,3,
|
||||
detail::list_elem<T4,4,
|
||||
detail::list_end > > > > > very_long;
|
||||
|
||||
very_long m;
|
||||
|
||||
public:
|
||||
|
||||
// Get a specific tuple element
|
||||
template <unsigned N>
|
||||
typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
// ... and the const version
|
||||
template <unsigned N>
|
||||
const typename detail::type_getter<T0,0,typename very_long::next_type, N>::type& get () const {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
|
||||
// comparison operators
|
||||
bool operator== (const tuple& other) const {
|
||||
return m == other.m;
|
||||
}
|
||||
|
||||
// ... and the other way round
|
||||
bool operator!= (const tuple& other) const {
|
||||
return !(m == other.m);
|
||||
}
|
||||
|
||||
// cast to another tuple - all single elements must be convertible
|
||||
template <typename T0b, typename T1b,typename T2b,typename T3b, typename T4b>
|
||||
operator tuple <T0b,T1b,T2b,T3b,T4b> () const {
|
||||
tuple <T0b,T1b,T2b,T3b,T4b> s;
|
||||
s.m = (typename tuple <T0b,T1b,T2b,T3b,T4b>::very_long)m;
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
// Another way to access an element ...
|
||||
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 (
|
||||
tuple<T0,T1,T2,T3,T4>& m) {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
// ... and the const version
|
||||
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 (
|
||||
const tuple<T0,T1,T2,T3,T4>& m) {
|
||||
return m.template get<N>();
|
||||
}
|
||||
|
||||
// Constructs a tuple with 5 elements
|
||||
template <typename T0,typename T1,typename T2,typename T3,typename T4>
|
||||
inline tuple <T0,T1,T2,T3,T4> make_tuple (const T0& t0,
|
||||
const T1& t1,const T2& t2,const T3& t3,const T4& t4) {
|
||||
|
||||
tuple <T0,T1,T2,T3,T4> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
t.template get<2>() = t2;
|
||||
t.template get<3>() = t3;
|
||||
t.template get<4>() = t4;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 4 elements
|
||||
template <typename T0,typename T1,typename T2,typename T3>
|
||||
inline tuple <T0,T1,T2,T3> make_tuple (const T0& t0,
|
||||
const T1& t1,const T2& t2,const T3& t3) {
|
||||
tuple <T0,T1,T2,T3> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
t.template get<2>() = t2;
|
||||
t.template get<3>() = t3;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 3 elements
|
||||
template <typename T0,typename T1,typename T2>
|
||||
inline tuple <T0,T1,T2> make_tuple (const T0& t0,
|
||||
const T1& t1,const T2& t2) {
|
||||
tuple <T0,T1,T2> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
t.template get<2>() = t2;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 2 elements
|
||||
template <typename T0,typename T1>
|
||||
inline tuple <T0,T1> make_tuple (const T0& t0,
|
||||
const T1& t1) {
|
||||
tuple <T0,T1> t;
|
||||
t.template get<0>() = t0;
|
||||
t.template get<1>() = t1;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 1 elements (well ...)
|
||||
template <typename T0>
|
||||
inline tuple <T0> make_tuple (const T0& t0) {
|
||||
tuple <T0> t;
|
||||
t.template get<0>() = t0;
|
||||
return t;
|
||||
}
|
||||
|
||||
// Constructs a tuple with 0 elements (well ...)
|
||||
inline tuple <> make_tuple () {
|
||||
tuple <> t;
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !! BOOST_TUPLE_INCLUDED
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by assimp.rc
|
||||
|
||||
// Nächste Standardwerte für neue Objekte
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by assimp.rc
|
||||
|
||||
// Nächste Standardwerte für neue Objekte
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
The Clipper code library, the "Software" (that includes Delphi, C++ & C#
|
||||
source code, accompanying samples and documentation), has been released
|
||||
under the following license, terms and conditions:
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
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
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
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
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
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
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
The Clipper code library, the "Software" (that includes Delphi, C++ & C#
|
||||
source code, accompanying samples and documentation), has been released
|
||||
under the following license, terms and conditions:
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
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
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
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
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
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
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,306 +1,306 @@
|
|||
/*******************************************************************************
|
||||
* *
|
||||
* Author : Angus Johnson *
|
||||
* Version : 4.8.8 *
|
||||
* Date : 30 August 2012 *
|
||||
* Website : http://www.angusj.com *
|
||||
* Copyright : Angus Johnson 2010-2012 *
|
||||
* *
|
||||
* License: *
|
||||
* Use, modification & distribution is subject to Boost Software License Ver 1. *
|
||||
* http://www.boost.org/LICENSE_1_0.txt *
|
||||
* *
|
||||
* Attributions: *
|
||||
* The code in this library is an extension of Bala Vatti's clipping algorithm: *
|
||||
* "A generic solution to polygon clipping" *
|
||||
* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
|
||||
* http://portal.acm.org/citation.cfm?id=129906 *
|
||||
* *
|
||||
* Computer graphics and geometric modeling: implementation and algorithms *
|
||||
* By Max K. Agoston *
|
||||
* Springer; 1 edition (January 4, 2005) *
|
||||
* http://books.google.com/books?q=vatti+clipping+agoston *
|
||||
* *
|
||||
* See also: *
|
||||
* "Polygon Offsetting by Computing Winding Numbers" *
|
||||
* Paper no. DETC2005-85513 pp. 565-575 *
|
||||
* ASME 2005 International Design Engineering Technical Conferences *
|
||||
* and Computers and Information in Engineering Conference (IDETC/CIE2005) *
|
||||
* September 24–28, 2005 , Long Beach, California, USA *
|
||||
* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef clipper_hpp
|
||||
#define clipper_hpp
|
||||
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <ostream>
|
||||
|
||||
namespace ClipperLib {
|
||||
|
||||
enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };
|
||||
enum PolyType { ptSubject, ptClip };
|
||||
//By far the most widely used winding rules for polygon filling are
|
||||
//EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32)
|
||||
//Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL)
|
||||
//see http://glprogramming.com/red/chapter11.html
|
||||
enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
|
||||
|
||||
typedef signed long long long64;
|
||||
typedef unsigned long long ulong64;
|
||||
|
||||
struct IntPoint {
|
||||
public:
|
||||
long64 X;
|
||||
long64 Y;
|
||||
IntPoint(long64 x = 0, long64 y = 0): X(x), Y(y) {};
|
||||
friend std::ostream& operator <<(std::ostream &s, IntPoint &p);
|
||||
};
|
||||
|
||||
typedef std::vector< IntPoint > Polygon;
|
||||
typedef std::vector< Polygon > Polygons;
|
||||
|
||||
std::ostream& operator <<(std::ostream &s, Polygon &p);
|
||||
std::ostream& operator <<(std::ostream &s, Polygons &p);
|
||||
|
||||
struct ExPolygon {
|
||||
Polygon outer;
|
||||
Polygons holes;
|
||||
};
|
||||
typedef std::vector< ExPolygon > ExPolygons;
|
||||
|
||||
enum JoinType { jtSquare, jtRound, jtMiter };
|
||||
|
||||
bool Orientation(const Polygon &poly);
|
||||
double Area(const Polygon &poly);
|
||||
void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
|
||||
double delta, JoinType jointype = jtSquare, double MiterLimit = 2);
|
||||
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(Polygons &polys, PolyFillType fillType = pftEvenOdd);
|
||||
|
||||
void ReversePolygon(Polygon& p);
|
||||
void ReversePolygons(Polygons& p);
|
||||
|
||||
//used internally ...
|
||||
enum EdgeSide { esNeither = 0, esLeft = 1, esRight = 2, esBoth = 3 };
|
||||
enum IntersectProtects { ipNone = 0, ipLeft = 1, ipRight = 2, ipBoth = 3 };
|
||||
|
||||
struct TEdge {
|
||||
long64 xbot;
|
||||
long64 ybot;
|
||||
long64 xcurr;
|
||||
long64 ycurr;
|
||||
long64 xtop;
|
||||
long64 ytop;
|
||||
double dx;
|
||||
long64 tmpX;
|
||||
PolyType polyType;
|
||||
EdgeSide side;
|
||||
int windDelta; //1 or -1 depending on winding direction
|
||||
int windCnt;
|
||||
int windCnt2; //winding count of the opposite polytype
|
||||
int outIdx;
|
||||
TEdge *next;
|
||||
TEdge *prev;
|
||||
TEdge *nextInLML;
|
||||
TEdge *nextInAEL;
|
||||
TEdge *prevInAEL;
|
||||
TEdge *nextInSEL;
|
||||
TEdge *prevInSEL;
|
||||
};
|
||||
|
||||
struct IntersectNode {
|
||||
TEdge *edge1;
|
||||
TEdge *edge2;
|
||||
IntPoint pt;
|
||||
IntersectNode *next;
|
||||
};
|
||||
|
||||
struct LocalMinima {
|
||||
long64 Y;
|
||||
TEdge *leftBound;
|
||||
TEdge *rightBound;
|
||||
LocalMinima *next;
|
||||
};
|
||||
|
||||
struct Scanbeam {
|
||||
long64 Y;
|
||||
Scanbeam *next;
|
||||
};
|
||||
|
||||
struct OutPt; //forward declaration
|
||||
|
||||
struct OutRec {
|
||||
int idx;
|
||||
bool isHole;
|
||||
OutRec *FirstLeft;
|
||||
OutRec *AppendLink;
|
||||
OutPt *pts;
|
||||
OutPt *bottomPt;
|
||||
OutPt *bottomFlag;
|
||||
EdgeSide sides;
|
||||
};
|
||||
|
||||
struct OutPt {
|
||||
int idx;
|
||||
IntPoint pt;
|
||||
OutPt *next;
|
||||
OutPt *prev;
|
||||
};
|
||||
|
||||
struct JoinRec {
|
||||
IntPoint pt1a;
|
||||
IntPoint pt1b;
|
||||
int poly1Idx;
|
||||
IntPoint pt2a;
|
||||
IntPoint pt2b;
|
||||
int poly2Idx;
|
||||
};
|
||||
|
||||
struct HorzJoinRec {
|
||||
TEdge *edge;
|
||||
int savedIdx;
|
||||
};
|
||||
|
||||
struct IntRect { long64 left; long64 top; long64 right; long64 bottom; };
|
||||
|
||||
typedef std::vector < OutRec* > PolyOutList;
|
||||
typedef std::vector < TEdge* > EdgeList;
|
||||
typedef std::vector < JoinRec* > JoinList;
|
||||
typedef std::vector < HorzJoinRec* > HorzJoinList;
|
||||
|
||||
//ClipperBase is the ancestor to the Clipper class. It should not be
|
||||
//instantiated directly. This class simply abstracts the conversion of sets of
|
||||
//polygon coordinates into edge objects that are stored in a LocalMinima list.
|
||||
class ClipperBase
|
||||
{
|
||||
public:
|
||||
ClipperBase();
|
||||
virtual ~ClipperBase();
|
||||
bool AddPolygon(const Polygon &pg, PolyType polyType);
|
||||
bool AddPolygons( const Polygons &ppg, PolyType polyType);
|
||||
virtual void Clear();
|
||||
IntRect GetBounds();
|
||||
protected:
|
||||
void DisposeLocalMinimaList();
|
||||
TEdge* AddBoundsToLML(TEdge *e);
|
||||
void PopLocalMinima();
|
||||
virtual void Reset();
|
||||
void InsertLocalMinima(LocalMinima *newLm);
|
||||
LocalMinima *m_CurrentLM;
|
||||
LocalMinima *m_MinimaList;
|
||||
bool m_UseFullRange;
|
||||
EdgeList m_edges;
|
||||
};
|
||||
|
||||
class Clipper : public virtual ClipperBase
|
||||
{
|
||||
public:
|
||||
Clipper();
|
||||
~Clipper();
|
||||
bool Execute(ClipType clipType,
|
||||
Polygons &solution,
|
||||
PolyFillType subjFillType = pftEvenOdd,
|
||||
PolyFillType clipFillType = pftEvenOdd);
|
||||
bool Execute(ClipType clipType,
|
||||
ExPolygons &solution,
|
||||
PolyFillType subjFillType = pftEvenOdd,
|
||||
PolyFillType clipFillType = pftEvenOdd);
|
||||
void Clear();
|
||||
bool ReverseSolution() {return m_ReverseOutput;};
|
||||
void ReverseSolution(bool value) {m_ReverseOutput = value;};
|
||||
protected:
|
||||
void Reset();
|
||||
virtual bool ExecuteInternal(bool fixHoleLinkages);
|
||||
private:
|
||||
PolyOutList m_PolyOuts;
|
||||
JoinList m_Joins;
|
||||
HorzJoinList m_HorizJoins;
|
||||
ClipType m_ClipType;
|
||||
Scanbeam *m_Scanbeam;
|
||||
TEdge *m_ActiveEdges;
|
||||
TEdge *m_SortedEdges;
|
||||
IntersectNode *m_IntersectNodes;
|
||||
bool m_ExecuteLocked;
|
||||
PolyFillType m_ClipFillType;
|
||||
PolyFillType m_SubjFillType;
|
||||
bool m_ReverseOutput;
|
||||
void DisposeScanbeamList();
|
||||
void SetWindingCount(TEdge& edge);
|
||||
bool IsEvenOddFillType(const TEdge& edge) const;
|
||||
bool IsEvenOddAltFillType(const TEdge& edge) const;
|
||||
void InsertScanbeam(const long64 Y);
|
||||
long64 PopScanbeam();
|
||||
void InsertLocalMinimaIntoAEL(const long64 botY);
|
||||
void InsertEdgeIntoAEL(TEdge *edge);
|
||||
void AddEdgeToSEL(TEdge *edge);
|
||||
void CopyAELToSEL();
|
||||
void DeleteFromSEL(TEdge *e);
|
||||
void DeleteFromAEL(TEdge *e);
|
||||
void UpdateEdgeIntoAEL(TEdge *&e);
|
||||
void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2);
|
||||
bool IsContributing(const TEdge& edge) const;
|
||||
bool IsTopHorz(const long64 XPos);
|
||||
void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
|
||||
void DoMaxima(TEdge *e, long64 topY);
|
||||
void ProcessHorizontals();
|
||||
void ProcessHorizontal(TEdge *horzEdge);
|
||||
void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
|
||||
void AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
|
||||
void AppendPolygon(TEdge *e1, TEdge *e2);
|
||||
void DoEdge1(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 IntersectEdges(TEdge *e1, TEdge *e2,
|
||||
const IntPoint &pt, IntersectProtects protects);
|
||||
OutRec* CreateOutRec();
|
||||
void AddOutPt(TEdge *e, const IntPoint &pt);
|
||||
void DisposeBottomPt(OutRec &outRec);
|
||||
void DisposeAllPolyPts();
|
||||
void DisposeOutRec(PolyOutList::size_type index);
|
||||
bool ProcessIntersections(const long64 botY, const long64 topY);
|
||||
void AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt);
|
||||
void BuildIntersectList(const long64 botY, const long64 topY);
|
||||
void ProcessIntersectList();
|
||||
void ProcessEdgesAtTopOfScanbeam(const long64 topY);
|
||||
void BuildResult(Polygons& polys);
|
||||
void BuildResultEx(ExPolygons& polys);
|
||||
void SetHoleState(TEdge *e, OutRec *OutRec);
|
||||
void DisposeIntersectNodes();
|
||||
bool FixupIntersections();
|
||||
void FixupOutPolygon(OutRec &outRec);
|
||||
bool IsHole(TEdge *e);
|
||||
void FixHoleLinkage(OutRec *outRec);
|
||||
void CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2);
|
||||
void CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2);
|
||||
void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1);
|
||||
void ClearJoins();
|
||||
void AddHorzJoin(TEdge *e, int idx);
|
||||
void ClearHorzJoins();
|
||||
void JoinCommonEdges(bool fixHoleLinkages);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class clipperException : public std::exception
|
||||
{
|
||||
public:
|
||||
clipperException(const char* description): m_descr(description) {}
|
||||
virtual ~clipperException() throw() {}
|
||||
virtual const char* what() const throw() {return m_descr.c_str();}
|
||||
private:
|
||||
std::string m_descr;
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
} //ClipperLib namespace
|
||||
|
||||
#endif //clipper_hpp
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Author : Angus Johnson *
|
||||
* Version : 4.8.8 *
|
||||
* Date : 30 August 2012 *
|
||||
* Website : http://www.angusj.com *
|
||||
* Copyright : Angus Johnson 2010-2012 *
|
||||
* *
|
||||
* License: *
|
||||
* Use, modification & distribution is subject to Boost Software License Ver 1. *
|
||||
* http://www.boost.org/LICENSE_1_0.txt *
|
||||
* *
|
||||
* Attributions: *
|
||||
* The code in this library is an extension of Bala Vatti's clipping algorithm: *
|
||||
* "A generic solution to polygon clipping" *
|
||||
* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
|
||||
* http://portal.acm.org/citation.cfm?id=129906 *
|
||||
* *
|
||||
* Computer graphics and geometric modeling: implementation and algorithms *
|
||||
* By Max K. Agoston *
|
||||
* Springer; 1 edition (January 4, 2005) *
|
||||
* http://books.google.com/books?q=vatti+clipping+agoston *
|
||||
* *
|
||||
* See also: *
|
||||
* "Polygon Offsetting by Computing Winding Numbers" *
|
||||
* Paper no. DETC2005-85513 pp. 565-575 *
|
||||
* ASME 2005 International Design Engineering Technical Conferences *
|
||||
* and Computers and Information in Engineering Conference (IDETC/CIE2005) *
|
||||
* September 24–28, 2005 , Long Beach, California, USA *
|
||||
* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf *
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef clipper_hpp
|
||||
#define clipper_hpp
|
||||
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <ostream>
|
||||
|
||||
namespace ClipperLib {
|
||||
|
||||
enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };
|
||||
enum PolyType { ptSubject, ptClip };
|
||||
//By far the most widely used winding rules for polygon filling are
|
||||
//EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32)
|
||||
//Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL)
|
||||
//see http://glprogramming.com/red/chapter11.html
|
||||
enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
|
||||
|
||||
typedef signed long long long64;
|
||||
typedef unsigned long long ulong64;
|
||||
|
||||
struct IntPoint {
|
||||
public:
|
||||
long64 X;
|
||||
long64 Y;
|
||||
IntPoint(long64 x = 0, long64 y = 0): X(x), Y(y) {};
|
||||
friend std::ostream& operator <<(std::ostream &s, IntPoint &p);
|
||||
};
|
||||
|
||||
typedef std::vector< IntPoint > Polygon;
|
||||
typedef std::vector< Polygon > Polygons;
|
||||
|
||||
std::ostream& operator <<(std::ostream &s, Polygon &p);
|
||||
std::ostream& operator <<(std::ostream &s, Polygons &p);
|
||||
|
||||
struct ExPolygon {
|
||||
Polygon outer;
|
||||
Polygons holes;
|
||||
};
|
||||
typedef std::vector< ExPolygon > ExPolygons;
|
||||
|
||||
enum JoinType { jtSquare, jtRound, jtMiter };
|
||||
|
||||
bool Orientation(const Polygon &poly);
|
||||
double Area(const Polygon &poly);
|
||||
void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
|
||||
double delta, JoinType jointype = jtSquare, double MiterLimit = 2);
|
||||
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(Polygons &polys, PolyFillType fillType = pftEvenOdd);
|
||||
|
||||
void ReversePolygon(Polygon& p);
|
||||
void ReversePolygons(Polygons& p);
|
||||
|
||||
//used internally ...
|
||||
enum EdgeSide { esNeither = 0, esLeft = 1, esRight = 2, esBoth = 3 };
|
||||
enum IntersectProtects { ipNone = 0, ipLeft = 1, ipRight = 2, ipBoth = 3 };
|
||||
|
||||
struct TEdge {
|
||||
long64 xbot;
|
||||
long64 ybot;
|
||||
long64 xcurr;
|
||||
long64 ycurr;
|
||||
long64 xtop;
|
||||
long64 ytop;
|
||||
double dx;
|
||||
long64 tmpX;
|
||||
PolyType polyType;
|
||||
EdgeSide side;
|
||||
int windDelta; //1 or -1 depending on winding direction
|
||||
int windCnt;
|
||||
int windCnt2; //winding count of the opposite polytype
|
||||
int outIdx;
|
||||
TEdge *next;
|
||||
TEdge *prev;
|
||||
TEdge *nextInLML;
|
||||
TEdge *nextInAEL;
|
||||
TEdge *prevInAEL;
|
||||
TEdge *nextInSEL;
|
||||
TEdge *prevInSEL;
|
||||
};
|
||||
|
||||
struct IntersectNode {
|
||||
TEdge *edge1;
|
||||
TEdge *edge2;
|
||||
IntPoint pt;
|
||||
IntersectNode *next;
|
||||
};
|
||||
|
||||
struct LocalMinima {
|
||||
long64 Y;
|
||||
TEdge *leftBound;
|
||||
TEdge *rightBound;
|
||||
LocalMinima *next;
|
||||
};
|
||||
|
||||
struct Scanbeam {
|
||||
long64 Y;
|
||||
Scanbeam *next;
|
||||
};
|
||||
|
||||
struct OutPt; //forward declaration
|
||||
|
||||
struct OutRec {
|
||||
int idx;
|
||||
bool isHole;
|
||||
OutRec *FirstLeft;
|
||||
OutRec *AppendLink;
|
||||
OutPt *pts;
|
||||
OutPt *bottomPt;
|
||||
OutPt *bottomFlag;
|
||||
EdgeSide sides;
|
||||
};
|
||||
|
||||
struct OutPt {
|
||||
int idx;
|
||||
IntPoint pt;
|
||||
OutPt *next;
|
||||
OutPt *prev;
|
||||
};
|
||||
|
||||
struct JoinRec {
|
||||
IntPoint pt1a;
|
||||
IntPoint pt1b;
|
||||
int poly1Idx;
|
||||
IntPoint pt2a;
|
||||
IntPoint pt2b;
|
||||
int poly2Idx;
|
||||
};
|
||||
|
||||
struct HorzJoinRec {
|
||||
TEdge *edge;
|
||||
int savedIdx;
|
||||
};
|
||||
|
||||
struct IntRect { long64 left; long64 top; long64 right; long64 bottom; };
|
||||
|
||||
typedef std::vector < OutRec* > PolyOutList;
|
||||
typedef std::vector < TEdge* > EdgeList;
|
||||
typedef std::vector < JoinRec* > JoinList;
|
||||
typedef std::vector < HorzJoinRec* > HorzJoinList;
|
||||
|
||||
//ClipperBase is the ancestor to the Clipper class. It should not be
|
||||
//instantiated directly. This class simply abstracts the conversion of sets of
|
||||
//polygon coordinates into edge objects that are stored in a LocalMinima list.
|
||||
class ClipperBase
|
||||
{
|
||||
public:
|
||||
ClipperBase();
|
||||
virtual ~ClipperBase();
|
||||
bool AddPolygon(const Polygon &pg, PolyType polyType);
|
||||
bool AddPolygons( const Polygons &ppg, PolyType polyType);
|
||||
virtual void Clear();
|
||||
IntRect GetBounds();
|
||||
protected:
|
||||
void DisposeLocalMinimaList();
|
||||
TEdge* AddBoundsToLML(TEdge *e);
|
||||
void PopLocalMinima();
|
||||
virtual void Reset();
|
||||
void InsertLocalMinima(LocalMinima *newLm);
|
||||
LocalMinima *m_CurrentLM;
|
||||
LocalMinima *m_MinimaList;
|
||||
bool m_UseFullRange;
|
||||
EdgeList m_edges;
|
||||
};
|
||||
|
||||
class Clipper : public virtual ClipperBase
|
||||
{
|
||||
public:
|
||||
Clipper();
|
||||
~Clipper();
|
||||
bool Execute(ClipType clipType,
|
||||
Polygons &solution,
|
||||
PolyFillType subjFillType = pftEvenOdd,
|
||||
PolyFillType clipFillType = pftEvenOdd);
|
||||
bool Execute(ClipType clipType,
|
||||
ExPolygons &solution,
|
||||
PolyFillType subjFillType = pftEvenOdd,
|
||||
PolyFillType clipFillType = pftEvenOdd);
|
||||
void Clear();
|
||||
bool ReverseSolution() {return m_ReverseOutput;};
|
||||
void ReverseSolution(bool value) {m_ReverseOutput = value;};
|
||||
protected:
|
||||
void Reset();
|
||||
virtual bool ExecuteInternal(bool fixHoleLinkages);
|
||||
private:
|
||||
PolyOutList m_PolyOuts;
|
||||
JoinList m_Joins;
|
||||
HorzJoinList m_HorizJoins;
|
||||
ClipType m_ClipType;
|
||||
Scanbeam *m_Scanbeam;
|
||||
TEdge *m_ActiveEdges;
|
||||
TEdge *m_SortedEdges;
|
||||
IntersectNode *m_IntersectNodes;
|
||||
bool m_ExecuteLocked;
|
||||
PolyFillType m_ClipFillType;
|
||||
PolyFillType m_SubjFillType;
|
||||
bool m_ReverseOutput;
|
||||
void DisposeScanbeamList();
|
||||
void SetWindingCount(TEdge& edge);
|
||||
bool IsEvenOddFillType(const TEdge& edge) const;
|
||||
bool IsEvenOddAltFillType(const TEdge& edge) const;
|
||||
void InsertScanbeam(const long64 Y);
|
||||
long64 PopScanbeam();
|
||||
void InsertLocalMinimaIntoAEL(const long64 botY);
|
||||
void InsertEdgeIntoAEL(TEdge *edge);
|
||||
void AddEdgeToSEL(TEdge *edge);
|
||||
void CopyAELToSEL();
|
||||
void DeleteFromSEL(TEdge *e);
|
||||
void DeleteFromAEL(TEdge *e);
|
||||
void UpdateEdgeIntoAEL(TEdge *&e);
|
||||
void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2);
|
||||
bool IsContributing(const TEdge& edge) const;
|
||||
bool IsTopHorz(const long64 XPos);
|
||||
void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
|
||||
void DoMaxima(TEdge *e, long64 topY);
|
||||
void ProcessHorizontals();
|
||||
void ProcessHorizontal(TEdge *horzEdge);
|
||||
void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
|
||||
void AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
|
||||
void AppendPolygon(TEdge *e1, TEdge *e2);
|
||||
void DoEdge1(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 IntersectEdges(TEdge *e1, TEdge *e2,
|
||||
const IntPoint &pt, IntersectProtects protects);
|
||||
OutRec* CreateOutRec();
|
||||
void AddOutPt(TEdge *e, const IntPoint &pt);
|
||||
void DisposeBottomPt(OutRec &outRec);
|
||||
void DisposeAllPolyPts();
|
||||
void DisposeOutRec(PolyOutList::size_type index);
|
||||
bool ProcessIntersections(const long64 botY, const long64 topY);
|
||||
void AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt);
|
||||
void BuildIntersectList(const long64 botY, const long64 topY);
|
||||
void ProcessIntersectList();
|
||||
void ProcessEdgesAtTopOfScanbeam(const long64 topY);
|
||||
void BuildResult(Polygons& polys);
|
||||
void BuildResultEx(ExPolygons& polys);
|
||||
void SetHoleState(TEdge *e, OutRec *OutRec);
|
||||
void DisposeIntersectNodes();
|
||||
bool FixupIntersections();
|
||||
void FixupOutPolygon(OutRec &outRec);
|
||||
bool IsHole(TEdge *e);
|
||||
void FixHoleLinkage(OutRec *outRec);
|
||||
void CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2);
|
||||
void CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2);
|
||||
void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1);
|
||||
void ClearJoins();
|
||||
void AddHorzJoin(TEdge *e, int idx);
|
||||
void ClearHorzJoins();
|
||||
void JoinCommonEdges(bool fixHoleLinkages);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class clipperException : public std::exception
|
||||
{
|
||||
public:
|
||||
clipperException(const char* description): m_descr(description) {}
|
||||
virtual ~clipperException() throw() {}
|
||||
virtual const char* what() const throw() {return m_descr.c_str();}
|
||||
private:
|
||||
std::string m_descr;
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
} //ClipperLib namespace
|
||||
|
||||
#endif //clipper_hpp
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,73 +1,73 @@
|
|||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __IRR_HEAPSORT_H_INCLUDED__
|
||||
#define __IRR_HEAPSORT_H_INCLUDED__
|
||||
|
||||
#include "irrTypes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
//! Sinks an element into the heap.
|
||||
template<class T>
|
||||
inline void heapsink(T*array, s32 element, s32 max)
|
||||
{
|
||||
while ((element<<1) < max) // there is a left child
|
||||
{
|
||||
s32 j = (element<<1);
|
||||
|
||||
if (j+1 < max && array[j] < array[j+1])
|
||||
j = j+1; // take right child
|
||||
|
||||
if (array[element] < array[j])
|
||||
{
|
||||
T t = array[j]; // swap elements
|
||||
array[j] = array[element];
|
||||
array[element] = t;
|
||||
element = j;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Sorts an array with size 'size' using heapsort.
|
||||
template<class T>
|
||||
inline void heapsort(T* array_, s32 size)
|
||||
{
|
||||
// for heapsink we pretent this is not c++, where
|
||||
// arrays start with index 0. So we decrease the array pointer,
|
||||
// the maximum always +2 and the element always +1
|
||||
|
||||
T* virtualArray = array_ - 1;
|
||||
s32 virtualSize = size + 2;
|
||||
s32 i;
|
||||
|
||||
// build heap
|
||||
|
||||
for (i=((size-1)/2); i>=0; --i)
|
||||
heapsink(virtualArray, i+1, virtualSize-1);
|
||||
|
||||
// sort array
|
||||
|
||||
for (i=size-1; i>=0; --i)
|
||||
{
|
||||
T t = array_[0];
|
||||
array_[0] = array_[i];
|
||||
array_[i] = t;
|
||||
heapsink(virtualArray, 1, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace core
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __IRR_HEAPSORT_H_INCLUDED__
|
||||
#define __IRR_HEAPSORT_H_INCLUDED__
|
||||
|
||||
#include "irrTypes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
//! Sinks an element into the heap.
|
||||
template<class T>
|
||||
inline void heapsink(T*array, s32 element, s32 max)
|
||||
{
|
||||
while ((element<<1) < max) // there is a left child
|
||||
{
|
||||
s32 j = (element<<1);
|
||||
|
||||
if (j+1 < max && array[j] < array[j+1])
|
||||
j = j+1; // take right child
|
||||
|
||||
if (array[element] < array[j])
|
||||
{
|
||||
T t = array[j]; // swap elements
|
||||
array[j] = array[element];
|
||||
array[element] = t;
|
||||
element = j;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//! Sorts an array with size 'size' using heapsort.
|
||||
template<class T>
|
||||
inline void heapsort(T* array_, s32 size)
|
||||
{
|
||||
// for heapsink we pretent this is not c++, where
|
||||
// arrays start with index 0. So we decrease the array pointer,
|
||||
// the maximum always +2 and the element always +1
|
||||
|
||||
T* virtualArray = array_ - 1;
|
||||
s32 virtualSize = size + 2;
|
||||
s32 i;
|
||||
|
||||
// build heap
|
||||
|
||||
for (i=((size-1)/2); i>=0; --i)
|
||||
heapsink(virtualArray, i+1, virtualSize-1);
|
||||
|
||||
// sort array
|
||||
|
||||
for (i=size-1; i>=0; --i)
|
||||
{
|
||||
T t = array_[0];
|
||||
array_[0] = array_[i];
|
||||
array_[i] = t;
|
||||
heapsink(virtualArray, 1, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
} // end namespace core
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,444 +1,444 @@
|
|||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
||||
// 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
|
||||
|
||||
#ifndef __IRR_ARRAY_H_INCLUDED__
|
||||
#define __IRR_ARRAY_H_INCLUDED__
|
||||
|
||||
#include "irrTypes.h"
|
||||
#include "heapsort.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
//! Self reallocating template array (like stl vector) with additional features.
|
||||
/** Some features are: Heap sorting, binary search methods, easier debugging.
|
||||
*/
|
||||
template <class T>
|
||||
class array
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
array()
|
||||
: data(0), allocated(0), used(0),
|
||||
free_when_destroyed(true), is_sorted(true)
|
||||
{
|
||||
}
|
||||
|
||||
//! Constructs a array and allocates an initial chunk of memory.
|
||||
//! \param start_count: Amount of elements to allocate.
|
||||
array(u32 start_count)
|
||||
: data(0), allocated(0), used(0),
|
||||
free_when_destroyed(true), is_sorted(true)
|
||||
{
|
||||
reallocate(start_count);
|
||||
}
|
||||
|
||||
|
||||
//! Copy constructor
|
||||
array(const array<T>& other)
|
||||
: data(0)
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Destructor. Frees allocated memory, if set_free_when_destroyed
|
||||
//! was not set to false by the user before.
|
||||
~array()
|
||||
{
|
||||
if (free_when_destroyed)
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Reallocates the array, make it bigger or smaller.
|
||||
//! \param new_size: New size of array.
|
||||
void reallocate(u32 new_size)
|
||||
{
|
||||
T* old_data = data;
|
||||
|
||||
data = new T[new_size];
|
||||
allocated = new_size;
|
||||
|
||||
s32 end = used < new_size ? used : new_size;
|
||||
for (s32 i=0; i<end; ++i)
|
||||
data[i] = old_data[i];
|
||||
|
||||
if (allocated < used)
|
||||
used = allocated;
|
||||
|
||||
delete [] old_data;
|
||||
}
|
||||
|
||||
//! Adds an element at back of array. If the array is to small to
|
||||
//! add this new element, the array is made bigger.
|
||||
//! \param element: Element to add at the back of the array.
|
||||
void push_back(const T& element)
|
||||
{
|
||||
if (used + 1 > allocated)
|
||||
{
|
||||
// reallocate(used * 2 +1);
|
||||
// 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
|
||||
// corruption
|
||||
|
||||
T e;
|
||||
e = element; // copy element
|
||||
reallocate(used * 2 +1); // increase data block
|
||||
data[used++] = e; // push_back
|
||||
is_sorted = false;
|
||||
return;
|
||||
}
|
||||
|
||||
data[used++] = element;
|
||||
is_sorted = false;
|
||||
}
|
||||
|
||||
|
||||
//! 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
|
||||
//! is slow, because the whole array needs to be copied for this.
|
||||
//! \param element: Element to add at the back of the array.
|
||||
void push_front(const T& element)
|
||||
{
|
||||
if (used + 1 > allocated)
|
||||
reallocate(used * 2 +1);
|
||||
|
||||
for (int i=(int)used; i>0; --i)
|
||||
data[i] = data[i-1];
|
||||
|
||||
data[0] = element;
|
||||
is_sorted = false;
|
||||
++used;
|
||||
}
|
||||
|
||||
|
||||
//! Insert item into array at specified position. Please use this
|
||||
//! only if you know what you are doing (possible performance loss).
|
||||
//! The preferred method of adding elements should be push_back().
|
||||
//! \param element: Element to be inserted
|
||||
//! \param index: Where position to insert the new element.
|
||||
void insert(const T& element, u32 index=0)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>used) // access violation
|
||||
|
||||
if (used + 1 > allocated)
|
||||
reallocate(used * 2 +1);
|
||||
|
||||
for (u32 i=used++; i>index; i--)
|
||||
data[i] = data[i-1];
|
||||
|
||||
data[index] = element;
|
||||
is_sorted = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//! Clears the array and deletes all allocated memory.
|
||||
void clear()
|
||||
{
|
||||
delete [] data;
|
||||
data = 0;
|
||||
used = 0;
|
||||
allocated = 0;
|
||||
is_sorted = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sets pointer to new array, using this as new workspace.
|
||||
//! \param newPointer: Pointer to new array of elements.
|
||||
//! \param size: Size of the new array.
|
||||
void set_pointer(T* newPointer, u32 size)
|
||||
{
|
||||
delete [] data;
|
||||
data = newPointer;
|
||||
allocated = size;
|
||||
used = size;
|
||||
is_sorted = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sets if the array should delete the memory it used.
|
||||
//! \param f: If true, the array frees the allocated memory in its
|
||||
//! destructor, otherwise not. The default is true.
|
||||
void set_free_when_destroyed(bool f)
|
||||
{
|
||||
free_when_destroyed = f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sets the size of the array.
|
||||
//! \param usedNow: Amount of elements now used.
|
||||
void set_used(u32 usedNow)
|
||||
{
|
||||
if (allocated < usedNow)
|
||||
reallocate(usedNow);
|
||||
|
||||
used = usedNow;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Assignement operator
|
||||
void operator=(const array<T>& other)
|
||||
{
|
||||
if (data)
|
||||
delete [] data;
|
||||
|
||||
//if (allocated < other.allocated)
|
||||
if (other.allocated == 0)
|
||||
data = 0;
|
||||
else
|
||||
data = new T[other.allocated];
|
||||
|
||||
used = other.used;
|
||||
free_when_destroyed = other.free_when_destroyed;
|
||||
is_sorted = other.is_sorted;
|
||||
allocated = other.allocated;
|
||||
|
||||
for (u32 i=0; i<other.used; ++i)
|
||||
data[i] = other.data[i];
|
||||
}
|
||||
|
||||
|
||||
//! Direct access operator
|
||||
T& operator [](u32 index)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used) // access violation
|
||||
|
||||
return data[index];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Direct access operator
|
||||
const T& operator [](u32 index) const
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used) // access violation
|
||||
|
||||
return data[index];
|
||||
}
|
||||
|
||||
//! Gets last frame
|
||||
const T& getLast() const
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!used) // access violation
|
||||
|
||||
return data[used-1];
|
||||
}
|
||||
|
||||
//! Gets last frame
|
||||
T& getLast()
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!used) // access violation
|
||||
|
||||
return data[used-1];
|
||||
}
|
||||
|
||||
|
||||
//! Returns a pointer to the array.
|
||||
//! \return Pointer to the array.
|
||||
T* pointer()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns a const pointer to the array.
|
||||
//! \return Pointer to the array.
|
||||
const T* const_pointer() const
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns size of used array.
|
||||
//! \return Size of elements in the array.
|
||||
u32 size() const
|
||||
{
|
||||
return used;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns amount memory allocated.
|
||||
//! \return Returns amount of memory allocated. The amount of bytes
|
||||
//! allocated would be allocated_size() * sizeof(ElementsUsed);
|
||||
u32 allocated_size() const
|
||||
{
|
||||
return allocated;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns true if array is empty
|
||||
//! \return True if the array is empty, false if not.
|
||||
bool empty() const
|
||||
{
|
||||
return used == 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sorts the array using heapsort. There is no additional memory waste and
|
||||
//! the algorithm performs (O) n log n in worst case.
|
||||
void sort()
|
||||
{
|
||||
if (is_sorted || used<2)
|
||||
return;
|
||||
|
||||
heapsort(data, used);
|
||||
is_sorted = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! 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
|
||||
//! already sorted.
|
||||
//! \param element: Element to search for.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 binary_search(const T& element)
|
||||
{
|
||||
return binary_search(element, 0, used-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! 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
|
||||
//! already sorted.
|
||||
//! \param element: Element to search for.
|
||||
//! \param left: First left index
|
||||
//! \param right: Last right index.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 binary_search(const T& element, s32 left, s32 right)
|
||||
{
|
||||
if (!used)
|
||||
return -1;
|
||||
|
||||
sort();
|
||||
|
||||
s32 m;
|
||||
|
||||
do
|
||||
{
|
||||
m = (left+right)>>1;
|
||||
|
||||
if (element < data[m])
|
||||
right = m - 1;
|
||||
else
|
||||
left = m + 1;
|
||||
|
||||
} while((element < data[m] || data[m] < element) && left<=right);
|
||||
|
||||
// this last line equals to:
|
||||
// " while((element != array[m]) && left<=right);"
|
||||
// but we only want to use the '<' operator.
|
||||
// the same in next line, it is "(element == array[m])"
|
||||
|
||||
if (!(element < data[m]) && !(data[m] < element))
|
||||
return m;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//! Finds an element in linear time, which is very slow. Use
|
||||
//! binary_search for faster finding. Only works if =operator is implemented.
|
||||
//! \param element: Element to search for.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 linear_search(T& element)
|
||||
{
|
||||
for (u32 i=0; i<used; ++i)
|
||||
if (!(element < data[i]) && !(data[i] < element))
|
||||
return (s32)i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//! Finds an element in linear time, which is very slow. Use
|
||||
//! binary_search for faster finding. Only works if =operator is implemented.
|
||||
//! \param element: Element to search for.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 linear_reverse_search(T& element)
|
||||
{
|
||||
for (s32 i=used-1; i>=0; --i)
|
||||
if (data[i] == element)
|
||||
return (s32)i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Erases an element from the array. May be slow, because all elements
|
||||
//! following after the erased element have to be copied.
|
||||
//! \param index: Index of element to be erased.
|
||||
void erase(u32 index)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used || index<0) // access violation
|
||||
|
||||
for (u32 i=index+1; i<used; ++i)
|
||||
data[i-1] = data[i];
|
||||
|
||||
--used;
|
||||
}
|
||||
|
||||
|
||||
//! Erases some elements from the array. may be slow, because all elements
|
||||
//! following after the erased element have to be copied.
|
||||
//! \param index: Index of the first element to be erased.
|
||||
//! \param count: Amount of elements to be erased.
|
||||
void erase(u32 index, s32 count)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used || index<0 || count<1 || index+count>used) // access violation
|
||||
|
||||
for (u32 i=index+count; i<used; ++i)
|
||||
data[i-count] = data[i];
|
||||
|
||||
used-= count;
|
||||
}
|
||||
|
||||
|
||||
//! Sets if the array is sorted
|
||||
void set_sorted(bool _is_sorted)
|
||||
{
|
||||
is_sorted = _is_sorted;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
T* data;
|
||||
u32 allocated;
|
||||
u32 used;
|
||||
bool free_when_destroyed;
|
||||
bool is_sorted;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace core
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
||||
// 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
|
||||
|
||||
#ifndef __IRR_ARRAY_H_INCLUDED__
|
||||
#define __IRR_ARRAY_H_INCLUDED__
|
||||
|
||||
#include "irrTypes.h"
|
||||
#include "heapsort.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
//! Self reallocating template array (like stl vector) with additional features.
|
||||
/** Some features are: Heap sorting, binary search methods, easier debugging.
|
||||
*/
|
||||
template <class T>
|
||||
class array
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
array()
|
||||
: data(0), allocated(0), used(0),
|
||||
free_when_destroyed(true), is_sorted(true)
|
||||
{
|
||||
}
|
||||
|
||||
//! Constructs a array and allocates an initial chunk of memory.
|
||||
//! \param start_count: Amount of elements to allocate.
|
||||
array(u32 start_count)
|
||||
: data(0), allocated(0), used(0),
|
||||
free_when_destroyed(true), is_sorted(true)
|
||||
{
|
||||
reallocate(start_count);
|
||||
}
|
||||
|
||||
|
||||
//! Copy constructor
|
||||
array(const array<T>& other)
|
||||
: data(0)
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Destructor. Frees allocated memory, if set_free_when_destroyed
|
||||
//! was not set to false by the user before.
|
||||
~array()
|
||||
{
|
||||
if (free_when_destroyed)
|
||||
delete [] data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Reallocates the array, make it bigger or smaller.
|
||||
//! \param new_size: New size of array.
|
||||
void reallocate(u32 new_size)
|
||||
{
|
||||
T* old_data = data;
|
||||
|
||||
data = new T[new_size];
|
||||
allocated = new_size;
|
||||
|
||||
s32 end = used < new_size ? used : new_size;
|
||||
for (s32 i=0; i<end; ++i)
|
||||
data[i] = old_data[i];
|
||||
|
||||
if (allocated < used)
|
||||
used = allocated;
|
||||
|
||||
delete [] old_data;
|
||||
}
|
||||
|
||||
//! Adds an element at back of array. If the array is to small to
|
||||
//! add this new element, the array is made bigger.
|
||||
//! \param element: Element to add at the back of the array.
|
||||
void push_back(const T& element)
|
||||
{
|
||||
if (used + 1 > allocated)
|
||||
{
|
||||
// reallocate(used * 2 +1);
|
||||
// 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
|
||||
// corruption
|
||||
|
||||
T e;
|
||||
e = element; // copy element
|
||||
reallocate(used * 2 +1); // increase data block
|
||||
data[used++] = e; // push_back
|
||||
is_sorted = false;
|
||||
return;
|
||||
}
|
||||
|
||||
data[used++] = element;
|
||||
is_sorted = false;
|
||||
}
|
||||
|
||||
|
||||
//! 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
|
||||
//! is slow, because the whole array needs to be copied for this.
|
||||
//! \param element: Element to add at the back of the array.
|
||||
void push_front(const T& element)
|
||||
{
|
||||
if (used + 1 > allocated)
|
||||
reallocate(used * 2 +1);
|
||||
|
||||
for (int i=(int)used; i>0; --i)
|
||||
data[i] = data[i-1];
|
||||
|
||||
data[0] = element;
|
||||
is_sorted = false;
|
||||
++used;
|
||||
}
|
||||
|
||||
|
||||
//! Insert item into array at specified position. Please use this
|
||||
//! only if you know what you are doing (possible performance loss).
|
||||
//! The preferred method of adding elements should be push_back().
|
||||
//! \param element: Element to be inserted
|
||||
//! \param index: Where position to insert the new element.
|
||||
void insert(const T& element, u32 index=0)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>used) // access violation
|
||||
|
||||
if (used + 1 > allocated)
|
||||
reallocate(used * 2 +1);
|
||||
|
||||
for (u32 i=used++; i>index; i--)
|
||||
data[i] = data[i-1];
|
||||
|
||||
data[index] = element;
|
||||
is_sorted = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//! Clears the array and deletes all allocated memory.
|
||||
void clear()
|
||||
{
|
||||
delete [] data;
|
||||
data = 0;
|
||||
used = 0;
|
||||
allocated = 0;
|
||||
is_sorted = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sets pointer to new array, using this as new workspace.
|
||||
//! \param newPointer: Pointer to new array of elements.
|
||||
//! \param size: Size of the new array.
|
||||
void set_pointer(T* newPointer, u32 size)
|
||||
{
|
||||
delete [] data;
|
||||
data = newPointer;
|
||||
allocated = size;
|
||||
used = size;
|
||||
is_sorted = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sets if the array should delete the memory it used.
|
||||
//! \param f: If true, the array frees the allocated memory in its
|
||||
//! destructor, otherwise not. The default is true.
|
||||
void set_free_when_destroyed(bool f)
|
||||
{
|
||||
free_when_destroyed = f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sets the size of the array.
|
||||
//! \param usedNow: Amount of elements now used.
|
||||
void set_used(u32 usedNow)
|
||||
{
|
||||
if (allocated < usedNow)
|
||||
reallocate(usedNow);
|
||||
|
||||
used = usedNow;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Assignement operator
|
||||
void operator=(const array<T>& other)
|
||||
{
|
||||
if (data)
|
||||
delete [] data;
|
||||
|
||||
//if (allocated < other.allocated)
|
||||
if (other.allocated == 0)
|
||||
data = 0;
|
||||
else
|
||||
data = new T[other.allocated];
|
||||
|
||||
used = other.used;
|
||||
free_when_destroyed = other.free_when_destroyed;
|
||||
is_sorted = other.is_sorted;
|
||||
allocated = other.allocated;
|
||||
|
||||
for (u32 i=0; i<other.used; ++i)
|
||||
data[i] = other.data[i];
|
||||
}
|
||||
|
||||
|
||||
//! Direct access operator
|
||||
T& operator [](u32 index)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used) // access violation
|
||||
|
||||
return data[index];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Direct access operator
|
||||
const T& operator [](u32 index) const
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used) // access violation
|
||||
|
||||
return data[index];
|
||||
}
|
||||
|
||||
//! Gets last frame
|
||||
const T& getLast() const
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!used) // access violation
|
||||
|
||||
return data[used-1];
|
||||
}
|
||||
|
||||
//! Gets last frame
|
||||
T& getLast()
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!used) // access violation
|
||||
|
||||
return data[used-1];
|
||||
}
|
||||
|
||||
|
||||
//! Returns a pointer to the array.
|
||||
//! \return Pointer to the array.
|
||||
T* pointer()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns a const pointer to the array.
|
||||
//! \return Pointer to the array.
|
||||
const T* const_pointer() const
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns size of used array.
|
||||
//! \return Size of elements in the array.
|
||||
u32 size() const
|
||||
{
|
||||
return used;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns amount memory allocated.
|
||||
//! \return Returns amount of memory allocated. The amount of bytes
|
||||
//! allocated would be allocated_size() * sizeof(ElementsUsed);
|
||||
u32 allocated_size() const
|
||||
{
|
||||
return allocated;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Returns true if array is empty
|
||||
//! \return True if the array is empty, false if not.
|
||||
bool empty() const
|
||||
{
|
||||
return used == 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Sorts the array using heapsort. There is no additional memory waste and
|
||||
//! the algorithm performs (O) n log n in worst case.
|
||||
void sort()
|
||||
{
|
||||
if (is_sorted || used<2)
|
||||
return;
|
||||
|
||||
heapsort(data, used);
|
||||
is_sorted = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! 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
|
||||
//! already sorted.
|
||||
//! \param element: Element to search for.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 binary_search(const T& element)
|
||||
{
|
||||
return binary_search(element, 0, used-1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! 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
|
||||
//! already sorted.
|
||||
//! \param element: Element to search for.
|
||||
//! \param left: First left index
|
||||
//! \param right: Last right index.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 binary_search(const T& element, s32 left, s32 right)
|
||||
{
|
||||
if (!used)
|
||||
return -1;
|
||||
|
||||
sort();
|
||||
|
||||
s32 m;
|
||||
|
||||
do
|
||||
{
|
||||
m = (left+right)>>1;
|
||||
|
||||
if (element < data[m])
|
||||
right = m - 1;
|
||||
else
|
||||
left = m + 1;
|
||||
|
||||
} while((element < data[m] || data[m] < element) && left<=right);
|
||||
|
||||
// this last line equals to:
|
||||
// " while((element != array[m]) && left<=right);"
|
||||
// but we only want to use the '<' operator.
|
||||
// the same in next line, it is "(element == array[m])"
|
||||
|
||||
if (!(element < data[m]) && !(data[m] < element))
|
||||
return m;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//! Finds an element in linear time, which is very slow. Use
|
||||
//! binary_search for faster finding. Only works if =operator is implemented.
|
||||
//! \param element: Element to search for.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 linear_search(T& element)
|
||||
{
|
||||
for (u32 i=0; i<used; ++i)
|
||||
if (!(element < data[i]) && !(data[i] < element))
|
||||
return (s32)i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
//! Finds an element in linear time, which is very slow. Use
|
||||
//! binary_search for faster finding. Only works if =operator is implemented.
|
||||
//! \param element: Element to search for.
|
||||
//! \return Returns position of the searched element if it was found,
|
||||
//! otherwise -1 is returned.
|
||||
s32 linear_reverse_search(T& element)
|
||||
{
|
||||
for (s32 i=used-1; i>=0; --i)
|
||||
if (data[i] == element)
|
||||
return (s32)i;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! Erases an element from the array. May be slow, because all elements
|
||||
//! following after the erased element have to be copied.
|
||||
//! \param index: Index of element to be erased.
|
||||
void erase(u32 index)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used || index<0) // access violation
|
||||
|
||||
for (u32 i=index+1; i<used; ++i)
|
||||
data[i-1] = data[i];
|
||||
|
||||
--used;
|
||||
}
|
||||
|
||||
|
||||
//! Erases some elements from the array. may be slow, because all elements
|
||||
//! following after the erased element have to be copied.
|
||||
//! \param index: Index of the first element to be erased.
|
||||
//! \param count: Amount of elements to be erased.
|
||||
void erase(u32 index, s32 count)
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(index>=used || index<0 || count<1 || index+count>used) // access violation
|
||||
|
||||
for (u32 i=index+count; i<used; ++i)
|
||||
data[i-count] = data[i];
|
||||
|
||||
used-= count;
|
||||
}
|
||||
|
||||
|
||||
//! Sets if the array is sorted
|
||||
void set_sorted(bool _is_sorted)
|
||||
{
|
||||
is_sorted = _is_sorted;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
T* data;
|
||||
u32 allocated;
|
||||
u32 used;
|
||||
bool free_when_destroyed;
|
||||
bool is_sorted;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace core
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,108 +1,108 @@
|
|||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __IRR_TYPES_H_INCLUDED__
|
||||
#define __IRR_TYPES_H_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
//! 8 bit unsigned variable.
|
||||
/** This is a typedef for unsigned char, it ensures portability of the engine. */
|
||||
typedef unsigned char u8;
|
||||
|
||||
//! 8 bit signed variable.
|
||||
/** This is a typedef for signed char, it ensures portability of the engine. */
|
||||
typedef signed char s8;
|
||||
|
||||
//! 8 bit character variable.
|
||||
/** This is a typedef for char, it ensures portability of the engine. */
|
||||
typedef char c8;
|
||||
|
||||
|
||||
|
||||
//! 16 bit unsigned variable.
|
||||
/** This is a typedef for unsigned short, it ensures portability of the engine. */
|
||||
typedef unsigned short u16;
|
||||
|
||||
//! 16 bit signed variable.
|
||||
/** This is a typedef for signed short, it ensures portability of the engine. */
|
||||
typedef signed short s16;
|
||||
|
||||
|
||||
|
||||
//! 32 bit unsigned variable.
|
||||
/** This is a typedef for unsigned int, it ensures portability of the engine. */
|
||||
typedef unsigned int u32;
|
||||
|
||||
//! 32 bit signed variable.
|
||||
/** This is a typedef for signed int, it ensures portability of the engine. */
|
||||
typedef signed int s32;
|
||||
|
||||
|
||||
|
||||
// 64 bit signed variable.
|
||||
// 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
|
||||
// other than Microsoft Compilers, so it is outcommented.
|
||||
//typedef __int64 s64;
|
||||
|
||||
|
||||
|
||||
//! 32 bit floating point variable.
|
||||
/** This is a typedef for float, it ensures portability of the engine. */
|
||||
typedef float f32;
|
||||
|
||||
//! 64 bit floating point variable.
|
||||
/** This is a typedef for double, it ensures portability of the engine. */
|
||||
typedef double f64;
|
||||
|
||||
|
||||
} // end namespace
|
||||
|
||||
|
||||
// define the wchar_t type if not already built in.
|
||||
#ifdef _MSC_VER
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
//! A 16 bit wide character type.
|
||||
/**
|
||||
Defines the wchar_t-type.
|
||||
In VS6, its not possible to tell
|
||||
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,
|
||||
so we'll use this.
|
||||
*/
|
||||
typedef unsigned short wchar_t;
|
||||
#define _WCHAR_T_DEFINED
|
||||
#endif // wchar is not defined
|
||||
#endif // microsoft compiler
|
||||
|
||||
//! define a break macro for debugging only in Win32 mode.
|
||||
// WORKAROUND (assimp): remove __asm
|
||||
#if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG)
|
||||
#if defined(_M_IX86)
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) /*if (_CONDITION_) {_asm int 3}*/
|
||||
#else
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
|
||||
#endif
|
||||
#else
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
|
||||
#endif
|
||||
|
||||
//! Defines a small statement to work around a microsoft compiler 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,
|
||||
the return value may appear as true. See
|
||||
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*/
|
||||
|
||||
// WORKAROUND (assimp): remove __asm
|
||||
#if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
|
||||
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX /*__asm mov eax,100*/
|
||||
#else
|
||||
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
|
||||
#endif // _IRR_MANAGED_MARSHALLING_BUGFIX
|
||||
|
||||
#endif // __IRR_TYPES_H_INCLUDED__
|
||||
|
||||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __IRR_TYPES_H_INCLUDED__
|
||||
#define __IRR_TYPES_H_INCLUDED__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
//! 8 bit unsigned variable.
|
||||
/** This is a typedef for unsigned char, it ensures portability of the engine. */
|
||||
typedef unsigned char u8;
|
||||
|
||||
//! 8 bit signed variable.
|
||||
/** This is a typedef for signed char, it ensures portability of the engine. */
|
||||
typedef signed char s8;
|
||||
|
||||
//! 8 bit character variable.
|
||||
/** This is a typedef for char, it ensures portability of the engine. */
|
||||
typedef char c8;
|
||||
|
||||
|
||||
|
||||
//! 16 bit unsigned variable.
|
||||
/** This is a typedef for unsigned short, it ensures portability of the engine. */
|
||||
typedef unsigned short u16;
|
||||
|
||||
//! 16 bit signed variable.
|
||||
/** This is a typedef for signed short, it ensures portability of the engine. */
|
||||
typedef signed short s16;
|
||||
|
||||
|
||||
|
||||
//! 32 bit unsigned variable.
|
||||
/** This is a typedef for unsigned int, it ensures portability of the engine. */
|
||||
typedef unsigned int u32;
|
||||
|
||||
//! 32 bit signed variable.
|
||||
/** This is a typedef for signed int, it ensures portability of the engine. */
|
||||
typedef signed int s32;
|
||||
|
||||
|
||||
|
||||
// 64 bit signed variable.
|
||||
// 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
|
||||
// other than Microsoft Compilers, so it is outcommented.
|
||||
//typedef __int64 s64;
|
||||
|
||||
|
||||
|
||||
//! 32 bit floating point variable.
|
||||
/** This is a typedef for float, it ensures portability of the engine. */
|
||||
typedef float f32;
|
||||
|
||||
//! 64 bit floating point variable.
|
||||
/** This is a typedef for double, it ensures portability of the engine. */
|
||||
typedef double f64;
|
||||
|
||||
|
||||
} // end namespace
|
||||
|
||||
|
||||
// define the wchar_t type if not already built in.
|
||||
#ifdef _MSC_VER
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
//! A 16 bit wide character type.
|
||||
/**
|
||||
Defines the wchar_t-type.
|
||||
In VS6, its not possible to tell
|
||||
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,
|
||||
so we'll use this.
|
||||
*/
|
||||
typedef unsigned short wchar_t;
|
||||
#define _WCHAR_T_DEFINED
|
||||
#endif // wchar is not defined
|
||||
#endif // microsoft compiler
|
||||
|
||||
//! define a break macro for debugging only in Win32 mode.
|
||||
// WORKAROUND (assimp): remove __asm
|
||||
#if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG)
|
||||
#if defined(_M_IX86)
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) /*if (_CONDITION_) {_asm int 3}*/
|
||||
#else
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
|
||||
#endif
|
||||
#else
|
||||
#define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
|
||||
#endif
|
||||
|
||||
//! Defines a small statement to work around a microsoft compiler 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,
|
||||
the return value may appear as true. See
|
||||
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*/
|
||||
|
||||
// WORKAROUND (assimp): remove __asm
|
||||
#if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
|
||||
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX /*__asm mov eax,100*/
|
||||
#else
|
||||
#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
|
||||
#endif // _IRR_MANAGED_MARSHALLING_BUGFIX
|
||||
|
||||
#endif // __IRR_TYPES_H_INCLUDED__
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
|
||||
IrrXML
|
||||
Downloaded September 2008
|
||||
|
||||
- fixed a minor compiler warning (vs 2005, shift too large)
|
||||
- fixed an issue regarding wchar_t/unsigned short
|
||||
|
||||
IrrXML
|
||||
Downloaded September 2008
|
||||
|
||||
- fixed a minor compiler warning (vs 2005, shift too large)
|
||||
- fixed an issue regarding wchar_t/unsigned short
|
||||
|
|
|
@ -1,105 +1,105 @@
|
|||
/*
|
||||
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
|
||||
* http://code.google.com/p/poly2tri/
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * 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
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
// Otherwise #defines like M_PI are undeclared under Visual Studio
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <exception>
|
||||
#include <math.h>
|
||||
|
||||
namespace p2t {
|
||||
|
||||
const double PI_3div4 = 3 * M_PI / 4;
|
||||
const double EPSILON = 1e-15;
|
||||
|
||||
enum Orientation { CW, CCW, COLLINEAR };
|
||||
|
||||
/**
|
||||
* Forumla to calculate signed area<br>
|
||||
* Positive if CCW<br>
|
||||
* Negative if CW<br>
|
||||
* 0 if collinear<br>
|
||||
* <pre>
|
||||
* A[P1,P2,P3] = (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
|
||||
* = (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)
|
||||
* </pre>
|
||||
*/
|
||||
Orientation Orient2d(Point& pa, Point& pb, Point& pc)
|
||||
{
|
||||
double detleft = (pa.x - pc.x) * (pb.y - pc.y);
|
||||
double detright = (pa.y - pc.y) * (pb.x - pc.x);
|
||||
double val = detleft - detright;
|
||||
if (val > -EPSILON && val < EPSILON) {
|
||||
return COLLINEAR;
|
||||
} else if (val > 0) {
|
||||
return CCW;
|
||||
}
|
||||
return CW;
|
||||
}
|
||||
|
||||
bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd)
|
||||
{
|
||||
double pdx = pd.x;
|
||||
double pdy = pd.y;
|
||||
double adx = pa.x - pdx;
|
||||
double ady = pa.y - pdy;
|
||||
double bdx = pb.x - pdx;
|
||||
double bdy = pb.y - pdy;
|
||||
|
||||
double adxbdy = adx * bdy;
|
||||
double bdxady = bdx * ady;
|
||||
double oabd = adxbdy - bdxady;
|
||||
|
||||
if (oabd <= EPSILON) {
|
||||
return false;
|
||||
}
|
||||
|
||||
double cdx = pc.x - pdx;
|
||||
double cdy = pc.y - pdy;
|
||||
|
||||
double cdxady = cdx * ady;
|
||||
double adxcdy = adx * cdy;
|
||||
double ocad = cdxady - adxcdy;
|
||||
|
||||
if (ocad <= EPSILON) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
|
||||
* http://code.google.com/p/poly2tri/
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * 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
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
// Otherwise #defines like M_PI are undeclared under Visual Studio
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <exception>
|
||||
#include <math.h>
|
||||
|
||||
namespace p2t {
|
||||
|
||||
const double PI_3div4 = 3 * M_PI / 4;
|
||||
const double EPSILON = 1e-15;
|
||||
|
||||
enum Orientation { CW, CCW, COLLINEAR };
|
||||
|
||||
/**
|
||||
* Forumla to calculate signed area<br>
|
||||
* Positive if CCW<br>
|
||||
* Negative if CW<br>
|
||||
* 0 if collinear<br>
|
||||
* <pre>
|
||||
* A[P1,P2,P3] = (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
|
||||
* = (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)
|
||||
* </pre>
|
||||
*/
|
||||
Orientation Orient2d(Point& pa, Point& pb, Point& pc)
|
||||
{
|
||||
double detleft = (pa.x - pc.x) * (pb.y - pc.y);
|
||||
double detright = (pa.y - pc.y) * (pb.x - pc.x);
|
||||
double val = detleft - detright;
|
||||
if (val > -EPSILON && val < EPSILON) {
|
||||
return COLLINEAR;
|
||||
} else if (val > 0) {
|
||||
return CCW;
|
||||
}
|
||||
return CW;
|
||||
}
|
||||
|
||||
bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd)
|
||||
{
|
||||
double pdx = pd.x;
|
||||
double pdy = pd.y;
|
||||
double adx = pa.x - pdx;
|
||||
double ady = pa.y - pdy;
|
||||
double bdx = pb.x - pdx;
|
||||
double bdy = pb.y - pdy;
|
||||
|
||||
double adxbdy = adx * bdy;
|
||||
double bdxady = bdx * ady;
|
||||
double oabd = adxbdy - bdxady;
|
||||
|
||||
if (oabd <= EPSILON) {
|
||||
return false;
|
||||
}
|
||||
|
||||
double cdx = pc.x - pdx;
|
||||
double cdy = pc.y - pdy;
|
||||
|
||||
double cdxady = cdx * ady;
|
||||
double adxcdy = adx * cdy;
|
||||
double ocad = cdxady - adxcdy;
|
||||
|
||||
if (ocad <= EPSILON) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,105 +1,105 @@
|
|||
/*
|
||||
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
|
||||
* http://code.google.com/p/poly2tri/
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * 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
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef CDT_H
|
||||
#define CDT_H
|
||||
|
||||
#include "advancing_front.h"
|
||||
#include "sweep_context.h"
|
||||
#include "sweep.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mason Green <mason.green@gmail.com>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace p2t {
|
||||
|
||||
class CDT
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor - add polyline with non repeating points
|
||||
*
|
||||
* @param polyline
|
||||
*/
|
||||
CDT(std::vector<Point*> polyline);
|
||||
|
||||
/**
|
||||
* Destructor - clean up memory
|
||||
*/
|
||||
~CDT();
|
||||
|
||||
/**
|
||||
* Add a hole
|
||||
*
|
||||
* @param polyline
|
||||
*/
|
||||
void AddHole(std::vector<Point*> polyline);
|
||||
|
||||
/**
|
||||
* Add a steiner point
|
||||
*
|
||||
* @param point
|
||||
*/
|
||||
void AddPoint(Point* point);
|
||||
|
||||
/**
|
||||
* Triangulate - do this AFTER you've added the polyline, holes, and Steiner points
|
||||
*/
|
||||
void Triangulate();
|
||||
|
||||
/**
|
||||
* Get CDT triangles
|
||||
*/
|
||||
std::vector<Triangle*> GetTriangles();
|
||||
|
||||
/**
|
||||
* Get triangle map
|
||||
*/
|
||||
std::list<Triangle*> GetMap();
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Internals
|
||||
*/
|
||||
|
||||
SweepContext* sweep_context_;
|
||||
Sweep* sweep_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
|
||||
* http://code.google.com/p/poly2tri/
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * 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
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef CDT_H
|
||||
#define CDT_H
|
||||
|
||||
#include "advancing_front.h"
|
||||
#include "sweep_context.h"
|
||||
#include "sweep.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mason Green <mason.green@gmail.com>
|
||||
*
|
||||
*/
|
||||
|
||||
namespace p2t {
|
||||
|
||||
class CDT
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor - add polyline with non repeating points
|
||||
*
|
||||
* @param polyline
|
||||
*/
|
||||
CDT(std::vector<Point*> polyline);
|
||||
|
||||
/**
|
||||
* Destructor - clean up memory
|
||||
*/
|
||||
~CDT();
|
||||
|
||||
/**
|
||||
* Add a hole
|
||||
*
|
||||
* @param polyline
|
||||
*/
|
||||
void AddHole(std::vector<Point*> polyline);
|
||||
|
||||
/**
|
||||
* Add a steiner point
|
||||
*
|
||||
* @param point
|
||||
*/
|
||||
void AddPoint(Point* point);
|
||||
|
||||
/**
|
||||
* Triangulate - do this AFTER you've added the polyline, holes, and Steiner points
|
||||
*/
|
||||
void Triangulate();
|
||||
|
||||
/**
|
||||
* Get CDT triangles
|
||||
*/
|
||||
std::vector<Triangle*> GetTriangles();
|
||||
|
||||
/**
|
||||
* Get triangle map
|
||||
*/
|
||||
std::list<Triangle*> GetMap();
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Internals
|
||||
*/
|
||||
|
||||
SweepContext* sweep_context_;
|
||||
Sweep* sweep_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,186 +1,186 @@
|
|||
/*
|
||||
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
|
||||
* http://code.google.com/p/poly2tri/
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * 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
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef SWEEP_CONTEXT_H
|
||||
#define SWEEP_CONTEXT_H
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
|
||||
namespace p2t {
|
||||
|
||||
// Inital triangle factor, seed triangle will extend 30% of
|
||||
// PointSet width to both left and right.
|
||||
const double kAlpha = 0.3;
|
||||
|
||||
struct Point;
|
||||
class Triangle;
|
||||
struct Node;
|
||||
struct Edge;
|
||||
class AdvancingFront;
|
||||
|
||||
class SweepContext {
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
SweepContext(std::vector<Point*> polyline);
|
||||
/// Destructor
|
||||
~SweepContext();
|
||||
|
||||
void set_head(Point* p1);
|
||||
|
||||
Point* head();
|
||||
|
||||
void set_tail(Point* p1);
|
||||
|
||||
Point* tail();
|
||||
|
||||
int point_count();
|
||||
|
||||
Node& LocateNode(Point& point);
|
||||
|
||||
void RemoveNode(Node* node);
|
||||
|
||||
void CreateAdvancingFront(std::vector<Node*> nodes);
|
||||
|
||||
/// Try to map a node to all sides of this triangle that don't have a neighbor
|
||||
void MapTriangleToNodes(Triangle& t);
|
||||
|
||||
void AddToMap(Triangle* triangle);
|
||||
|
||||
Point* GetPoint(const int& index);
|
||||
|
||||
Point* GetPoints();
|
||||
|
||||
void RemoveFromMap(Triangle* triangle);
|
||||
|
||||
void AddHole(std::vector<Point*> polyline);
|
||||
|
||||
void AddPoint(Point* point);
|
||||
|
||||
AdvancingFront* front();
|
||||
|
||||
void MeshClean(Triangle& triangle);
|
||||
|
||||
std::vector<Triangle*> GetTriangles();
|
||||
/*
|
||||
* Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
|
||||
* http://code.google.com/p/poly2tri/
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * 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
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef SWEEP_CONTEXT_H
|
||||
#define SWEEP_CONTEXT_H
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
|
||||
namespace p2t {
|
||||
|
||||
// Inital triangle factor, seed triangle will extend 30% of
|
||||
// PointSet width to both left and right.
|
||||
const double kAlpha = 0.3;
|
||||
|
||||
struct Point;
|
||||
class Triangle;
|
||||
struct Node;
|
||||
struct Edge;
|
||||
class AdvancingFront;
|
||||
|
||||
class SweepContext {
|
||||
public:
|
||||
|
||||
/// Constructor
|
||||
SweepContext(std::vector<Point*> polyline);
|
||||
/// Destructor
|
||||
~SweepContext();
|
||||
|
||||
void set_head(Point* p1);
|
||||
|
||||
Point* head();
|
||||
|
||||
void set_tail(Point* p1);
|
||||
|
||||
Point* tail();
|
||||
|
||||
int point_count();
|
||||
|
||||
Node& LocateNode(Point& point);
|
||||
|
||||
void RemoveNode(Node* node);
|
||||
|
||||
void CreateAdvancingFront(std::vector<Node*> nodes);
|
||||
|
||||
/// Try to map a node to all sides of this triangle that don't have a neighbor
|
||||
void MapTriangleToNodes(Triangle& t);
|
||||
|
||||
void AddToMap(Triangle* triangle);
|
||||
|
||||
Point* GetPoint(const int& index);
|
||||
|
||||
Point* GetPoints();
|
||||
|
||||
void RemoveFromMap(Triangle* triangle);
|
||||
|
||||
void AddHole(std::vector<Point*> polyline);
|
||||
|
||||
void AddPoint(Point* point);
|
||||
|
||||
AdvancingFront* front();
|
||||
|
||||
void MeshClean(Triangle& triangle);
|
||||
|
||||
std::vector<Triangle*> GetTriangles();
|
||||
std::list<Triangle*> GetMap();
|
||||
|
||||
std::vector<Edge*> edge_list;
|
||||
|
||||
struct Basin {
|
||||
Node* left_node;
|
||||
Node* bottom_node;
|
||||
Node* right_node;
|
||||
double width;
|
||||
bool left_highest;
|
||||
|
||||
Basin() : left_node(NULL), bottom_node(NULL), right_node(NULL), width(0.0), left_highest(false)
|
||||
{
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
left_node = NULL;
|
||||
bottom_node = NULL;
|
||||
right_node = NULL;
|
||||
width = 0.0;
|
||||
left_highest = false;
|
||||
}
|
||||
};
|
||||
|
||||
struct EdgeEvent {
|
||||
Edge* constrained_edge;
|
||||
bool right;
|
||||
|
||||
EdgeEvent() : constrained_edge(NULL), right(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Basin basin;
|
||||
EdgeEvent edge_event;
|
||||
|
||||
private:
|
||||
|
||||
friend class Sweep;
|
||||
|
||||
std::vector<Triangle*> triangles_;
|
||||
std::list<Triangle*> map_;
|
||||
std::vector<Point*> points_;
|
||||
|
||||
// Advancing front
|
||||
AdvancingFront* front_;
|
||||
// head point used with advancing front
|
||||
Point* head_;
|
||||
// tail point used with advancing front
|
||||
Point* tail_;
|
||||
|
||||
Node *af_head_, *af_middle_, *af_tail_;
|
||||
|
||||
void InitTriangulation();
|
||||
void InitEdges(std::vector<Point*> polyline);
|
||||
|
||||
};
|
||||
|
||||
inline AdvancingFront* SweepContext::front()
|
||||
{
|
||||
return front_;
|
||||
}
|
||||
|
||||
inline int SweepContext::point_count()
|
||||
{
|
||||
return points_.size();
|
||||
}
|
||||
|
||||
inline void SweepContext::set_head(Point* p1)
|
||||
{
|
||||
head_ = p1;
|
||||
}
|
||||
|
||||
inline Point* SweepContext::head()
|
||||
{
|
||||
return head_;
|
||||
}
|
||||
|
||||
inline void SweepContext::set_tail(Point* p1)
|
||||
{
|
||||
tail_ = p1;
|
||||
}
|
||||
|
||||
inline Point* SweepContext::tail()
|
||||
{
|
||||
return tail_;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
std::vector<Edge*> edge_list;
|
||||
|
||||
struct Basin {
|
||||
Node* left_node;
|
||||
Node* bottom_node;
|
||||
Node* right_node;
|
||||
double width;
|
||||
bool left_highest;
|
||||
|
||||
Basin() : left_node(NULL), bottom_node(NULL), right_node(NULL), width(0.0), left_highest(false)
|
||||
{
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
left_node = NULL;
|
||||
bottom_node = NULL;
|
||||
right_node = NULL;
|
||||
width = 0.0;
|
||||
left_highest = false;
|
||||
}
|
||||
};
|
||||
|
||||
struct EdgeEvent {
|
||||
Edge* constrained_edge;
|
||||
bool right;
|
||||
|
||||
EdgeEvent() : constrained_edge(NULL), right(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Basin basin;
|
||||
EdgeEvent edge_event;
|
||||
|
||||
private:
|
||||
|
||||
friend class Sweep;
|
||||
|
||||
std::vector<Triangle*> triangles_;
|
||||
std::list<Triangle*> map_;
|
||||
std::vector<Point*> points_;
|
||||
|
||||
// Advancing front
|
||||
AdvancingFront* front_;
|
||||
// head point used with advancing front
|
||||
Point* head_;
|
||||
// tail point used with advancing front
|
||||
Point* tail_;
|
||||
|
||||
Node *af_head_, *af_middle_, *af_tail_;
|
||||
|
||||
void InitTriangulation();
|
||||
void InitEdges(std::vector<Point*> polyline);
|
||||
|
||||
};
|
||||
|
||||
inline AdvancingFront* SweepContext::front()
|
||||
{
|
||||
return front_;
|
||||
}
|
||||
|
||||
inline int SweepContext::point_count()
|
||||
{
|
||||
return points_.size();
|
||||
}
|
||||
|
||||
inline void SweepContext::set_head(Point* p1)
|
||||
{
|
||||
head_ = p1;
|
||||
}
|
||||
|
||||
inline Point* SweepContext::head()
|
||||
{
|
||||
return head_;
|
||||
}
|
||||
|
||||
inline void SweepContext::set_tail(Point* p1)
|
||||
{
|
||||
tail_ = p1;
|
||||
}
|
||||
|
||||
inline Point* SweepContext::tail()
|
||||
{
|
||||
return tail_;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,75 +1,75 @@
|
|||
diff -r 5de9623d6a50 poly2tri/common/shapes.h
|
||||
--- 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
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
+#include <stdexcept>
|
||||
#include <assert.h>
|
||||
#include <cmath>
|
||||
|
||||
@@ -136,7 +137,9 @@
|
||||
p = &p2;
|
||||
} else if (p1.x == p2.x) {
|
||||
// Repeat points
|
||||
- assert(false);
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("repeat points");
|
||||
+ //assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
diff -r 5de9623d6a50 poly2tri/sweep/sweep.cc
|
||||
--- 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
|
||||
@@ -113,6 +113,8 @@
|
||||
Point* p1 = triangle->PointCCW(point);
|
||||
Orientation o1 = Orient2d(eq, *p1, ep);
|
||||
if (o1 == COLLINEAR) {
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
if( triangle->Contains(&eq, p1)) {
|
||||
triangle->MarkConstrainedEdge(&eq, p1 );
|
||||
// We are modifying the constraint maybe it would be better to
|
||||
@@ -121,8 +123,8 @@
|
||||
triangle = &triangle->NeighborAcross(point);
|
||||
EdgeEvent( tcx, ep, *p1, triangle, *p1 );
|
||||
} else {
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
- assert(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -130,6 +132,9 @@
|
||||
Point* p2 = triangle->PointCW(point);
|
||||
Orientation o2 = Orient2d(eq, *p2, ep);
|
||||
if (o2 == COLLINEAR) {
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
+
|
||||
if( triangle->Contains(&eq, p2)) {
|
||||
triangle->MarkConstrainedEdge(&eq, p2 );
|
||||
// We are modifying the constraint maybe it would be better to
|
||||
@@ -138,8 +143,8 @@
|
||||
triangle = &triangle->NeighborAcross(point);
|
||||
EdgeEvent( tcx, ep, *p2, triangle, *p2 );
|
||||
} else {
|
||||
- std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
- assert(0);
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -712,7 +717,8 @@
|
||||
return *ot.PointCW(op);
|
||||
} else{
|
||||
//throw new RuntimeException("[Unsupported] Opposing point on constrained edge");
|
||||
- assert(0);
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("[Unsupported] Opposing point on constrained edge");
|
||||
}
|
||||
}
|
||||
|
||||
diff -r 5de9623d6a50 poly2tri/common/shapes.h
|
||||
--- 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
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <cstddef>
|
||||
+#include <stdexcept>
|
||||
#include <assert.h>
|
||||
#include <cmath>
|
||||
|
||||
@@ -136,7 +137,9 @@
|
||||
p = &p2;
|
||||
} else if (p1.x == p2.x) {
|
||||
// Repeat points
|
||||
- assert(false);
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("repeat points");
|
||||
+ //assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
diff -r 5de9623d6a50 poly2tri/sweep/sweep.cc
|
||||
--- 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
|
||||
@@ -113,6 +113,8 @@
|
||||
Point* p1 = triangle->PointCCW(point);
|
||||
Orientation o1 = Orient2d(eq, *p1, ep);
|
||||
if (o1 == COLLINEAR) {
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
if( triangle->Contains(&eq, p1)) {
|
||||
triangle->MarkConstrainedEdge(&eq, p1 );
|
||||
// We are modifying the constraint maybe it would be better to
|
||||
@@ -121,8 +123,8 @@
|
||||
triangle = &triangle->NeighborAcross(point);
|
||||
EdgeEvent( tcx, ep, *p1, triangle, *p1 );
|
||||
} else {
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
- assert(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -130,6 +132,9 @@
|
||||
Point* p2 = triangle->PointCW(point);
|
||||
Orientation o2 = Orient2d(eq, *p2, ep);
|
||||
if (o2 == COLLINEAR) {
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
+
|
||||
if( triangle->Contains(&eq, p2)) {
|
||||
triangle->MarkConstrainedEdge(&eq, p2 );
|
||||
// We are modifying the constraint maybe it would be better to
|
||||
@@ -138,8 +143,8 @@
|
||||
triangle = &triangle->NeighborAcross(point);
|
||||
EdgeEvent( tcx, ep, *p2, triangle, *p2 );
|
||||
} else {
|
||||
- std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
- assert(0);
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("EdgeEvent - collinear points not supported");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -712,7 +717,8 @@
|
||||
return *ot.PointCW(op);
|
||||
} else{
|
||||
//throw new RuntimeException("[Unsupported] Opposing point on constrained edge");
|
||||
- assert(0);
|
||||
+ // ASSIMP_CHANGE (aramis_acg)
|
||||
+ throw std::runtime_error("[Unsupported] Opposing point on constrained edge");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,132 +1,132 @@
|
|||
/* crypt.h -- base code for crypt/uncrypt ZIPfile
|
||||
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
|
||||
This code is a modified version of crypting code in Infozip distribution
|
||||
|
||||
The encryption/decryption parts of this source code (as opposed to the
|
||||
non-echoing password parts) were originally written in Europe. The
|
||||
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.)
|
||||
|
||||
This encryption code is a direct transcription of the algorithm from
|
||||
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
|
||||
file (appnote.txt) is distributed with the PKZIP program (even in the
|
||||
version without encryption capabilities).
|
||||
|
||||
If you don't need crypting in your application, just define symbols
|
||||
NOCRYPT and NOUNCRYPT.
|
||||
|
||||
This code support the "Traditional PKWARE Encryption".
|
||||
|
||||
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
|
||||
Encryption is not supported.
|
||||
*/
|
||||
|
||||
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
|
||||
|
||||
/***********************************************************************
|
||||
* Return the next byte in the pseudo-random sequence
|
||||
*/
|
||||
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
|
||||
{
|
||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
||||
* unpredictable manner on 16-bit systems; not a problem
|
||||
* with any known compiler so far, though */
|
||||
|
||||
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
|
||||
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* 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)
|
||||
{
|
||||
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
|
||||
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
|
||||
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
|
||||
{
|
||||
register int keyshift = (int)((*(pkeys+1)) >> 24);
|
||||
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Initialize the encryption keys and the random header according to
|
||||
* the given password.
|
||||
*/
|
||||
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
|
||||
{
|
||||
*(pkeys+0) = 305419896L;
|
||||
*(pkeys+1) = 591751049L;
|
||||
*(pkeys+2) = 878082192L;
|
||||
while (*passwd != '\0') {
|
||||
update_keys(pkeys,pcrc_32_tab,(int)*passwd);
|
||||
passwd++;
|
||||
}
|
||||
}
|
||||
|
||||
#define zdecode(pkeys,pcrc_32_tab,c) \
|
||||
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
|
||||
|
||||
#define zencode(pkeys,pcrc_32_tab,c,t) \
|
||||
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
|
||||
|
||||
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
|
||||
|
||||
#define RAND_HEAD_LEN 12
|
||||
/* "last resort" source for second part of crypt seed pattern */
|
||||
# ifndef ZCR_SEED2
|
||||
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
|
||||
# endif
|
||||
|
||||
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
|
||||
const char *passwd; /* password string */
|
||||
unsigned char *buf; /* where to write header */
|
||||
int bufSize;
|
||||
unsigned long* pkeys;
|
||||
const unsigned long* pcrc_32_tab;
|
||||
unsigned long crcForCrypting;
|
||||
{
|
||||
int n; /* index in random header */
|
||||
int t; /* temporary */
|
||||
int c; /* random byte */
|
||||
unsigned char header[RAND_HEAD_LEN-2]; /* random header */
|
||||
static unsigned calls = 0; /* ensure different random header each time */
|
||||
|
||||
if (bufSize<RAND_HEAD_LEN)
|
||||
return 0;
|
||||
|
||||
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
|
||||
* output of rand() to get less predictability, since rand() is
|
||||
* often poorly implemented.
|
||||
*/
|
||||
if (++calls == 1)
|
||||
{
|
||||
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
|
||||
}
|
||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
||||
{
|
||||
c = (rand() >> 7) & 0xff;
|
||||
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
|
||||
}
|
||||
/* Encrypt random header (last two bytes is high word of crc) */
|
||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
||||
{
|
||||
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 >> 24) & 0xff, t);
|
||||
return n;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* crypt.h -- base code for crypt/uncrypt ZIPfile
|
||||
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
|
||||
This code is a modified version of crypting code in Infozip distribution
|
||||
|
||||
The encryption/decryption parts of this source code (as opposed to the
|
||||
non-echoing password parts) were originally written in Europe. The
|
||||
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.)
|
||||
|
||||
This encryption code is a direct transcription of the algorithm from
|
||||
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
|
||||
file (appnote.txt) is distributed with the PKZIP program (even in the
|
||||
version without encryption capabilities).
|
||||
|
||||
If you don't need crypting in your application, just define symbols
|
||||
NOCRYPT and NOUNCRYPT.
|
||||
|
||||
This code support the "Traditional PKWARE Encryption".
|
||||
|
||||
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
|
||||
Encryption is not supported.
|
||||
*/
|
||||
|
||||
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
|
||||
|
||||
/***********************************************************************
|
||||
* Return the next byte in the pseudo-random sequence
|
||||
*/
|
||||
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
|
||||
{
|
||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
||||
* unpredictable manner on 16-bit systems; not a problem
|
||||
* with any known compiler so far, though */
|
||||
|
||||
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
|
||||
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* 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)
|
||||
{
|
||||
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
|
||||
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
|
||||
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
|
||||
{
|
||||
register int keyshift = (int)((*(pkeys+1)) >> 24);
|
||||
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Initialize the encryption keys and the random header according to
|
||||
* the given password.
|
||||
*/
|
||||
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
|
||||
{
|
||||
*(pkeys+0) = 305419896L;
|
||||
*(pkeys+1) = 591751049L;
|
||||
*(pkeys+2) = 878082192L;
|
||||
while (*passwd != '\0') {
|
||||
update_keys(pkeys,pcrc_32_tab,(int)*passwd);
|
||||
passwd++;
|
||||
}
|
||||
}
|
||||
|
||||
#define zdecode(pkeys,pcrc_32_tab,c) \
|
||||
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
|
||||
|
||||
#define zencode(pkeys,pcrc_32_tab,c,t) \
|
||||
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
|
||||
|
||||
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
|
||||
|
||||
#define RAND_HEAD_LEN 12
|
||||
/* "last resort" source for second part of crypt seed pattern */
|
||||
# ifndef ZCR_SEED2
|
||||
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
|
||||
# endif
|
||||
|
||||
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
|
||||
const char *passwd; /* password string */
|
||||
unsigned char *buf; /* where to write header */
|
||||
int bufSize;
|
||||
unsigned long* pkeys;
|
||||
const unsigned long* pcrc_32_tab;
|
||||
unsigned long crcForCrypting;
|
||||
{
|
||||
int n; /* index in random header */
|
||||
int t; /* temporary */
|
||||
int c; /* random byte */
|
||||
unsigned char header[RAND_HEAD_LEN-2]; /* random header */
|
||||
static unsigned calls = 0; /* ensure different random header each time */
|
||||
|
||||
if (bufSize<RAND_HEAD_LEN)
|
||||
return 0;
|
||||
|
||||
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
|
||||
* output of rand() to get less predictability, since rand() is
|
||||
* often poorly implemented.
|
||||
*/
|
||||
if (++calls == 1)
|
||||
{
|
||||
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
|
||||
}
|
||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
||||
{
|
||||
c = (rand() >> 7) & 0xff;
|
||||
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
|
||||
}
|
||||
/* Encrypt random header (last two bytes is high word of crc) */
|
||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
||||
{
|
||||
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 >> 24) & 0xff, t);
|
||||
return n;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,181 +1,181 @@
|
|||
/* ioapi.c -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||
# include <zlib.h>
|
||||
# else
|
||||
# include "../zlib/zlib.h"
|
||||
# endif
|
||||
#include "ioapi.h"
|
||||
|
||||
|
||||
|
||||
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
|
||||
|
||||
#ifndef SEEK_CUR
|
||||
#define SEEK_CUR 1
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_END
|
||||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET 0
|
||||
#endif
|
||||
|
||||
voidpf ZCALLBACK fopen_file_func (
|
||||
voidpf opaque,
|
||||
const char* filename,
|
||||
int mode);
|
||||
|
||||
uLong ZCALLBACK fread_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
void* buf,
|
||||
uLong size);
|
||||
|
||||
uLong ZCALLBACK fwrite_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
const void* buf,
|
||||
uLong size);
|
||||
|
||||
long ZCALLBACK ftell_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream);
|
||||
|
||||
long ZCALLBACK fseek_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
uLong offset,
|
||||
int origin);
|
||||
|
||||
int ZCALLBACK fclose_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream);
|
||||
|
||||
int ZCALLBACK ferror_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream);
|
||||
|
||||
|
||||
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
|
||||
voidpf opaque;
|
||||
const char* filename;
|
||||
int mode;
|
||||
{
|
||||
FILE* file = NULL;
|
||||
const char* mode_fopen = NULL;
|
||||
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
|
||||
mode_fopen = "rb";
|
||||
else
|
||||
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
|
||||
mode_fopen = "r+b";
|
||||
else
|
||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
|
||||
mode_fopen = "wb";
|
||||
|
||||
if ((filename!=NULL) && (mode_fopen != NULL))
|
||||
file = fopen(filename, mode_fopen);
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
void* buf;
|
||||
uLong size;
|
||||
{
|
||||
uLong ret;
|
||||
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
const void* buf;
|
||||
uLong size;
|
||||
{
|
||||
uLong ret;
|
||||
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
long ZCALLBACK ftell_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
long ret;
|
||||
ret = ftell((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
uLong offset;
|
||||
int origin;
|
||||
{
|
||||
int fseek_origin=0;
|
||||
long ret;
|
||||
switch (origin)
|
||||
{
|
||||
case ZLIB_FILEFUNC_SEEK_CUR :
|
||||
fseek_origin = SEEK_CUR;
|
||||
break;
|
||||
case ZLIB_FILEFUNC_SEEK_END :
|
||||
fseek_origin = SEEK_END;
|
||||
break;
|
||||
case ZLIB_FILEFUNC_SEEK_SET :
|
||||
fseek_origin = SEEK_SET;
|
||||
break;
|
||||
default: return -1;
|
||||
}
|
||||
ret = 0;
|
||||
fseek((FILE *)stream, offset, fseek_origin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ZCALLBACK fclose_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
int ret;
|
||||
ret = fclose((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ZCALLBACK ferror_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
int ret;
|
||||
ret = ferror((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void fill_fopen_filefunc (pzlib_filefunc_def)
|
||||
zlib_filefunc_def* pzlib_filefunc_def;
|
||||
{
|
||||
pzlib_filefunc_def->zopen_file = fopen_file_func;
|
||||
pzlib_filefunc_def->zread_file = fread_file_func;
|
||||
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
|
||||
pzlib_filefunc_def->ztell_file = ftell_file_func;
|
||||
pzlib_filefunc_def->zseek_file = fseek_file_func;
|
||||
pzlib_filefunc_def->zclose_file = fclose_file_func;
|
||||
pzlib_filefunc_def->zerror_file = ferror_file_func;
|
||||
pzlib_filefunc_def->opaque = NULL;
|
||||
}
|
||||
/* ioapi.c -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||
# include <zlib.h>
|
||||
# else
|
||||
# include "../zlib/zlib.h"
|
||||
# endif
|
||||
#include "ioapi.h"
|
||||
|
||||
|
||||
|
||||
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
|
||||
|
||||
#ifndef SEEK_CUR
|
||||
#define SEEK_CUR 1
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_END
|
||||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET 0
|
||||
#endif
|
||||
|
||||
voidpf ZCALLBACK fopen_file_func (
|
||||
voidpf opaque,
|
||||
const char* filename,
|
||||
int mode);
|
||||
|
||||
uLong ZCALLBACK fread_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
void* buf,
|
||||
uLong size);
|
||||
|
||||
uLong ZCALLBACK fwrite_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
const void* buf,
|
||||
uLong size);
|
||||
|
||||
long ZCALLBACK ftell_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream);
|
||||
|
||||
long ZCALLBACK fseek_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream,
|
||||
uLong offset,
|
||||
int origin);
|
||||
|
||||
int ZCALLBACK fclose_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream);
|
||||
|
||||
int ZCALLBACK ferror_file_func (
|
||||
voidpf opaque,
|
||||
voidpf stream);
|
||||
|
||||
|
||||
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
|
||||
voidpf opaque;
|
||||
const char* filename;
|
||||
int mode;
|
||||
{
|
||||
FILE* file = NULL;
|
||||
const char* mode_fopen = NULL;
|
||||
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
|
||||
mode_fopen = "rb";
|
||||
else
|
||||
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
|
||||
mode_fopen = "r+b";
|
||||
else
|
||||
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
|
||||
mode_fopen = "wb";
|
||||
|
||||
if ((filename!=NULL) && (mode_fopen != NULL))
|
||||
file = fopen(filename, mode_fopen);
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
void* buf;
|
||||
uLong size;
|
||||
{
|
||||
uLong ret;
|
||||
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
const void* buf;
|
||||
uLong size;
|
||||
{
|
||||
uLong ret;
|
||||
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
long ZCALLBACK ftell_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
long ret;
|
||||
ret = ftell((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
uLong offset;
|
||||
int origin;
|
||||
{
|
||||
int fseek_origin=0;
|
||||
long ret;
|
||||
switch (origin)
|
||||
{
|
||||
case ZLIB_FILEFUNC_SEEK_CUR :
|
||||
fseek_origin = SEEK_CUR;
|
||||
break;
|
||||
case ZLIB_FILEFUNC_SEEK_END :
|
||||
fseek_origin = SEEK_END;
|
||||
break;
|
||||
case ZLIB_FILEFUNC_SEEK_SET :
|
||||
fseek_origin = SEEK_SET;
|
||||
break;
|
||||
default: return -1;
|
||||
}
|
||||
ret = 0;
|
||||
fseek((FILE *)stream, offset, fseek_origin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ZCALLBACK fclose_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
int ret;
|
||||
ret = fclose((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ZCALLBACK ferror_file_func (opaque, stream)
|
||||
voidpf opaque;
|
||||
voidpf stream;
|
||||
{
|
||||
int ret;
|
||||
ret = ferror((FILE *)stream);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void fill_fopen_filefunc (pzlib_filefunc_def)
|
||||
zlib_filefunc_def* pzlib_filefunc_def;
|
||||
{
|
||||
pzlib_filefunc_def->zopen_file = fopen_file_func;
|
||||
pzlib_filefunc_def->zread_file = fread_file_func;
|
||||
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
|
||||
pzlib_filefunc_def->ztell_file = ftell_file_func;
|
||||
pzlib_filefunc_def->zseek_file = fseek_file_func;
|
||||
pzlib_filefunc_def->zclose_file = fclose_file_func;
|
||||
pzlib_filefunc_def->zerror_file = ferror_file_func;
|
||||
pzlib_filefunc_def->opaque = NULL;
|
||||
}
|
||||
|
|
|
@ -1,75 +1,75 @@
|
|||
/* ioapi.h -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
*/
|
||||
|
||||
#ifndef _ZLIBIOAPI_H
|
||||
#define _ZLIBIOAPI_H
|
||||
|
||||
|
||||
#define ZLIB_FILEFUNC_SEEK_CUR (1)
|
||||
#define ZLIB_FILEFUNC_SEEK_END (2)
|
||||
#define ZLIB_FILEFUNC_SEEK_SET (0)
|
||||
|
||||
#define ZLIB_FILEFUNC_MODE_READ (1)
|
||||
#define ZLIB_FILEFUNC_MODE_WRITE (2)
|
||||
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
|
||||
|
||||
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
|
||||
#define ZLIB_FILEFUNC_MODE_CREATE (8)
|
||||
|
||||
|
||||
#ifndef ZCALLBACK
|
||||
|
||||
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
|
||||
#define ZCALLBACK CALLBACK
|
||||
#else
|
||||
#define ZCALLBACK
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
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 *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 *seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin);
|
||||
typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream);
|
||||
typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream);
|
||||
|
||||
typedef struct zlib_filefunc_def_s
|
||||
{
|
||||
open_file_func zopen_file;
|
||||
read_file_func zread_file;
|
||||
write_file_func zwrite_file;
|
||||
tell_file_func ztell_file;
|
||||
seek_file_func zseek_file;
|
||||
close_file_func zclose_file;
|
||||
testerror_file_func zerror_file;
|
||||
voidpf opaque;
|
||||
} zlib_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 ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
|
||||
#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 ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
|
||||
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* ioapi.h -- IO base function header for compress/uncompress .zip
|
||||
files using zlib + zip or unzip API
|
||||
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
*/
|
||||
|
||||
#ifndef _ZLIBIOAPI_H
|
||||
#define _ZLIBIOAPI_H
|
||||
|
||||
|
||||
#define ZLIB_FILEFUNC_SEEK_CUR (1)
|
||||
#define ZLIB_FILEFUNC_SEEK_END (2)
|
||||
#define ZLIB_FILEFUNC_SEEK_SET (0)
|
||||
|
||||
#define ZLIB_FILEFUNC_MODE_READ (1)
|
||||
#define ZLIB_FILEFUNC_MODE_WRITE (2)
|
||||
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
|
||||
|
||||
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
|
||||
#define ZLIB_FILEFUNC_MODE_CREATE (8)
|
||||
|
||||
|
||||
#ifndef ZCALLBACK
|
||||
|
||||
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
|
||||
#define ZCALLBACK CALLBACK
|
||||
#else
|
||||
#define ZCALLBACK
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
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 *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 *seek_file_func) (voidpf opaque, voidpf stream, uLong offset, int origin);
|
||||
typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream);
|
||||
typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream);
|
||||
|
||||
typedef struct zlib_filefunc_def_s
|
||||
{
|
||||
open_file_func zopen_file;
|
||||
read_file_func zread_file;
|
||||
write_file_func zwrite_file;
|
||||
tell_file_func ztell_file;
|
||||
seek_file_func zseek_file;
|
||||
close_file_func zclose_file;
|
||||
testerror_file_func zerror_file;
|
||||
voidpf opaque;
|
||||
} zlib_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 ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
|
||||
#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 ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
|
||||
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,358 +1,358 @@
|
|||
/* unzip.h -- IO for uncompress .zip files using zlib
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
|
||||
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
|
||||
WinZip, InfoZip tools and compatible.
|
||||
|
||||
Multi volume ZipFile (span) are not supported.
|
||||
Encryption compatible with pkzip 2.04g only supported
|
||||
Old compressions used by old PKZip 1.x are not supported
|
||||
|
||||
|
||||
I WAIT FEEDBACK at mail info@winimage.com
|
||||
Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
|
||||
|
||||
Condition of use and distribution are the same than zlib :
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
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
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* 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/
|
||||
PkWare has also a specification at :
|
||||
ftp://ftp.pkware.com/probdesc.zip
|
||||
*/
|
||||
|
||||
#ifndef _unz_H
|
||||
#define _unz_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIB_H
|
||||
# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||
# include <zlib.h>
|
||||
# else
|
||||
# include "../zlib/zlib.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIBIOAPI_H
|
||||
#include "ioapi.h"
|
||||
#endif
|
||||
|
||||
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
|
||||
/* like the STRICT of WIN32, we define a pointer that cannot be converted
|
||||
from (void*) without cast */
|
||||
typedef struct TagunzFile__ { int unused; } unzFile__;
|
||||
typedef unzFile__ *unzFile;
|
||||
#else
|
||||
typedef voidp unzFile;
|
||||
#endif
|
||||
|
||||
|
||||
#define UNZ_OK (0)
|
||||
#define UNZ_END_OF_LIST_OF_FILE (-100)
|
||||
#define UNZ_ERRNO (Z_ERRNO)
|
||||
#define UNZ_EOF (0)
|
||||
#define UNZ_PARAMERROR (-102)
|
||||
#define UNZ_BADZIPFILE (-103)
|
||||
#define UNZ_INTERNALERROR (-104)
|
||||
#define UNZ_CRCERROR (-105)
|
||||
|
||||
/* tm_unz contain date/time info */
|
||||
typedef struct tm_unz_s
|
||||
{
|
||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
||||
uInt tm_mday; /* day of the month - [1,31] */
|
||||
uInt tm_mon; /* months since January - [0,11] */
|
||||
uInt tm_year; /* years - [1980..2044] */
|
||||
} tm_unz;
|
||||
|
||||
/* unz_global_info structure contain global data about the ZIPfile
|
||||
These data comes from the end of central dir */
|
||||
typedef struct unz_global_info_s
|
||||
{
|
||||
uLong number_entry; /* total number of entries in
|
||||
the central dir on this disk */
|
||||
uLong size_comment; /* size of the global comment of the zipfile */
|
||||
} unz_global_info;
|
||||
|
||||
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_info_s
|
||||
{
|
||||
uLong version; /* version made by 2 bytes */
|
||||
uLong version_needed; /* version needed to extract 2 bytes */
|
||||
uLong flag; /* general purpose bit flag 2 bytes */
|
||||
uLong compression_method; /* compression method 2 bytes */
|
||||
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
|
||||
uLong crc; /* crc-32 4 bytes */
|
||||
uLong compressed_size; /* compressed size 4 bytes */
|
||||
uLong uncompressed_size; /* uncompressed size 4 bytes */
|
||||
uLong size_filename; /* filename length 2 bytes */
|
||||
uLong size_file_extra; /* extra field length 2 bytes */
|
||||
uLong size_file_comment; /* file comment length 2 bytes */
|
||||
|
||||
uLong disk_num_start; /* disk number start 2 bytes */
|
||||
uLong internal_fa; /* internal file attributes 2 bytes */
|
||||
uLong external_fa; /* external file attributes 4 bytes */
|
||||
|
||||
tm_unz tmu_date;
|
||||
} unz_file_info;
|
||||
|
||||
extern int ZEXPORT unzStringFileNameCompare (const char* fileName1,
|
||||
const char* fileName2,
|
||||
int iCaseSensitivity);
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
*/
|
||||
|
||||
|
||||
extern unzFile ZEXPORT unzOpen (const char *path);
|
||||
/*
|
||||
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
|
||||
"zlib/zlib113.zip".
|
||||
If the zipfile cannot be opened (file don't exist or in not valid), the
|
||||
return value is NULL.
|
||||
Else, the return value is a unzFile Handle, usable with other function
|
||||
of this unzip package.
|
||||
*/
|
||||
|
||||
extern unzFile ZEXPORT unzOpen2 (const char *path,
|
||||
zlib_filefunc_def* pzlib_filefunc_def);
|
||||
/*
|
||||
Open a Zip file, like unzOpen, but provide a set of file low level API
|
||||
for read/write the zip file (see ioapi.h)
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzClose (unzFile file);
|
||||
/*
|
||||
Close a ZipFile opened with unzipOpen.
|
||||
If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
|
||||
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
extern int ZEXPORT unzGetGlobalInfo (unzFile file,
|
||||
unz_global_info *pglobal_info);
|
||||
/*
|
||||
Write info about the ZipFile in the *pglobal_info structure.
|
||||
No preparation of the structure is needed
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
|
||||
extern int ZEXPORT unzGetGlobalComment (unzFile file,
|
||||
char *szComment,
|
||||
uLong uSizeBuf);
|
||||
/*
|
||||
Get the global comment string of the ZipFile, in the szComment buffer.
|
||||
uSizeBuf is the size of the szComment buffer.
|
||||
return the number of byte copied or an error code <0
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* Unzip package allow you browse the directory of the zipfile */
|
||||
|
||||
extern int ZEXPORT unzGoToFirstFile (unzFile file);
|
||||
/*
|
||||
Set the current file of the zipfile to the first file.
|
||||
return UNZ_OK if there is no problem
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGoToNextFile (unzFile file);
|
||||
/*
|
||||
Set the current file of the zipfile to the next file.
|
||||
return UNZ_OK if there is no problem
|
||||
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzLocateFile (unzFile file,
|
||||
const char *szFileName,
|
||||
int iCaseSensitivity);
|
||||
/*
|
||||
Try locate the file szFileName in the zipfile.
|
||||
For the iCaseSensitivity signification, see unzStringFileNameCompare
|
||||
|
||||
return value :
|
||||
UNZ_OK if the file is found. It becomes the current file.
|
||||
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
||||
*/
|
||||
|
||||
|
||||
/* ****************************************** */
|
||||
/* Ryan supplied functions */
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_pos_s
|
||||
{
|
||||
uLong pos_in_zip_directory; /* offset in zip file directory */
|
||||
uLong num_of_file; /* # of file */
|
||||
} unz_file_pos;
|
||||
|
||||
extern int ZEXPORT unzGetFilePos(
|
||||
unzFile file,
|
||||
unz_file_pos* file_pos);
|
||||
|
||||
extern int ZEXPORT unzGoToFilePos(
|
||||
unzFile file,
|
||||
unz_file_pos* file_pos);
|
||||
|
||||
/* ****************************************** */
|
||||
|
||||
extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
|
||||
unz_file_info *pfile_info,
|
||||
char *szFileName,
|
||||
uLong fileNameBufferSize,
|
||||
void *extraField,
|
||||
uLong extraFieldBufferSize,
|
||||
char *szComment,
|
||||
uLong commentBufferSize);
|
||||
/*
|
||||
Get Info about the current file
|
||||
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
|
||||
the current file
|
||||
if szFileName!=NULL, the filemane string will be copied in szFileName
|
||||
(fileNameBufferSize is the size of the buffer)
|
||||
if extraField!=NULL, the extra field information will be copied in extraField
|
||||
(extraFieldBufferSize is the size of the buffer).
|
||||
This is the Central-header version of the extra field
|
||||
if szComment!=NULL, the comment string of the file will be copied in szComment
|
||||
(commentBufferSize is the size of the buffer)
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
/* 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)
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile (unzFile file);
|
||||
/*
|
||||
Open for reading data the current file in the zipfile.
|
||||
If there is no error, the return value is UNZ_OK.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file,
|
||||
const char* password);
|
||||
/*
|
||||
Open for reading data the current file in the zipfile.
|
||||
password is a crypting password
|
||||
If there is no error, the return value is UNZ_OK.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile2 (unzFile file,
|
||||
int* method,
|
||||
int* level,
|
||||
int raw);
|
||||
/*
|
||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
||||
if raw==1
|
||||
*method will receive method of compression, *level will receive level of
|
||||
compression
|
||||
note : you can set level parameter as NULL (if you did not want known level,
|
||||
but you CANNOT set method parameter as NULL
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile3 (unzFile file,
|
||||
int* method,
|
||||
int* level,
|
||||
int raw,
|
||||
const char* password);
|
||||
/*
|
||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
||||
if raw==1
|
||||
*method will receive method of compression, *level will receive level of
|
||||
compression
|
||||
note : you can set level parameter as NULL (if you did not want known level,
|
||||
but you CANNOT set method parameter as NULL
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT unzCloseCurrentFile (unzFile file);
|
||||
/*
|
||||
Close the file in zip opened with unzOpenCurrentFile
|
||||
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzReadCurrentFile (unzFile file,
|
||||
voidp buf,
|
||||
unsigned len);
|
||||
/*
|
||||
Read bytes from the current file (opened by unzOpenCurrentFile)
|
||||
buf contain buffer where data must be copied
|
||||
len the size of buf.
|
||||
|
||||
return the number of byte copied if somes bytes are copied
|
||||
return 0 if the end of file was reached
|
||||
return <0 with error code if there is an error
|
||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
||||
*/
|
||||
|
||||
extern z_off_t ZEXPORT unztell (unzFile file);
|
||||
/*
|
||||
Give the current position in uncompressed data
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzeof (unzFile file);
|
||||
/*
|
||||
return 1 if the end of file was reached, 0 elsewhere
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGetLocalExtrafield (unzFile file,
|
||||
voidp buf,
|
||||
unsigned len);
|
||||
/*
|
||||
Read extra field from the current file (opened by unzOpenCurrentFile)
|
||||
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)
|
||||
|
||||
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
|
||||
buf.
|
||||
the return value is the number of bytes copied in buf, or (if <0)
|
||||
the error code
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
/* Get the current file offset */
|
||||
extern uLong ZEXPORT unzGetOffset (unzFile file);
|
||||
|
||||
/* Set the current file offset */
|
||||
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _unz_H */
|
||||
/* unzip.h -- IO for uncompress .zip files using zlib
|
||||
Version 1.01e, February 12th, 2005
|
||||
|
||||
Copyright (C) 1998-2005 Gilles Vollant
|
||||
|
||||
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
|
||||
WinZip, InfoZip tools and compatible.
|
||||
|
||||
Multi volume ZipFile (span) are not supported.
|
||||
Encryption compatible with pkzip 2.04g only supported
|
||||
Old compressions used by old PKZip 1.x are not supported
|
||||
|
||||
|
||||
I WAIT FEEDBACK at mail info@winimage.com
|
||||
Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
|
||||
|
||||
Condition of use and distribution are the same than zlib :
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
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
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* 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/
|
||||
PkWare has also a specification at :
|
||||
ftp://ftp.pkware.com/probdesc.zip
|
||||
*/
|
||||
|
||||
#ifndef _unz_H
|
||||
#define _unz_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIB_H
|
||||
# ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||
# include <zlib.h>
|
||||
# else
|
||||
# include "../zlib/zlib.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef _ZLIBIOAPI_H
|
||||
#include "ioapi.h"
|
||||
#endif
|
||||
|
||||
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
|
||||
/* like the STRICT of WIN32, we define a pointer that cannot be converted
|
||||
from (void*) without cast */
|
||||
typedef struct TagunzFile__ { int unused; } unzFile__;
|
||||
typedef unzFile__ *unzFile;
|
||||
#else
|
||||
typedef voidp unzFile;
|
||||
#endif
|
||||
|
||||
|
||||
#define UNZ_OK (0)
|
||||
#define UNZ_END_OF_LIST_OF_FILE (-100)
|
||||
#define UNZ_ERRNO (Z_ERRNO)
|
||||
#define UNZ_EOF (0)
|
||||
#define UNZ_PARAMERROR (-102)
|
||||
#define UNZ_BADZIPFILE (-103)
|
||||
#define UNZ_INTERNALERROR (-104)
|
||||
#define UNZ_CRCERROR (-105)
|
||||
|
||||
/* tm_unz contain date/time info */
|
||||
typedef struct tm_unz_s
|
||||
{
|
||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
||||
uInt tm_mday; /* day of the month - [1,31] */
|
||||
uInt tm_mon; /* months since January - [0,11] */
|
||||
uInt tm_year; /* years - [1980..2044] */
|
||||
} tm_unz;
|
||||
|
||||
/* unz_global_info structure contain global data about the ZIPfile
|
||||
These data comes from the end of central dir */
|
||||
typedef struct unz_global_info_s
|
||||
{
|
||||
uLong number_entry; /* total number of entries in
|
||||
the central dir on this disk */
|
||||
uLong size_comment; /* size of the global comment of the zipfile */
|
||||
} unz_global_info;
|
||||
|
||||
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_info_s
|
||||
{
|
||||
uLong version; /* version made by 2 bytes */
|
||||
uLong version_needed; /* version needed to extract 2 bytes */
|
||||
uLong flag; /* general purpose bit flag 2 bytes */
|
||||
uLong compression_method; /* compression method 2 bytes */
|
||||
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
|
||||
uLong crc; /* crc-32 4 bytes */
|
||||
uLong compressed_size; /* compressed size 4 bytes */
|
||||
uLong uncompressed_size; /* uncompressed size 4 bytes */
|
||||
uLong size_filename; /* filename length 2 bytes */
|
||||
uLong size_file_extra; /* extra field length 2 bytes */
|
||||
uLong size_file_comment; /* file comment length 2 bytes */
|
||||
|
||||
uLong disk_num_start; /* disk number start 2 bytes */
|
||||
uLong internal_fa; /* internal file attributes 2 bytes */
|
||||
uLong external_fa; /* external file attributes 4 bytes */
|
||||
|
||||
tm_unz tmu_date;
|
||||
} unz_file_info;
|
||||
|
||||
extern int ZEXPORT unzStringFileNameCompare (const char* fileName1,
|
||||
const char* fileName2,
|
||||
int iCaseSensitivity);
|
||||
/*
|
||||
Compare two filename (fileName1,fileName2).
|
||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
||||
or strcasecmp)
|
||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
||||
(like 1 on Unix, 2 on Windows)
|
||||
*/
|
||||
|
||||
|
||||
extern unzFile ZEXPORT unzOpen (const char *path);
|
||||
/*
|
||||
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
|
||||
"zlib/zlib113.zip".
|
||||
If the zipfile cannot be opened (file don't exist or in not valid), the
|
||||
return value is NULL.
|
||||
Else, the return value is a unzFile Handle, usable with other function
|
||||
of this unzip package.
|
||||
*/
|
||||
|
||||
extern unzFile ZEXPORT unzOpen2 (const char *path,
|
||||
zlib_filefunc_def* pzlib_filefunc_def);
|
||||
/*
|
||||
Open a Zip file, like unzOpen, but provide a set of file low level API
|
||||
for read/write the zip file (see ioapi.h)
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzClose (unzFile file);
|
||||
/*
|
||||
Close a ZipFile opened with unzipOpen.
|
||||
If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
|
||||
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
extern int ZEXPORT unzGetGlobalInfo (unzFile file,
|
||||
unz_global_info *pglobal_info);
|
||||
/*
|
||||
Write info about the ZipFile in the *pglobal_info structure.
|
||||
No preparation of the structure is needed
|
||||
return UNZ_OK if there is no problem. */
|
||||
|
||||
|
||||
extern int ZEXPORT unzGetGlobalComment (unzFile file,
|
||||
char *szComment,
|
||||
uLong uSizeBuf);
|
||||
/*
|
||||
Get the global comment string of the ZipFile, in the szComment buffer.
|
||||
uSizeBuf is the size of the szComment buffer.
|
||||
return the number of byte copied or an error code <0
|
||||
*/
|
||||
|
||||
|
||||
/***************************************************************************/
|
||||
/* Unzip package allow you browse the directory of the zipfile */
|
||||
|
||||
extern int ZEXPORT unzGoToFirstFile (unzFile file);
|
||||
/*
|
||||
Set the current file of the zipfile to the first file.
|
||||
return UNZ_OK if there is no problem
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGoToNextFile (unzFile file);
|
||||
/*
|
||||
Set the current file of the zipfile to the next file.
|
||||
return UNZ_OK if there is no problem
|
||||
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzLocateFile (unzFile file,
|
||||
const char *szFileName,
|
||||
int iCaseSensitivity);
|
||||
/*
|
||||
Try locate the file szFileName in the zipfile.
|
||||
For the iCaseSensitivity signification, see unzStringFileNameCompare
|
||||
|
||||
return value :
|
||||
UNZ_OK if the file is found. It becomes the current file.
|
||||
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
||||
*/
|
||||
|
||||
|
||||
/* ****************************************** */
|
||||
/* Ryan supplied functions */
|
||||
/* unz_file_info contain information about a file in the zipfile */
|
||||
typedef struct unz_file_pos_s
|
||||
{
|
||||
uLong pos_in_zip_directory; /* offset in zip file directory */
|
||||
uLong num_of_file; /* # of file */
|
||||
} unz_file_pos;
|
||||
|
||||
extern int ZEXPORT unzGetFilePos(
|
||||
unzFile file,
|
||||
unz_file_pos* file_pos);
|
||||
|
||||
extern int ZEXPORT unzGoToFilePos(
|
||||
unzFile file,
|
||||
unz_file_pos* file_pos);
|
||||
|
||||
/* ****************************************** */
|
||||
|
||||
extern int ZEXPORT unzGetCurrentFileInfo (unzFile file,
|
||||
unz_file_info *pfile_info,
|
||||
char *szFileName,
|
||||
uLong fileNameBufferSize,
|
||||
void *extraField,
|
||||
uLong extraFieldBufferSize,
|
||||
char *szComment,
|
||||
uLong commentBufferSize);
|
||||
/*
|
||||
Get Info about the current file
|
||||
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
|
||||
the current file
|
||||
if szFileName!=NULL, the filemane string will be copied in szFileName
|
||||
(fileNameBufferSize is the size of the buffer)
|
||||
if extraField!=NULL, the extra field information will be copied in extraField
|
||||
(extraFieldBufferSize is the size of the buffer).
|
||||
This is the Central-header version of the extra field
|
||||
if szComment!=NULL, the comment string of the file will be copied in szComment
|
||||
(commentBufferSize is the size of the buffer)
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
/* 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)
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile (unzFile file);
|
||||
/*
|
||||
Open for reading data the current file in the zipfile.
|
||||
If there is no error, the return value is UNZ_OK.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file,
|
||||
const char* password);
|
||||
/*
|
||||
Open for reading data the current file in the zipfile.
|
||||
password is a crypting password
|
||||
If there is no error, the return value is UNZ_OK.
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile2 (unzFile file,
|
||||
int* method,
|
||||
int* level,
|
||||
int raw);
|
||||
/*
|
||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
||||
if raw==1
|
||||
*method will receive method of compression, *level will receive level of
|
||||
compression
|
||||
note : you can set level parameter as NULL (if you did not want known level,
|
||||
but you CANNOT set method parameter as NULL
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzOpenCurrentFile3 (unzFile file,
|
||||
int* method,
|
||||
int* level,
|
||||
int raw,
|
||||
const char* password);
|
||||
/*
|
||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
||||
if raw==1
|
||||
*method will receive method of compression, *level will receive level of
|
||||
compression
|
||||
note : you can set level parameter as NULL (if you did not want known level,
|
||||
but you CANNOT set method parameter as NULL
|
||||
*/
|
||||
|
||||
|
||||
extern int ZEXPORT unzCloseCurrentFile (unzFile file);
|
||||
/*
|
||||
Close the file in zip opened with unzOpenCurrentFile
|
||||
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzReadCurrentFile (unzFile file,
|
||||
voidp buf,
|
||||
unsigned len);
|
||||
/*
|
||||
Read bytes from the current file (opened by unzOpenCurrentFile)
|
||||
buf contain buffer where data must be copied
|
||||
len the size of buf.
|
||||
|
||||
return the number of byte copied if somes bytes are copied
|
||||
return 0 if the end of file was reached
|
||||
return <0 with error code if there is an error
|
||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
||||
*/
|
||||
|
||||
extern z_off_t ZEXPORT unztell (unzFile file);
|
||||
/*
|
||||
Give the current position in uncompressed data
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzeof (unzFile file);
|
||||
/*
|
||||
return 1 if the end of file was reached, 0 elsewhere
|
||||
*/
|
||||
|
||||
extern int ZEXPORT unzGetLocalExtrafield (unzFile file,
|
||||
voidp buf,
|
||||
unsigned len);
|
||||
/*
|
||||
Read extra field from the current file (opened by unzOpenCurrentFile)
|
||||
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)
|
||||
|
||||
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
|
||||
buf.
|
||||
the return value is the number of bytes copied in buf, or (if <0)
|
||||
the error code
|
||||
*/
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
/* Get the current file offset */
|
||||
extern uLong ZEXPORT unzGetOffset (unzFile file);
|
||||
|
||||
/* Set the current file offset */
|
||||
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _unz_H */
|
||||
|
|
|
@ -1,199 +1,199 @@
|
|||
cmake_minimum_required(VERSION 2.4.4)
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
|
||||
|
||||
# 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
|
||||
cmake_policy(PUSH)
|
||||
if(CMAKE_MAJOR_VERSION GREATER 2)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
endif()
|
||||
project(zlib C)
|
||||
cmake_policy(POP)
|
||||
|
||||
set(VERSION "1.2.8")
|
||||
|
||||
option(ASM686 "Enable building i686 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_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_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")
|
||||
|
||||
include(CheckTypeSize)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckCSourceCompiles)
|
||||
enable_testing()
|
||||
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(stddef.h HAVE_STDDEF_H)
|
||||
|
||||
#
|
||||
# Check to see if we have large file support
|
||||
#
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
|
||||
# We add these other definitions here because CheckTypeSize.cmake
|
||||
# in CMake 2.4.x does not automatically do so and we want
|
||||
# compatibility with CMake 2.4.x.
|
||||
if(HAVE_SYS_TYPES_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
|
||||
endif()
|
||||
if(HAVE_STDINT_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
|
||||
endif()
|
||||
if(HAVE_STDDEF_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
|
||||
endif()
|
||||
check_type_size(off64_t OFF64_T)
|
||||
if(HAVE_OFF64_T)
|
||||
add_definitions(-D_LARGEFILE64_SOURCE=1)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
|
||||
|
||||
#
|
||||
# Check for fseeko
|
||||
#
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
if(NOT HAVE_FSEEKO)
|
||||
add_definitions(-DNO_FSEEKO)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Check for unistd.h
|
||||
#
|
||||
check_include_file(unistd.h Z_HAVE_UNISTD_H)
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
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
|
||||
# in their source tree...
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
|
||||
message(STATUS "Renaming")
|
||||
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
|
||||
message(STATUS "to 'zconf.h.included' because this file is included with zlib")
|
||||
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)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
|
||||
${ZLIB_PC} @ONLY)
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
|
||||
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
|
||||
|
||||
|
||||
#============================================================================
|
||||
# zlib
|
||||
#============================================================================
|
||||
|
||||
set(ZLIB_PUBLIC_HDRS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
|
||||
zlib.h
|
||||
)
|
||||
set(ZLIB_PRIVATE_HDRS
|
||||
crc32.h
|
||||
deflate.h
|
||||
gzguts.h
|
||||
inffast.h
|
||||
inffixed.h
|
||||
inflate.h
|
||||
inftrees.h
|
||||
trees.h
|
||||
zutil.h
|
||||
)
|
||||
set(ZLIB_SRCS
|
||||
adler32.c
|
||||
compress.c
|
||||
crc32.c
|
||||
deflate.c
|
||||
gzclose.c
|
||||
gzlib.c
|
||||
gzread.c
|
||||
gzwrite.c
|
||||
inflate.c
|
||||
infback.c
|
||||
inftrees.c
|
||||
inffast.c
|
||||
trees.c
|
||||
uncompr.c
|
||||
zutil.c
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
set(ZLIB_DLL_SRCS
|
||||
win32/zlib1.rc # If present will override custom build rule below.
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
if(ASM686)
|
||||
set(ZLIB_ASMS contrib/asm686/match.S)
|
||||
elseif (AMD64)
|
||||
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
|
||||
endif ()
|
||||
|
||||
if(ZLIB_ASMS)
|
||||
add_definitions(-DASMV)
|
||||
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(ASM686)
|
||||
ENABLE_LANGUAGE(ASM_MASM)
|
||||
set(ZLIB_ASMS
|
||||
contrib/masmx86/inffas32.asm
|
||||
contrib/masmx86/match686.asm
|
||||
)
|
||||
elseif (AMD64)
|
||||
ENABLE_LANGUAGE(ASM_MASM)
|
||||
set(ZLIB_ASMS
|
||||
contrib/masmx64/gvmat64.asm
|
||||
contrib/masmx64/inffasx64.asm
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ZLIB_ASMS)
|
||||
add_definitions(-DASMV -DASMINF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# 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)
|
||||
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
|
||||
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
|
||||
|
||||
if(MINGW)
|
||||
# This gets us DLL resource information when compiling on MinGW.
|
||||
if(NOT CMAKE_RC_COMPILER)
|
||||
set(CMAKE_RC_COMPILER windres.exe)
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
|
||||
COMMAND ${CMAKE_RC_COMPILER}
|
||||
-D GCC_WINDRES
|
||||
-I ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-I ${CMAKE_CURRENT_BINARY_DIR}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
|
||||
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
|
||||
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
endif(MINGW)
|
||||
|
||||
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
INSTALL( TARGETS zlibstatic
|
||||
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
||||
COMPONENT ${LIBASSIMP_COMPONENT})
|
||||
cmake_minimum_required(VERSION 2.4.4)
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
|
||||
|
||||
# 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
|
||||
cmake_policy(PUSH)
|
||||
if(CMAKE_MAJOR_VERSION GREATER 2)
|
||||
cmake_policy(SET CMP0048 OLD)
|
||||
endif()
|
||||
project(zlib C)
|
||||
cmake_policy(POP)
|
||||
|
||||
set(VERSION "1.2.8")
|
||||
|
||||
option(ASM686 "Enable building i686 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_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_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")
|
||||
|
||||
include(CheckTypeSize)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckCSourceCompiles)
|
||||
enable_testing()
|
||||
|
||||
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(stddef.h HAVE_STDDEF_H)
|
||||
|
||||
#
|
||||
# Check to see if we have large file support
|
||||
#
|
||||
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
|
||||
# We add these other definitions here because CheckTypeSize.cmake
|
||||
# in CMake 2.4.x does not automatically do so and we want
|
||||
# compatibility with CMake 2.4.x.
|
||||
if(HAVE_SYS_TYPES_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
|
||||
endif()
|
||||
if(HAVE_STDINT_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
|
||||
endif()
|
||||
if(HAVE_STDDEF_H)
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
|
||||
endif()
|
||||
check_type_size(off64_t OFF64_T)
|
||||
if(HAVE_OFF64_T)
|
||||
add_definitions(-D_LARGEFILE64_SOURCE=1)
|
||||
endif()
|
||||
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
|
||||
|
||||
#
|
||||
# Check for fseeko
|
||||
#
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
if(NOT HAVE_FSEEKO)
|
||||
add_definitions(-DNO_FSEEKO)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Check for unistd.h
|
||||
#
|
||||
check_include_file(unistd.h Z_HAVE_UNISTD_H)
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
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
|
||||
# in their source tree...
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
|
||||
message(STATUS "Renaming")
|
||||
message(STATUS " ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h")
|
||||
message(STATUS "to 'zconf.h.included' because this file is included with zlib")
|
||||
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)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(ZLIB_PC ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc)
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
|
||||
${ZLIB_PC} @ONLY)
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
|
||||
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})
|
||||
|
||||
|
||||
#============================================================================
|
||||
# zlib
|
||||
#============================================================================
|
||||
|
||||
set(ZLIB_PUBLIC_HDRS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
|
||||
zlib.h
|
||||
)
|
||||
set(ZLIB_PRIVATE_HDRS
|
||||
crc32.h
|
||||
deflate.h
|
||||
gzguts.h
|
||||
inffast.h
|
||||
inffixed.h
|
||||
inflate.h
|
||||
inftrees.h
|
||||
trees.h
|
||||
zutil.h
|
||||
)
|
||||
set(ZLIB_SRCS
|
||||
adler32.c
|
||||
compress.c
|
||||
crc32.c
|
||||
deflate.c
|
||||
gzclose.c
|
||||
gzlib.c
|
||||
gzread.c
|
||||
gzwrite.c
|
||||
inflate.c
|
||||
infback.c
|
||||
inftrees.c
|
||||
inffast.c
|
||||
trees.c
|
||||
uncompr.c
|
||||
zutil.c
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
set(ZLIB_DLL_SRCS
|
||||
win32/zlib1.rc # If present will override custom build rule below.
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
if(ASM686)
|
||||
set(ZLIB_ASMS contrib/asm686/match.S)
|
||||
elseif (AMD64)
|
||||
set(ZLIB_ASMS contrib/amd64/amd64-match.S)
|
||||
endif ()
|
||||
|
||||
if(ZLIB_ASMS)
|
||||
add_definitions(-DASMV)
|
||||
set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(ASM686)
|
||||
ENABLE_LANGUAGE(ASM_MASM)
|
||||
set(ZLIB_ASMS
|
||||
contrib/masmx86/inffas32.asm
|
||||
contrib/masmx86/match686.asm
|
||||
)
|
||||
elseif (AMD64)
|
||||
ENABLE_LANGUAGE(ASM_MASM)
|
||||
set(ZLIB_ASMS
|
||||
contrib/masmx64/gvmat64.asm
|
||||
contrib/masmx64/inffasx64.asm
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ZLIB_ASMS)
|
||||
add_definitions(-DASMV -DASMINF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# 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)
|
||||
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
|
||||
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
|
||||
|
||||
if(MINGW)
|
||||
# This gets us DLL resource information when compiling on MinGW.
|
||||
if(NOT CMAKE_RC_COMPILER)
|
||||
set(CMAKE_RC_COMPILER windres.exe)
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
|
||||
COMMAND ${CMAKE_RC_COMPILER}
|
||||
-D GCC_WINDRES
|
||||
-I ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-I ${CMAKE_CURRENT_BINARY_DIR}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
|
||||
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
|
||||
set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
|
||||
endif(MINGW)
|
||||
|
||||
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
|
||||
INSTALL( TARGETS zlibstatic
|
||||
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR}
|
||||
COMPONENT ${LIBASSIMP_COMPONENT})
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
This is a heavily modified and shrinked version of zlib 1.2.3
|
||||
|
||||
- Removed comments from zlib.h
|
||||
- Removed gzip/zip archive I/O
|
||||
- Removed infback.c
|
||||
- Added Assimp #idefs to exclude it if not needed
|
||||
- Disabled debug macros in zutil.h
|
||||
|
||||
Assimp itself does not use the compression part yet, so
|
||||
it needn't be compiled (trees.c, deflate.c, compress.c).
|
||||
This is a heavily modified and shrinked version of zlib 1.2.3
|
||||
|
||||
- Removed comments from zlib.h
|
||||
- Removed gzip/zip archive I/O
|
||||
- Removed infback.c
|
||||
- Added Assimp #idefs to exclude it if not needed
|
||||
- Disabled debug macros in zutil.h
|
||||
|
||||
Assimp itself does not use the compression part yet, so
|
||||
it needn't be compiled (trees.c, deflate.c, compress.c).
|
||||
Currently these units are just used by assimp_cmd.
|
|
@ -1,40 +1,40 @@
|
|||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
1096
doc/dox_cmd.h
1096
doc/dox_cmd.h
File diff suppressed because it is too large
Load Diff
|
@ -1,22 +1,22 @@
|
|||
|
||||
// ===============================================================================
|
||||
// May be included multiple times - resets structure packing to the defaults
|
||||
// for all supported compilers. Reverts the changes made by #include <pushpack1.h>
|
||||
//
|
||||
// Currently this works on the following compilers:
|
||||
// MSVC 7,8,9
|
||||
// GCC
|
||||
// BORLAND (complains about 'pack state changed but not reverted', but works)
|
||||
// ===============================================================================
|
||||
|
||||
#ifndef AI_PUSHPACK_IS_DEFINED
|
||||
# error pushpack1.h must be included after poppack1.h
|
||||
#endif
|
||||
|
||||
// reset packing to the original value
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
|
||||
# pragma pack( pop )
|
||||
#endif
|
||||
#undef PACK_STRUCT
|
||||
|
||||
#undef AI_PUSHPACK_IS_DEFINED
|
||||
|
||||
// ===============================================================================
|
||||
// May be included multiple times - resets structure packing to the defaults
|
||||
// for all supported compilers. Reverts the changes made by #include <pushpack1.h>
|
||||
//
|
||||
// Currently this works on the following compilers:
|
||||
// MSVC 7,8,9
|
||||
// GCC
|
||||
// BORLAND (complains about 'pack state changed but not reverted', but works)
|
||||
// ===============================================================================
|
||||
|
||||
#ifndef AI_PUSHPACK_IS_DEFINED
|
||||
# error pushpack1.h must be included after poppack1.h
|
||||
#endif
|
||||
|
||||
// reset packing to the original value
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
|
||||
# pragma pack( pop )
|
||||
#endif
|
||||
#undef PACK_STRUCT
|
||||
|
||||
#undef AI_PUSHPACK_IS_DEFINED
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,92 +1,92 @@
|
|||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Android implementation of IOSystem using the standard C file functions.
|
||||
* Aimed to ease the acces to android assets */
|
||||
|
||||
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
#ifndef AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
#define AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
|
||||
#include "../code/DefaultIOSystem.h"
|
||||
#include <android/asset_manager.h>
|
||||
#include <android/asset_manager_jni.h>
|
||||
#include <android/native_activity.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** Android extension to DefaultIOSystem using the standard C file functions */
|
||||
class AndroidJNIIOSystem : public DefaultIOSystem
|
||||
{
|
||||
public:
|
||||
|
||||
/** Initialize android activity data */
|
||||
std::string mApkWorkspacePath;
|
||||
AAssetManager* mApkAssetManager;
|
||||
|
||||
/** Constructor. */
|
||||
AndroidJNIIOSystem(ANativeActivity* activity);
|
||||
|
||||
/** Destructor. */
|
||||
~AndroidJNIIOSystem();
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Tests for the existence of a file at the given path. */
|
||||
bool Exists( const char* pFile) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Opens a file at the given path, with given mode */
|
||||
IOStream* Open( const char* strFile, const char* strMode);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Inits Android extractor
|
||||
void AndroidActivityInit(ANativeActivity* activity);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Extracts android asset
|
||||
bool AndroidExtractAsset(std::string name);
|
||||
|
||||
};
|
||||
|
||||
} //!ns Assimp
|
||||
|
||||
#endif //AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
#endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the
|
||||
following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Android implementation of IOSystem using the standard C file functions.
|
||||
* Aimed to ease the acces to android assets */
|
||||
|
||||
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
#ifndef AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
#define AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
|
||||
#include "../code/DefaultIOSystem.h"
|
||||
#include <android/asset_manager.h>
|
||||
#include <android/asset_manager_jni.h>
|
||||
#include <android/native_activity.h>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
/** Android extension to DefaultIOSystem using the standard C file functions */
|
||||
class AndroidJNIIOSystem : public DefaultIOSystem
|
||||
{
|
||||
public:
|
||||
|
||||
/** Initialize android activity data */
|
||||
std::string mApkWorkspacePath;
|
||||
AAssetManager* mApkAssetManager;
|
||||
|
||||
/** Constructor. */
|
||||
AndroidJNIIOSystem(ANativeActivity* activity);
|
||||
|
||||
/** Destructor. */
|
||||
~AndroidJNIIOSystem();
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Tests for the existence of a file at the given path. */
|
||||
bool Exists( const char* pFile) const;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
/** Opens a file at the given path, with given mode */
|
||||
IOStream* Open( const char* strFile, const char* strMode);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Inits Android extractor
|
||||
void AndroidActivityInit(ANativeActivity* activity);
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Extracts android asset
|
||||
bool AndroidExtractAsset(std::string name);
|
||||
|
||||
};
|
||||
|
||||
} //!ns Assimp
|
||||
|
||||
#endif //AI_ANDROIDJNIIOSYSTEM_H_INC
|
||||
#endif //__ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
|
||||
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.
|
||||
|
||||
vcredist_x86.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.
|
||||
|
||||
3) Build assimp, assimpcmd and assimpview for the 'release-dll' target and both the Win32 and x64 architectures.
|
||||
|
||||
4) Get Inno Setup
|
||||
5) Compile, output is written to the 'out' folder.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
vcredist_x86.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.
|
||||
|
||||
3) Build assimp, assimpcmd and assimpview for the 'release-dll' target and both the Win32 and x64 architectures.
|
||||
|
||||
4) Get Inno Setup
|
||||
5) Compile, output is written to the 'out' folder.
|
||||
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
|
||||
------------------------------------------------------------------------------------
|
||||
Open Asset Import Library (Assimp) SDK Installer
|
||||
Release Notes
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
http://assimp.sf.net
|
||||
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
1. Missing d3dx9_(some-number).dll?
|
||||
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?
|
||||
Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
|
||||
|
||||
3. assimp.exe not in PATH
|
||||
Add it to PATH. That's not a bug, the installer does not alter the PATH.
|
||||
|
||||
4. Crashes immediately
|
||||
You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry.
|
||||
|
||||
------------------------------------------------------------------------------------
|
||||
Open Asset Import Library (Assimp) SDK Installer
|
||||
Release Notes
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
http://assimp.sf.net
|
||||
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
1. Missing d3dx9_(some-number).dll?
|
||||
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?
|
||||
Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
|
||||
|
||||
3. assimp.exe not in PATH
|
||||
Add it to PATH. That's not a bug, the installer does not alter the PATH.
|
||||
|
||||
4. Crashes immediately
|
||||
You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry.
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
|
||||
------------------------------------------------------------------------------------
|
||||
Open Asset Import Library (Assimp) Viewer Installer
|
||||
Release Notes
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
http://assimp.sf.net
|
||||
|
||||
Known Bugs & Limitations
|
||||
========================
|
||||
|
||||
Viewer
|
||||
|
||||
- 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.
|
||||
- Several important texture file formats (such as GIF) are not supported.
|
||||
- HUD is blurred on the right side. ATI/AMD hardware only.
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
1. Missing d3dx9_(number).dll?
|
||||
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?
|
||||
Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
|
||||
|
||||
3. assimp.exe not in PATH
|
||||
Add it to PATH. That's not a bug, the installer does not alter the PATH.
|
||||
|
||||
4. Crashes immediately
|
||||
|
||||
------------------------------------------------------------------------------------
|
||||
Open Asset Import Library (Assimp) Viewer Installer
|
||||
Release Notes
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
http://assimp.sf.net
|
||||
|
||||
Known Bugs & Limitations
|
||||
========================
|
||||
|
||||
Viewer
|
||||
|
||||
- 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.
|
||||
- Several important texture file formats (such as GIF) are not supported.
|
||||
- HUD is blurred on the right side. ATI/AMD hardware only.
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
1. Missing d3dx9_(number).dll?
|
||||
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?
|
||||
Reinstall Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
|
||||
|
||||
3. assimp.exe not in PATH
|
||||
Add it to PATH. That's not a bug, the installer does not alter the PATH.
|
||||
|
||||
4. Crashes immediately
|
||||
You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry.
|
|
@ -1,29 +1,29 @@
|
|||
|
||||
------------------------------------------------------------------------------------
|
||||
Open Asset Import Library (Assimp) Tools/Binaries for Windows
|
||||
Release Notes
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Known Bugs & Limitations
|
||||
========================
|
||||
|
||||
Viewer
|
||||
|
||||
- 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.
|
||||
- Alpha-sorting is implemented, but still causes artifacts when models are moved quickly.
|
||||
- Several important texture file formats (such as GIF) are not supported.
|
||||
- HUD is blurred on the right side. ATI/AMD hardware only.
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
1. Missing d3dx9_42.dll?
|
||||
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?
|
||||
(Re)install Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
|
||||
|
||||
3. Crashes immediately
|
||||
|
||||
------------------------------------------------------------------------------------
|
||||
Open Asset Import Library (Assimp) Tools/Binaries for Windows
|
||||
Release Notes
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Known Bugs & Limitations
|
||||
========================
|
||||
|
||||
Viewer
|
||||
|
||||
- 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.
|
||||
- Alpha-sorting is implemented, but still causes artifacts when models are moved quickly.
|
||||
- Several important texture file formats (such as GIF) are not supported.
|
||||
- HUD is blurred on the right side. ATI/AMD hardware only.
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
||||
1. Missing d3dx9_42.dll?
|
||||
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?
|
||||
(Re)install Microsoft Visual C++ 2005 SP1 Redistributable (x86 or x64, depending on your system)
|
||||
|
||||
3. Crashes immediately
|
||||
You CPU lacks SSE2 support. Build Assimp from scratch to suit your CPU, sorry.
|
|
@ -1,175 +1,175 @@
|
|||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Android extension of DefaultIOSystem using the standard C file functions */
|
||||
|
||||
|
||||
#include <assimp/config.h>
|
||||
#include <android/api-level.h>
|
||||
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <android/log.h>
|
||||
#include <android/asset_manager.h>
|
||||
#include <android/asset_manager_jni.h>
|
||||
#include <android/native_activity.h>
|
||||
#include <assimp/ai_assert.h>
|
||||
#include <assimp/port/AndroidJNI/AndroidJNIIOSystem.h>
|
||||
#include <code/DefaultIOStream.h>
|
||||
#include <fstream>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Constructor.
|
||||
AndroidJNIIOSystem::AndroidJNIIOSystem(ANativeActivity* activity)
|
||||
{
|
||||
AndroidActivityInit(activity);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Destructor.
|
||||
AndroidJNIIOSystem::~AndroidJNIIOSystem()
|
||||
{
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Tests for the existence of a file at the given path.
|
||||
bool AndroidJNIIOSystem::Exists( const char* pFile) const
|
||||
{
|
||||
AAsset* asset = AAssetManager_open(mApkAssetManager, pFile,
|
||||
AASSET_MODE_UNKNOWN);
|
||||
FILE* file = ::fopen( (mApkWorkspacePath + getOsSeparator() + std::string(pFile)).c_str(), "rb");
|
||||
|
||||
if (!asset && !file)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset manager can not find: %s", pFile);
|
||||
return false;
|
||||
}
|
||||
|
||||
__android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset exists");
|
||||
if (file)
|
||||
::fclose( file);
|
||||
return true;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Inits Android extractor
|
||||
void AndroidJNIIOSystem::AndroidActivityInit(ANativeActivity* activity)
|
||||
{
|
||||
mApkWorkspacePath = activity->internalDataPath;
|
||||
mApkAssetManager = activity->assetManager;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Extracts android asset
|
||||
bool AndroidJNIIOSystem::AndroidExtractAsset(std::string name)
|
||||
{
|
||||
std::string newPath = mApkWorkspacePath + getOsSeparator() + name;
|
||||
|
||||
DefaultIOSystem io;
|
||||
|
||||
// Do not extract if extracted already
|
||||
if ( io.Exists(newPath.c_str()) ) {
|
||||
__android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset already extracted");
|
||||
return true;
|
||||
}
|
||||
// Open file
|
||||
AAsset* asset = AAssetManager_open(mApkAssetManager, name.c_str(),
|
||||
AASSET_MODE_UNKNOWN);
|
||||
std::vector<char> assetContent;
|
||||
|
||||
if (asset != NULL) {
|
||||
// Find size
|
||||
off_t assetSize = AAsset_getLength(asset);
|
||||
|
||||
// Prepare input buffer
|
||||
assetContent.resize(assetSize);
|
||||
|
||||
// Store input buffer
|
||||
AAsset_read(asset, &assetContent[0], assetSize);
|
||||
|
||||
// Close
|
||||
AAsset_close(asset);
|
||||
|
||||
// Prepare output buffer
|
||||
std::ofstream assetExtracted(newPath.c_str(),
|
||||
std::ios::out | std::ios::binary);
|
||||
if (!assetExtracted) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "assimp",
|
||||
"Can not open output file");
|
||||
}
|
||||
|
||||
// Write output buffer into a file
|
||||
assetExtracted.write(&assetContent[0], assetContent.size());
|
||||
assetExtracted.close();
|
||||
|
||||
__android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset extracted");
|
||||
} else {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "assimp", "Asset not found: %s", name.c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Open a new file with a given path.
|
||||
IOStream* AndroidJNIIOSystem::Open( const char* strFile, const char* strMode)
|
||||
{
|
||||
ai_assert(NULL != strFile);
|
||||
ai_assert(NULL != strMode);
|
||||
|
||||
std::string fullPath(mApkWorkspacePath + getOsSeparator() + std::string(strFile));
|
||||
if (Exists(strFile))
|
||||
AndroidExtractAsset(std::string(strFile));
|
||||
|
||||
FILE* file = ::fopen( fullPath.c_str(), strMode);
|
||||
|
||||
if( NULL == file)
|
||||
return NULL;
|
||||
|
||||
__android_log_print(ANDROID_LOG_ERROR, "assimp", "AndroidIOSystem: file %s opened", fullPath.c_str());
|
||||
return new DefaultIOStream(file, fullPath);
|
||||
}
|
||||
|
||||
#undef PATHLIMIT
|
||||
#endif // __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2012, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use of this software in source and binary forms,
|
||||
with or without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
* Neither the name of the assimp team, nor the names of its
|
||||
contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior
|
||||
written permission of the assimp team.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @file Android extension of DefaultIOSystem using the standard C file functions */
|
||||
|
||||
|
||||
#include <assimp/config.h>
|
||||
#include <android/api-level.h>
|
||||
#if __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <android/log.h>
|
||||
#include <android/asset_manager.h>
|
||||
#include <android/asset_manager_jni.h>
|
||||
#include <android/native_activity.h>
|
||||
#include <assimp/ai_assert.h>
|
||||
#include <assimp/port/AndroidJNI/AndroidJNIIOSystem.h>
|
||||
#include <code/DefaultIOStream.h>
|
||||
#include <fstream>
|
||||
|
||||
using namespace Assimp;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Constructor.
|
||||
AndroidJNIIOSystem::AndroidJNIIOSystem(ANativeActivity* activity)
|
||||
{
|
||||
AndroidActivityInit(activity);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Destructor.
|
||||
AndroidJNIIOSystem::~AndroidJNIIOSystem()
|
||||
{
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Tests for the existence of a file at the given path.
|
||||
bool AndroidJNIIOSystem::Exists( const char* pFile) const
|
||||
{
|
||||
AAsset* asset = AAssetManager_open(mApkAssetManager, pFile,
|
||||
AASSET_MODE_UNKNOWN);
|
||||
FILE* file = ::fopen( (mApkWorkspacePath + getOsSeparator() + std::string(pFile)).c_str(), "rb");
|
||||
|
||||
if (!asset && !file)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset manager can not find: %s", pFile);
|
||||
return false;
|
||||
}
|
||||
|
||||
__android_log_print(ANDROID_LOG_ERROR, "Assimp", "Asset exists");
|
||||
if (file)
|
||||
::fclose( file);
|
||||
return true;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Inits Android extractor
|
||||
void AndroidJNIIOSystem::AndroidActivityInit(ANativeActivity* activity)
|
||||
{
|
||||
mApkWorkspacePath = activity->internalDataPath;
|
||||
mApkAssetManager = activity->assetManager;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Extracts android asset
|
||||
bool AndroidJNIIOSystem::AndroidExtractAsset(std::string name)
|
||||
{
|
||||
std::string newPath = mApkWorkspacePath + getOsSeparator() + name;
|
||||
|
||||
DefaultIOSystem io;
|
||||
|
||||
// Do not extract if extracted already
|
||||
if ( io.Exists(newPath.c_str()) ) {
|
||||
__android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset already extracted");
|
||||
return true;
|
||||
}
|
||||
// Open file
|
||||
AAsset* asset = AAssetManager_open(mApkAssetManager, name.c_str(),
|
||||
AASSET_MODE_UNKNOWN);
|
||||
std::vector<char> assetContent;
|
||||
|
||||
if (asset != NULL) {
|
||||
// Find size
|
||||
off_t assetSize = AAsset_getLength(asset);
|
||||
|
||||
// Prepare input buffer
|
||||
assetContent.resize(assetSize);
|
||||
|
||||
// Store input buffer
|
||||
AAsset_read(asset, &assetContent[0], assetSize);
|
||||
|
||||
// Close
|
||||
AAsset_close(asset);
|
||||
|
||||
// Prepare output buffer
|
||||
std::ofstream assetExtracted(newPath.c_str(),
|
||||
std::ios::out | std::ios::binary);
|
||||
if (!assetExtracted) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "assimp",
|
||||
"Can not open output file");
|
||||
}
|
||||
|
||||
// Write output buffer into a file
|
||||
assetExtracted.write(&assetContent[0], assetContent.size());
|
||||
assetExtracted.close();
|
||||
|
||||
__android_log_print(ANDROID_LOG_DEFAULT, "Assimp", "Asset extracted");
|
||||
} else {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "assimp", "Asset not found: %s", name.c_str());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Open a new file with a given path.
|
||||
IOStream* AndroidJNIIOSystem::Open( const char* strFile, const char* strMode)
|
||||
{
|
||||
ai_assert(NULL != strFile);
|
||||
ai_assert(NULL != strMode);
|
||||
|
||||
std::string fullPath(mApkWorkspacePath + getOsSeparator() + std::string(strFile));
|
||||
if (Exists(strFile))
|
||||
AndroidExtractAsset(std::string(strFile));
|
||||
|
||||
FILE* file = ::fopen( fullPath.c_str(), strMode);
|
||||
|
||||
if( NULL == file)
|
||||
return NULL;
|
||||
|
||||
__android_log_print(ANDROID_LOG_ERROR, "assimp", "AndroidIOSystem: file %s opened", fullPath.c_str());
|
||||
return new DefaultIOStream(file, fullPath);
|
||||
}
|
||||
|
||||
#undef PATHLIMIT
|
||||
#endif // __ANDROID__ and __ANDROID_API__ > 9 and defined(AI_CONFIG_ANDROID_JNI_ASSIMP_MANAGER_SUPPORT)
|
||||
|
|
|
@ -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 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
|
||||
|
||||
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.
|
||||
|
||||
See http://sourceforge.net/tracker/?func=detail&aid=3212646&group_id=226462&atid=1067634 for the original patch
|
||||
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
#ifndef __ILUT_CONFIG_H__
|
||||
#define __ILUT_CONFIG_H__
|
||||
|
||||
#define IL_USE_PRAGMA_LIBS
|
||||
|
||||
// Supported APIs (ILUT)
|
||||
|
||||
//
|
||||
// sorry just
|
||||
// cant get this one to work under windows
|
||||
// have disabled for the now
|
||||
//
|
||||
// will look at it some more later
|
||||
//
|
||||
// Kriss
|
||||
//
|
||||
#undef ILUT_USE_ALLEGRO
|
||||
|
||||
#undef ILUT_USE_DIRECTX8
|
||||
//#define ILUT_USE_DIRECTX9
|
||||
//#define ILUT_USE_DIRECTX10
|
||||
#define ILUT_USE_OPENGL
|
||||
//#define ILUT_USE_SDL
|
||||
#define ILUT_USE_WIN32
|
||||
|
||||
#endif//__ILUT_CONFIG_H__
|
||||
#ifndef __ILUT_CONFIG_H__
|
||||
#define __ILUT_CONFIG_H__
|
||||
|
||||
#define IL_USE_PRAGMA_LIBS
|
||||
|
||||
// Supported APIs (ILUT)
|
||||
|
||||
//
|
||||
// sorry just
|
||||
// cant get this one to work under windows
|
||||
// have disabled for the now
|
||||
//
|
||||
// will look at it some more later
|
||||
//
|
||||
// Kriss
|
||||
//
|
||||
#undef ILUT_USE_ALLEGRO
|
||||
|
||||
#undef ILUT_USE_DIRECTX8
|
||||
//#define ILUT_USE_DIRECTX9
|
||||
//#define ILUT_USE_DIRECTX10
|
||||
#define ILUT_USE_OPENGL
|
||||
//#define ILUT_USE_SDL
|
||||
#define ILUT_USE_WIN32
|
||||
|
||||
#endif//__ILUT_CONFIG_H__
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,18 +1,18 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008.
|
||||
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. 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.
|
||||
"
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008.
|
||||
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. 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.
|
||||
"
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
Jeep designed, modelled and skinned by me, Psionic
|
||||
|
||||
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.
|
||||
|
||||
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:-
|
||||
|
||||
http://xu1productions.com/3dstudio/index.html - 3D Game Resources
|
||||
|
||||
http://www.psionicdesign.com - My Main 2D/3D Digital Art site
|
||||
|
||||
Jeep designed, modelled and skinned by me, Psionic
|
||||
|
||||
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.
|
||||
|
||||
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:-
|
||||
|
||||
http://xu1productions.com/3dstudio/index.html - 3D Game Resources
|
||||
|
||||
http://www.psionicdesign.com - My Main 2D/3D Digital Art site
|
||||
|
||||
Psionic 2002
|
|
@ -1,18 +1,18 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
hello!
|
||||
|
||||
fell free to use the object...so do what U want!
|
||||
& sent me your pictures...:-)
|
||||
for commercial use, contact me!
|
||||
|
||||
http://www.elektrobar.com/lux/
|
||||
|
||||
or mail to:
|
||||
lux@elektrobar.com
|
||||
|
||||
hello!
|
||||
|
||||
fell free to use the object...so do what U want!
|
||||
& sent me your pictures...:-)
|
||||
for commercial use, contact me!
|
||||
|
||||
http://www.elektrobar.com/lux/
|
||||
|
||||
or mail to:
|
||||
lux@elektrobar.com
|
||||
|
||||
have fun.....VIRLUX
|
|
@ -1,25 +1,25 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
CONVERTED FROM 3DS TO ASE WITH AC3D
|
|
@ -1,24 +1,24 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
CONVERTED FROM 3DS TO ASE WITH AC3D
|
|
@ -1,51 +1,51 @@
|
|||
Dwarf lowpoly model Pack
|
||||
Copyright 2004, Psionic Design
|
||||
e-mail: psionic@blueyonder.co.uk
|
||||
Used with permission.
|
||||
|
||||
|
||||
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!
|
||||
|
||||
|
||||
|
||||
USAGE INFORMATION:
|
||||
|
||||
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
|
||||
|
||||
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:-
|
||||
|
||||
website: http://www.psionic3d.co.uk
|
||||
email: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
WHAT'S INCLUDED IN THE ZIP:
|
||||
|
||||
ReadMe.txt - This file
|
||||
b3d.zip - Blitz 3D Format models and textures
|
||||
ms3d.zip - Milkshape 3D Format models and textures
|
||||
x.zip - DarkBasic Direct X 8 Format models and textures
|
||||
|
||||
|
||||
|
||||
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 redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
|
||||
|
||||
|
||||
Psi
|
||||
http://www.psionic3d.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
Dwarf lowpoly model Pack
|
||||
Copyright 2004, Psionic Design
|
||||
e-mail: psionic@blueyonder.co.uk
|
||||
Used with permission.
|
||||
|
||||
|
||||
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!
|
||||
|
||||
|
||||
|
||||
USAGE INFORMATION:
|
||||
|
||||
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
|
||||
|
||||
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:-
|
||||
|
||||
website: http://www.psionic3d.co.uk
|
||||
email: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
WHAT'S INCLUDED IN THE ZIP:
|
||||
|
||||
ReadMe.txt - This file
|
||||
b3d.zip - Blitz 3D Format models and textures
|
||||
ms3d.zip - Milkshape 3D Format models and textures
|
||||
x.zip - DarkBasic Direct X 8 Format models and textures
|
||||
|
||||
|
||||
|
||||
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 redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
|
||||
|
||||
|
||||
Psi
|
||||
http://www.psionic3d.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
turtle1.b3d
|
||||
Copyright 2004, Psionic Design
|
||||
e-mail: psionic@blueyonder.co.uk
|
||||
Used with permission.
|
||||
|
||||
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.
|
||||
turtle1.b3d
|
||||
Copyright 2004, Psionic Design
|
||||
e-mail: psionic@blueyonder.co.uk
|
||||
Used with permission.
|
||||
|
||||
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 redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
|
|
@ -1,31 +1,31 @@
|
|||
|
||||
----------------------------------------------------------------------------------------------
|
||||
TITLE : Bob, MD5 character source file
|
||||
AUTHOR : Ken Beyer (kat)
|
||||
EMAIL ADDRESS : info@katsbits.com
|
||||
HOMEPAGE URL : http://www.katsbits.com
|
||||
|
||||
|
||||
MODEL NAME/s
|
||||
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.
|
||||
|
||||
|
||||
DISTRIBUTION
|
||||
Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution.
|
||||
Commercial use is permitted with written licensed permission.
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
Files:
|
||||
- Bob.md5mesh
|
||||
- Bob.md5anim
|
||||
- Bob.blend
|
||||
- ./*.png
|
||||
|
||||
Changes:
|
||||
- converted all tga's to png, updated .blend and .md5mesh accordingly
|
||||
- removed absolute texture paths from the md5mesh file
|
||||
- minor downscaling of all textures to fit in less bytes
|
||||
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------------------------------
|
||||
TITLE : Bob, MD5 character source file
|
||||
AUTHOR : Ken Beyer (kat)
|
||||
EMAIL ADDRESS : info@katsbits.com
|
||||
HOMEPAGE URL : http://www.katsbits.com
|
||||
|
||||
|
||||
MODEL NAME/s
|
||||
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.
|
||||
|
||||
|
||||
DISTRIBUTION
|
||||
Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution.
|
||||
Commercial use is permitted with written licensed permission.
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
Files:
|
||||
- Bob.md5mesh
|
||||
- Bob.md5anim
|
||||
- Bob.blend
|
||||
- ./*.png
|
||||
|
||||
Changes:
|
||||
- converted all tga's to png, updated .blend and .md5mesh accordingly
|
||||
- removed absolute texture paths from the md5mesh file
|
||||
- minor downscaling of all textures to fit in less bytes
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
COnverted from 3ds to DXF with Ac3D
|
|
@ -1,4 +1,4 @@
|
|||
Good IFC test cases
|
||||
===================
|
||||
|
||||
Good IFC test cases
|
||||
===================
|
||||
|
||||
http://www.iai.fzk.de/www-extern/index.php?id=1135
|
|
@ -1,11 +1,11 @@
|
|||
This skybox is basing on a skydome texture from
|
||||
|
||||
http://mikepan.homeip.net/earth
|
||||
|
||||
Downloaded November 22th, 08
|
||||
Distribution note:
|
||||
"These royalty-free skydome textures work best when applied to a sphere or hemisphere"
|
||||
|
||||
|
||||
|
||||
Thanks for your great work!
|
||||
This skybox is basing on a skydome texture from
|
||||
|
||||
http://mikepan.homeip.net/earth
|
||||
|
||||
Downloaded November 22th, 08
|
||||
Distribution note:
|
||||
"These royalty-free skydome textures work best when applied to a sphere or hemisphere"
|
||||
|
||||
|
||||
|
||||
Thanks for your great work!
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
"These 3d models are contributed by John Hoffman and are based on
|
||||
characters from a cartoon show called "Jayce and the wheel warriors"
|
||||
(except the marauder) John's site: http://www3.sympatico.ca/john.hoffman"
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
|
||||
These files belong to the QuickDraw model in the LWS folder - they are referenced
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
"These 3d models are contributed by John Hoffman and are based on
|
||||
characters from a cartoon show called "Jayce and the wheel warriors"
|
||||
(except the marauder) John's site: http://www3.sympatico.ca/john.hoffman"
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
|
||||
These files belong to the QuickDraw model in the LWS folder - they are referenced
|
||||
and loaded into the LWS scene.
|
|
@ -1,24 +1,24 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
||||
|
||||
INFO
|
||||
====
|
||||
|
||||
CONVERTED FROM 3DS TO LWO2 WITH AC3D
|
|
@ -1,15 +1,15 @@
|
|||
From http://telias.free.fr
|
||||
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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.
|
||||
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.
|
||||
"
|
||||
|
||||
|
||||
CHANGES:
|
||||
From http://telias.free.fr
|
||||
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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.
|
||||
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.
|
||||
"
|
||||
|
||||
|
||||
CHANGES:
|
||||
Paths have been modified
|
|
@ -1,18 +1,18 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
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. 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.
|
||||
"
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
-------------------------------------------------------------------------
|
||||
|
||||
TITLE : kt_kubalwagon
|
||||
AUTHOR : ken 'kat' beyer
|
||||
EMAIL ADDRESS : cpdt@telinco.co.uk
|
||||
HOMEPAGE URL : http://www.quake3bits.co.uk
|
||||
NUMBER OF MODELS : 1
|
||||
SHADER SCRIPTS : yes - included
|
||||
|
||||
------------------
|
||||
* MODEL NAME/s *
|
||||
[model details below]
|
||||
european_fnt_v2.md3
|
||||
|
||||
euro_rnt_2.tga (alpha'd steering wheel)
|
||||
european_fnt.tga
|
||||
|
||||
|
||||
------------------
|
||||
|
||||
CREDITS
|
||||
ID software, eskimo roll, EMSIPE, QkenneyQ
|
||||
DISTRIBUTION
|
||||
as long as this readme is included...!
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
TITLE : kt_kubalwagon
|
||||
AUTHOR : ken 'kat' beyer
|
||||
EMAIL ADDRESS : cpdt@telinco.co.uk
|
||||
HOMEPAGE URL : http://www.quake3bits.co.uk
|
||||
NUMBER OF MODELS : 1
|
||||
SHADER SCRIPTS : yes - included
|
||||
|
||||
------------------
|
||||
* MODEL NAME/s *
|
||||
[model details below]
|
||||
european_fnt_v2.md3
|
||||
|
||||
euro_rnt_2.tga (alpha'd steering wheel)
|
||||
european_fnt.tga
|
||||
|
||||
|
||||
------------------
|
||||
|
||||
CREDITS
|
||||
ID software, eskimo roll, EMSIPE, QkenneyQ
|
||||
DISTRIBUTION
|
||||
as long as this readme is included...!
|
||||
|
||||
--------------------------------------------------------------------------
|
|
@ -1,26 +1,26 @@
|
|||
-------------------------------------------------------------------------
|
||||
|
||||
TITLE : kt_watercan
|
||||
AUTHOR : ken 'kat' beyer
|
||||
EMAIL ADDRESS : cpdt@telinco.co.uk
|
||||
HOMEPAGE URL : http://www.quake3bits.co.uk
|
||||
NUMBER OF MODELS : 2
|
||||
SHADER SCRIPTS : n/a
|
||||
|
||||
------------------
|
||||
* MODEL NAME/s *
|
||||
[model details below]
|
||||
watercan.md3
|
||||
watercan_dmg.md3 (dmg='damaged')
|
||||
|
||||
water_can.tga 256x128
|
||||
|
||||
|
||||
------------------
|
||||
|
||||
CREDITS
|
||||
ID software, eskimo roll, EMSIPE, QkenneyQ
|
||||
DISTRIBUTION
|
||||
as long as this readme is included...!
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
TITLE : kt_watercan
|
||||
AUTHOR : ken 'kat' beyer
|
||||
EMAIL ADDRESS : cpdt@telinco.co.uk
|
||||
HOMEPAGE URL : http://www.quake3bits.co.uk
|
||||
NUMBER OF MODELS : 2
|
||||
SHADER SCRIPTS : n/a
|
||||
|
||||
------------------
|
||||
* MODEL NAME/s *
|
||||
[model details below]
|
||||
watercan.md3
|
||||
watercan_dmg.md3 (dmg='damaged')
|
||||
|
||||
water_can.tga 256x128
|
||||
|
||||
|
||||
------------------
|
||||
|
||||
CREDITS
|
||||
ID software, eskimo roll, EMSIPE, QkenneyQ
|
||||
DISTRIBUTION
|
||||
as long as this readme is included...!
|
||||
|
||||
--------------------------------------------------------------------------
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
License: Creative Commons
|
||||
- Remix
|
||||
- Share alike
|
||||
- Attribution Author: zphr (Christian Lenke)
|
||||
|
||||
|
||||
|
||||
|
||||
License: Creative Commons
|
||||
- Remix
|
||||
- Share alike
|
||||
- Attribution Author: zphr (Christian Lenke)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
|
||||
----------------------------------------------------------------------------------------------
|
||||
TITLE : Bob, MD5 character source file
|
||||
AUTHOR : Ken Beyer (kat)
|
||||
EMAIL ADDRESS : info@katsbits.com
|
||||
HOMEPAGE URL : http://www.katsbits.com
|
||||
|
||||
|
||||
MODEL NAME/s
|
||||
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.
|
||||
|
||||
|
||||
DISTRIBUTION
|
||||
Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution.
|
||||
Commercial use is permitted with written licensed permission.
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
Files:
|
||||
- Bob.md5mesh
|
||||
- Bob.md5anim
|
||||
- Bob.blend
|
||||
- ./*.png
|
||||
|
||||
Changes:
|
||||
- converted all tga's to png, updated .blend and .md5mesh accordingly
|
||||
- removed absolute texture paths from the md5mesh file
|
||||
- minor downscaling of all textures to fit in less bytes
|
||||
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------------------------------
|
||||
TITLE : Bob, MD5 character source file
|
||||
AUTHOR : Ken Beyer (kat)
|
||||
EMAIL ADDRESS : info@katsbits.com
|
||||
HOMEPAGE URL : http://www.katsbits.com
|
||||
|
||||
|
||||
MODEL NAME/s
|
||||
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.
|
||||
|
||||
|
||||
DISTRIBUTION
|
||||
Copyright © 2009 KatsBits. Distribution MUST include this readme and authorship attribution.
|
||||
Commercial use is permitted with written licensed permission.
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
Files:
|
||||
- Bob.md5mesh
|
||||
- Bob.md5anim
|
||||
- Bob.blend
|
||||
- ./*.png
|
||||
|
||||
Changes:
|
||||
- converted all tga's to png, updated .blend and .md5mesh accordingly
|
||||
- removed absolute texture paths from the md5mesh file
|
||||
- minor downscaling of all textures to fit in less bytes
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,73 +1,73 @@
|
|||
Title : G.I.Joe Skins
|
||||
Filename : joemodel.zip
|
||||
Version : 1
|
||||
Date : 11/05/97
|
||||
Author : Kenneth Whelan
|
||||
Email : JWHELAN@pop.prodigy.net
|
||||
Credits : id software, Larry Hama, Steven Polge, and Rene Post for making Quake ME
|
||||
|
||||
|
||||
|
||||
Build time: ??? Time???
|
||||
|
||||
Type of Mod
|
||||
-----------
|
||||
Quake C : no
|
||||
Sound : no
|
||||
MDL : Yes
|
||||
|
||||
|
||||
Format of QuakeC (if a Quake C Mod)
|
||||
-----------------------------------
|
||||
unified diff : no
|
||||
context diff : no
|
||||
.qc files : no
|
||||
progs.dat : no
|
||||
|
||||
|
||||
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,
|
||||
Storm Shadow v2, Shockwave, Repeater, Gung-Ho, Shipwreck, Dusty v3, and
|
||||
Tunnel Rat v2.
|
||||
|
||||
|
||||
|
||||
Known bugs
|
||||
None that I know of.
|
||||
|
||||
How to Install the Modification
|
||||
-------------------------------
|
||||
|
||||
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.
|
||||
|
||||
Technical Details
|
||||
-----------------
|
||||
|
||||
can't think of any
|
||||
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
This is my first publicly distributed quake graphic change.
|
||||
I did it to get away from the stress of school.
|
||||
|
||||
|
||||
Copyright and Distribution Permissions
|
||||
--------------------------------------
|
||||
|
||||
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
|
||||
together.
|
||||
|
||||
|
||||
Availability
|
||||
------------
|
||||
|
||||
This modification is available from the following places:
|
||||
|
||||
http://www.yojoe.com/
|
||||
|
||||
Title : G.I.Joe Skins
|
||||
Filename : joemodel.zip
|
||||
Version : 1
|
||||
Date : 11/05/97
|
||||
Author : Kenneth Whelan
|
||||
Email : JWHELAN@pop.prodigy.net
|
||||
Credits : id software, Larry Hama, Steven Polge, and Rene Post for making Quake ME
|
||||
|
||||
|
||||
|
||||
Build time: ??? Time???
|
||||
|
||||
Type of Mod
|
||||
-----------
|
||||
Quake C : no
|
||||
Sound : no
|
||||
MDL : Yes
|
||||
|
||||
|
||||
Format of QuakeC (if a Quake C Mod)
|
||||
-----------------------------------
|
||||
unified diff : no
|
||||
context diff : no
|
||||
.qc files : no
|
||||
progs.dat : no
|
||||
|
||||
|
||||
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,
|
||||
Storm Shadow v2, Shockwave, Repeater, Gung-Ho, Shipwreck, Dusty v3, and
|
||||
Tunnel Rat v2.
|
||||
|
||||
|
||||
|
||||
Known bugs
|
||||
None that I know of.
|
||||
|
||||
How to Install the Modification
|
||||
-------------------------------
|
||||
|
||||
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.
|
||||
|
||||
Technical Details
|
||||
-----------------
|
||||
|
||||
can't think of any
|
||||
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
This is my first publicly distributed quake graphic change.
|
||||
I did it to get away from the stress of school.
|
||||
|
||||
|
||||
Copyright and Distribution Permissions
|
||||
--------------------------------------
|
||||
|
||||
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
|
||||
together.
|
||||
|
||||
|
||||
Availability
|
||||
------------
|
||||
|
||||
This modification is available from the following places:
|
||||
|
||||
http://www.yojoe.com/
|
||||
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
Stegosaur Model
|
||||
from the Free Models Project
|
||||
www.oz.net/~simitar/model.html
|
||||
|
||||
|
||||
June 3, 1997
|
||||
|
||||
created by Sirius (Dillon Aumiller)
|
||||
E-mail: sirius25@hotmail.com
|
||||
|
||||
|
||||
June 5, 1997
|
||||
|
||||
modified by The Serpent Lord (Seth Galbraith)
|
||||
E-mail: sgalbrai@linknet.kitsap.lib.wa.us
|
||||
WWW: www.oz.net/~simitar
|
||||
|
||||
|
||||
This model can be used or modified for any purpose
|
||||
as long as this text document is included with it
|
||||
and all modellers listed in this document are
|
||||
listed wherever credits are appropriate for that
|
||||
purpose.
|
||||
|
||||
|
||||
Help Wanted:
|
||||
|
||||
The Free Models Project can use help with
|
||||
models and in other areas, such as legal boilerplate
|
||||
for models.
|
||||
|
||||
WWW: www.oz.net/~simitar/model.html
|
||||
E-mail: sgalbrai@linknet.kitsap.lib.wa.us
|
||||
Stegosaur Model
|
||||
from the Free Models Project
|
||||
www.oz.net/~simitar/model.html
|
||||
|
||||
|
||||
June 3, 1997
|
||||
|
||||
created by Sirius (Dillon Aumiller)
|
||||
E-mail: sirius25@hotmail.com
|
||||
|
||||
|
||||
June 5, 1997
|
||||
|
||||
modified by The Serpent Lord (Seth Galbraith)
|
||||
E-mail: sgalbrai@linknet.kitsap.lib.wa.us
|
||||
WWW: www.oz.net/~simitar
|
||||
|
||||
|
||||
This model can be used or modified for any purpose
|
||||
as long as this text document is included with it
|
||||
and all modellers listed in this document are
|
||||
listed wherever credits are appropriate for that
|
||||
purpose.
|
||||
|
||||
|
||||
Help Wanted:
|
||||
|
||||
The Free Models Project can use help with
|
||||
models and in other areas, such as legal boilerplate
|
||||
for models.
|
||||
|
||||
WWW: www.oz.net/~simitar/model.html
|
||||
E-mail: sgalbrai@linknet.kitsap.lib.wa.us
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
|
||||
+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)
|
||||
|
||||
teckmechbot animated .mdl
|
||||
|
||||
This model was created for the FMP, because I believe
|
||||
that the FMP is a great concept !!
|
||||
|
||||
There is some movement in the model.
|
||||
The legs can be animated for walking, stomping, or running
|
||||
around !
|
||||
Ok, it's my first model, so I will work on less polygony
|
||||
in the future ;-)
|
||||
|
||||
|
||||
Created By: Curiel7
|
||||
Contact: ebuy@optelnow.net (E-MAIL)
|
||||
Date Created: 7/07/2000
|
||||
======================================================
|
||||
|
||||
This model can be used or modified for any purpose
|
||||
as long as this text document is included with it
|
||||
and all modelers listed in this document are
|
||||
listed wherever credits are appropriate for that
|
||||
purpose.
|
||||
|
||||
|
||||
The Free Models Project can use your help with
|
||||
game-oriented models and other areas
|
||||
|
||||
WWW: http://www.planetquake.com/simitar
|
||||
E-mail: sgalbrai@linknet.kitsap.lib.wa.us
|
||||
|
||||
|
||||
+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)+)
|
||||
|
||||
teckmechbot animated .mdl
|
||||
|
||||
This model was created for the FMP, because I believe
|
||||
that the FMP is a great concept !!
|
||||
|
||||
There is some movement in the model.
|
||||
The legs can be animated for walking, stomping, or running
|
||||
around !
|
||||
Ok, it's my first model, so I will work on less polygony
|
||||
in the future ;-)
|
||||
|
||||
|
||||
Created By: Curiel7
|
||||
Contact: ebuy@optelnow.net (E-MAIL)
|
||||
Date Created: 7/07/2000
|
||||
======================================================
|
||||
|
||||
This model can be used or modified for any purpose
|
||||
as long as this text document is included with it
|
||||
and all modelers listed in this document are
|
||||
listed wherever credits are appropriate for that
|
||||
purpose.
|
||||
|
||||
|
||||
The Free Models Project can use your help with
|
||||
game-oriented models and other areas
|
||||
|
||||
WWW: http://www.planetquake.com/simitar
|
||||
E-mail: sgalbrai@linknet.kitsap.lib.wa.us
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
teapot.nff, home4.nff - http://www.martinreddy.net/ukvrsig/wtk.html
|
||||
|
||||
cokecan.nff -www.vrupl.evl.uic.edu/Eng591_Pages/cokecan.nff
|
||||
teapot.nff, home4.nff - http://www.martinreddy.net/ukvrsig/wtk.html
|
||||
|
||||
cokecan.nff -www.vrupl.evl.uic.edu/Eng591_Pages/cokecan.nff
|
||||
TODO: License status to be confirmed
|
|
@ -1,27 +1,27 @@
|
|||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
Notices 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. 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.
|
||||
"
|
||||
|
||||
"
|
||||
'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
|
||||
====
|
||||
|
||||
=====================================================================
|
||||
|
||||
From http://telias.free.fr
|
||||
Model copyright: Elias Tsiantas
|
||||
|
||||
=====================================================================
|
||||
|
||||
Downloaded 4th November 2008 (Obama ftw!).
|
||||
Notices 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. 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.
|
||||
"
|
||||
|
||||
"
|
||||
'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
|
||||
====
|
||||
|
||||
Converted from 3DS to OBJ with AC3D
|
|
@ -1,4 +1,4 @@
|
|||
Obj exported from Blender
|
||||
|
||||
http://toychest.in.tum.de/wiki/projects:kuka_lwr
|
||||
Obj exported from Blender
|
||||
|
||||
http://toychest.in.tum.de/wiki/projects:kuka_lwr
|
||||
License: Creative-Commons-by-Attribution-3.0
|
|
@ -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.
|
|
@ -1,51 +1,51 @@
|
|||
Dwarf lowpoly model Pack
|
||||
Copyright 2004, Psionic Design
|
||||
e-mail: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
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!
|
||||
|
||||
|
||||
|
||||
USAGE INFORMATION:
|
||||
|
||||
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
|
||||
|
||||
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:-
|
||||
|
||||
website: http://www.psionic3d.co.uk
|
||||
email: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
WHAT'S INCLUDED IN THE ZIP:
|
||||
|
||||
ReadMe.txt - This file
|
||||
b3d.zip - Blitz 3D Format models and textures
|
||||
ms3d.zip - Milkshape 3D Format models and textures
|
||||
x.zip - DarkBasic Direct X 8 Format models and textures
|
||||
|
||||
|
||||
|
||||
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 redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
|
||||
|
||||
|
||||
Psi
|
||||
http://www.psionic3d.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
Dwarf lowpoly model Pack
|
||||
Copyright 2004, Psionic Design
|
||||
e-mail: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
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!
|
||||
|
||||
|
||||
|
||||
USAGE INFORMATION:
|
||||
|
||||
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
|
||||
|
||||
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:-
|
||||
|
||||
website: http://www.psionic3d.co.uk
|
||||
email: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
WHAT'S INCLUDED IN THE ZIP:
|
||||
|
||||
ReadMe.txt - This file
|
||||
b3d.zip - Blitz 3D Format models and textures
|
||||
ms3d.zip - Milkshape 3D Format models and textures
|
||||
x.zip - DarkBasic Direct X 8 Format models and textures
|
||||
|
||||
|
||||
|
||||
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 redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
|
||||
|
||||
|
||||
Psi
|
||||
http://www.psionic3d.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
All 'mirror' files are not absolutely correct. That's mainly
|
||||
because it's difficult convert Max' handling of mirroring to
|
||||
our's.
|
||||
|
||||
In other words: TO DO, but only if someone REALLY needs it.
|
||||
|
||||
-------------------------------------------------------------
|
||||
|
||||
To see how it should look like - test/ReferenceImages
|
||||
Note that the viewer has no 'decal' texture mapping mode, so
|
||||
All 'mirror' files are not absolutely correct. That's mainly
|
||||
because it's difficult convert Max' handling of mirroring to
|
||||
our's.
|
||||
|
||||
In other words: TO DO, but only if someone REALLY needs it.
|
||||
|
||||
-------------------------------------------------------------
|
||||
|
||||
To see how it should look like - test/ReferenceImages
|
||||
Note that the viewer has no 'decal' texture mapping mode, so
|
||||
the usual clamping is used.
|
|
@ -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.
|
|
@ -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.
|
|
@ -1,50 +1,50 @@
|
|||
http://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion
|
||||
|
||||
|
||||
ReadmeFirst.txt
|
||||
================
|
||||
|
||||
|
||||
READMEFIRST v1.00 last update July 20, 2008 by B. Hahne
|
||||
|
||||
This READMEFIRST file accompanies the cgspeed.com "BVH conversion"
|
||||
release of the Carnegie-Mellon University (CMU) Graphics Lab Motion
|
||||
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
|
||||
dataset.
|
||||
|
||||
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
|
||||
Hahne, a hobbyist animator, in the interest of making the data more
|
||||
available and easily usable by other animators. I presently (2008)
|
||||
maintain the web site www.cgspeed.com, where this BVH conversion
|
||||
release will be available or linked.
|
||||
|
||||
The emphasis on this release is to produce BVH files that can rapidly
|
||||
be used in MotionBuilder for motion retargetting. The files are not
|
||||
yet particularly Poser-friendly or DazStudio-friendly, due to
|
||||
incorrect assumptions that those programs have to make about the
|
||||
underlying joint rotation setup.
|
||||
|
||||
|
||||
[...]
|
||||
|
||||
|
||||
|
||||
USAGE RIGHTS:
|
||||
|
||||
CMU places no restrictions on the use of the original dataset, and I
|
||||
(Bruce) place no additional restrictions on the use of this particular
|
||||
BVH conversion.
|
||||
|
||||
Here's the relevant paragraph from mocap.cs.cmu.edu:
|
||||
|
||||
Use this data! This data is free for use in research and commercial
|
||||
projects worldwide. If you publish results obtained using this data,
|
||||
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
|
||||
to your acknowledgments section: "The data used in this project was
|
||||
obtained from mocap.cs.cmu.edu. The database was created with funding
|
||||
from NSF EIA-0196217."
|
||||
|
||||
http://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion
|
||||
|
||||
|
||||
ReadmeFirst.txt
|
||||
================
|
||||
|
||||
|
||||
READMEFIRST v1.00 last update July 20, 2008 by B. Hahne
|
||||
|
||||
This READMEFIRST file accompanies the cgspeed.com "BVH conversion"
|
||||
release of the Carnegie-Mellon University (CMU) Graphics Lab Motion
|
||||
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
|
||||
dataset.
|
||||
|
||||
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
|
||||
Hahne, a hobbyist animator, in the interest of making the data more
|
||||
available and easily usable by other animators. I presently (2008)
|
||||
maintain the web site www.cgspeed.com, where this BVH conversion
|
||||
release will be available or linked.
|
||||
|
||||
The emphasis on this release is to produce BVH files that can rapidly
|
||||
be used in MotionBuilder for motion retargetting. The files are not
|
||||
yet particularly Poser-friendly or DazStudio-friendly, due to
|
||||
incorrect assumptions that those programs have to make about the
|
||||
underlying joint rotation setup.
|
||||
|
||||
|
||||
[...]
|
||||
|
||||
|
||||
|
||||
USAGE RIGHTS:
|
||||
|
||||
CMU places no restrictions on the use of the original dataset, and I
|
||||
(Bruce) place no additional restrictions on the use of this particular
|
||||
BVH conversion.
|
||||
|
||||
Here's the relevant paragraph from mocap.cs.cmu.edu:
|
||||
|
||||
Use this data! This data is free for use in research and commercial
|
||||
projects worldwide. If you publish results obtained using this data,
|
||||
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
|
||||
to your acknowledgments section: "The data used in this project was
|
||||
obtained from mocap.cs.cmu.edu. The database was created with funding
|
||||
from NSF EIA-0196217."
|
||||
|
||||
[...]
|
|
@ -1,16 +1,16 @@
|
|||
From kwxport
|
||||
http://www.kwxport.org/
|
||||
|
||||
>>
|
||||
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
|
||||
if something goes wrong."
|
||||
>>
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
From kwxport
|
||||
http://www.kwxport.org/
|
||||
|
||||
>>
|
||||
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
|
||||
if something goes wrong."
|
||||
>>
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
for dawfInCellar_ChildOfCellar & dawfInCellar_SameHierarchy:
|
||||
|
||||
the strange scalings of cellar and dwarf are intended.
|
||||
for dawfInCellar_ChildOfCellar & dawfInCellar_SameHierarchy:
|
||||
|
||||
the strange scalings of cellar and dwarf are intended.
|
||||
|
|
|
@ -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
|
|
@ -1,5 +1,5 @@
|
|||
Wikipedia Commons,
|
||||
downloaded November 25th 08
|
||||
|
||||
|
||||
Wikipedia Commons,
|
||||
downloaded November 25th 08
|
||||
|
||||
|
||||
http://upload.wikimedia.org/wikipedia/commons/0/01/Lambert-cylindrical-equal-area-projection.jpg
|
|
@ -1,9 +1,9 @@
|
|||
Source:
|
||||
|
||||
Nasa, Monthly Global Images
|
||||
|
||||
http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php
|
||||
|
||||
|
||||
Downloaded November 24, 08.
|
||||
Source:
|
||||
|
||||
Nasa, Monthly Global Images
|
||||
|
||||
http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php
|
||||
|
||||
|
||||
Downloaded November 24, 08.
|
||||
Rescaled to 2048 * 1024 with GIMP
|
|
@ -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!
|
|
@ -1,2 +1,2 @@
|
|||
Regression file.
|
||||
Regression file.
|
||||
by Tom Speed, see http://groups.google.com/group/bmx3d/browse_thread/thread/36db3b191f81be36
|
|
@ -1,24 +1,24 @@
|
|||
|
||||
From IRRLICHT/media
|
||||
|
||||
|
||||
The Irrlicht Engine License
|
||||
===========================
|
||||
|
||||
Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
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
|
||||
in a product, an acknowledgement in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be clearly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
From IRRLICHT/media
|
||||
|
||||
|
||||
The Irrlicht Engine License
|
||||
===========================
|
||||
|
||||
Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
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
|
||||
in a product, an acknowledgement in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be clearly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
|
@ -1,24 +1,24 @@
|
|||
|
||||
From IRRLICHT/media
|
||||
|
||||
|
||||
The Irrlicht Engine License
|
||||
===========================
|
||||
|
||||
Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
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
|
||||
in a product, an acknowledgement in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be clearly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
|
||||
From IRRLICHT/media
|
||||
|
||||
|
||||
The Irrlicht Engine License
|
||||
===========================
|
||||
|
||||
Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
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
|
||||
in a product, an acknowledgement in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be clearly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
|
@ -1,6 +1,6 @@
|
|||
My name: Grimmmy
|
||||
Hi everybody!!!
|
||||
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!
|
||||
You may reach me at rojkov91@mail.ru
|
||||
My name: Grimmmy
|
||||
Hi everybody!!!
|
||||
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!
|
||||
You may reach me at rojkov91@mail.ru
|
||||
P.S: Excuse my bad english
|
|
@ -1,6 +1,6 @@
|
|||
My name: Grimmmy
|
||||
Hi everybody!!!
|
||||
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!
|
||||
You may reach me at rojkov91@mail.ru
|
||||
My name: Grimmmy
|
||||
Hi everybody!!!
|
||||
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!
|
||||
You may reach me at rojkov91@mail.ru
|
||||
P.S: Excuse my bad english
|
|
@ -1,15 +1,15 @@
|
|||
Jeep designed, modelled and skinned by me, Psionic
|
||||
|
||||
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.
|
||||
|
||||
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:-
|
||||
|
||||
http://xu1productions.com/3dstudio/index.html - 3D Game Resources
|
||||
|
||||
http://www.psionicdesign.com - My Main 2D/3D Digital Art site
|
||||
|
||||
Jeep designed, modelled and skinned by me, Psionic
|
||||
|
||||
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.
|
||||
|
||||
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:-
|
||||
|
||||
http://xu1productions.com/3dstudio/index.html - 3D Game Resources
|
||||
|
||||
http://www.psionicdesign.com - My Main 2D/3D Digital Art site
|
||||
|
||||
Psionic 2002
|
|
@ -1,8 +1,8 @@
|
|||
Source: the3darchive.com
|
||||
|
||||
Downloaded 4th November 08 (Obama ftw!)
|
||||
|
||||
Copyright notice found on the page:
|
||||
|
||||
Where do the models in the archive come from?
|
||||
Source: the3darchive.com
|
||||
|
||||
Downloaded 4th November 08 (Obama ftw!)
|
||||
|
||||
Copyright notice found on the page:
|
||||
|
||||
Where do the models in the archive come from?
|
||||
All 3D files available from the3darchive.com are from the public domain.
|
|
@ -1,8 +1,8 @@
|
|||
Source: the3darchive.com
|
||||
|
||||
Downloaded 4th November 08 (Obama ftw!)
|
||||
|
||||
Copyright notice found on the page:
|
||||
|
||||
Where do the models in the archive come from?
|
||||
Source: the3darchive.com
|
||||
|
||||
Downloaded 4th November 08 (Obama ftw!)
|
||||
|
||||
Copyright notice found on the page:
|
||||
|
||||
Where do the models in the archive come from?
|
||||
All 3D files available from the3darchive.com are from the public domain.
|
|
@ -1,2 +1,2 @@
|
|||
"MotionCaptureROM.ase" Recorded using ViconIQ.
|
||||
Converted to VRML with 3DS Max 2008.
|
||||
"MotionCaptureROM.ase" Recorded using ViconIQ.
|
||||
Converted to VRML with 3DS Max 2008.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
Zylinder animation:
|
||||
|
||||
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 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.
|
||||
|
||||
Zylinder animation:
|
||||
|
||||
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 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.
|
||||
|
||||
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.
|
|
@ -1,16 +1,16 @@
|
|||
From kwxport
|
||||
http://www.kwxport.org/
|
||||
|
||||
>>
|
||||
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
|
||||
if something goes wrong."
|
||||
>>
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
From kwxport
|
||||
http://www.kwxport.org/
|
||||
|
||||
>>
|
||||
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
|
||||
if something goes wrong."
|
||||
>>
|
||||
|
||||
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:
|
||||
|
||||
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.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue