summaryrefslogtreecommitdiffstats
path: root/src/core/Debug.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-23 22:25:18 +0200
committeraap <aap@papnet.eu>2020-04-24 11:42:38 +0200
commitf03b4eec4c37eab75a5bd639279cfcc615105b01 (patch)
treec4be4fa57b16c61d45e8156a51dd07b11e049bba /src/core/Debug.cpp
parentMerge branch 'master' of github.com:gtamodding/re3 (diff)
downloadre3-f03b4eec4c37eab75a5bd639279cfcc615105b01.tar
re3-f03b4eec4c37eab75a5bd639279cfcc615105b01.tar.gz
re3-f03b4eec4c37eab75a5bd639279cfcc615105b01.tar.bz2
re3-f03b4eec4c37eab75a5bd639279cfcc615105b01.tar.lz
re3-f03b4eec4c37eab75a5bd639279cfcc615105b01.tar.xz
re3-f03b4eec4c37eab75a5bd639279cfcc615105b01.tar.zst
re3-f03b4eec4c37eab75a5bd639279cfcc615105b01.zip
Diffstat (limited to 'src/core/Debug.cpp')
-rw-r--r--src/core/Debug.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/core/Debug.cpp b/src/core/Debug.cpp
index 917c99ab..e794dcaf 100644
--- a/src/core/Debug.cpp
+++ b/src/core/Debug.cpp
@@ -1,5 +1,7 @@
#include "common.h"
+#include "RwHelper.h"
#include "Debug.h"
+#include "Lines.h"
#include "Font.h"
#include "main.h"
#include "Text.h"
@@ -114,11 +116,14 @@ CDebug::DisplayScreenStrings()
CFont::SetFontStyle(FONT_BANK);
for(i = 0; i < ms_nScreenStrs; i++){
+/*
AsciiToUnicode(ms_aScreenStrs[i].str, gUString);
CFont::SetColor(CRGBA(0, 0, 0, 255));
CFont::PrintString(ms_aScreenStrs[i].x, ms_aScreenStrs[i].y, gUString);
CFont::SetColor(CRGBA(255, 255, 255, 255));
CFont::PrintString(ms_aScreenStrs[i].x+1, ms_aScreenStrs[i].y+1, gUString);
+*/
+ ObrsPrintfString(ms_aScreenStrs[i].str, ms_aScreenStrs[i].x, ms_aScreenStrs[i].y);
}
CFont::DrawFonts();
@@ -131,7 +136,35 @@ CDebug::PrintAt(const char *str, int x, int y)
if(ms_nScreenStrs >= MAX_SCREEN_STRS)
return;
strncpy(ms_aScreenStrs[ms_nScreenStrs].str, str, 256);
- ms_aScreenStrs[ms_nScreenStrs].x = x*12;
- ms_aScreenStrs[ms_nScreenStrs].y = y*22;
+ ms_aScreenStrs[ms_nScreenStrs].x = x;//*12;
+ ms_aScreenStrs[ms_nScreenStrs].y = y;//*22;
ms_nScreenStrs++;
}
+
+CDebug::Line CDebug::ms_aLines[MAX_DEBUG_LINES];
+int CDebug::ms_nLines;
+
+void
+CDebug::AddLine(CVector p1, CVector p2, uint32 c1, uint32 c2)
+{
+ if(ms_nLines >= MAX_DEBUG_LINES)
+ return;
+ ms_aLines[ms_nLines].p1 = p1;
+ ms_aLines[ms_nLines].p2 = p2;
+ ms_aLines[ms_nLines].c1 = c1;
+ ms_aLines[ms_nLines].c2 = c2;
+ ms_nLines++;
+}
+
+void
+CDebug::DrawLines(void)
+{
+ int i;
+ RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
+ RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
+ for(i = 0; i < ms_nLines; i++){
+ Line *l = &ms_aLines[i];
+ CLines::RenderLineWithClipping(l->p1.x, l->p1.y, l->p1.z, l->p2.x, l->p2.y, l->p2.z, l->c1, l->c2);
+ }
+ ms_nLines = 0;
+}