This commit is contained in:
hiker 2015-10-13 21:12:22 +11:00
commit 7356958774
11 changed files with 73 additions and 16 deletions

View File

@ -398,7 +398,7 @@ if(MSVC OR MINGW)
endif()
if(MINGW)
find_library(LIBGCC NAMES "libgcc_s_dw2-1.dll" "libgcc_s_sjlj-1.dll" PATHS ${CMAKE_FIND_ROOT_PATH})
find_library(LIBGCC NAMES "libgcc_s_dw2-1.dll" "libgcc_s_sjlj-1.dll" "libgcc_s_seh-1.dll" PATHS ${CMAKE_FIND_ROOT_PATH})
if(LIBGCC)
file(COPY ${LIBGCC} DESTINATION ${CMAKE_BINARY_DIR}/bin/)
endif()

View File

@ -0,0 +1,20 @@
# Usage:
# cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw-64bit.cmake
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/dependencies)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ALWAYS)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@ -1,3 +1,6 @@
# Usage:
# cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw.cmake
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

View File

@ -4,25 +4,27 @@
<spreading angle="10" />
<velocity x="0.0"
y="0.002"
y="0.003"
z="0.0" />
<material file="smoke_black.png" />
<!-- Amount of particles emitted per second -->
<rate min="25"
max="50" />
<rate min="7"
max="12" />
<!-- Minimal and maximal lifetime of a particle, in milliseconds. -->
<lifetime min="2500"
max="5000" />
<!-- Size of the particles -->
<size min="0.6"
max="1.5" />
<size min="1.6"
max="2.5"
x-increase-factor="2.6"
y-increase-factor="2.6" />
<color min="255 255 255"
max="255 255 255" />
<color min="50 50 50"
max="100 100 100" />
<!-- How much time in milliseconds before the particle is fully faded out -->
<fadeout time="1000" />

View File

@ -18,8 +18,8 @@
max="700" />
<!-- Size of the particles -->
<size min="0.2"
max="0.3"
<size min="0.5"
max="0.8"
x-increase-factor="1.1"
y-increase-factor="1.3"
/>

View File

@ -58,15 +58,24 @@ static inline void btAlignedFreeDefault(void *ptr)
free(ptr);
}
#else
static inline void *btAlignedAllocDefault(size_t size, int alignment)
{
void *ret;
char *real;
#ifdef __MINGW64__
uintptr_t offset;
#else
unsigned long offset;
#endif
real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
if (real) {
#ifdef __MINGW64__
offset = (alignment - (uintptr_t)(real + sizeof(void *))) & (alignment-1);
#else
offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
#endif
ret = (void *)((real + sizeof(void *)) + offset);
*((void **)(ret)-1) = (void *)(real);
} else {

View File

@ -213,7 +213,11 @@ protected:
int *intPtr=0;
short *shtPtr=0;
#ifdef __MINGW64__
char *cp = 0;int dataLen =0;intptr_t nr=0;
#else
char *cp = 0;int dataLen =0;long nr=0;
#endif
intPtr = (int*)m_dna;
/*
@ -247,7 +251,11 @@ protected:
cp++;
}
{
#ifdef __MINGW64__
nr= (intptr_t)cp;
#else
nr= (long)cp;
#endif
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)
@ -282,7 +290,11 @@ protected:
}
{
#ifdef __MINGW64__
nr= (intptr_t)cp;
#else
nr= (long)cp;
#endif
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)

View File

@ -61,7 +61,7 @@ Event::Event(ENetEvent* event)
if (peers[i]->m_peer == event->peer)
{
*peer = peers[i];
Log::verbose("Event", "The peer you sought has been found on %lx", (long int)(peer));
Log::verbose("Event", "The peer you sought has been found on %p", peer);
return;
}
}
@ -70,7 +70,7 @@ Event::Event(ENetEvent* event)
STKPeer* new_peer = new STKPeer();
new_peer->m_peer = event->peer;
*peer = new_peer;
Log::debug("Event", "Creating a new peer, address are STKPeer:%lx, Peer:%lx", (long int)(new_peer), (long int)(event->peer));
Log::debug("Event", "Creating a new peer, address are STKPeer:%p, Peer:%p", new_peer, event->peer);
}
}

View File

@ -80,9 +80,9 @@ bool STKPeer::connectToHost(STKHost* localhost, TransportAddress host,
return false;
}
Log::verbose("STKPeer", "Connecting to %i.%i.%i.%i:%i.\nENetPeer address "
"is %ld", (peer->address.host>>0)&0xff,
"is %p", (peer->address.host>>0)&0xff,
(peer->address.host>>8)&0xff,(peer->address.host>>16)&0xff,
(peer->address.host>>24)&0xff,peer->address.port, (long int)(peer));
(peer->address.host>>24)&0xff,peer->address.port, peer);
return true;
}

View File

@ -117,6 +117,14 @@ namespace Scripting
return SimpleVec3(velocity.getX(), velocity.getY(), velocity.getZ());
}
/** Gets the maximum speed (velocity) a kart can reach */
float getMaxSpeed(int idKart)
{
AbstractKart* kart = World::getWorld()->getKart(idKart);
return kart->getKartProperties()->getMaxSpeed() *
kart->getPlayerDifficulty()->getMaxSpeed();
}
/** @}*/
/** @}*/
@ -130,6 +138,7 @@ namespace Scripting
//r = engine->RegisterGlobalFunction("void jumpTo(int id, float x, float y)", asFUNCTION(jumpTo), asCALL_GENERIC); assert(r >= 0);
r = engine->RegisterGlobalFunction("Vec3 getLocation(int id)", asFUNCTION(getLocation), asCALL_CDECL); assert(r >= 0);
r = engine->RegisterGlobalFunction("Vec3 getVelocity(int id)", asFUNCTION(getVelocity), asCALL_CDECL); assert(r >= 0);
r = engine->RegisterGlobalFunction("float getMaxSpeed(int id)", asFUNCTION(getMaxSpeed), asCALL_CDECL); assert(r >= 0);
}
void registerScriptEnums(asIScriptEngine *engine)

View File

@ -11,13 +11,15 @@
#ifndef SCRIPTSTDSTRING_H
#define SCRIPTSTDSTRING_H
// String must be included before angelscript.h to avoid some errors during
// compilation with GetObject function
#include <string>
#ifndef ANGELSCRIPT_H
// Avoid having to inform include path if header is already include before
#include <angelscript.h>
#endif
#include <string>
//---------------------------
// Compilation settings
//