-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm_line.h
107 lines (91 loc) · 1.9 KB
/
m_line.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//
// line.h
// de
//
// Created by Thomas Foster on 6/27/23.
//
#ifndef line_h
#define line_h
#include "common.h"
#include "next.h"
#include <stdbool.h>
typedef enum
{
VISIBILITY_NONE,
VISIBILITY_PARTIAL,
VISIBILITY_FULL
} Visibility;
typedef enum
{
LINE_BLOCKS_ALL,
LINE_BLOCKS_MONSTERS,
LINE_TWO_SIDED,
LINE_TOP_UNPEGGED,
LINE_BOTTOM_UNPEGGED,
LINE_SECRET,
LINE_BLOCKS_SOUND,
LINE_DONT_DRAW,
LINE_ALWAYS_DRAW,
LINE_SPECIAL,
LINE_TAG,
LINE_OFFSET_X,
LINE_OFFSET_Y,
LINE_BOTTOM_TEXTURE,
LINE_MIDDLE_TEXTURE,
LINE_TOP_TEXTURE,
LINE_SIDE_SELECTION,
} LineProperty;
typedef enum
{
SIDE_FRONT,
SIDE_BACK,
NUM_SIDES
} Side;
typedef struct
{
int floorHeight;
int ceilingHeight;
char floorFlat[9];
char ceilingFlat[9];
int lightLevel;
int special;
int tag;
} SectorDef;
typedef struct
{
int offsetX;
int offsetY;
char bottom[9];
char middle[9];
char top[9];
SectorDef sectorDef;
int sectorNum; // Used by the node builder.
} Sidedef;
typedef struct
{
NXPoint p1, p2; // Only used by node builder.
int v1; // The index in map.vertices
int v2; // The index in map.vertices
int flags;
int special;
int tag;
Sidedef sides[2];
enum
{
DESELECTED,
FRONT_SELECTED,
BACK_SELECTED,
} selected;
bool deleted;
// Which side should be shown when opening the line panel.
bool panelBackSelected;
} Line;
void InitLineCross(void);
SDL_FPoint LineMidpoint(const Line * line);
float LineLength(const Line * line);
SDL_FPoint LineNormal(const Line * line, float length);
void GetLinePoints(int index, SDL_Point * p1, SDL_Point * p2);
Sidedef * SelectedSide(Line * line);
void ClipLine(int lineIndex, SDL_Point * out1, SDL_Point * out2);
Visibility LineVisibility(int index);
#endif /* line_h */