mirror of
https://github.com/ZDoom/zdbsp.git
synced 2025-02-14 08:01:16 +00:00
- Fixed writing of v5 GL segs in ZDBSP.
- Fixed ZDBSP compilation under Linux, including support for 64-bit architectures. SVN r162 (trunk)
This commit is contained in:
parent
21aeec0e3a
commit
dd6f2eab90
8 changed files with 49 additions and 21 deletions
14
Makefile
14
Makefile
|
@ -1,5 +1,15 @@
|
|||
CFLAGS = -O3 -Wall -fomit-frame-pointer -Izlib -pipe -ffast-math -MMD \
|
||||
-mtune=i686
|
||||
CFLAGS = -Wall -fomit-frame-pointer -Izlib -pipe -ffast-math -MMD
|
||||
|
||||
# Optimization flags
|
||||
CFLAGS += -O3 -fomit-frame-pointer
|
||||
|
||||
# Unoptimization flags
|
||||
#CFLAGS += -g
|
||||
|
||||
# Processor features flags
|
||||
CFLAGS += -mtune=i686
|
||||
#CFLAGS += -march=k8
|
||||
|
||||
LDFLAGS =
|
||||
RM = rm -f FILE
|
||||
ZLIBDIR = zlib/
|
||||
|
|
13
main.cpp
13
main.cpp
|
@ -35,9 +35,13 @@
|
|||
|
||||
#else
|
||||
|
||||
#define HAVE_TIMING 0
|
||||
#define START_COUNTER(s,e,f)
|
||||
#define END_COUNTER(s,e,f)
|
||||
#include <time.h>
|
||||
#define HAVE_TIMING 1
|
||||
#define START_COUNTER(s,e,f) \
|
||||
clock_t s, e; s = clock();
|
||||
#define END_COUNTER(s,e,f,l) \
|
||||
e = clock(); \
|
||||
if (!NoTiming) printf (l, double(e - s) / CLOCKS_PER_SEC);
|
||||
|
||||
// Need these to check if input/output are the same file
|
||||
#include <sys/types.h>
|
||||
|
@ -414,6 +418,9 @@ static void ShowUsage ()
|
|||
#endif
|
||||
" -V, --version Display version information\n"
|
||||
" --help Display this usage information"
|
||||
#ifndef _WIN32
|
||||
"\n"
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ void FNodeBuilder::CreateSubsectorsForReal ()
|
|||
sub.numlines = (DWORD)(SegList.Size() - sub.firstline);
|
||||
|
||||
// Sort segs by linedef for special effects
|
||||
qsort (&SegList[sub.firstline], sub.numlines, sizeof(int), SortSegs);
|
||||
qsort (&SegList[sub.firstline], sub.numlines, sizeof(USegPtr), SortSegs);
|
||||
|
||||
// Convert seg pointers into indices
|
||||
D(printf ("Output subsector %d:\n", Subsectors.Size()));
|
||||
|
@ -478,7 +478,7 @@ int FNodeBuilder::SelectSplitter (DWORD set, node_t &node, DWORD &splitseg, int
|
|||
return nosplitters ? -1 : 0;
|
||||
}
|
||||
|
||||
D(Printf ("split seg %lu in set %d, score %d, step %d, nosplit %d\n", bestseg, set, bestvalue, step, nosplit));
|
||||
D(Printf ("split seg %u in set %u, score %d, step %d, nosplit %d\n", bestseg, set, bestvalue, step, nosplit));
|
||||
|
||||
splitseg = bestseg;
|
||||
SetNodeFromSeg (node, &Segs[bestseg]);
|
||||
|
@ -787,13 +787,13 @@ void FNodeBuilder::SplitSegs (DWORD set, node_t &node, DWORD splitseg, DWORD &ou
|
|||
{
|
||||
case 0: // seg is entirely in front
|
||||
seg->next = outset0;
|
||||
//Printf ("%lu in front\n", set);
|
||||
//Printf ("%u in front\n", set);
|
||||
outset0 = set;
|
||||
break;
|
||||
|
||||
case 1: // seg is entirely in back
|
||||
seg->next = outset1;
|
||||
//Printf ("%lu in back\n", set);
|
||||
//Printf ("%u in back\n", set);
|
||||
outset1 = set;
|
||||
break;
|
||||
|
||||
|
@ -804,10 +804,10 @@ void FNodeBuilder::SplitSegs (DWORD set, node_t &node, DWORD splitseg, DWORD &ou
|
|||
int seg2;
|
||||
unsigned int i;
|
||||
|
||||
//Printf ("%lu is cut\n", set);
|
||||
//Printf ("%u is cut\n", set);
|
||||
if (seg->loopnum)
|
||||
{
|
||||
Printf (" Split seg %lu (%d,%d)-(%d,%d) of sector %d on line %d\n",
|
||||
Printf (" Split seg %u (%d,%d)-(%d,%d) of sector %d on line %d\n",
|
||||
set,
|
||||
Vertices[seg->v1].x>>16, Vertices[seg->v1].y>>16,
|
||||
Vertices[seg->v2].x>>16, Vertices[seg->v2].y>>16,
|
||||
|
@ -1100,7 +1100,7 @@ void FNodeBuilder::PrintSet (int l, DWORD set)
|
|||
Printf ("set %d:\n", l);
|
||||
for (; set != DWORD_MAX; set = Segs[set].next)
|
||||
{
|
||||
Printf ("\t%lu(%d)%c%d(%d,%d)-%d(%d,%d)\n", set,
|
||||
Printf ("\t%u(%d)%c%d(%d,%d)-%d(%d,%d)\n", set,
|
||||
Segs[set].frontsector,
|
||||
Segs[set].linedef == -1 ? '+' : ':',
|
||||
Segs[set].v1,
|
||||
|
|
|
@ -420,7 +420,7 @@ void FEventTree::PrintTree (const FEvent *event) const
|
|||
{
|
||||
PrintTree (event->Left);
|
||||
}
|
||||
printf (" Color %s, distance %g, vertex %d, seg %lu\n", event->Color ? "BLACK" : " RED ",
|
||||
printf (" Color %s, distance %g, vertex %d, seg %u\n", event->Color ? "BLACK" : " RED ",
|
||||
sqrt(event->Distance/4294967296.0), event->Info.Vertex, event->Info.FrontSeg);
|
||||
if (event->Right != &Nil)
|
||||
{
|
||||
|
|
|
@ -1115,7 +1115,7 @@ void FProcessor::WriteGLSegs5 (FWadWriter &out)
|
|||
}
|
||||
else
|
||||
{
|
||||
segdata[i].v1 = LittleLong(0x800000000u | ((int)Level.GLSegs[i].v1 - Level.NumOrgVerts));
|
||||
segdata[i].v1 = LittleLong(0x80000000u | ((int)Level.GLSegs[i].v1 - Level.NumOrgVerts));
|
||||
}
|
||||
if (Level.GLSegs[i].v2 < (DWORD)Level.NumOrgVerts)
|
||||
{
|
||||
|
@ -1123,7 +1123,7 @@ void FProcessor::WriteGLSegs5 (FWadWriter &out)
|
|||
}
|
||||
else
|
||||
{
|
||||
segdata[i].v2 = LittleLong(0x800000000u | ((int)Level.GLSegs[i].v2 - Level.NumOrgVerts));
|
||||
segdata[i].v2 = LittleLong(0x80000000u | ((int)Level.GLSegs[i].v2 - Level.NumOrgVerts));
|
||||
}
|
||||
segdata[i].linedef = LittleShort(Level.GLSegs[i].linedef);
|
||||
segdata[i].side = LittleShort(Level.GLSegs[i].side);
|
||||
|
|
2
wad.cpp
2
wad.cpp
|
@ -351,7 +351,7 @@ void FWadWriter::Close ()
|
|||
{
|
||||
if (File)
|
||||
{
|
||||
__int32 head[2];
|
||||
int32_t head[2];
|
||||
|
||||
head[0] = LittleLong(Lumps.Size());
|
||||
head[1] = LittleLong(ftell (File));
|
||||
|
|
8
wad.h
8
wad.h
|
@ -14,14 +14,14 @@
|
|||
struct WadHeader
|
||||
{
|
||||
char Magic[4];
|
||||
__int32 NumLumps;
|
||||
__int32 Directory;
|
||||
int32_t NumLumps;
|
||||
int32_t Directory;
|
||||
};
|
||||
|
||||
struct WadLump
|
||||
{
|
||||
__int32 FilePos;
|
||||
__int32 Size;
|
||||
int32_t FilePos;
|
||||
int32_t Size;
|
||||
char Name[8];
|
||||
};
|
||||
|
||||
|
|
13
zdbsp.h
13
zdbsp.h
|
@ -9,6 +9,13 @@
|
|||
#include <exception>
|
||||
#include <stdexcept>
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef __int32 int32_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#define ZDBSP_VERSION "1.7"
|
||||
|
||||
enum EBlockmapMode
|
||||
|
@ -49,8 +56,12 @@ typedef int fixed_t;
|
|||
typedef unsigned char BYTE;
|
||||
typedef unsigned short WORD;
|
||||
typedef signed short SWORD;
|
||||
#ifdef _WIN32
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned __int32 angle_t;
|
||||
#else
|
||||
typedef uint32_t DWORD;
|
||||
#endif
|
||||
typedef uint32_t angle_t;
|
||||
|
||||
angle_t PointToAngle (fixed_t x, fixed_t y);
|
||||
|
||||
|
|
Loading…
Reference in a new issue