@@ -116,11 +116,6 @@ void draw_debug_float(int whichNumber, float numberToShow) {
116116
117117void debug_utilities (z64_disp_buf_t * db )
118118{
119-
120- if (!DEBUG_MODE ){
121- return ;
122- }
123-
124119 // Press L to levitate
125120 // Shoutouts to glankk
126121 if (z64_game .common .input [0 ].raw .pad .l ) {
@@ -340,16 +335,14 @@ void draw_debug_menu(z64_disp_buf_t *db) {
340335 menu_category_t * d = & (menu_categories [i ]);
341336 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
342337 if (i != current_menu_indexes .main_index ) {
343- text_print_size (d -> name , left , top , font_width );
338+ text_print_size (db , d -> name , left , top , font_width , font_height );
344339 }
345340 }
346- text_flush_size (db , font_width , font_height , 0 , 0 );
347341
348342 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
349343 menu_category_t * d = & (menu_categories [current_menu_indexes .main_index ]);
350344 int top = start_top + ((icon_size + padding ) * current_menu_indexes .main_index ) + 1 ;
351- text_print_size (d -> name , left , top , font_width );
352- text_flush_size (db , font_width , font_height , 0 , 0 );
345+ text_print_size (db , d -> name , left , top , font_width , font_height );
353346 }
354347 else {
355348 switch (current_menu_indexes .main_index )
@@ -360,16 +353,14 @@ void draw_debug_menu(z64_disp_buf_t *db) {
360353 warp_t * d = & (dungeon_warps [i ]);
361354 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
362355 if (i != current_menu_indexes .dungeon_index ) {
363- text_print_size (d -> name , left , top , font_width );
356+ text_print_size (db , d -> name , left , top , font_width , font_height );
364357 }
365358 }
366- text_flush_size (db , font_width , font_height , 0 , 0 );
367359
368360 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
369361 warp_t * d = & (dungeon_warps [current_menu_indexes .dungeon_index ]);
370362 int top = start_top + ((icon_size + padding ) * current_menu_indexes .dungeon_index ) + 1 ;
371- text_print_size (d -> name , left , top , font_width );
372- text_flush_size (db , font_width , font_height , 0 , 0 );
363+ text_print_size (db , d -> name , left , top , font_width , font_height );
373364 break ;
374365
375366 case 1 : // Overworld
@@ -379,31 +370,27 @@ void draw_debug_menu(z64_disp_buf_t *db) {
379370 warp_t * d = & (overworld_warps [i ]);
380371 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
381372 if (i != current_menu_indexes .overworld_index ) {
382- text_print_size (d -> name , left , top , font_width );
373+ text_print_size (db , d -> name , left , top , font_width , font_height );
383374 }
384375 }
385- text_flush_size (db , font_width , font_height , 0 , 0 );
386376 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
387377 d = & (overworld_warps [current_menu_indexes .overworld_index ]);
388378 top = start_top + ((icon_size + padding ) * current_menu_indexes .overworld_index ) + 1 ;
389- text_print_size (d -> name , left , top , font_width );
390- text_flush_size (db , font_width , font_height , 0 , 0 );
379+ text_print_size (db , d -> name , left , top , font_width , font_height );
391380 }
392381 else {
393382 for (int i = 0 ; i < 9 ; i ++ ) {
394383 warp_t * d = & (overworld_warps [i + 10 ]);
395384 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
396385 if (i + 10 != current_menu_indexes .overworld_index ) {
397- text_print_size (d -> name , left , top , font_width );
386+ text_print_size (db , d -> name , left , top , font_width , font_height );
398387 }
399388 }
400- text_flush_size (db , font_width , font_height , 0 , 0 );
401389
402390 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
403391 d = & (overworld_warps [current_menu_indexes .overworld_index ]);
404392 top = start_top + ((icon_size + padding ) * (current_menu_indexes .overworld_index - 10 )) + 1 ;
405- text_print_size (d -> name , left , top , font_width );
406- text_flush_size (db , font_width , font_height , 0 , 0 );
393+ text_print_size (db , d -> name , left , top , font_width , font_height );
407394 }
408395 break ;
409396 case 2 : // Bosses
@@ -412,16 +399,14 @@ void draw_debug_menu(z64_disp_buf_t *db) {
412399 warp_t * d = & (bosses_warps [i ]);
413400 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
414401 if (i != current_menu_indexes .boss_index ) {
415- text_print_size (d -> name , left , top , font_width );
402+ text_print_size (db , d -> name , left , top , font_width , font_height );
416403 }
417404 }
418- text_flush_size (db , font_width , font_height , 0 , 0 );
419405
420406 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
421407 d = & (bosses_warps [current_menu_indexes .boss_index ]);
422408 top = start_top + ((icon_size + padding ) * current_menu_indexes .boss_index ) + 1 ;
423- text_print_size (d -> name , left , top , font_width );
424- text_flush_size (db , font_width , font_height , 0 , 0 );
409+ text_print_size (db , d -> name , left , top , font_width , font_height );
425410 break ;
426411 case 3 : // Items
427412 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xFF , 0xFF , 0xFF , 0xFF );
@@ -430,48 +415,42 @@ void draw_debug_menu(z64_disp_buf_t *db) {
430415 item_t * dd = & (items_debug [i ]);
431416 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
432417 if (i != current_menu_indexes .item_index ) {
433- text_print_size (dd -> name , left , top , font_width );
418+ text_print_size (db , dd -> name , left , top , font_width , font_height );
434419 }
435420 }
436- text_flush_size (db , font_width , font_height , 0 , 0 );
437421
438422 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
439423 item_t * dd = & (items_debug [current_menu_indexes .item_index ]);
440424 top = start_top + ((icon_size + padding ) * current_menu_indexes .item_index ) + 1 ;
441- text_print_size (dd -> name , left , top , font_width );
442- text_flush_size (db , font_width , font_height , 0 , 0 );
425+ text_print_size (db , dd -> name , left , top , font_width , font_height );
443426 }
444427 if (current_menu_indexes .item_index > 9 && current_menu_indexes .item_index < 20 ) {
445428 for (int i = 0 ; i < 10 ; i ++ ) {
446429 item_t * dd = & (items_debug [i + 10 ]);
447430 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
448431 if (i + 10 != current_menu_indexes .item_index ) {
449- text_print_size (dd -> name , left , top , font_width );
432+ text_print_size (db , dd -> name , left , top , font_width , font_height );
450433 }
451434 }
452- text_flush_size (db , font_width , font_height , 0 , 0 );
453435
454436 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
455437 item_t * dd = & (items_debug [current_menu_indexes .item_index ]);
456438 top = start_top + ((icon_size + padding ) * (current_menu_indexes .item_index - 10 )) + 1 ;
457- text_print_size (dd -> name , left , top , font_width );
458- text_flush_size (db , font_width , font_height , 0 , 0 );
439+ text_print_size (db , dd -> name , left , top , font_width , font_height );
459440 }
460441 if (current_menu_indexes .item_index > 19 && current_menu_indexes .item_index < 28 ) {
461442 for (int i = 0 ; i < 9 ; i ++ ) {
462443 item_t * dd = & (items_debug [i + 20 ]);
463444 int top = start_top + ((icon_size + padding ) * i ) + 1 ;
464445 if (i + 20 != current_menu_indexes .item_index ) {
465- text_print_size (dd -> name , left , top , font_width );
446+ text_print_size (db , dd -> name , left , top , font_width , font_height );
466447 }
467448 }
468- text_flush_size (db , font_width , font_height , 0 , 0 );
469449
470450 gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xE0 , 0xE0 , 0x10 , 0xFF );
471451 item_t * dd = & (items_debug [current_menu_indexes .item_index ]);
472452 top = start_top + ((icon_size + padding ) * (current_menu_indexes .item_index - 20 )) + 1 ;
473- text_print_size (dd -> name , left , top , font_width );
474- text_flush_size (db , font_width , font_height , 0 , 0 );
453+ text_print_size (db , dd -> name , left , top , font_width , font_height );
475454 }
476455 break ;
477456 default :
@@ -506,8 +485,7 @@ int draw_int_helper(z64_disp_buf_t *db, int32_t number, int16_t left, int16_t to
506485 // Set the color
507486 gDPSetPrimColor (db -> p ++ , 0 , 0 , color .r , color .g , color .b , color .a );
508487 if (isNegative ) {
509- text_print_size ("-" , left - rupee_digit_sprite .tile_w , top , 8 );
510- text_flush_size (db , 8 , 16 , 0 , 0 );
488+ text_print_size (db , "-" , left - rupee_digit_sprite .tile_w , top , 8 , 16 );
511489 }
512490 // Draw each digit
513491 for (uint8_t c = j ; c > 0 ; c -- ) {
@@ -575,8 +553,7 @@ void draw_debug_numbers(z64_disp_buf_t *db) {
575553
576554 colorRGBA8_t color = { debug_text_color .r , debug_text_color .g , debug_text_color .b , 0xFF };
577555 int numberDigit = draw_int_helper (db , entireValue , debug_text_x_placement , height + offsetY , color );
578- text_print_size ("." , debug_text_x_placement + numberDigit * rupee_digit_sprite .tile_w , height + offsetY , rupee_digit_sprite .tile_w );
579- text_flush_size (db , rupee_digit_sprite .tile_w , rupee_digit_sprite .tile_h , 0 , 0 );
556+ text_print_size (db , "." , debug_text_x_placement + numberDigit * rupee_digit_sprite .tile_w , height + offsetY , rupee_digit_sprite .tile_w , rupee_digit_sprite .tile_h );
580557 draw_int_helper (db , decimalValue , debug_text_x_placement + numberDigit * rupee_digit_sprite .tile_w + font_sprite .tile_w ,
581558 height + offsetY , color );
582559 }
0 commit comments