This commit is contained in:
PeachyPeachSM64 2026-05-23 12:49:28 +02:00
parent 2d6848a768
commit 22dbda6007
3 changed files with 14 additions and 8 deletions

View file

@ -645,7 +645,6 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32
f32 diff = (surf->prevVertex1[0] - x1) * (surf->prevVertex1[0] - x1);
diff += (surf->prevVertex1[1] - surf->vertex1[1]) * (surf->prevVertex1[1] - surf->vertex1[1]);
diff += (surf->prevVertex1[2] - z1) * (surf->prevVertex1[2] - z1);
//printf("%f\n", sqrtf(diff));
if (diff > 10000) {
interpolate = FALSE;
} else {

View file

@ -3,6 +3,7 @@
#include "pc/ini.h"
#include "pc/mods/mods.h"
#include "pc/mods/mods_utils.h"
#include "pc/debuglog.h"
#include "player_palette.h"
const struct PlayerPalette DEFAULT_MARIO_PALETTE =
@ -118,7 +119,7 @@ void player_palettes_read(const char* palettesPath, bool appendPalettes) {
if (!player_palette_init(palettesPath, path, appendPalettes)) {
#ifdef DEVELOPMENT
printf("Failed to load palette '%s.ini'\n", path);
LOG_ERROR("Failed to load palette '%s.ini'", path);
#endif
continue;
}
@ -140,7 +141,7 @@ void player_palettes_read(const char* palettesPath, bool appendPalettes) {
gPresetPalettes[gPresetPaletteCount].palette = palette;
gPresetPaletteCount++;
#ifdef DEVELOPMENT
printf("Loaded palette '%s.ini'\n", path);
LOG_INFO("Loaded palette '%s.ini'", path);
#endif
if (gPresetPaletteCount >= MAX_PRESET_PALETTES) { break; }
}
@ -160,8 +161,12 @@ void player_palette_export(char* name) {
snprintf(ppath, SYS_MAX_PATH, "%s/%s.ini", palettesPath, name);
fs_sys_mkdir(palettesPath);
printf("Saving palette as '%s.ini'\n", name);
FILE* file = fopen(ppath, "w");
if (!file) {
LOG_ERROR("Unable to create file '%s.ini'!", name);
return;
}
fprintf(file, "[PALETTE]\n\
PANTS_R = %d\n\
PANTS_G = %d\n\
@ -212,6 +217,8 @@ EMBLEM_B = %d\n",
configPlayerPalette.parts[EMBLEM][1],
configPlayerPalette.parts[EMBLEM][2]);
fclose(file);
LOG_INFO("Saving palette as '%s.ini'", name);
}
bool player_palette_delete(const char* palettesPath, char* name, bool appendPalettes) {
@ -224,7 +231,7 @@ bool player_palette_delete(const char* palettesPath, char* name, bool appendPale
}
if (remove(ppath) == 0) {
printf("Deleting palette '%s.ini'\n", name);
LOG_INFO("Deleting palette '%s.ini'", name);
return true;
}
return false;

View file

@ -85,7 +85,7 @@ struct Object *try_allocate_object(struct ObjectNode *destList, struct ObjectNod
struct ObjectNode *nextObj = NULL;
if (destList == NULL || freeList == NULL) {
fprintf(stderr, "FATAL ERROR: Failed to try and allocate a object because either the destList %p or freeList %p was NULL!\n", destList, freeList);
LOG_ERROR("Failed to try and allocate a object because either the destList %p or freeList %p was NULL!", destList, freeList);
return NULL;
}
@ -99,7 +99,7 @@ struct Object *try_allocate_object(struct ObjectNode *destList, struct ObjectNod
if (destList->prev != NULL) {
destList->prev->next = nextObj;
} else {
fprintf(stderr, "ERROR: The previous object in the destination list %p was NULL! Unexpected errors may occur.\n", destList);
LOG_ERROR("The previous object in the destination list %p was NULL! Unexpected errors may occur.", destList);
}
destList->prev = nextObj;
} else {
@ -383,7 +383,7 @@ struct Object *create_object(const BehaviorScript *bhvScript) {
}
if (objListIndex >= NUM_OBJ_LISTS) {
fprintf(stderr, "Failed to create object with non-existent object list index %i with behavior script %p.\n", objListIndex, bhvScript);
LOG_ERROR("Failed to create object with non-existent object list index %i with behavior script %p.", objListIndex, bhvScript);
return NULL;
}