Skip to content

Port Recast Demo mod to linux #741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LeFroid
Copy link

@LeFroid LeFroid commented May 16, 2025

🍰 Pullrequest

This PR will allow linux users to test the recast demo mod

Proof

  • Shared some screenshots in Discord, can provide other proof as needed

Issues

  • Couldn't build previously, was disabled in CMake

How2Test

  • Run cmake with build flag -DBUILD_RECASTDEMOMOD=ON
  • make -jX install
  • cd into install folder/bin/tools and run ./RecastDemoMod --dataDir <path to maps,mmaps,vmaps>

Todo / Checklist

  • Test build again on Windows
  • Test on another linux machine

@@ -55,10 +102,15 @@ void scanDirectory(const char* path, const char* ext, FileList& list)
while ((current = readdir(dp)) != 0)
{
int len = strlen(current->d_name);
if (len > 4 && strncmp(current->d_name+len-4, ext, 4) == 0) // TODO:: may not work due to joker(*) added
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change stands out to me, what is its purpose, and have you validated it works on windows

Copy link
Author

@LeFroid LeFroid May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is under a platform-specific block for *nix, so it shouldn't have an impact.
In CMaNGOS_Map::ScanFoldersForMaps, this function is called like this:
scanDirectory(m_ctx->getMapFolder(), "*.map", m_MapFiles);
The issue is that we are doing a string comparison on the file suffix (ex: "0011246.map" -> ".map") and a pattern ("*.map"). Needed to offset pattern by 1 to compare ".map" to ".map" instead of "*.map"

Separately, added an else condition for more complicated pattern matching inside CMaNGOS_Map::scanFoldersForTiles() where we need to load tiles where the file has both prefix and suffix (ex: "001*.mmtile")

@killerwife
Copy link
Contributor

I will test on windows, but likely not before sunday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants