Skip to content

Commit

Permalink
A couple of fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberium committed Sep 12, 2023
1 parent 242aaf1 commit da47d5b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions contrib/RecastDemoMod/Include/Sample_CMangos.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,27 +232,27 @@ class Sample_CMangos : public Sample
Sample_CMangos();
virtual ~Sample_CMangos();
void UpdateVisibleTile(int tx, int ty);
virtual void handleSettings();
virtual void handleSettings() override;
void handleExtraSettings(bool shiftPressed, bool ctrlPressed) override;
void BuildSettingsDialogs();
bool handleDialogs() override;
bool toggleMapDialog() override { m_showMapDialog = !m_showMapDialog; return false; }
bool canHandleDialogs() override { return true; }
void handleTools();
void handleDebugMode();
void handleRender(float* camPos, int mTx, int mTy);
void handleRenderOverlay(double* proj, double* model, int* view, float* camPos);
void handleMeshChanged(class InputGeom* geom);
bool handleBuild();
void collectSettings(struct BuildSettings& settings);
void handleTools() override;
void handleDebugMode() override;
void handleRender(float* camPos, int mTx, int mTy) override;
void handleRenderOverlay(double* proj, double* model, int* view, float* camPos) override;
void handleMeshChanged(class InputGeom* geom) override;
bool handleBuild() override;
void collectSettings(struct BuildSettings& settings) override;
void WaitForFreeWorker();
void ScanSupportedFiles(std::vector<std::string>& filelist) override;
bool handleGeom(InputGeom*& geom) override;
static bool GetMapAttributes(std::filesystem::path const& fileName, int& mapId, std::pair<int, int>& tileXY);
static bool GetVMapAttributes(std::filesystem::path const& fileName, int& mapId, std::pair<int, int>& tileXY);
static bool GetVMTreeAttributes(std::filesystem::path const& fileName, int& mapId);
bool GetMMapAttributes(std::filesystem::path const& fileName, int& mapId, std::pair<int, int>& tileXY, int& alternateId);
bool handleCustomClick(int tx, int ty, float const* rs, float const* re, bool ctrl, bool shift);
bool handleCustomClick(int tx, int ty, float const* rs, float const* re, bool ctrl, bool shift) override;

void getTilePos(const float* pos, int& tx, int& ty);

Expand Down
8 changes: 4 additions & 4 deletions contrib/RecastDemoMod/Source/Sample_CMangos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,9 @@ bool Sample_CMangos::handleDialogs()
if (loadedItr != m_loadedTiles.end())
continue;
if (tInfo.alternate > 0)
snprintf(msg, sizeof(msg), "[%d, %d] - %d\0", tInfo.tileXY.first, tInfo.tileXY.second, tInfo.alternate);
snprintf(msg, sizeof(msg), "[%d, %d] - %d", tInfo.tileXY.first, tInfo.tileXY.second, tInfo.alternate);
else
snprintf(msg, sizeof(msg), "[%d, %d]\0", tInfo.tileXY.first, tInfo.tileXY.second);
snprintf(msg, sizeof(msg), "[%d, %d]", tInfo.tileXY.first, tInfo.tileXY.second);
if (imguiItem(msg, m_scanFinished))
{
m_showTileSelectionWindows = false;
Expand Down Expand Up @@ -1450,7 +1450,7 @@ void Sample_CMangos::CreateTransportInfo()
scanDirectoryAppend("vmaps", ".vmo", wmoFiles);
for (auto const& file : wmoFiles)
{
auto& trItr = nameToKeyIndex.find(file);
auto const& trItr = nameToKeyIndex.find(file);
if (trItr == nameToKeyIndex.end())
continue;

Expand Down Expand Up @@ -1588,7 +1588,7 @@ bool Sample_CMangos::LoadMapGeom(InputGeom*& geom, FileMapData& mInfo)
{
std::ostringstream buff;
buff << std::setfill('0') << std::setw(4) << mInfo.id;
auto& trInfo = TransportFileNameMap.find(buff.str().c_str());
auto const& trInfo = TransportFileNameMap.find(buff.str().c_str());
if (trInfo != TransportFileNameMap.end())
{
geom->LoadTransport(m_ctx, trInfo->first, trInfo->second);
Expand Down
2 changes: 1 addition & 1 deletion contrib/recastdemomod/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ int main(int /*argc*/, char** /*argv*/)
snprintf(text, 64, "Position [%5.3f, %5.3f, %5.3f] current tile[%d, %d]", cameraPos[0], cameraPos[1], cameraPos[2], tileY, tileX);
imguiDrawText(width - 650, height - 20, IMGUI_ALIGN_LEFT, text, imguiRGBA(255, 255, 255, 128));
char sFPS[10];
snprintf(sFPS, 10, "FPS: %i\0", currFPS);
snprintf(sFPS, 10, "FPS: %i", currFPS);
imguiDrawText(width / 2, height - 13, IMGUI_ALIGN_LEFT, sFPS, imguiRGBA(255, 255, 255, 128));
}

Expand Down

0 comments on commit da47d5b

Please sign in to comment.