• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[TUT]Howto use Visual Studio 2013 instead 2008 crap

Joined
Apr 12, 2013
Messages
544
Reaction score
272
Hey, im bored, so here we go; (Atm it's only working for older TerrainV2 sources)

Search for;

(r3dLib.cpp)

PHP:
// def to 0 to disable license key check

Add above or below (doesn't matter)

PHP:
/* 			aLca Visual Studio 2013 Workaround				*/

#include <functional>

namespace std

{
    class _String_base
    {

    public:

        static void _cdecl _Xlen(void);

        static void _cdecl _Xran(void);

    };

};

void _cdecl std::_String_base::_Xlen(void)
{   // report a length_error

    _Xlength_error("string too long");
}

void _cdecl std::_String_base::_Xran(void)

{   // report an out_of_range error

    _Xout_of_range("invalid string position");
}

/*                                                       	*/

Search for LevelEditor.cpp, add below #include "r3dPCH.h"

PHP:
#include <functional>

NEWER SOURCES ONLY!

Replace r3dSTLAllocators.h

PHP:
//=========================================================================//    Module: r3dSTLAllocators.h

//    Copyright (C) Online Warmongers Group Inc. 2013.

//=========================================================================

#if     _MSC_VER > 1000 /*IFSTRIP=IGN*/

#pragma once

#endif

#ifdef  _MSC_VER

#pragma pack(push,8)

#endif  /* _MSC_VER */

#include <limits>

#ifndef _FARQ    /* specify standard memory model */

#define _FARQ

#define _PDFT    ptrdiff_t

#define _SIZT    size_t

#endif

#define _POINTER_X(T, A)    T _FARQ *

#define _REFERENCE_X(T, A)    T _FARQ &

//////////////////////////////////////////////////////////////////////////

template <typename T, int AT>

class r3dSTLCustomAllocator

{

public:

    //type definitions

    typedef size_t    size_type;

    typedef ptrdiff_t difference_type;

    typedef T*        pointer;

    typedef const T*  const_pointer;

    typedef T&        reference;

    typedef const T&  const_reference;

    typedef T         value_type;

    //rebind allocator to type U

    template <class U>

    struct rebind

    {

        typedef r3dSTLCustomAllocator<U, AT> other;

    };

    //return address of values

    pointer address (reference value) const
    {
        return &value;
    }

    const_pointer address (const_reference value) const
    {
        return &value;
    }

    /*constructors and destructor

    *-nothing to do because the allocator has no state

    */

    r3dSTLCustomAllocator() throw() {}

    r3dSTLCustomAllocator(const r3dSTLCustomAllocator&) throw() {}

    template <class U>

    r3dSTLCustomAllocator (const r3dSTLCustomAllocator<U, AT>&) throw() {}

    ~r3dSTLCustomAllocator() throw() {}

    //return maximum number of elements that can be allocated

    size_type max_size () const throw()

    {
        //for numeric_limits see Section 4.3, page 59

        return std::numeric_limits<size_t>::max() / sizeof(T);
    }

    //allocate but don't initialize num elements of type T

    pointer allocate (size_type num, typename r3dSTLCustomAllocator<void, AT>::const_pointer hint = 0)
    {
        //allocate memory with global new

        return (pointer) r3dAllocateMemory(num * sizeof(T), 1, static_cast<r3dAllocationTypes>(AT));
    }

    //initialize elements of allocated storage p with value value

    void construct (pointer p, const T& value)
    {
        //initialize memory with placement new

        new((void*)p)T(value);
    }

    //destroy elements of initialized storage p

    void destroy (pointer p)
    {
        // destroy objects by calling their destructor

        p->~T();
    }

    //deallocate storage p of deleted elements

    void deallocate (pointer p, size_type num)
    {
        //deallocate memory with global delete

        r3dDeallocateMemory(p, 1, static_cast<r3dAllocationTypes>(AT));
    }
};

//return that all specializations of this allocator are interchangeable

template <class T1, class T2, int AT>

bool operator== (const r3dSTLCustomAllocator<T1, AT>&,
                 const r3dSTLCustomAllocator<T2, AT>&) throw()
{
    return true;
}

template <class T1, class T2, int AT>

bool operator!= (const r3dSTLCustomAllocator<T1, AT>&,
                 const r3dSTLCustomAllocator<T2, AT>&) throw()
{
    return false;
}

//////////////////////////////////////////////////////////////////////////

template<int AT>

class r3dSTLCustomAllocator<void, AT>

{    // allocator for type void

public:

    typedef void _Ty;

    typedef _Ty _FARQ *pointer;

    typedef const _Ty _FARQ *const_pointer;

    typedef _Ty value_type;

    template<class _Other>

    struct rebind
    {    // convert an allocator<void> to an allocator <_Other>
        typedef r3dSTLCustomAllocator<_Other, AT> other;
    };

    r3dSTLCustomAllocator() _THROW0()
    {    // construct default allocator (do nothing)
    }

    r3dSTLCustomAllocator(const r3dSTLCustomAllocator<_Ty, AT>&) _THROW0()
    {    // construct by copying (do nothing)

    }

    template<class _Other>

    r3dSTLCustomAllocator(const r3dSTLCustomAllocator<_Other, AT>&) _THROW0()
    {    // construct from related allocator (do nothing)

    }

    template<class _Other>

    r3dSTLCustomAllocator<_Ty, AT>& operator=(const r3dSTLCustomAllocator<_Other, AT>&)
    {    // assign from a related allocator (do nothing)
        return (*this);
    }
};

Replace r3dCompileAssert.h

PHP:
#pragma once

// compile time assert

#ifdef __cplusplus

#define JOIN( X, Y ) JOIN2(X,Y)

#define JOIN2( X, Y ) X##Y

namespace assert_static

    template <bool> struct STATIC_ASSERT_FAILURE;
	
    template <> struct STATIC_ASSERT_FAILURE<true> { enum { value = 1 }; };

    template<int x> struct static_assert_test{};
}

#define COMPILE_ASSERT(x) \

    typedef ::assert_static::static_assert_test<\

    sizeof(::assert_static::STATIC_ASSERT_FAILURE< (bool)( x ) >)>\

    JOIN(_static_assert_typedef, __LINE__)

#else // __cplusplus

#define COMPILE_ASSERT(x) extern int __dummy[(int)x]

#endif // __cplusplus

#define VERIFY_EXPLICIT_CAST(from, to) COMPILE_ASSERT(sizeof(from) == sizeof(to))

Search for;

PHP:
vbData->ranges.push_back(std::make_pair<int, int>(0, MaxInstancesToDraw));

Replace with;

PHP:
vbData->ranges.push_back(std::make_pair(0, MaxInstancesToDraw));

Edit;

Supported operating systems

Windows 8.1 (x86 and x64)

Windows 7 SP1 (x86 and x64)

Windows Server 2012 R2 (x64)

Windows Server 2012 (x64)

Windows Server 2008 R2 SP1 (x64)
 
Last edited:
Experienced Elementalist
Joined
Jun 5, 2013
Messages
256
Reaction score
163
I will do all you have said, and here is the result.
how to run Visual Studio Ultimate 2013?
aLca - [TUT]Howto use Visual Studio 2013 instead 2008 crap - RaGEZONE Forums
 
Joined
May 18, 2013
Messages
852
Reaction score
323
Okay, so in the errors, I see that there is Re-definition errors, meaning you could try commentin out the line of code with errors. When I get home, I will try it out.
 
Joined
Apr 12, 2013
Messages
544
Reaction score
272
Then try it with Ultimate, or any other. :p But it's fine when it's working.

Edit; I believe u might still using 2008 as Platform Toolset?!

 
Back
Top