[10097] Update G3D up to v8.0b4

+ Got rid of zip lib requirement in G3D...
  Still can re-enable code by defining _HAVE_ZIP...

+ Remove silly X11 lib dependency from G3D
  Code doesn't seem to do anything yet anyway, and even if, we don't want it :p

+ Fix another weird G3D build problem...

+ Remove some __asm usage in g3d, which is not available on Win64
  My editor also decided to remove a ton of trailing white spaces...tss...

+ Reapply G3D fixes for 64bit VC

+ not use SSE specific header when SSE not enabled in *nix

+ Updated project files

+ New vmap_assembler VC90/VC80 Project

+ vmap assembler binaries updates

NOTE: Old vmap fikes expected work (as tests show) with new library version.
      But better use new generated versions. Its different in small parts to bad or good...

(based on Lynx3d's repo commit 44798d3)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Lynx3d 2010-06-23 04:01:54 +04:00 committed by VladimirMangos
parent 2f3c518935
commit ae3ad10bcf
235 changed files with 58189 additions and 4547 deletions

View file

@ -1,22 +1,27 @@
/**
@file platform.h
#defines for platform specific issues.
\#defines for platform specific issues.
@maintainer Morgan McGuire, matrix@graphics3d.com
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2003-06-09
@edited 2006-01-16
@edited 2010-01-11
*/
#ifndef G3D_PLATFORM_H
#define G3D_PLATFORM_H
#ifndef G3D_platform_h
#define G3D_platform_h
/**
The version number of G3D in the form: MmmBB ->
The version number of G3D in the form: MmmBB ->
version M.mm [beta BB]
*/
#define G3D_VER 61000
#define G3D_VER 80004
// fatal error for unsupported architectures
#if defined(__powerpc__)
# error PowerPC is not supported by G3D!
#endif
#if defined(G3D_RELEASEDEBUG)
# define G3D_DEBUGRELEASE
@ -26,53 +31,48 @@
# undef _DEBUG
#endif
/** @def G3D_DEBUG()
Defined if G3D is built in debug mode. */
#if !defined(G3D_DEBUG) && (defined(_DEBUG) || defined(G3D_DEBUGRELEASE))
# define G3D_DEBUG
#endif
#ifdef _MSC_VER
#ifndef _MSC_VER
/// Fast call is a register-based optimized calling convention supported only by Visual C++
#define __fastcall
#endif
#ifdef _MSC_VER
#define G3D_WIN32
#elif defined(__MINGW32__)
#define G3D_WIN32
#define G3D_MINGW32
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#define G3D_FREEBSD
#define G3D_LINUX
#elif defined(__linux__)
#define G3D_LINUX
#elif defined(__OpenBSD__)
#define G3D_LINUX
#elif defined(__FreeBSD__)
#define G3D_LINUX
#elif defined(__NetBSD__)
#define G3D_LINUX
#elif defined(__APPLE__)
#define G3D_OSX
#elif defined(sun) || defined(__sun__)
#define G3D_SOLARIS
// Prevent OS X fp.h header from being included; it defines
// pi as a constant, which creates a conflict with G3D
#define __FP__
#else
#error Unknown platform
#error Unknown platform
#endif
// Default to compiling with SSE, but if you want to compile
// without installing SP5.0 and the Processor Pack on Windows, compile with NO_SSE
// defined (can be passed to the compiler command line with /D "NO_SSE")
#if !defined(NO_SSE)
#define SSE
// Detect 64-bit under various compilers
#if (defined(_M_X64) || defined(_WIN64) || defined(__LP64__) || defined(_LP64))
# define G3D_64BIT
#if defined(WIN32)
#include <intrin.h>
#endif
#else
# define G3D_32BIT
#endif
#ifdef G3D_WIN32
// Turn off warnings about deprecated C routines (TODO: revisit)
# pragma warning (disable : 4996)
#endif
// On g++, recognize cases where the -msse2 flag was not specified
#if defined(SSE) && defined(__GNUC__) && ! defined (__SSE__)
# undef SSE
#endif
#if defined(__GNUC__)
# if __STDC_VERSION__ < 199901
# define restrict __restrict__
# endif
// Strongly encourage inlining on gcc
#ifdef __GNUC__
#define inline __inline__
#endif
@ -83,99 +83,46 @@
# ifndef __GNUC__
# error G3D only supports the gcc compiler on Linux.
# endif
//# ifndef __i386__
//# error G3D only supports x86 machines on Linux.
//# endif
# define G3D_DEPRECATED __attribute__((__deprecated__))
# ifndef __cdecl
# define __cdecl __attribute__((cdecl))
# endif
# ifndef __stdcall
# define __stdcall __attribute__((stdcall))
# endif
# define G3D_CHECK_PRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 3)))
# define G3D_CHECK_VPRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 0)))
# define G3D_CHECK_PRINTF_ARGS __attribute__((__format__(__printf__, 1, 2)))
# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0)))
#endif
#ifdef G3D_SOLARIS
# define G3D_DEPRECATED __attribute__((__deprecated__))
# ifndef __cdecl
# define __cdecl __attribute__((cdecl))
# endif
# ifndef __stdcall
# define __stdcall __attribute__((stdcall))
# endif
# define G3D_CHECK_PRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 3)))
# define G3D_CHECK_VPRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 0)))
# define G3D_CHECK_PRINTF_ARGS __attribute__((__format__(__printf__, 1, 2)))
# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0)))
#endif
#ifdef G3D_OSX
#ifndef __GNUC__
#error G3D only supports the gcc compiler on OS X.
#endif
#if defined(__i386__)
#define G3D_OSX_INTEL
#elif defined(__PPC__)
#define G3D_OSX_PPC
#else
#define G3D_OSX_UNKNOWN
#endif
# ifndef __GNUC__
# error G3D only supports the gcc compiler on OS X.
# endif
# ifndef __cdecl
# define __cdecl __attribute__((cdecl))
# endif
# if defined(__i386__)
# define G3D_OSX_INTEL
# elif defined(__PPC__)
# define G3D_OSX_PPC
# else
# define G3D_OSX_UNKNOWN
# endif
# ifndef __stdcall
# define __stdcall __attribute__((stdcall))
# endif
# define G3D_DEPRECATED __attribute__((__deprecated__))
# define G3D_CHECK_PRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 3)))
# define G3D_CHECK_VPRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 0)))
# define G3D_CHECK_PRINTF_ARGS __attribute__((__format__(__printf__, 1, 2)))
# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0)))
#endif
#ifdef G3D_WIN32
// Microsoft Visual C++ 7.1 _MSC_VER = 1310
// Microsoft Visual C++ 7.0 _MSC_VER = 1300
// Microsoft Visual C++ 6.0 _MSC_VER = 1200
// Microsoft Visual C++ 5.0 _MSC_VER = 1100
#ifdef _MSC_VER
// Microsoft Visual C++ 8.0 ("Express") = 1400
// Microsoft Visual C++ 7.1 ("2003") _MSC_VER = 1310
// Microsoft Visual C++ 7.0 ("2002") _MSC_VER = 1300
// Microsoft Visual C++ 6.0 _MSC_VER = 1200
// Microsoft Visual C++ 5.0 _MSC_VER = 1100
// Old versions of MSVC (6.0 and previous) don't
// support C99 for loop scoping rules. This fixes them.
# if (_MSC_VER <= 1200)
// This trick will generate a warning; disable the warning
# pragma warning (disable : 4127)
# define for if (false) {} else for
# endif
// Turn off warnings about deprecated C routines
# pragma warning (disable : 4996)
# if (_MSC_VER <= 1200)
// Nothing we can do on VC6 for deprecated functions
# define G3D_DEPRECATED
# else
# define G3D_DEPRECATED __declspec(deprecated)
# endif
// Turn off "conditional expression is constant" warning; MSVC generates this
// for debug assertions in inlined methods.
# pragma warning (disable : 4127)
/** @def G3D_DEPRECATED()
Creates deprecated warning. */
# define G3D_DEPRECATED __declspec(deprecated)
// Prevent Winsock conflicts by hiding the winsock API
#ifndef _WINSOCKAPI_
# define _G3D_INTERNAL_HIDE_WINSOCK_
# define _WINSOCKAPI_
# ifndef _WINSOCKAPI_
# define _G3D_INTERNAL_HIDE_WINSOCK_
# define _WINSOCKAPI_
# endif
// Disable 'name too long for browse information' warning
@ -183,34 +130,34 @@
// TODO: remove
# pragma warning (disable : 4244)
# if defined(_MSC_VER) && (_MSC_VER <= 1200)
// VC6 std:: has signed problems in it
# pragma warning (disable : 4018)
# endif
# define restrict
# define ZLIB_WINAPI
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_PRINTF_ARGS
// Mingw32 defines restrict
# ifndef G3D_MINGW32
# define restrict
# endif
# define G3D_CHECK_PRINTF_ARGS
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_VPRINTF_ARGS
# define G3D_CHECK_PRINTF_METHOD_ARGS
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_PRINTF_METHOD_ARGS
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_VPRINTF_METHOD_ARGS
// On MSVC, we need to link against the multithreaded DLL version of
// the C++ runtime because that is what SDL and ZLIB are compiled
// against. This is not the default for MSVC, so we set the following
// defines to force correct linking.
// defines to force correct linking.
//
// For documentation on compiler options, see:
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_.2f.md.2c_2f.ml.2c_2f.mt.2c_2f.ld.asp
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_Compiler_Reference.asp
//
#if 0 //ignore that for mangos
// DLL runtime
#ifndef _DLL
#define _DLL
@ -220,68 +167,165 @@
#ifndef _MT
#define _MT 1
#endif
// Ensure that we aren't forced into the static lib
#ifdef _STATIC_CPPLIB
#undef _STATIC_CPPLIB
#endif
#endif
#ifdef _DEBUG
#pragma comment (linker, "/NODEFAULTLIB:libc.lib")
#pragma comment (linker, "/NODEFAULTLIB:libcmt.lib")
#pragma comment (linker, "/NODEFAULTLIB:msvcrt.lib")
#pragma comment (linker, "/NODEFAULTLIB:libcd.lib")
#pragma comment (linker, "/NODEFAULTLIB:msvcrtd.lib")
#pragma comment (linker, "/NODEFAULTLIB:LIBCMTD.LIB")
#pragma comment (linker, "/NODEFAULTLIB:LIBCPMTD.LIB")
#pragma comment (linker, "/NODEFAULTLIB:LIBCPD.LIB")
#pragma comment (linker, "/DEFAULTLIB:MSVCPRTD.LIB")
#pragma comment(linker, "/NODEFAULTLIB:LIBCD.LIB")
#pragma comment(linker, "/DEFAULTLIB:MSVCRTD.LIB")
#else
#pragma comment(linker, "/NODEFAULTLIB:LIBC.LIB")
#pragma comment(linker, "/NODEFAULTLIB:msvcrt.lib")
#pragma comment(linker, "/NODEFAULTLIB:libcd.lib")
#pragma comment(linker, "/NODEFAULTLIB:libcmtd.lib")
#pragma comment(linker, "/NODEFAULTLIB:msvcrtd.lib")
#pragma comment(linker, "/DEFAULTLIB:MSVCRT.LIB")
#pragma comment (linker, "/NODEFAULTLIB:LIBCMT.LIB")
#pragma comment (linker, "/NODEFAULTLIB:LIBCPMT.LIB")
#pragma comment(linker, "/NODEFAULTLIB:LIBCP.LIB")
#pragma comment (linker, "/DEFAULTLIB:MSVCPRT.LIB")
#endif
// Now set up external linking
#ifdef _DEBUG
// zlib and SDL were linked against the release MSVCRT; force
# ifdef _DEBUG
// zlib was linked against the release MSVCRT; force
// the debug version.
#pragma comment(linker, "/NODEFAULTLIB:MSVCRT.LIB")
# endif
# pragma comment(linker, "/NODEFAULTLIB:MSVCRT.LIB")
# endif
# ifndef WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
# endif
# define NOMINMAX 1
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
# include <windows.h>
# undef WIN32_LEAN_AND_MEAN
# undef NOMINMAX
#ifdef _G3D_INTERNAL_HIDE_WINSOCK_
# undef _G3D_INTERNAL_HIDE_WINSOCK_
# undef _WINSOCKAPI_
#endif
#endif
# if defined(_MSC_VER) && (_MSC_VER <= 1200)
// VC6 std:: has signed/unsigned problems
# pragma warning (disable : 4018)
# ifdef _G3D_INTERNAL_HIDE_WINSOCK_
# undef _G3D_INTERNAL_HIDE_WINSOCK_
# undef _WINSOCKAPI_
# endif
/**
/** @def G3D_START_AT_MAIN()
Defines necessary wrapper around WinMain on Windows to allow transfer of execution to main(). */
# define G3D_START_AT_MAIN()\
int WINAPI G3D_WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw);\
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) {\
return G3D_WinMain(hInst, hPrev, szCmdLine, sw);\
}
#else
/** @def G3D_START_AT_MAIN()
Defines necessary wrapper around WinMain on Windows to allow transfer of execution to main(). */
# define G3D_START_AT_MAIN()
#endif // win32
#ifdef __GNUC__
# include <stdint.h>
# if __STDC_VERSION__ < 199901
# define restrict __restrict__
# endif
/** @def G3D_DEPRECATED()
Creates deprecated warning. */
# define G3D_DEPRECATED __attribute__((__deprecated__))
// setup function calling conventions
# if defined(__i386__) && ! defined(__x86_64__)
# ifndef __cdecl
# define __cdecl __attribute__((cdecl))
# endif
# ifndef __stdcall
# define __stdcall __attribute__((stdcall))
# endif
# elif defined(__x86_64__)
# ifndef __cdecl
# define __cdecl
# endif
# ifndef __stdcall
# define __stdcall
# endif
# endif // calling conventions
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_PRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 3)))
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_VPRINTF_METHOD_ARGS __attribute__((__format__(__printf__, 2, 0)))
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_PRINTF_ARGS __attribute__((__format__(__printf__, 1, 2)))
/** @def G3D_CHECK_PRINTF_METHOD_ARGS()
Enables printf parameter validation on gcc. */
# define G3D_CHECK_VPRINTF_ARGS __attribute__((__format__(__printf__, 1, 0)))
#endif
/**
@def STR(expression)
Creates a string from the expression. Frequently used with G3D::Shader
to express shading programs inline.
to express shading programs inline.
<CODE>STR(this becomes a string)<PRE> evaluates the same as <CODE>"this becomes a string"</CODE>
<CODE>STR(this becomes a string)\verbatim<PRE>\endverbatim evaluates the same as \verbatim<CODE>\endverbatim"this becomes a string"</CODE>
*/
#define STR(x) #x
#undef G3D_DEPRECATED
#define G3D_DEPRECATED
/** @def PRAGMA(expression)
\#pragma may not appear inside a macro, so this uses the pragma operator
to create an equivalent statement.*/
#ifdef _MSC_VER
// Microsoft's version http://msdn.microsoft.com/en-us/library/d9x1s805.aspx
# define PRAGMA(x) __pragma(x)
#else
// C99 standard http://www.delorie.com/gnu/docs/gcc/cpp_45.html
# define PRAGMA(x) _Pragma(#x)
#endif
/** @def G3D_BEGIN_PACKED_CLASS(byteAlign)
Switch to tight alignment
See G3D::Color3uint8 for an example.*/
#ifdef _MSC_VER
# define G3D_BEGIN_PACKED_CLASS(byteAlign) PRAGMA( pack(push, byteAlign) )
#else
# define G3D_BEGIN_PACKED_CLASS(byteAlign)
#endif
/** @def G3D_END_PACKED_CLASS(byteAlign)
End switch to tight alignment
See G3D::Color3uint8 for an example.*/
#ifdef _MSC_VER
# define G3D_END_PACKED_CLASS(byteAlign) ; PRAGMA( pack(pop) )
#elif defined(__GNUC__)
# define G3D_END_PACKED_CLASS(byteAlign) __attribute((aligned(byteAlign))) ;
#else
# define G3D_END_PACKED_CLASS(byteAlign) ;
#endif
// Header guard
#endif