mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-27 06:50:35 +00:00
85d0ad5054
This is a pretty big function, and I'll admit that my code for it is pretty low quality. But it matches. Scratch is here if you'd like to make improvements: https://decomp.me/scratch/xok2Z A lot of the things that I tried to remove the gotos and temp variables didn't work. The entity extension for this uses f32 variables. Those are defined in `game.h`, but `game.h` is not accessible to `entity.h`, so I moved the definition of f32 to `types.h` which is accessible in all places and overall seems like a better place for it anyway.
46 lines
848 B
C
46 lines
848 B
C
#ifndef TYPES_H
|
|
#define TYPES_H
|
|
|
|
#ifndef VERSION_PC
|
|
typedef char int8_t;
|
|
typedef short int16_t;
|
|
typedef int int32_t;
|
|
typedef long long int64_t;
|
|
typedef unsigned char uint8_t;
|
|
typedef unsigned short uint16_t;
|
|
typedef unsigned int uint32_t;
|
|
typedef unsigned long long uint64_t;
|
|
typedef unsigned char u_char;
|
|
typedef unsigned short u_short;
|
|
typedef unsigned int u_long;
|
|
typedef unsigned int size_t;
|
|
#else
|
|
#include <sys/types.h>
|
|
#endif
|
|
|
|
typedef signed char s8;
|
|
typedef signed short s16;
|
|
typedef signed int s32;
|
|
typedef signed long long s64;
|
|
typedef unsigned char u8;
|
|
typedef unsigned short u16;
|
|
typedef unsigned int u32;
|
|
typedef unsigned long long u64;
|
|
|
|
typedef signed char byte;
|
|
typedef enum { false, true } bool;
|
|
|
|
#ifndef NULL
|
|
#define NULL (0)
|
|
#endif
|
|
|
|
typedef union {
|
|
s32 val;
|
|
struct {
|
|
s16 lo;
|
|
s16 hi;
|
|
} i;
|
|
} f32;
|
|
|
|
#endif
|