aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/psxgpu
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2023-07-03 08:13:23 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2023-07-03 08:13:23 +0200
commit06e65bea3a778b2dae5af77a7935ae3868ddd4d3 (patch)
tree3af954ebead7540c9478d0a026ca2e59f3cf7b64 /libpsn00b/psxgpu
parent472cf1c254ea5be5aff8a6c7067cbed2d467d85b (diff)
downloadpsn00bsdk-06e65bea3a778b2dae5af77a7935ae3868ddd4d3.tar.gz
Fix setjmp.h, FntSort(), examples, rewrite system/timer
Diffstat (limited to 'libpsn00b/psxgpu')
-rw-r--r--libpsn00b/psxgpu/font.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/libpsn00b/psxgpu/font.c b/libpsn00b/psxgpu/font.c
index ce45874..020015e 100644
--- a/libpsn00b/psxgpu/font.c
+++ b/libpsn00b/psxgpu/font.c
@@ -194,7 +194,7 @@ void *FntFlush(int id) {
break;
}
- i = toupper( *text )-32;
+ i = toupper( *text ) - ' ';
if( i > 0 ) {
@@ -236,11 +236,22 @@ void *FntSort(uint32_t *ot, void *pri, int x, int y, const char *text) {
DR_TPAGE *tpage;
SPRT_8 *sprt = (SPRT_8*)pri;
- int i;
+ int i, sx, sy;
+
+ sx = x;
+ sy = y;
while( *text != 0 ) {
- i = toupper( *text )-32;
+ if (*text == '\n') {
+ sx = x;
+ sy += 8;
+ text++;
+
+ continue;
+ }
+
+ i = toupper( *text ) - ' ';
if( i > 0 ) {
@@ -248,7 +259,7 @@ void *FntSort(uint32_t *ot, void *pri, int x, int y, const char *text) {
setSprt8(sprt);
setShadeTex(sprt, 1);
setSemiTrans(sprt, 1);
- setXY0(sprt, x, y);
+ setXY0(sprt, sx, sy);
setUV0(sprt, (i % 16) * 8, (i / 16) * 8);
sprt->clut = _font_clut;
addPrim(ot, sprt);
@@ -256,7 +267,7 @@ void *FntSort(uint32_t *ot, void *pri, int x, int y, const char *text) {
}
- x += 8;
+ sx += 8;
text++;
}