diff options
38 files changed, 398 insertions, 239 deletions
diff --git a/cmake/macros/FindMySQL.cmake b/cmake/macros/FindMySQL.cmake index 72128450638..40fa716ed69 100644 --- a/cmake/macros/FindMySQL.cmake +++ b/cmake/macros/FindMySQL.cmake @@ -63,6 +63,19 @@ if( UNIX ) endif( MYSQL_CONFIG ) endif( UNIX ) +if( WIN32 ) + # read environment variables and change \ to / + SET(PROGRAM_FILES_32 $ENV{ProgramFiles}) + if (${PROGRAM_FILES_32}) + STRING(REPLACE "\\\\" "/" PROGRAM_FILES_32 ${PROGRAM_FILES_32}) + endif(${PROGRAM_FILES_32}) + + SET(PROGRAM_FILES_64 $ENV{ProgramW6432}) + if (${PROGRAM_FILES_64}) + STRING(REPLACE "\\\\" "/" PROGRAM_FILES_64 ${PROGRAM_FILES_64}) + endif(${PROGRAM_FILES_64}) +endif ( WIN32 ) + find_path(MYSQL_INCLUDE_DIR NAMES mysql.h diff --git a/dep/PackageList.txt b/dep/PackageList.txt index 704fab5c168..495bcffd239 100644 --- a/dep/PackageList.txt +++ b/dep/PackageList.txt @@ -46,4 +46,4 @@ gSOAP (a portable development toolkit for C and C++ XML Web services and XML dat recastnavigation (Recast is state of the art navigation mesh construction toolset for games) https://github.com/memononen/recastnavigation - Version: 42b96b7306d39bb7680ddb0f89d480a8296c83ff + Version: 1dd5cf1883d61e723fef3d4957cf758c50e7a52b diff --git a/dep/g3dlite/G3D-v9.0 hotfix3.diff b/dep/g3dlite/G3D-v9.0 hotfix3.diff new file mode 100644 index 00000000000..ff5a662684c --- /dev/null +++ b/dep/g3dlite/G3D-v9.0 hotfix3.diff @@ -0,0 +1,117 @@ + dep/g3dlite/Readme.txt | 3 ++- + dep/g3dlite/include/G3D/Log.h | 2 +- + dep/g3dlite/include/G3D/Rect2D.h | 2 +- + dep/g3dlite/source/FileSystem.cpp | 3 +++ + dep/g3dlite/source/debugAssert.cpp | 2 ++ + dep/g3dlite/source/fileutils.cpp | 10 ++++++++++ + dep/g3dlite/source/prompt.cpp | 2 ++ + 7 files changed, 21 insertions(+), 3 deletions(-) + +diff --git a/dep/g3dlite/Readme.txt b/dep/g3dlite/Readme.txt +index 7fab7f8..7439943 100644 +--- a/dep/g3dlite/Readme.txt ++++ b/dep/g3dlite/Readme.txt +@@ -11,4 +11,5 @@ G3D-v8.0_hotfix7.diff - 2013-08-31 - fix typo in Matrix4 == operator + G3D-v8.0_hotfix8.diff - 2013-09-01 - fix typo in Vector3int32 += operator + G3D-v8.0_hotfix9.diff - 2014-06-01 - only VS < 10 don't ship inttypes.h + G3D-v9.0 hotfix1.diff - 2014-08-22 - updated to G3D9, reapplied previous patches and removed unneeded changes +-G3D-v9.0 hotfix2.diff - 2014-08-23 - fix some -Wconversion warnings +\ No newline at end of file ++G3D-v9.0 hotfix2.diff - 2014-08-23 - fix some -Wconversion warnings ++G3D-v9.0 hotfix3.diff - 2015-06-28 - fix some warnings +diff --git a/dep/g3dlite/include/G3D/Log.h b/dep/g3dlite/include/G3D/Log.h +index 2aedb13..c8a5d53 100644 +--- a/dep/g3dlite/include/G3D/Log.h ++++ b/dep/g3dlite/include/G3D/Log.h +@@ -57,9 +57,9 @@ private: + + static Log* commonLog; + ++public: + int stripFromStackBottom; + +-public: + + /** + @param stripFromStackBottom Number of call stacks to strip from the +diff --git a/dep/g3dlite/include/G3D/Rect2D.h b/dep/g3dlite/include/G3D/Rect2D.h +index f72dd08..93dd0e6 100644 +--- a/dep/g3dlite/include/G3D/Rect2D.h ++++ b/dep/g3dlite/include/G3D/Rect2D.h +@@ -118,7 +118,7 @@ private: + } + + /** Uninitialized constructor */ +- Rect2D(bool b) {} ++ Rect2D(bool /*b*/) {} + public: + + /** \param any Must either Rect2D::xywh(#, #, #, #) or Rect2D::xyxy(#, #, #, #)*/ +diff --git a/dep/g3dlite/source/FileSystem.cpp b/dep/g3dlite/source/FileSystem.cpp +index 32a84e7..06e6ff0 100644 +--- a/dep/g3dlite/source/FileSystem.cpp ++++ b/dep/g3dlite/source/FileSystem.cpp +@@ -137,6 +137,9 @@ void FileSystem::Dir::computeZipListing(const std::string& zipfile, const std::s + + zip_close(z); + z = NULL; ++#else ++ (void)zipfile; ++ (void)_pathInsideZipfile; + #endif + } + +diff --git a/dep/g3dlite/source/debugAssert.cpp b/dep/g3dlite/source/debugAssert.cpp +index 92ce237..cfccf9a 100644 +--- a/dep/g3dlite/source/debugAssert.cpp ++++ b/dep/g3dlite/source/debugAssert.cpp +@@ -121,6 +121,8 @@ static void createErrorMessage( + const char* moduleName = strrchr(modulePath, '\\'); + outTitle = outTitle + string(" - ") + string(moduleName ? (moduleName + 1) : modulePath); + ++ #else ++ (void)outTitle; + #endif + + // Build the message. +diff --git a/dep/g3dlite/source/fileutils.cpp b/dep/g3dlite/source/fileutils.cpp +index 966cca7..2788ada 100644 +--- a/dep/g3dlite/source/fileutils.cpp ++++ b/dep/g3dlite/source/fileutils.cpp +@@ -396,6 +396,10 @@ bool zipfileExists(const std::string& filename, std::string& outZipfile, + } + + } ++#else ++ (void)filename; ++ (void)outZipfile; ++ (void)outInternalFile; + #endif + // not a valid directory structure ever, + // obviously no .zip was found within the path +@@ -756,6 +760,12 @@ static void getFileOrDirListZip(const std::string& path, + zip_close( z ); + + fileSet.getMembers(files); ++#else ++ (void)path; ++ (void)prefix; ++ (void)files; ++ (void)wantFiles; ++ (void)includePath; + #endif + } + +diff --git a/dep/g3dlite/source/prompt.cpp b/dep/g3dlite/source/prompt.cpp +index ee520d8..6927fd0 100644 +--- a/dep/g3dlite/source/prompt.cpp ++++ b/dep/g3dlite/source/prompt.cpp +@@ -572,6 +572,8 @@ int prompt( + return result; + } + #endif ++#else ++ (void)useGui; + #endif /* G3DFIX: exclude GUI prompt code */ + return textPrompt(windowTitle, prompt, choice, numChoices); + } diff --git a/dep/g3dlite/Readme.txt b/dep/g3dlite/Readme.txt index 7fab7f83e8d..74399439220 100644 --- a/dep/g3dlite/Readme.txt +++ b/dep/g3dlite/Readme.txt @@ -11,4 +11,5 @@ G3D-v8.0_hotfix7.diff - 2013-08-31 - fix typo in Matrix4 == operator G3D-v8.0_hotfix8.diff - 2013-09-01 - fix typo in Vector3int32 += operator G3D-v8.0_hotfix9.diff - 2014-06-01 - only VS < 10 don't ship inttypes.h G3D-v9.0 hotfix1.diff - 2014-08-22 - updated to G3D9, reapplied previous patches and removed unneeded changes -G3D-v9.0 hotfix2.diff - 2014-08-23 - fix some -Wconversion warnings
\ No newline at end of file +G3D-v9.0 hotfix2.diff - 2014-08-23 - fix some -Wconversion warnings +G3D-v9.0 hotfix3.diff - 2015-06-28 - fix some warnings diff --git a/dep/g3dlite/include/G3D/Log.h b/dep/g3dlite/include/G3D/Log.h index 2aedb13dcdc..c8a5d53f887 100644 --- a/dep/g3dlite/include/G3D/Log.h +++ b/dep/g3dlite/include/G3D/Log.h @@ -57,9 +57,9 @@ private: static Log* commonLog; +public: int stripFromStackBottom; -public: /** @param stripFromStackBottom Number of call stacks to strip from the diff --git a/dep/g3dlite/include/G3D/Rect2D.h b/dep/g3dlite/include/G3D/Rect2D.h index f72dd082ad8..93dd0e619cc 100644 --- a/dep/g3dlite/include/G3D/Rect2D.h +++ b/dep/g3dlite/include/G3D/Rect2D.h @@ -118,7 +118,7 @@ private: } /** Uninitialized constructor */ - Rect2D(bool b) {} + Rect2D(bool /*b*/) {} public: /** \param any Must either Rect2D::xywh(#, #, #, #) or Rect2D::xyxy(#, #, #, #)*/ diff --git a/dep/g3dlite/source/FileSystem.cpp b/dep/g3dlite/source/FileSystem.cpp index 32a84e77048..06e6ff00a5e 100644 --- a/dep/g3dlite/source/FileSystem.cpp +++ b/dep/g3dlite/source/FileSystem.cpp @@ -137,6 +137,9 @@ void FileSystem::Dir::computeZipListing(const std::string& zipfile, const std::s zip_close(z); z = NULL; +#else + (void)zipfile; + (void)_pathInsideZipfile; #endif } diff --git a/dep/g3dlite/source/debugAssert.cpp b/dep/g3dlite/source/debugAssert.cpp index 92ce2376490..cfccf9a0cc5 100644 --- a/dep/g3dlite/source/debugAssert.cpp +++ b/dep/g3dlite/source/debugAssert.cpp @@ -121,6 +121,8 @@ static void createErrorMessage( const char* moduleName = strrchr(modulePath, '\\'); outTitle = outTitle + string(" - ") + string(moduleName ? (moduleName + 1) : modulePath); + #else + (void)outTitle; #endif // Build the message. diff --git a/dep/g3dlite/source/fileutils.cpp b/dep/g3dlite/source/fileutils.cpp index 966cca7d4bf..2788adad3bc 100644 --- a/dep/g3dlite/source/fileutils.cpp +++ b/dep/g3dlite/source/fileutils.cpp @@ -396,6 +396,10 @@ bool zipfileExists(const std::string& filename, std::string& outZipfile, } } +#else + (void)filename; + (void)outZipfile; + (void)outInternalFile; #endif // not a valid directory structure ever, // obviously no .zip was found within the path @@ -756,6 +760,12 @@ static void getFileOrDirListZip(const std::string& path, zip_close( z ); fileSet.getMembers(files); +#else + (void)path; + (void)prefix; + (void)files; + (void)wantFiles; + (void)includePath; #endif } diff --git a/dep/g3dlite/source/prompt.cpp b/dep/g3dlite/source/prompt.cpp index ee520d85db7..6927fd03b85 100644 --- a/dep/g3dlite/source/prompt.cpp +++ b/dep/g3dlite/source/prompt.cpp @@ -572,6 +572,8 @@ int prompt( return result; } #endif +#else + (void)useGui; #endif /* G3DFIX: exclude GUI prompt code */ return textPrompt(windowTitle, prompt, choice, numChoices); } diff --git a/dep/recastnavigation/Detour/Include/DetourCommon.h b/dep/recastnavigation/Detour/Include/DetourCommon.h index 0888614ea9b..2afba0d780b 100644 --- a/dep/recastnavigation/Detour/Include/DetourCommon.h +++ b/dep/recastnavigation/Detour/Include/DetourCommon.h @@ -19,6 +19,8 @@ #ifndef DETOURCOMMON_H #define DETOURCOMMON_H +#include "DetourMath.h" + /** @defgroup detour Detour @@ -71,11 +73,6 @@ template<class T> inline T dtSqr(T a) { return a*a; } /// @return The value, clamped to the specified range. template<class T> inline T dtClamp(T v, T mn, T mx) { return v < mn ? mn : (v > mx ? mx : v); } -/// Returns the square root of the value. -/// @param[in] x The value. -/// @return The square root of the vlaue. -float dtSqrt(float x); - /// @} /// @name Vector helper functions. /// @{ @@ -202,7 +199,7 @@ inline void dtVcopy(float* dest, const float* a) /// @return The scalar length of the vector. inline float dtVlen(const float* v) { - return dtSqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + return dtMathSqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); } /// Derives the square of the scalar length of the vector. (len * len) @@ -222,7 +219,7 @@ inline float dtVdist(const float* v1, const float* v2) const float dx = v2[0] - v1[0]; const float dy = v2[1] - v1[1]; const float dz = v2[2] - v1[2]; - return dtSqrt(dx*dx + dy*dy + dz*dz); + return dtMathSqrtf(dx*dx + dy*dy + dz*dz); } /// Returns the square of the distance between two points. @@ -247,7 +244,7 @@ inline float dtVdist2D(const float* v1, const float* v2) { const float dx = v2[0] - v1[0]; const float dz = v2[2] - v1[2]; - return dtSqrt(dx*dx + dz*dz); + return dtMathSqrtf(dx*dx + dz*dz); } /// Derives the square of the distance between the specified points on the xz-plane. @@ -265,7 +262,7 @@ inline float dtVdist2DSqr(const float* v1, const float* v2) /// @param[in,out] v The vector to normalize. [(x, y, z)] inline void dtVnormalize(float* v) { - float d = 1.0f / dtSqrt(dtSqr(v[0]) + dtSqr(v[1]) + dtSqr(v[2])); + float d = 1.0f / dtMathSqrtf(dtSqr(v[0]) + dtSqr(v[1]) + dtSqr(v[2])); v[0] *= d; v[1] *= d; v[2] *= d; diff --git a/dep/recastnavigation/Detour/Include/DetourMath.h b/dep/recastnavigation/Detour/Include/DetourMath.h new file mode 100644 index 00000000000..95e14f8843b --- /dev/null +++ b/dep/recastnavigation/Detour/Include/DetourMath.h @@ -0,0 +1,20 @@ +/** +@defgroup detour Detour + +Members in this module are wrappers around the standard math library +*/ + +#ifndef DETOURMATH_H +#define DETOURMATH_H + +#include <math.h> + +inline float dtMathFabsf(float x) { return fabsf(x); } +inline float dtMathSqrtf(float x) { return sqrtf(x); } +inline float dtMathFloorf(float x) { return floorf(x); } +inline float dtMathCeilf(float x) { return ceilf(x); } +inline float dtMathCosf(float x) { return cosf(x); } +inline float dtMathSinf(float x) { return sinf(x); } +inline float dtMathAtan2f(float y, float x) { return atan2f(y, x); } + +#endif diff --git a/dep/recastnavigation/Detour/Source/DetourCommon.cpp b/dep/recastnavigation/Detour/Source/DetourCommon.cpp index b5700f5930b..26fe65c1781 100644 --- a/dep/recastnavigation/Detour/Source/DetourCommon.cpp +++ b/dep/recastnavigation/Detour/Source/DetourCommon.cpp @@ -16,16 +16,11 @@ // 3. This notice may not be removed or altered from any source distribution. // -#include <math.h> #include "DetourCommon.h" +#include "DetourMath.h" ////////////////////////////////////////////////////////////////////////////////////////// -float dtSqrt(float x) -{ - return sqrtf(x); -} - void dtClosestPtPointTriangle(float* closest, const float* p, const float* a, const float* b, const float* c) { @@ -360,7 +355,7 @@ void dtRandomPointInConvexPoly(const float* pts, const int npts, float* areas, acc += dacc; } - float v = dtSqrt(t); + float v = dtMathSqrtf(t); const float a = 1 - v; const float b = (1 - u) * v; diff --git a/dep/recastnavigation/Detour/Source/DetourNavMesh.cpp b/dep/recastnavigation/Detour/Source/DetourNavMesh.cpp index 51740509950..e8a679bb5d1 100644 --- a/dep/recastnavigation/Detour/Source/DetourNavMesh.cpp +++ b/dep/recastnavigation/Detour/Source/DetourNavMesh.cpp @@ -16,13 +16,13 @@ // 3. This notice may not be removed or altered from any source distribution. // -#include <math.h> #include <float.h> #include <string.h> #include <stdio.h> #include "DetourNavMesh.h" #include "DetourNode.h" #include "DetourCommon.h" +#include "DetourMath.h" #include "DetourAlloc.h" #include "DetourAssert.h" #include <new> @@ -709,7 +709,7 @@ dtPolyRef dtNavMesh::findNearestPolyInTile(const dtMeshTile* tile, float closestPtPoly[3]; float diff[3]; bool posOverPoly = false; - float d = 0; + float d; closestPointOnPoly(ref, center, closestPtPoly, &posOverPoly); // If a point is directly over a polygon and closer than diff --git a/dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp b/dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp index 9d8471b96a1..1bf271bed7a 100644 --- a/dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp +++ b/dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp @@ -16,13 +16,13 @@ // 3. This notice may not be removed or altered from any source distribution. // -#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <float.h> #include "DetourNavMesh.h" #include "DetourCommon.h" +#include "DetourMath.h" #include "DetourNavMeshBuilder.h" #include "DetourAlloc.h" #include "DetourAssert.h" @@ -202,8 +202,8 @@ static int createBVTree(const unsigned short* verts, const int /*nverts*/, if (z > it.bmax[2]) it.bmax[2] = z; } // Remap y - it.bmin[1] = (unsigned short)floorf((float)it.bmin[1]*ch/cs); - it.bmax[1] = (unsigned short)ceilf((float)it.bmax[1]*ch/cs); + it.bmin[1] = (unsigned short)dtMathFloorf((float)it.bmin[1]*ch/cs); + it.bmax[1] = (unsigned short)dtMathCeilf((float)it.bmax[1]*ch/cs); } int curNode = 0; diff --git a/dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp b/dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp index ec3a2946ea5..fbf3724e85b 100644 --- a/dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp +++ b/dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp @@ -16,13 +16,13 @@ // 3. This notice may not be removed or altered from any source distribution. // -#include <math.h> #include <float.h> #include <string.h> #include "DetourNavMeshQuery.h" #include "DetourNavMesh.h" #include "DetourNode.h" #include "DetourCommon.h" +#include "DetourMath.h" #include "DetourAlloc.h" #include "DetourAssert.h" #include <new> @@ -99,9 +99,9 @@ inline float dtQueryFilter::getCost(const float* pa, const float* pb, return dtVdist(pa, pb) * m_areaCost[curPoly->getArea()]; } #endif - + // Edited by TC -static const float H_SCALE = 2.0f; // Search heuristic scale. +static const float H_SCALE = 2.0f; // Search heuristic scale. dtNavMeshQuery* dtAllocNavMeshQuery() @@ -309,7 +309,7 @@ dtStatus dtNavMeshQuery::findRandomPoint(const dtQueryFilter* filter, float (*fr return DT_SUCCESS; } -dtStatus dtNavMeshQuery::findRandomPointAroundCircle(dtPolyRef startRef, const float* centerPos, const float radius, +dtStatus dtNavMeshQuery::findRandomPointAroundCircle(dtPolyRef startRef, const float* centerPos, const float maxRadius, const dtQueryFilter* filter, float (*frand)(), dtPolyRef* randomRef, float* randomPt) const { @@ -341,7 +341,7 @@ dtStatus dtNavMeshQuery::findRandomPointAroundCircle(dtPolyRef startRef, const f dtStatus status = DT_SUCCESS; - const float radiusSqr = dtSqr(radius); + const float radiusSqr = dtSqr(maxRadius); float areaSum = 0.0f; const dtMeshTile* randomTile = 0; @@ -705,7 +705,7 @@ dtStatus dtNavMeshQuery::getPolyHeight(dtPolyRef ref, const float* pos, float* h /// @p nearestRef before using @p nearestPt. /// /// @warning This function is not suitable for large area searches. If the search -/// extents overlaps more than 128 polygons it may return an invalid result. +/// extents overlaps more than MAX_SEARCH (128) polygons it may return an invalid result. /// dtStatus dtNavMeshQuery::findNearestPoly(const float* center, const float* extents, const dtQueryFilter* filter, @@ -716,9 +716,10 @@ dtStatus dtNavMeshQuery::findNearestPoly(const float* center, const float* exten *nearestRef = 0; // Get nearby polygons from proximity grid. - dtPolyRef polys[128]; + const int MAX_SEARCH = 128; + dtPolyRef polys[MAX_SEARCH]; int polyCount = 0; - if (dtStatusFailed(queryPolygons(center, extents, filter, polys, &polyCount, 128))) + if (dtStatusFailed(queryPolygons(center, extents, filter, polys, &polyCount, MAX_SEARCH))) return DT_FAILURE | DT_INVALID_PARAM; // Find nearest polygon amongst the nearby polygons. @@ -1304,12 +1305,8 @@ dtStatus dtNavMeshQuery::updateSlicedFindPath(const int maxIter, int* doneIters) if (!m_query.filter->passFilter(neighbourRef, neighbourTile, neighbourPoly)) continue; - // deal explicitly with crossing tile boundaries - unsigned char crossSide = 0; - if (bestTile->links[i].side != 0xff) - crossSide = bestTile->links[i].side >> 1; - - dtNode* neighbourNode = m_nodePool->getNode(neighbourRef, crossSide); + // get the neighbor node + dtNode* neighbourNode = m_nodePool->getNode(neighbourRef, 0); if (!neighbourNode) { m_query.status |= DT_OUT_OF_NODES; diff --git a/dep/recastnavigation/Recast/Include/Recast.h b/dep/recastnavigation/Recast/Include/Recast.h index 66974cdbcc3..d3e9219a9f6 100644 --- a/dep/recastnavigation/Recast/Include/Recast.h +++ b/dep/recastnavigation/Recast/Include/Recast.h @@ -1083,7 +1083,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, /// @returns True if the operation completed successfully. bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf, const float maxError, const int maxEdgeLen, - rcContourSet& cset, const int flags = RC_CONTOUR_TESS_WALL_EDGES); + rcContourSet& cset, const int buildFlags = RC_CONTOUR_TESS_WALL_EDGES); /// Builds a polygon mesh from the provided contours. /// @ingroup recast diff --git a/dep/recastnavigation/Recast/Source/Recast.cpp b/dep/recastnavigation/Recast/Source/Recast.cpp index b9d86036c3f..59d99609446 100644 --- a/dep/recastnavigation/Recast/Source/Recast.cpp +++ b/dep/recastnavigation/Recast/Source/Recast.cpp @@ -238,7 +238,7 @@ static void calcTriNormal(const float* v0, const float* v1, const float* v2, flo /// @par /// -/// Only sets the aread id's for the walkable triangles. Does not alter the +/// Only sets the area id's for the walkable triangles. Does not alter the /// area id's for unwalkable triangles. /// /// See the #rcConfig documentation for more information on the configuration parameters. @@ -267,7 +267,7 @@ void rcMarkWalkableTriangles(rcContext* ctx, const float walkableSlopeAngle, /// @par /// -/// Only sets the aread id's for the unwalkable triangles. Does not alter the +/// Only sets the area id's for the unwalkable triangles. Does not alter the /// area id's for walkable triangles. /// /// See the #rcConfig documentation for more information on the configuration parameters. @@ -318,7 +318,7 @@ int rcGetHeightFieldSpanCount(rcContext* ctx, rcHeightfield& hf) /// @par /// /// This is just the beginning of the process of fully building a compact heightfield. -/// Various filters may be applied applied, then the distance field and regions built. +/// Various filters may be applied, then the distance field and regions built. /// E.g: #rcBuildDistanceField and #rcBuildRegions /// /// See the #rcConfig documentation for more information on the configuration parameters. @@ -486,4 +486,4 @@ static int getCompactHeightFieldMemoryusage(const rcCompactHeightfield& chf) size += sizeof(rcCompactCell) * chf.width * chf.height; return size; } -*/
\ No newline at end of file +*/ diff --git a/dep/recastnavigation/Recast/Source/RecastContour.cpp b/dep/recastnavigation/Recast/Source/RecastContour.cpp index 8aa9d1d92a1..a7be6691f3e 100644 --- a/dep/recastnavigation/Recast/Source/RecastContour.cpp +++ b/dep/recastnavigation/Recast/Source/RecastContour.cpp @@ -464,7 +464,7 @@ static int calcAreaOfPolygon2D(const int* verts, const int nverts) } // TODO: these are the same as in RecastMesh.cpp, consider using the same. - +// Last time I checked the if version got compiled using cmov, which was a lot faster than module (with idiv). inline int prev(int i, int n) { return i-1 >= 0 ? i-1 : n-1; } inline int next(int i, int n) { return i+1 < n ? i+1 : 0; } diff --git a/dep/recastnavigation/Recast/Source/RecastLayers.cpp b/dep/recastnavigation/Recast/Source/RecastLayers.cpp index cb1a39f4bda..41458c1ea68 100644 --- a/dep/recastnavigation/Recast/Source/RecastLayers.cpp +++ b/dep/recastnavigation/Recast/Source/RecastLayers.cpp @@ -38,7 +38,7 @@ struct rcLayerRegion unsigned char layerId; // Layer ID unsigned char nlayers; // Layer count unsigned char nneis; // Neighbour count - unsigned char base; // Flag indicating if the region is the base of merged regions. + unsigned char base; // Flag indicating if the region is the base of merged regions. }; @@ -293,7 +293,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, for (int i = 0; i < nregs; ++i) { rcLayerRegion& root = regs[i]; - // Skip alreadu visited. + // Skip already visited. if (root.layerId != 0xff) continue; @@ -368,7 +368,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, rcLayerRegion& rj = regs[j]; if (!rj.base) continue; - // Skip if teh regions are not close to each other. + // Skip if the regions are not close to each other. if (!overlapRange(ri.ymin,ri.ymax+mergeHeight, rj.ymin,rj.ymax+mergeHeight)) continue; // Skip if the height range would become too large. @@ -377,7 +377,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, if ((ymax - ymin) >= 255) continue; - // Make sure that there is no overlap when mergin 'ri' and 'rj'. + // Make sure that there is no overlap when merging 'ri' and 'rj'. bool overlap = false; // Iterate over all regions which have the same layerId as 'rj' for (int k = 0; k < nregs; ++k) @@ -417,7 +417,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, // Add overlaid layers from 'rj' to 'ri'. for (int k = 0; k < rj.nlayers; ++k) addUnique(ri.layers, ri.nlayers, rj.layers[k]); - // Update heigh bounds. + // Update height bounds. ri.ymin = rcMin(ri.ymin, rj.ymin); ri.ymax = rcMax(ri.ymax, rj.ymax); } @@ -481,10 +481,8 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, for (int i = 0; i < lset.nlayers; ++i) { unsigned char curId = (unsigned char)i; - - // Allocate memory for the current layer. + rcHeightfieldLayer* layer = &lset.layers[i]; - memset(layer, 0, sizeof(rcHeightfieldLayer)); const int gridSize = sizeof(unsigned char)*lw*lh; @@ -528,7 +526,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, layer->cs = chf.cs; layer->ch = chf.ch; - // Adjust the bbox to fit the heighfield. + // Adjust the bbox to fit the heightfield. rcVcopy(layer->bmin, bmin); rcVcopy(layer->bmax, bmax); layer->bmin[1] = bmin[1] + hmin*chf.ch; @@ -542,7 +540,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, layer->miny = layer->height; layer->maxy = 0; - // Copy height and area from compact heighfield. + // Copy height and area from compact heightfield. for (int y = 0; y < lh; ++y) { for (int x = 0; x < lw; ++x) diff --git a/dep/recastnavigation/Recast/Source/RecastMesh.cpp b/dep/recastnavigation/Recast/Source/RecastMesh.cpp index e4f9c4b3629..c8853444019 100644 --- a/dep/recastnavigation/Recast/Source/RecastMesh.cpp +++ b/dep/recastnavigation/Recast/Source/RecastMesh.cpp @@ -160,6 +160,7 @@ static unsigned short addVertex(unsigned short x, unsigned short y, unsigned sho return (unsigned short)i; } +// Last time I checked the if version got compiled using cmov, which was a lot faster than module (with idiv). inline int prev(int i, int n) { return i-1 >= 0 ? i-1 : n-1; } inline int next(int i, int n) { return i+1 < n ? i+1 : 0; } @@ -746,7 +747,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } // Remove vertex. - for (int i = (int)rem; i < mesh.nverts; ++i) + for (int i = (int)rem; i < mesh.nverts - 1; ++i) { mesh.verts[i*3+0] = mesh.verts[(i+1)*3+0]; mesh.verts[i*3+1] = mesh.verts[(i+1)*3+1]; @@ -836,7 +837,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short } rcScopedDelete<int> thole = (int*)rcAlloc(sizeof(int)*nhole, RC_ALLOC_TEMP); - if (!tverts) + if (!thole) { ctx->log(RC_LOG_WARNING, "removeVertex: Out of memory 'thole' (%d).", nhole); return false; @@ -875,7 +876,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short return false; } rcScopedDelete<unsigned char> pareas = (unsigned char*)rcAlloc(sizeof(unsigned char)*ntris, RC_ALLOC_TEMP); - if (!pregs) + if (!pareas) { ctx->log(RC_LOG_ERROR, "removeVertex: Out of memory 'pareas' (%d).", ntris); return false; diff --git a/dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp b/dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp index 5cc2adf0320..56b059d7dd5 100644 --- a/dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp +++ b/dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp @@ -237,8 +237,8 @@ static unsigned short getHeight(const float fx, const float fy, const float fz, enum EdgeValues { - UNDEF = -1, - HULL = -2, + EV_UNDEF = -1, + EV_HULL = -2, }; static int findEdge(const int* edges, int nedges, int s, int t) @@ -249,7 +249,7 @@ static int findEdge(const int* edges, int nedges, int s, int t) if ((e[0] == s && e[1] == t) || (e[0] == t && e[1] == s)) return i; } - return UNDEF; + return EV_UNDEF; } static int addEdge(rcContext* ctx, int* edges, int& nedges, const int maxEdges, int s, int t, int l, int r) @@ -257,12 +257,12 @@ static int addEdge(rcContext* ctx, int* edges, int& nedges, const int maxEdges, if (nedges >= maxEdges) { ctx->log(RC_LOG_ERROR, "addEdge: Too many edges (%d/%d).", nedges, maxEdges); - return UNDEF; + return EV_UNDEF; } // Add edge if not already in the triangulation. int e = findEdge(edges, nedges, s, t); - if (e == UNDEF) + if (e == EV_UNDEF) { int* edge = &edges[nedges*4]; edge[0] = s; @@ -273,15 +273,15 @@ static int addEdge(rcContext* ctx, int* edges, int& nedges, const int maxEdges, } else { - return UNDEF; + return EV_UNDEF; } } static void updateLeftFace(int* e, int s, int t, int f) { - if (e[0] == s && e[1] == t && e[2] == UNDEF) + if (e[0] == s && e[1] == t && e[2] == EV_UNDEF) e[2] = f; - else if (e[1] == s && e[0] == t && e[3] == UNDEF) + else if (e[1] == s && e[0] == t && e[3] == EV_UNDEF) e[3] = f; } @@ -322,12 +322,12 @@ static void completeFacet(rcContext* ctx, const float* pts, int npts, int* edges // Cache s and t. int s,t; - if (edge[2] == UNDEF) + if (edge[2] == EV_UNDEF) { s = edge[0]; t = edge[1]; } - else if (edge[3] == UNDEF) + else if (edge[3] == EV_UNDEF) { s = edge[1]; t = edge[0]; @@ -390,15 +390,15 @@ static void completeFacet(rcContext* ctx, const float* pts, int npts, int* edges // Add new edge or update face info of old edge. e = findEdge(edges, nedges, pt, s); - if (e == UNDEF) - addEdge(ctx, edges, nedges, maxEdges, pt, s, nfaces, UNDEF); + if (e == EV_UNDEF) + addEdge(ctx, edges, nedges, maxEdges, pt, s, nfaces, EV_UNDEF); else updateLeftFace(&edges[e*4], pt, s, nfaces); // Add new edge or update face info of old edge. e = findEdge(edges, nedges, t, pt); - if (e == UNDEF) - addEdge(ctx, edges, nedges, maxEdges, t, pt, nfaces, UNDEF); + if (e == EV_UNDEF) + addEdge(ctx, edges, nedges, maxEdges, t, pt, nfaces, EV_UNDEF); else updateLeftFace(&edges[e*4], t, pt, nfaces); @@ -406,7 +406,7 @@ static void completeFacet(rcContext* ctx, const float* pts, int npts, int* edges } else { - updateLeftFace(&edges[e*4], s, t, HULL); + updateLeftFace(&edges[e*4], s, t, EV_HULL); } } @@ -420,14 +420,14 @@ static void delaunayHull(rcContext* ctx, const int npts, const float* pts, edges.resize(maxEdges*4); for (int i = 0, j = nhull-1; i < nhull; j=i++) - addEdge(ctx, &edges[0], nedges, maxEdges, hull[j],hull[i], HULL, UNDEF); + addEdge(ctx, &edges[0], nedges, maxEdges, hull[j],hull[i], EV_HULL, EV_UNDEF); int currentEdge = 0; while (currentEdge < nedges) { - if (edges[currentEdge*4+2] == UNDEF) + if (edges[currentEdge*4+2] == EV_UNDEF) completeFacet(ctx, pts, npts, &edges[0], nedges, maxEdges, nfaces, currentEdge); - if (edges[currentEdge*4+3] == UNDEF) + if (edges[currentEdge*4+3] == EV_UNDEF) completeFacet(ctx, pts, npts, &edges[0], nedges, maxEdges, nfaces, currentEdge); currentEdge++; } @@ -507,17 +507,11 @@ static float polyMinExtent(const float* verts, const int nverts) return rcSqrt(minDist); } -inline int next(int i, int n) -{ - return (i+1) % n; -} - -inline int prev(int i, int n) -{ - return (i + n-1) % n; -} +// Last time I checked the if version got compiled using cmov, which was a lot faster than module (with idiv). +inline int prev(int i, int n) { return i-1 >= 0 ? i-1 : n-1; } +inline int next(int i, int n) { return i+1 < n ? i+1 : 0; } -static void triangulateHull(const int nverts, const float* verts, const int nhull, const int* hull, rcIntArray& tris) +static void triangulateHull(const int /*nverts*/, const float* verts, const int nhull, const int* hull, rcIntArray& tris) { int start = 0, left = 1, right = nhull-1; diff --git a/dep/recastnavigation/Recast/Source/RecastRasterization.cpp b/dep/recastnavigation/Recast/Source/RecastRasterization.cpp index 45a7d35bf3e..c3bda80cd71 100644 --- a/dep/recastnavigation/Recast/Source/RecastRasterization.cpp +++ b/dep/recastnavigation/Recast/Source/RecastRasterization.cpp @@ -50,7 +50,7 @@ static rcSpan* allocSpan(rcHeightfield& hf) // Allocate memory for the new pool. rcSpanPool* pool = (rcSpanPool*)rcAlloc(sizeof(rcSpanPool), RC_ALLOC_PERM); if (!pool) return 0; - pool->next = 0; + // Add the pool into the list of pools. pool->next = hf.pools; hf.pools = pool; diff --git a/dep/recastnavigation/Recast/Source/RecastRegion.cpp b/dep/recastnavigation/Recast/Source/RecastRegion.cpp index 38bc4ff476f..352ba579e5f 100644 --- a/dep/recastnavigation/Recast/Source/RecastRegion.cpp +++ b/dep/recastnavigation/Recast/Source/RecastRegion.cpp @@ -1041,7 +1041,7 @@ static void addUniqueConnection(rcRegion& reg, int n) static bool mergeAndFilterLayerRegions(rcContext* ctx, int minRegionArea, unsigned short& maxRegionId, rcCompactHeightfield& chf, - unsigned short* srcReg, rcIntArray& overlaps) + unsigned short* srcReg, rcIntArray& /*overlaps*/) { const int w = chf.width; const int h = chf.height; diff --git a/dep/recastnavigation/recastnavigation.diff b/dep/recastnavigation/recastnavigation.diff index 42bab6474e3..0be25bc11d1 100644 --- a/dep/recastnavigation/recastnavigation.diff +++ b/dep/recastnavigation/recastnavigation.diff @@ -1,18 +1,17 @@ -From b84e9ffbd1d1e1fb2f5d78cc53d2bb7b56c3fce3 Mon Sep 17 00:00:00 2001 +From 37b4c6d3d78ea676d8b300a282013a27a51912c1 Mon Sep 17 00:00:00 2001 From: jackpoz <giacomopoz@gmail.com> Date: Fri, 20 Jun 2014 23:15:04 +0200 Subject: [PATCH] Add custom trinitycore changes --- - Detour/Include/DetourNavMesh.h | 76 ++++++++------------------ - Detour/Source/DetourCommon.cpp | 4 +- - Detour/Source/DetourNavMesh.cpp | 32 ++++------- - Detour/Source/DetourNavMeshBuilder.cpp | 6 +- - Detour/Source/DetourNavMeshQuery.cpp | 9 +-- - Detour/Source/DetourNode.cpp | 29 +++------- - DetourCrowd/Source/DetourObstacleAvoidance.cpp | 6 +- - Recast/Include/Recast.h | 8 +-- - 8 files changed, 59 insertions(+), 111 deletions(-) + Detour/Include/DetourNavMesh.h | 76 ++++++++++++------------------------ + Detour/Source/DetourNavMesh.cpp | 30 +++++--------- + Detour/Source/DetourNavMeshQuery.cpp | 5 ++- + Detour/Source/DetourNode.cpp | 29 ++++---------- + Recast/Include/Recast.h | 8 ++-- + Recast/Source/RecastMeshDetail.cpp | 2 +- + Recast/Source/RecastRegion.cpp | 2 +- + 7 files changed, 50 insertions(+), 102 deletions(-) diff --git a/Detour/Include/DetourNavMesh.h b/Detour/Include/DetourNavMesh.h index 1060845..782ddbc 100644 @@ -177,46 +176,10 @@ index 1060845..782ddbc 100644 }; /// Allocates a navigation mesh object using the Detour allocator. -diff --git a/Detour/Source/DetourCommon.cpp b/Detour/Source/DetourCommon.cpp -index a98d8c8..b5700f5 100644 ---- a/Detour/Source/DetourCommon.cpp -+++ b/Detour/Source/DetourCommon.cpp -@@ -16,14 +16,14 @@ - // 3. This notice may not be removed or altered from any source distribution. - // - -+#include <math.h> - #include "DetourCommon.h" --#include "DetourMath.h" - - ////////////////////////////////////////////////////////////////////////////////////////// - - float dtSqrt(float x) - { -- return dtMathSqrtf(x); -+ return sqrtf(x); - } - - void dtClosestPtPointTriangle(float* closest, const float* p, diff --git a/Detour/Source/DetourNavMesh.cpp b/Detour/Source/DetourNavMesh.cpp -index 9d627be..5174050 100644 +index d353d08..e8a679b 100644 --- a/Detour/Source/DetourNavMesh.cpp +++ b/Detour/Source/DetourNavMesh.cpp -@@ -16,13 +16,13 @@ - // 3. This notice may not be removed or altered from any source distribution. - // - -+#include <math.h> - #include <float.h> - #include <string.h> - #include <stdio.h> - #include "DetourNavMesh.h" - #include "DetourNode.h" - #include "DetourCommon.h" --#include "DetourMath.h" - #include "DetourAlloc.h" - #include "DetourAssert.h" - #include <new> @@ -193,13 +193,11 @@ dtNavMesh::dtNavMesh() : m_tileLutMask(0), m_posLookup(0), @@ -270,68 +233,21 @@ index 9d627be..5174050 100644 if (tile->salt == 0) tile->salt++; -diff --git a/Detour/Source/DetourNavMeshBuilder.cpp b/Detour/Source/DetourNavMeshBuilder.cpp -index 1bf271b..9d8471b 100644 ---- a/Detour/Source/DetourNavMeshBuilder.cpp -+++ b/Detour/Source/DetourNavMeshBuilder.cpp -@@ -16,13 +16,13 @@ - // 3. This notice may not be removed or altered from any source distribution. - // - -+#include <math.h> - #include <stdio.h> - #include <stdlib.h> - #include <string.h> - #include <float.h> - #include "DetourNavMesh.h" - #include "DetourCommon.h" --#include "DetourMath.h" - #include "DetourNavMeshBuilder.h" - #include "DetourAlloc.h" - #include "DetourAssert.h" -@@ -202,8 +202,8 @@ static int createBVTree(const unsigned short* verts, const int /*nverts*/, - if (z > it.bmax[2]) it.bmax[2] = z; - } - // Remap y -- it.bmin[1] = (unsigned short)dtMathFloorf((float)it.bmin[1]*ch/cs); -- it.bmax[1] = (unsigned short)dtMathCeilf((float)it.bmax[1]*ch/cs); -+ it.bmin[1] = (unsigned short)floorf((float)it.bmin[1]*ch/cs); -+ it.bmax[1] = (unsigned short)ceilf((float)it.bmax[1]*ch/cs); - } - - int curNode = 0; diff --git a/Detour/Source/DetourNavMeshQuery.cpp b/Detour/Source/DetourNavMeshQuery.cpp -index 9debb4d..ec3a294 100644 +index 5fbc83e..fbf3724 100644 --- a/Detour/Source/DetourNavMeshQuery.cpp +++ b/Detour/Source/DetourNavMeshQuery.cpp -@@ -16,13 +16,13 @@ - // 3. This notice may not be removed or altered from any source distribution. - // - -+#include <math.h> - #include <float.h> - #include <string.h> - #include "DetourNavMeshQuery.h" - #include "DetourNavMesh.h" - #include "DetourNode.h" - #include "DetourCommon.h" --#include "DetourMath.h" - #include "DetourAlloc.h" - #include "DetourAssert.h" - #include <new> -@@ -99,8 +99,9 @@ inline float dtQueryFilter::getCost(const float* pa, const float* pb, - return dtVdist(pa, pb) * m_areaCost[curPoly->getArea()]; +@@ -100,7 +100,8 @@ inline float dtQueryFilter::getCost(const float* pa, const float* pb, } #endif -- + -static const float H_SCALE = 0.999f; // Search heuristic scale. -+ +// Edited by TC -+static const float H_SCALE = 2.0f; // Search heuristic scale. ++static const float H_SCALE = 2.0f; // Search heuristic scale. dtNavMeshQuery* dtAllocNavMeshQuery() -@@ -3504,7 +3505,7 @@ dtStatus dtNavMeshQuery::findDistanceToWall(dtPolyRef startRef, const float* cen +@@ -3501,7 +3502,7 @@ dtStatus dtNavMeshQuery::findDistanceToWall(dtPolyRef startRef, const float* cen dtVsub(hitNormal, centerPos, hitPos); dtVnormalize(hitNormal); @@ -383,42 +299,8 @@ index 5cf6548..1d18977 100644 ////////////////////////////////////////////////////////////////////////////////////////// dtNodePool::dtNodePool(int maxNodes, int hashSize) : -diff --git a/DetourCrowd/Source/DetourObstacleAvoidance.cpp b/DetourCrowd/Source/DetourObstacleAvoidance.cpp -index 0fad9ef..d3f90b7 100644 ---- a/DetourCrowd/Source/DetourObstacleAvoidance.cpp -+++ b/DetourCrowd/Source/DetourObstacleAvoidance.cpp -@@ -18,10 +18,10 @@ - - #include "DetourObstacleAvoidance.h" - #include "DetourCommon.h" --#include "DetourMath.h" - #include "DetourAlloc.h" - #include "DetourAssert.h" - #include <string.h> -+#include <math.h> - #include <float.h> - #include <new> - -@@ -58,7 +58,7 @@ static int isectRaySeg(const float* ap, const float* u, - dtVsub(v,bq,bp); - dtVsub(w,ap,bp); - float d = dtVperp2D(u,v); -- if (dtMathFabs(d) < 1e-6f) return 0; -+ if (fabsf(d) < 1e-6f) return 0; - d = 1.0f/d; - t = dtVperp2D(v,w) * d; - if (t < 0 || t > 1) return 0; -@@ -482,7 +482,7 @@ int dtObstacleAvoidanceQuery::sampleVelocityAdaptive(const float* pos, const flo - const int nd = dtClamp(ndivs, 1, DT_MAX_PATTERN_DIVS); - const int nr = dtClamp(nrings, 1, DT_MAX_PATTERN_RINGS); - const float da = (1.0f/nd) * DT_PI*2; -- const float dang = dtMathAtan2f(dvel[2], dvel[0]); -+ const float dang = atan2f(dvel[2], dvel[0]); - - // Always add sample at zero - pat[npat*2+0] = 0; diff --git a/Recast/Include/Recast.h b/Recast/Include/Recast.h -index 83ca606..66974cd 100644 +index d8bdde2..d3e9219 100644 --- a/Recast/Include/Recast.h +++ b/Recast/Include/Recast.h @@ -243,7 +243,7 @@ struct rcConfig @@ -443,6 +325,32 @@ index 83ca606..66974cd 100644 rcSpan* next; ///< The next span higher up in column. }; +diff --git a/Recast/Source/RecastMeshDetail.cpp b/Recast/Source/RecastMeshDetail.cpp +index c0bba6f..56b059d 100644 +--- a/Recast/Source/RecastMeshDetail.cpp ++++ b/Recast/Source/RecastMeshDetail.cpp +@@ -511,7 +511,7 @@ static float polyMinExtent(const float* verts, const int nverts) + inline int prev(int i, int n) { return i-1 >= 0 ? i-1 : n-1; } + inline int next(int i, int n) { return i+1 < n ? i+1 : 0; } + +-static void triangulateHull(const int nverts, const float* verts, const int nhull, const int* hull, rcIntArray& tris) ++static void triangulateHull(const int /*nverts*/, const float* verts, const int nhull, const int* hull, rcIntArray& tris) + { + int start = 0, left = 1, right = nhull-1; + +diff --git a/Recast/Source/RecastRegion.cpp b/Recast/Source/RecastRegion.cpp +index 38bc4ff..352ba57 100644 +--- a/Recast/Source/RecastRegion.cpp ++++ b/Recast/Source/RecastRegion.cpp +@@ -1041,7 +1041,7 @@ static void addUniqueConnection(rcRegion& reg, int n) + static bool mergeAndFilterLayerRegions(rcContext* ctx, int minRegionArea, + unsigned short& maxRegionId, + rcCompactHeightfield& chf, +- unsigned short* srcReg, rcIntArray& overlaps) ++ unsigned short* srcReg, rcIntArray& /*overlaps*/) + { + const int w = chf.width; + const int h = chf.height; -- -1.9.0.msysgit.0 +1.9.5.msysgit.0 diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 07b540f1770..f3c76ce2a79 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -2511,7 +2511,7 @@ CREATE TABLE `updates` ( LOCK TABLES `updates` WRITE; /*!40000 ALTER TABLE `updates` DISABLE KEYS */; -INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0); +INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0), ('2015_06_26_00_characters_335.sql','f8230a59a9e878a6f54f421d6621f1595bd93861','RELEASED','2015-03-21 21:44:51',0); /*!40000 ALTER TABLE `updates` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/world/2015_06_28_00_world.sql b/sql/updates/world/2015_06_28_00_world.sql new file mode 100644 index 00000000000..3991d639615 --- /dev/null +++ b/sql/updates/world/2015_06_28_00_world.sql @@ -0,0 +1,17 @@ +-- +UPDATE `creature` SET `position_x`=1997.263,`position_y`=-3256.643, `position_z`=149.723,`orientation`=6.116 WHERE `guid`=105997; +UPDATE `creature` SET `position_x`=2091.723,`position_y`=-3245.161, `position_z`=161.245,`orientation`=3.312 WHERE `guid`=105998; +DELETE FROM `smart_scripts` WHERE `entryorguid`= -105997 AND `source_type`=0; +UPDATE `smart_scripts` SET `event_param1`=43892, `action_type`=11, `target_type`=1, `target_param1`=0, `target_param2`=0 WHERE `entryorguid` IN (24439) AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `action_type`=41, `action_param1`=0, `action_param2`=0 WHERE `entryorguid` IN (24439) AND `source_type`=0 AND `id`=4; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (24439); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22,2,24439,0,0, 29,0,15214,1,0,0,0,'','event 1 for 24439 require npc 15214 at 1 yard'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=43770; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(43770,43892,1,'Steel Gate Drop Off Check'); + +DELETE FROM `creature` WHERE `guid` IN (104706, 104705); +UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `guid`=104704; +UPDATE `creature_template` SET `npcflag`=16777216 WHERE `entry`=24418; diff --git a/sql/updates/world/2015_06_28_01_world.sql b/sql/updates/world/2015_06_28_01_world.sql new file mode 100644 index 00000000000..4f591bc293c --- /dev/null +++ b/sql/updates/world/2015_06_28_01_world.sql @@ -0,0 +1,23 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceGroup` = 1 AND `SourceEntry` IN ( 50036,51518,50087); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`) VALUES +(13, 1, 50036, 31, 3, 27641), +(13, 1, 51518, 31, 3, 27641), +(13, 1, 50087, 31, 3, 27641); + +DELETE FROM `spelldifficulty_dbc` WHERE `id` = 50044; +INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`) VALUES (50044, 50044, 59213); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=27641; + +DELETE FROM `creature_template_addon` WHERE `entry` IN (27641,30905); +INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES +(27641,'50044'), +(30905,'59213'); + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 27639 AND `source_type` = 0 AND `id` = 16; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 27640 AND `source_type` = 0 AND `id` = 2; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 27641 AND `source_type` = 0 AND `id` = 0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(27639, 0, 16, 0, 1, 0, 100, 0, 1000, 1000, 0, 0, 11, 51518, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ring-Lord Sorceress - Out of Combat - Cast Beam Visual'), +(27640, 0, 2, 0, 1, 0, 100, 0, 1000, 1000, 0, 0, 11, 51518, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ring-Lord Conjurer - Out of combat - Cast Visual'), +(27641, 0, 0, 0, 1, 0, 100, 1, 0, 0, 0, 0, 11, 50088, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Centrifuge Core - Out of Combat - Cast Energy Link');
\ No newline at end of file diff --git a/sql/updates/world/2015_06_28_02_world.sql b/sql/updates/world/2015_06_28_02_world.sql new file mode 100644 index 00000000000..0b376442393 --- /dev/null +++ b/sql/updates/world/2015_06_28_02_world.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `creature_addon` WHERE `guid` IN (104706, 104705); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (53099, 54640, 55288); +DELETE FROM `spell_scripts` WHERE `id` IN (53099, 55288); +INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(53099,0,0,15,53098,0,0,0,0,0,0), +(55288,0,0,15,55289,0,0,0,0,0,0); diff --git a/sql/updates/world/2015_06_28_03_world.sql b/sql/updates/world/2015_06_28_03_world.sql new file mode 100644 index 00000000000..ff6dfc6330f --- /dev/null +++ b/sql/updates/world/2015_06_28_03_world.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `gossip_menu_option` WHERE `menu_id`=1293 AND `id`=3; diff --git a/sql/updates/world/2015_06_28_04_world.sql b/sql/updates/world/2015_06_28_04_world.sql new file mode 100644 index 00000000000..9e96b40fa0b --- /dev/null +++ b/sql/updates/world/2015_06_28_04_world.sql @@ -0,0 +1,34 @@ +-- +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN (27405, 27406); +UPDATE `spell_area` SET `quest_start` =0, `quest_start_status` =0, `quest_end_status` =0 WHERE `spell` IN (48761, 48763); + +UPDATE `smart_scripts` SET `event_phase_mask`=0 WHERE `entryorguid`=27202 AND `source_type`=0 AND `id` =3; +UPDATE `smart_scripts` SET `link` =16 WHERE `entryorguid`=27202 AND `source_type`=0 AND `id` =12; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (27405, 27406) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2740500, 2740600) AND `source_type`=9; +DELETE FROM `smart_scripts` WHERE `entryorguid`=27202 AND `source_type`=0 AND id>15 ; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(27202, 0, 16, 17, 61, 0, 100, 0, 0, 0, 0, 0, 11, 48654, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Raven Priest - On Spellhit Banshee''s Magic Mirror - Cast The Perfect Dissemblance: Summon Priest''s Footman (No Repeat)'), +(27202, 0, 17, 18, 61, 0, 100, 0, 0, 0, 0, 0, 85, 48763, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Raven Priest - On Spellhit Banshee''s Magic Mirror - Cast Scarlet Raven Priest Image'), +(27202, 0, 18, 19, 61, 0, 100, 0, 0, 0, 0, 0, 85, 48761, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Raven Priest - On Spellhit Banshee''s Magic Mirror - Cast Scarlet Raven Priest Image'), +(27202, 0, 19, 0, 61, 0, 100, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Raven Priest - On Spellhit Banshee''s Magic Mirror - Set faction'), +(27405, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 2740500, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - On just summoned - Action list'), +(2740500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - Action list - Set faction'), +(2740500, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - Action list - Talk text1'), +(2740500, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 40, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - Action list - Start attack'), +(27405, 0, 1, 0, 0, 0, 100, 0, 2000, 2000, 28000, 28000, 11, 50713, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - IC - Unrelenting Onslaught '), +(27406, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, 2740600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - On just summoned - Action list'), +(2740600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 14, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - Action list - Set faction'), +(2740600, 9, 1, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - Action list - Talk text1'), +(2740600, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 40, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - Action list - Start attack'), +(27406, 0, 1, 0, 0, 0, 100, 0, 2000, 2000, 28000, 28000, 11, 50713, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Footman - IC - Unrelenting Onslaught '); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (27202); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,18,27202,0,0,20,1,0,0,0,0,0,0,'','Onslaught Raven Priest SAI event 17 require a male character'), +(22,19,27202,0,0,20,1,1,0,0,0,0,0,'','Onslaught Raven Priest SAI event 17 require a female character'); + +DELETE FROM `creature_text` WHERE `entry` IN (27405, 27406); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`, `BroadcastTextId`) VALUES +(27405,0,0,'What''s going on here, sarge?',12,0,100,0,0,0,'Onslaught Footman', 26541), +(27406,0,0,'I don''t know. Better kill them both to be on the safe side!',12,0,100,0,0,0,'Onslaught Footman', 26542); diff --git a/sql/updates/world/2015_06_28_05_world.sql b/sql/updates/world/2015_06_28_05_world.sql new file mode 100644 index 00000000000..b01701a74bd --- /dev/null +++ b/sql/updates/world/2015_06_28_05_world.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2558400) AND `source_type`=9 AND `id`>2; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2558400, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 28, 45775, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,'Inquisitor Salrand - On Script - Remove Aura'), +(2558400, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 21, 30, 0, 0, 0, 0, 0, 0,'Inquisitor Salrand - On Script - Start attack'); diff --git a/sql/updates/world/2015_06_28_06_world.sql b/sql/updates/world/2015_06_28_06_world.sql new file mode 100644 index 00000000000..f8937aaf081 --- /dev/null +++ b/sql/updates/world/2015_06_28_06_world.sql @@ -0,0 +1,13 @@ +-- +DELETE FROM `spell_area` WHERE `spell` IN(46424); +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES +(46424, 4119, 11896, 0, 0, 0, 2, 1, 10, 0), +(46424, 4035, 11896, 0, 0, 0, 2, 1, 10, 0), +(46424, 4146, 11896, 0, 0, 0, 2, 1, 10, 0), +(46424, 4116, 11896, 0, 0, 0, 2, 1, 10, 0), +(46424, 4117, 11896, 0, 0, 0, 2, 1, 10, 0), +(46424, 4037, 11896, 0, 0, 0, 2, 1, 10, 0); + +DELETE FROM `spell_scripts` WHERE `id`=46550; +INSERT INTO `spell_scripts` (`id`, `effIndex`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(46550, 0, 0, 14, 46424, 0, 0, 0, 0, 0, 0); diff --git a/sql/updates/world/2015_06_28_07_world.sql b/sql/updates/world/2015_06_28_07_world.sql new file mode 100644 index 00000000000..20bddf5597c --- /dev/null +++ b/sql/updates/world/2015_06_28_07_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject_template` SET `faction`=1673 WHERE `entry` IN (181597); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5f68b6de320..55d882c65d3 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9616,13 +9616,9 @@ void Player::SendBattlefieldWorldStates() { if (BattlefieldWG* wg = (BattlefieldWG*)sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) { - if (wg->IsWarTime()) - SendUpdateWorldState(ClockWorldState[1], uint32(time(NULL))); - else // Time to next battle - { - uint32 timer = wg->GetTimer() / 1000; - SendUpdateWorldState(ClockWorldState[1], time(NULL) + timer); - } + SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, wg->IsWarTime() ? 0 : 1); + uint32 timer = wg->IsWarTime() ? 0 : (wg->GetTimer() / 1000); // 0 - Time to next battle + SendUpdateWorldState(ClockWorldState[1], uint32(time(NULL) + timer)); } } } diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index afd1f73c785..2aebac6beb4 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -116,7 +116,7 @@ dtPolyRef PathGenerator::GetPathPolyByPosition(dtPolyRef const* polyPath, uint32 } if (distance) - *distance = dtSqrt(minDist3d); + *distance = dtMathSqrtf(minDist3d); return (minDist2d < 3.0f) ? nearestPoly : INVALID_POLYREF; } @@ -799,7 +799,7 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo // Find movement delta. float delta[VERTEX_SIZE]; dtVsub(delta, steerPos, iterPos); - float len = dtSqrt(dtVdot(delta, delta)); + float len = dtMathSqrtf(dtVdot(delta, delta)); // If the steer target is end of path or off-mesh link, do not move past the location. if ((endOfPath || offMeshConnection) && len < SMOOTH_PATH_STEP_SIZE) len = 1.0f; diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index 74f54355af0..137f63a381d 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -456,6 +456,7 @@ public: Initialize(); events.Reset(); DoCast(SPELL_WATER_GLOBULE); + me->SetReactState(REACT_PASSIVE); } void SetData(uint32 id, uint32 data) override @@ -475,11 +476,11 @@ public: switch (id) { case 0: - me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->Clear(); events.ScheduleEvent(EVENT_GLOBULE_MOVE, 500); break; case 1: - me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->Clear(); if (Creature* ichoron = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ICHORON))) me->GetMotionMaster()->MoveFollow(ichoron, 0.0f, 0.0f); break; diff --git a/src/tools/map_extractor/adt.h b/src/tools/map_extractor/adt.h index 9212784ab9e..cad773fbee4 100644 --- a/src/tools/map_extractor/adt.h +++ b/src/tools/map_extractor/adt.h @@ -67,8 +67,8 @@ class adt_MCLQ uint32 fcc; char fcc_txt[4]; }; - uint32 size; public: + uint32 size; float height1; float height2; struct liquid_data{ @@ -96,8 +96,8 @@ class adt_MCNK uint32 fcc; char fcc_txt[4]; }; - uint32 size; public: + uint32 size; uint32 flags; uint32 ix; uint32 iy; @@ -155,8 +155,8 @@ class adt_MCIN uint32 fcc; char fcc_txt[4]; }; - uint32 size; public: + uint32 size; struct adt_CELLS{ uint32 offsMCNK; uint32 size; @@ -271,6 +271,7 @@ class adt_MHDR uint32 fcc; char fcc_txt[4]; }; +public: uint32 size; uint32 pad; @@ -289,7 +290,6 @@ class adt_MHDR uint32 data3; uint32 data4; uint32 data5; -public: bool prepareLoadedData(); adt_MCIN *getMCIN(){ return (adt_MCIN *)((uint8 *)&pad+offsMCIN);} adt_MH2O *getMH2O(){ return offsMH2O ? (adt_MH2O *)((uint8 *)&pad+offsMH2O) : 0;} |
