Skip to content

Commit

Permalink
3rd party refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nem0 committed Sep 23, 2024
1 parent 3839337 commit d2dacaa
Show file tree
Hide file tree
Showing 34 changed files with 15,417 additions and 636 deletions.
12 changes: 12 additions & 0 deletions docs/3rdparty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
On Windows all 3rd party libraries are vendored in the LumixEngine repository, either as a binary, or in form of a source code. Everything should work out of the box.

## Recast

We utilize [Recast & Detour](https://github.com/recastnavigation/recastnavigation) for navigation purposes. The source code for Recast is included in our repository under [external/recast/src](../external/recast/src). To update Recast, you can run the provided [batch script](../scripts/download_deploy_recast.bat) which will download the latest version and copy it to the appropriate directory. Recast is included as a [unity build](https://en.wikipedia.org/wiki/Unity_build). Recast is build as a part of *navigation* plugin.

## FreeType2

We utilize [FreeType2](https://github.com/nem0/freetype2.git) for text rendering. On Windows, prebuilt library is included in [external/freetype/lib/win](../external/freetype/lib/win/) and is used by default. If you want to build FreeType from source code, use following steps:
1. Run [download_freetype.bat](../scripts/download_freetype.bat) to download FreeType source code.
2. Regenerate project using *GENie*.
3. Build project.
File renamed without changes.
223 changes: 0 additions & 223 deletions external/recast/include/DebugDraw.h

This file was deleted.

48 changes: 0 additions & 48 deletions external/recast/include/DetourDebugDraw.h

This file was deleted.

42 changes: 0 additions & 42 deletions external/recast/include/RecastDebugDraw.h

This file was deleted.

Binary file removed external/recast/lib/win64_vs2017/release/recast.lib
Binary file not shown.
Binary file removed external/recast/lib/win64_vs2017/release/recast.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,35 @@
// 3. This notice may not be removed or altered from any source distribution.
//

#ifndef RECAST_DUMP_H
#define RECAST_DUMP_H
#include <stdlib.h>
#include "DetourAlloc.h"

struct duFileIO
static void *dtAllocDefault(size_t size, dtAllocHint)
{
virtual ~duFileIO() = 0;
virtual bool isWriting() const = 0;
virtual bool isReading() const = 0;
virtual bool write(const void* ptr, const size_t size) = 0;
virtual bool read(void* ptr, const size_t size) = 0;
};
return malloc(size);
}

bool duDumpPolyMeshToObj(struct rcPolyMesh& pmesh, duFileIO* io);
bool duDumpPolyMeshDetailToObj(struct rcPolyMeshDetail& dmesh, duFileIO* io);

bool duDumpContourSet(struct rcContourSet& cset, duFileIO* io);
bool duReadContourSet(struct rcContourSet& cset, duFileIO* io);
static void dtFreeDefault(void *ptr)
{
free(ptr);
}

bool duDumpCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io);
bool duReadCompactHeightfield(struct rcCompactHeightfield& chf, duFileIO* io);
static dtAllocFunc* sAllocFunc = dtAllocDefault;
static dtFreeFunc* sFreeFunc = dtFreeDefault;

void duLogBuildTimes(rcContext& ctx, const int totalTileUsec);
void dtAllocSetCustom(dtAllocFunc *allocFunc, dtFreeFunc *freeFunc)
{
sAllocFunc = allocFunc ? allocFunc : dtAllocDefault;
sFreeFunc = freeFunc ? freeFunc : dtFreeDefault;
}

void* dtAlloc(size_t size, dtAllocHint hint)
{
return sAllocFunc(size, hint);
}

#endif // RECAST_DUMP_H
void dtFree(void* ptr)
{
if (ptr)
sFreeFunc(ptr);
}
Loading

0 comments on commit d2dacaa

Please sign in to comment.