Skip to content

Commit

Permalink
Fixing stable Linux!
Browse files Browse the repository at this point in the history
Also makes it run nice on a raspberry pi 3
  • Loading branch information
atsb committed Nov 11, 2022
1 parent b13af9f commit 3182813
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
26 changes: 17 additions & 9 deletions src/engine/doomdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,23 @@ enum {
ML_MACROS // Linedef macros, from editing
};

#ifdef _MSC_VER
#pragma pack(push, 1)
#endif

// A single Vertex.
typedef struct {
fixed_t x;
fixed_t y;
} mapvertex_t;
} PACKEDATTR mapvertex_t;

typedef struct {
byte r;
byte g;
byte b;
byte a;
int16_t tag;
} maplights_t;
} PACKEDATTR maplights_t;

// A SideDef, defining the visual appearance of a wall,
// by setting textures and offsets.
Expand All @@ -79,7 +83,7 @@ typedef struct {
word bottomtexture;
word midtexture;
int16_t sector; // Front sector, towards viewer.
} mapsidedef_t;
} PACKEDATTR mapsidedef_t;

// A LineDef, as used for editing, and as input
// to the BSP builder.
Expand All @@ -95,7 +99,7 @@ typedef struct {
// sidenum[1] will be -1 (NO_INDEX) if one sided
//
word sidenum[2]; // sidenum[1] will be -1 if one sided
} maplinedef_t;
} PACKEDATTR maplinedef_t;

#define NO_SIDE_INDEX ((word)-1)

Expand Down Expand Up @@ -177,7 +181,7 @@ typedef struct {
int16_t special;
int16_t tag;
word flags;
} mapsector_t;
} PACKEDATTR mapsector_t;

//
// Sector Flags
Expand All @@ -204,7 +208,7 @@ typedef struct {
typedef struct {
word numsegs;
word firstseg; // Index of first one, segs are stored sequentially.
} mapsubsector_t;
} PACKEDATTR mapsubsector_t;

// LineSeg, generated by splitting LineDefs
// using partition lines selected by BSP builder.
Expand All @@ -215,7 +219,7 @@ typedef struct {
word linedef;
int16_t side;
int16_t offset;
} mapseg_t;
} PACKEDATTR mapseg_t;

// BSP node structure.

Expand All @@ -236,7 +240,7 @@ typedef struct {
// If NF_SUBSECTOR its a subsector,
// else it's a node of another subtree.
word children[2];
} mapnode_t;
} PACKEDATTR mapnode_t;

// Thing definition, position, orientation and type,
// plus skill/visibility flags and attributes.
Expand All @@ -248,6 +252,10 @@ typedef struct {
int16_t type;
int16_t options;
int16_t tid;
} mapthing_t;
} PACKEDATTR mapthing_t;

#ifdef _MSC_VER
#pragma pack(pop)
#endif

#endif // __DOOMDATA__
15 changes: 9 additions & 6 deletions src/engine/gl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ GL_EXT_compiled_vertex_array_Define();
//GL_EXT_multi_draw_arrays_Define();
//GL_EXT_fog_coord_Define();
//GL_ARB_vertex_buffer_object_Define();
GL_ARB_texture_non_power_of_two_Define();
GL_ARB_texture_env_combine_Define();
GL_EXT_texture_env_combine_Define();
GL_EXT_texture_filter_anisotropic_Define();
Expand All @@ -110,12 +109,12 @@ GL_EXT_texture_filter_anisotropic_Define();
//

static dboolean FindExtension(const int8_t* ext) {
const byte* extensions = NULL;
const byte* start;
byte* where, * terminator;
const int8_t* extensions = NULL;
const int8_t* start;
const int8_t* where, * terminator;

// Extension names should not have spaces.
where = (byte*)dstrrchr((int8_t*)ext, ' ');
where = strrchr(ext, ' ');
if (where || *ext == '\0') {
return 0;
}
Expand All @@ -124,7 +123,7 @@ static dboolean FindExtension(const int8_t* ext) {

start = extensions;
for (;;) {
where = (byte*)strstr(start, ext);
where = strstr(start, ext);
if (!where) {
break;
}
Expand Down Expand Up @@ -326,6 +325,10 @@ void GL_SetTextureFilter(void) {
//

void GL_SetDefaultCombiner(void) {
if (!usingGL) {
return;
}

if (has_GL_ARB_multitexture) {
GL_SetTextureUnit(1, false);
GL_SetTextureUnit(2, false);
Expand Down
3 changes: 2 additions & 1 deletion src/engine/p_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ dboolean P_TryMove(mobj_t* thing, fixed_t x, fixed_t y) {
}
}
}
numspechit = 0;

return true;
}
Expand Down Expand Up @@ -1799,4 +1800,4 @@ void P_CheckChaseCamPosition(mobj_t* target, mobj_t* camera, fixed_t x, fixed_t
camera->x = x;
camera->y = y;
}
}
}
12 changes: 10 additions & 2 deletions src/engine/w_wad.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
// GLOBALS
//

#ifdef _MSC_VER
#pragma pack(push, 1)
#endif

//
// TYPES
//
Expand All @@ -70,13 +74,17 @@ typedef struct {
int8_t identification[4];
int numlumps;
int infotableofs;
} wadinfo_t;
} PACKEDATTR wadinfo_t;

typedef struct {
int filepos;
int size;
int8_t name[8];
} filelump_t;
} PACKEDATTR filelump_t;

#ifdef _MSC_VER
#pragma pack(pop)
#endif

#define MAX_MEMLUMPS 16

Expand Down

0 comments on commit 3182813

Please sign in to comment.