-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathraster_geometry.h
More file actions
39 lines (31 loc) · 864 Bytes
/
raster_geometry.h
File metadata and controls
39 lines (31 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef RASTER_GEOMETRY_H
#define RASTER_GEOMETRY_H
#include <tonc.h>
#include <inttypes.h>
#include "math.h"
typedef enum PolygonShadingType {
SHADING_FLAT_LIGHTING,
SHADING_FLAT,
SHADING_WIREFRAME
} PolygonShadingType;
/*
We use RASTER_POINT_NEAR_FAR_CULL as a special value for x and y when the raster point is behind the near plane or beyond the far plane.
*/
#define RASTER_POINT_NEAR_FAR_CULL INT16_MAX
typedef struct RasterPoint {
s16 x, y;
} ALIGN4 RasterPoint;
typedef struct RasterTriangle {
RasterPoint vert[3];
FIXED centroidZ;
COLOR color;
PolygonShadingType shading;
struct RasterTriangle* next; // For our ordering table in draw.c
} ALIGN4 RasterTriangle;
typedef struct Triangle {
Vec3 vert[3];
FIXED centroidZ;
COLOR color;
PolygonShadingType shading;
} ALIGN4 Triangle;
#endif