Skip to content

Commit

Permalink
Allow 64 bit windows builds (recastnavigation#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrettchisholm authored and jakobbotsch committed Oct 15, 2018
1 parent 9f9efe9 commit 56dbf4c
Show file tree
Hide file tree
Showing 7 changed files with 2,194 additions and 1,063 deletions.
2 changes: 1 addition & 1 deletion Recast/Include/RecastAlloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class rcIntArray
m_impl.pop_back();
return v;
}
int size() const { return m_impl.size(); }
int size() const { return static_cast<int>(m_impl.size()); }
int& operator[](int index) { return m_impl[index]; }
int operator[](int index) const { return m_impl[index]; }
};
Expand Down
2 changes: 1 addition & 1 deletion RecastDemo/Include/Sample_TempObstacles.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Sample_TempObstacles : public Sample
int m_cacheCompressedSize;
int m_cacheRawSize;
int m_cacheLayerCount;
int m_cacheBuildMemUsage;
unsigned int m_cacheBuildMemUsage;

enum DrawMode
{
Expand Down
2 changes: 1 addition & 1 deletion RecastDemo/Source/Sample_TempObstacles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ bool Sample_TempObstacles::handleBuild()
m_ctx->stopTimer(RC_TIMER_TOTAL);

m_cacheBuildTimeMs = m_ctx->getAccumulatedTime(RC_TIMER_TOTAL)/1000.0f;
m_cacheBuildMemUsage = m_talloc->high;
m_cacheBuildMemUsage = static_cast<unsigned int>(m_talloc->high);


const dtNavMesh* nav = m_navMesh;
Expand Down
2 changes: 1 addition & 1 deletion RecastDemo/Source/imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static char g_textPool[TEXT_POOL_SIZE];
static unsigned g_textPoolSize = 0;
static const char* allocText(const char* text)
{
unsigned len = strlen(text)+1;
unsigned len = static_cast<unsigned>(strlen(text)+1);
if (g_textPoolSize + len >= TEXT_POOL_SIZE)
return 0;
char* dst = &g_textPool[g_textPoolSize];
Expand Down
13 changes: 10 additions & 3 deletions RecastDemo/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,20 @@ solution "recastnavigation"

-- windows specific
configuration "windows"
platforms { "Win32", "Win64" }
defines { "WIN32", "_WINDOWS", "_CRT_SECURE_NO_WARNINGS", "_HAS_EXCEPTIONS=0" }
-- warnings "Extra" uses /W4 which is too aggressive for us, so use W3 instead.
-- Disable:
-- * C4351: new behavior for array initialization
-- * C4291: no matching operator delete found; we don't use exceptions, so doesn't matter
buildoptions { "/W3", "/wd4351", "/wd4291" }

filter "platforms:Win32"
architecture "x32"

filter "platforms:Win64"
architecture "x64"

project "DebugUtils"
language "C++"
kind "StaticLib"
Expand Down Expand Up @@ -153,7 +160,7 @@ project "RecastDemo"
-- windows library cflags and libs
configuration { "windows" }
includedirs { "../RecastDemo/Contrib/SDL/include" }
libdirs { "../RecastDemo/Contrib/SDL/lib/x86" }
libdirs { "../RecastDemo/Contrib/SDL/lib/%{cfg.architecture:gsub('x86_64', 'x64')}" }
debugdir "../RecastDemo/Bin/"
links {
"glu32",
Expand All @@ -163,7 +170,7 @@ project "RecastDemo"
}
postbuildcommands {
-- Copy the SDL2 dll to the Bin folder.
'{COPY} "%{wks.location}../../Contrib/SDL/lib/x86/SDL2.dll" "%{cfg.targetdir}"'
'{COPY} "%{wks.location}../../Contrib/SDL/lib/%{cfg.architecture:gsub("x86_64", "x64")}/SDL2.dll" "%{cfg.targetdir}"'
}

-- mac includes and libs
Expand Down Expand Up @@ -233,7 +240,7 @@ project "Tests"
-- windows library cflags and libs
configuration { "windows" }
includedirs { "../RecastDemo/Contrib/SDL/include" }
libdirs { "../RecastDemo/Contrib/SDL/lib/x86" }
libdirs { "../RecastDemo/Contrib/SDL/lib/%{cfg.architecture:gsub('x86_64', 'x64')}" }
debugdir "../RecastDemo/Bin/"
links {
"glu32",
Expand Down
Loading

0 comments on commit 56dbf4c

Please sign in to comment.