Skip to content

Commit

Permalink
Move collision viewer draw to hook and fix empty nametags (HarbourMas…
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez authored Nov 6, 2024
1 parent 894d3c0 commit dabd0c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
13 changes: 8 additions & 5 deletions soh/soh/Enhancements/debugger/colViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <libultraship/bridge.h>
#include <libultraship/libultraship.h>
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"

extern "C" {
#include <z64.h>
Expand Down Expand Up @@ -276,11 +277,6 @@ void CreateSphereData() {
sphereGfx.push_back(gsSPEndDisplayList());
}

void ColViewerWindow::InitElement() {
CreateCylinderData();
CreateSphereData();
}

// Initializes the display list for a ColRenderSetting
void InitGfx(std::vector<Gfx>& gfx, ColRenderSetting setting) {
uint32_t rm;
Expand Down Expand Up @@ -689,3 +685,10 @@ extern "C" void DrawColViewer() {

CLOSE_DISPS(gPlayState->state.gfxCtx);
}

void ColViewerWindow::InitElement() {
CreateCylinderData();
CreateSphereData();

GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayDrawEnd>(DrawColViewer);
}
2 changes: 1 addition & 1 deletion soh/soh/Enhancements/nametag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extern "C" void NameTag_RegisterForActorWithOptions(Actor* actor, const char* te
processedText.erase(std::remove_if(processedText.begin(), processedText.end(), [](const char& c) {
// 172 is max supported texture for the in-game font system,
// and filter anything less than a space but not the newline or nul characters
return c > (s8)172 || (c < ' ' && c != '\n' && c != '\0');
return (unsigned char)c > 172 || (c < ' ' && c != '\n' && c != '\0');
}), processedText.end());

int16_t numChar = processedText.length();
Expand Down
1 change: 0 additions & 1 deletion soh/src/code/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {

GameState_ReqPadData(gameState);
GameState_Update(gameState);
DrawColViewer();

OPEN_DISPS(gfxCtx);

Expand Down

0 comments on commit dabd0c2

Please sign in to comment.