Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
GetIconBrightnessForAngle.inc.c
Go to the documentation of this file.
1#include "common.h"
2
3// determines the 'brightness' of inspect and speech bubble icons as a function of angle,
4// making them appear more three-dimensional.
5s32 N(GetIconBrightnessForAngle)(f32 angle) {
6 s32 angleDiff;
7
8 if (angle >= 270.0f) {
9 angleDiff = 360.0f - angle;
10 } else if (angle >= 180.0f) {
11 angleDiff = angle - 180.0f;
12 } else if (angle >= 90.0f) {
13 angleDiff = 180.0f - angle;
14 } else {
15 angleDiff = angle;
16 }
17 return 0xFF - angleDiff - angleDiff;
18}
s32 N GetIconBrightnessForAngle(f32 angle)