Code cleanup, attempt at semitransparent shield

This commit is contained in:
Lucas S. Vieira 2024-11-12 19:42:33 -03:00
parent 014d3245dc
commit 1036c63bca
3 changed files with 4 additions and 4 deletions

View file

@ -66,20 +66,17 @@ load_object_table(const char *filename, ObjectTable *tbl)
entry->num_animations = get_short_be(bytes, &b);
if(entry->num_animations > 0) {
printf("Start reading animations...\n");
entry->animations = alloc_arena_malloc(
&_level_arena,
sizeof(ObjectAnim) * entry->num_animations);
for(uint16_t j = 0; j < entry->num_animations; j++) {
printf("Reading animation %d.\n", j);
ObjectAnim *animation = &entry->animations[j];
_load_animation(animation, bytes, &b);
}
}
if(has_fragment) {
printf("Start reading fragment...\n");
ObjectFrag *fragment = alloc_arena_malloc(
&_level_arena,
sizeof(ObjectFrag));
@ -93,7 +90,6 @@ load_object_table(const char *filename, ObjectTable *tbl)
sizeof(ObjectAnim) * fragment->num_animations);
for(uint16_t j = 0; j < fragment->num_animations; j++) {
printf("Reading fragment animation %d.\n", j);
ObjectAnim *animation = &fragment->animations[j];
_load_animation(animation, bytes, &b);
}

View file

@ -275,6 +275,8 @@ begin_render_routine:
poly->tpage = getTPage(1, 0, 576, 0);
poly->clut = getClut(0, 481);
setSemiTrans(poly, state->id == OBJ_SHIELD ? 1 : 0);
sort_prim(poly,
((state->id == OBJ_RING) || (state->id == OBJ_SHIELD))
? OTZ_LAYER_OBJECTS

View file

@ -8,6 +8,7 @@
#include "input.h"
#include "sound.h"
#include "util.h"
#include "timer.h"
extern int debug_mode;
@ -124,6 +125,7 @@ static const char *creditstxt[] = {
"The Spriters Resource",
"Schnappy",
"Lameguy64",
"spicyjpeg",
"\r",
"Thanks for Playing",