Move vpo native code into BuilderNative as it is easier to manage. The plugins folder doesn't support including native dlls properly anyway.

Fix visplane explorer busy looping when waiting for data and reduce the used core count to 75% of the total available
Made vpo native code thread safe, removing the need for ungodly DLL patching hacks
This commit is contained in:
Magnus Norddahl 2020-04-19 15:56:24 +02:00
parent db44d411c7
commit 8eb522c873
43 changed files with 1120 additions and 1635 deletions

View file

@ -23,9 +23,6 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TagRange", "Source\Plugins\TagRange\TagRange.csproj", "{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisplaneExplorer", "Source\Plugins\VisplaneExplorer\VisplaneExplorer.csproj", "{CF670175-7099-4090-A330-EE25C7230139}"
ProjectSection(ProjectDependencies) = postProject
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE} = {29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoundPropagation", "Source\Plugins\SoundPropagationMode\SoundPropagation.csproj", "{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}"
EndProject
@ -36,8 +33,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StairSectorBuilder", "Sourc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomapMode", "Source\Plugins\AutomapMode\AutomapMode.csproj", "{B33F68D5-1335-400C-A1D7-7F5602A030EF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vpo_dll", "Source\Plugins\vpo_dll\vpo_dll.vcxproj", "{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BuilderNative", "Source\Native\BuilderNative.vcxproj", "{78938655-9807-485E-9D4B-46226DC7AD27}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeDFloorMode", "Source\Plugins\3DFloorMode\ThreeDFloorMode.csproj", "{88CFD996-027B-4CBE-9828-26B2728B6127}"
@ -300,28 +295,6 @@ Global
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|x64.Build.0 = Release|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|x86.ActiveCfg = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|x86.Build.0 = Release|x86
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|Any CPU.ActiveCfg = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|Any CPU.Build.0 = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x64.ActiveCfg = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x64.Build.0 = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x86.ActiveCfg = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x86.Build.0 = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|Any CPU.ActiveCfg = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x64.ActiveCfg = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x64.Build.0 = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x86.ActiveCfg = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x86.Build.0 = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|Any CPU.ActiveCfg = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|Any CPU.Build.0 = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x64.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x64.Build.0 = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x86.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x86.Build.0 = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|Any CPU.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x64.ActiveCfg = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x64.Build.0 = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x86.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x86.Build.0 = Release|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug + Profiler|Any CPU.ActiveCfg = Release|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug + Profiler|Any CPU.Build.0 = Release|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug + Profiler|x64.ActiveCfg = Debug|x64

View file

@ -215,6 +215,18 @@
</ClCompile>
<ClCompile Include="RawMouse.cpp" />
<ClCompile Include="Backend.cpp" />
<ClCompile Include="VPO\m_bbox.cpp" />
<ClCompile Include="VPO\m_fixed.cpp" />
<ClCompile Include="VPO\p_setup.cpp" />
<ClCompile Include="VPO\r_bsp.cpp" />
<ClCompile Include="VPO\r_main.cpp" />
<ClCompile Include="VPO\r_plane.cpp" />
<ClCompile Include="VPO\r_segs.cpp" />
<ClCompile Include="VPO\tables.cpp" />
<ClCompile Include="VPO\vpo_main.cpp" />
<ClCompile Include="VPO\vpo_stuff.cpp" />
<ClCompile Include="VPO\w_file.cpp" />
<ClCompile Include="VPO\w_wad.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="OpenGL\GLBackend.h" />
@ -230,6 +242,26 @@
<ClInclude Include="Precomp.h" />
<ClInclude Include="RawMouse.h" />
<ClInclude Include="Backend.h" />
<ClInclude Include="VPO\doomdata.h" />
<ClInclude Include="VPO\doomdef.h" />
<ClInclude Include="VPO\doomtype.h" />
<ClInclude Include="VPO\inttypes.h" />
<ClInclude Include="VPO\m_bbox.h" />
<ClInclude Include="VPO\m_fixed.h" />
<ClInclude Include="VPO\r_bsp.h" />
<ClInclude Include="VPO\r_defs.h" />
<ClInclude Include="VPO\r_main.h" />
<ClInclude Include="VPO\r_plane.h" />
<ClInclude Include="VPO\r_state.h" />
<ClInclude Include="VPO\stdint.h" />
<ClInclude Include="VPO\sys_endian.h" />
<ClInclude Include="VPO\sys_macro.h" />
<ClInclude Include="VPO\sys_type.h" />
<ClInclude Include="VPO\tables.h" />
<ClInclude Include="VPO\vpo_api.h" />
<ClInclude Include="VPO\vpo_local.h" />
<ClInclude Include="VPO\w_file.h" />
<ClInclude Include="VPO\w_wad.h" />
</ItemGroup>
<ItemGroup>
<Text Include="OpenGL\gl_load\gl_extlist.txt" />

View file

@ -32,6 +32,42 @@
<Filter>OpenGL</Filter>
</ClCompile>
<ClCompile Include="Matrix.cpp" />
<ClCompile Include="VPO\m_bbox.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\m_fixed.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\p_setup.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\r_bsp.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\r_main.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\r_plane.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\r_segs.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\tables.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\vpo_main.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\vpo_stuff.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\w_file.cpp">
<Filter>VPO</Filter>
</ClCompile>
<ClCompile Include="VPO\w_wad.cpp">
<Filter>VPO</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Precomp.h" />
@ -67,6 +103,66 @@
<ClInclude Include="OpenGL\GLBackend.h">
<Filter>OpenGL</Filter>
</ClInclude>
<ClInclude Include="VPO\doomdata.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\doomdef.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\doomtype.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\m_bbox.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\m_fixed.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\r_bsp.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\r_defs.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\r_main.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\r_plane.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\r_state.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\stdint.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\sys_endian.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\sys_macro.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\sys_type.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\tables.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\vpo_api.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\vpo_local.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\w_file.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\w_wad.h">
<Filter>VPO</Filter>
</ClInclude>
<ClInclude Include="VPO\inttypes.h">
<Filter>VPO</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="exports.def" />
@ -78,6 +174,9 @@
<Filter Include="OpenGL\gl_load">
<UniqueIdentifier>{0acc1cd1-c19f-4410-95aa-718746ce8eaf}</UniqueIdentifier>
</Filter>
<Filter Include="VPO">
<UniqueIdentifier>{c9df2b45-2103-48f7-a0c7-39753781ee5c}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="OpenGL\gl_load\gl_extlist.txt">

View file

View file

View file

View file

View file

@ -27,20 +27,21 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
void M_ClearBox (fixed_t *box)
void Context::M_ClearBox (fixed_t *box)
{
box[BOXTOP] = box[BOXRIGHT] = INT_MIN;
box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX;
}
void
M_AddToBox
Context::M_AddToBox
( fixed_t* box,
fixed_t x,
fixed_t y )

View file

@ -42,14 +42,5 @@ enum
BOXRIGHT
}; // bbox coordinates
// Bounding box functions.
void M_ClearBox (fixed_t* box);
void
M_AddToBox
( fixed_t* box,
fixed_t x,
fixed_t y );
#endif

View file

@ -24,6 +24,7 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo

View file

View file

@ -25,14 +25,13 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
// the error message returned from P_SetupLevel()
static char level_error_msg[1024];
// this exception is thrown during P_SetupLevel() when a map with bad data
// is detected (e.g. vertex number out of range). The above message buffer
@ -40,36 +39,8 @@ static char level_error_msg[1024];
class invalid_data_exception { };
static bool level_is_hexen;
//
// MAP related Lookup tables.
// Store VERTEXES, LINEDEFS, SIDEDEFS, etc.
//
vertex_t* vertexes;
int numvertexes;
seg_t* segs;
int numsegs;
sector_t* sectors;
int numsectors;
subsector_t* subsectors;
int numsubsectors;
node_t* nodes;
int numnodes;
line_t* lines;
int numlines;
side_t* sides;
int numsides;
fixed_t Map_bbox[4];
static int R_TextureNumForName (const char * name)
@ -91,7 +62,7 @@ static int R_FlatNumForName (const char * name)
}
static void LevelError(const char *msg, ...)
void Context::LevelError(const char *msg, ...)
{
va_list argptr;
@ -107,7 +78,7 @@ static void LevelError(const char *msg, ...)
//
// P_LoadVertexes
//
void P_LoadVertexes (int lump)
void Context::P_LoadVertexes (int lump)
{
byte* data;
int i;
@ -143,7 +114,7 @@ void P_LoadVertexes (int lump)
//
// GetSectorAtNullAddress
//
sector_t * GetSectorAtNullAddress(void)
sector_t * Context::GetSectorAtNullAddress(void)
{
return sectors + 0;
}
@ -152,7 +123,7 @@ sector_t * GetSectorAtNullAddress(void)
//
// P_LoadSegs
//
void P_LoadSegs (int lump)
void Context::P_LoadSegs (int lump)
{
byte* data;
int i;
@ -235,7 +206,7 @@ void P_LoadSegs (int lump)
//
// P_LoadSubsectors
//
void P_LoadSubsectors (int lump)
void Context::P_LoadSubsectors (int lump)
{
byte* data;
int i;
@ -262,7 +233,7 @@ void P_LoadSubsectors (int lump)
// andrewj: added this
static void ValidateSubsectors ()
void Context::ValidateSubsectors ()
{
int i;
subsector_t * ss = subsectors;
@ -281,7 +252,7 @@ static void ValidateSubsectors ()
//
// P_LoadSectors
//
void P_LoadSectors (int lump)
void Context::P_LoadSectors (int lump)
{
byte* data;
int i;
@ -313,7 +284,7 @@ void P_LoadSectors (int lump)
}
static bool isChildValid(unsigned short child)
bool Context::isChildValid(unsigned short child)
{
if (child & NF_SUBSECTOR)
return ((child & ~NF_SUBSECTOR) < numsubsectors);
@ -325,7 +296,7 @@ static bool isChildValid(unsigned short child)
//
// P_LoadNodes
//
void P_LoadNodes (int lump)
void Context::P_LoadNodes (int lump)
{
byte* data;
int i;
@ -370,7 +341,7 @@ void P_LoadNodes (int lump)
/* andrewj : removed P_LoadThings(), not needed for Visplane Explorer */
static void LineDef_CommonSetup(line_t *ld)
void Context::LineDef_CommonSetup(line_t *ld)
{
vertex_t *v1 = ld->v1;
vertex_t *v2 = ld->v2;
@ -441,7 +412,7 @@ static void LineDef_CommonSetup(line_t *ld)
// P_LoadLineDefs
// Also counts secret lines for intermissions.
//
void P_LoadLineDefs (int lump)
void Context::P_LoadLineDefs (int lump)
{
byte* data;
int i;
@ -485,7 +456,7 @@ void P_LoadLineDefs (int lump)
// andrewj: added this for Hexen support
void P_LoadLineDefs_Hexen (int lump)
void Context::P_LoadLineDefs_Hexen (int lump)
{
byte* data;
int i, k;
@ -534,7 +505,7 @@ void P_LoadLineDefs_Hexen (int lump)
//
// P_LoadSideDefs
//
void P_LoadSideDefs (int lump)
void Context::P_LoadSideDefs (int lump)
{
byte* data;
int i;
@ -581,7 +552,7 @@ void P_LoadSideDefs (int lump)
// Builds sector line lists and subsector sector numbers.
// Finds block bounding boxes for sectors.
//
void P_GroupLines (void)
void Context::P_GroupLines (void)
{
line_t** linebuffer;
int i;
@ -692,7 +663,7 @@ void P_GroupLines (void)
// Main criterion is that sector is closed, and either has a tag
// or one of the linedefs has a manual door type.
//
static int HasManualDoor(const sector_t *sec)
int Context::HasManualDoor(const sector_t *sec)
{
int k;
@ -730,7 +701,7 @@ static int HasManualDoor(const sector_t *sec)
return 0;
}
static void CalcDoorAltHeight(sector_t *sec)
void Context::CalcDoorAltHeight(sector_t *sec)
{
fixed_t door_h = sec->floorheight; // == sec->ceilingheight
@ -776,7 +747,7 @@ static void CalcDoorAltHeight(sector_t *sec)
}
}
void P_DetectDoorSectors(void)
void Context::P_DetectDoorSectors()
{
int i;
@ -803,7 +774,7 @@ void P_DetectDoorSectors(void)
// Returns an error message if something went wrong
// or NULL on success.
//
const char * P_SetupLevel ( const char *lumpname, bool *is_hexen )
const char * Context::P_SetupLevel ( const char *lumpname, bool *is_hexen )
{
int base = W_CheckNumForName(lumpname);
@ -865,7 +836,7 @@ const char * P_SetupLevel ( const char *lumpname, bool *is_hexen )
}
void P_FreeLevelData (void)
void Context::P_FreeLevelData ()
{
if (vertexes)
{

View file

@ -24,31 +24,19 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
seg_t* curline;
side_t* sidedef;
line_t* linedef;
sector_t* frontsector;
sector_t* backsector;
drawseg_t drawsegs[MAXDRAWSEGS+10];
drawseg_t* ds_p;
int total_drawsegs;
void R_StoreWallRange ( int start, int stop );
//
// R_ClearDrawSegs
//
void R_ClearDrawSegs (void)
void Context::R_ClearDrawSegs (void)
{
total_drawsegs = 0;
@ -57,30 +45,6 @@ void R_ClearDrawSegs (void)
//
// ClipWallSegment
// Clips the given range of columns
// and includes it in the new clip list.
//
typedef struct
{
int first;
int last;
} cliprange_t;
// andrewj: increased limit to 128 for Visplane Explorer
// #define MAXSOLIDSEGS 32
#define MAXSOLIDSEGS 128
// newend is one past the last valid seg
cliprange_t solidsegs[MAXSOLIDSEGS+8];
cliprange_t* newend;
int max_solidsegs;
//
// R_ClipSolidWallSegment
@ -89,7 +53,7 @@ int max_solidsegs;
// that entirely block the view.
//
void
R_ClipSolidWallSegment ( int first, int last )
Context::R_ClipSolidWallSegment ( int first, int last )
{
cliprange_t* next;
cliprange_t* start;
@ -189,7 +153,7 @@ R_ClipSolidWallSegment ( int first, int last )
// Does handle windows,
// e.g. LineDefs with upper and lower texture.
//
void R_ClipPassWallSegment ( int first, int last )
void Context::R_ClipPassWallSegment ( int first, int last )
{
cliprange_t* start;
@ -235,7 +199,7 @@ void R_ClipPassWallSegment ( int first, int last )
//
// R_ClearClipSegs
//
void R_ClearClipSegs (void)
void Context::R_ClearClipSegs (void)
{
solidsegs[0].first = -0x7fffffff;
solidsegs[0].last = -1;
@ -251,7 +215,7 @@ void R_ClearClipSegs (void)
// Clips the given segment
// and adds any visible pieces to the line list.
//
void R_AddLine (seg_t* line)
void Context::R_AddLine (seg_t* line)
{
int x1;
int x2;
@ -357,7 +321,7 @@ void R_AddLine (seg_t* line)
// Returns true
// if some part of the bbox might be visible.
//
int checkcoord[12][4] =
static const int checkcoord[12][4] =
{
{3,0,2,1},
{3,0,2,0},
@ -373,7 +337,7 @@ int checkcoord[12][4] =
};
boolean R_CheckBBox (fixed_t* bspcoord)
boolean Context::R_CheckBBox (fixed_t* bspcoord)
{
int boxx;
int boxy;
@ -489,7 +453,7 @@ boolean R_CheckBBox (fixed_t* bspcoord)
// Add sprites of things in sector.
// Draw one or more line segments.
//
void R_Subsector (int num)
void Context::R_Subsector (int num)
{
int count;
seg_t* line;
@ -544,7 +508,7 @@ void R_Subsector (int num)
// Renders all subsectors below a given node,
// traversing subtree recursively.
// Just call with BSP root.
void R_RenderBSPNode (int bspnum)
void Context::R_RenderBSPNode (int bspnum)
{
node_t* bsp;
int side;

View file

@ -27,6 +27,7 @@
#ifndef __R_BSP__
#define __R_BSP__
#if 0
extern seg_t* curline;
extern side_t* sidedef;
extern line_t* linedef;
@ -53,5 +54,6 @@ void R_ClearClipSegs (void);
void R_ClearDrawSegs (void);
void R_RenderBSPNode (int bspnum);
#endif
#endif

View file

@ -41,7 +41,7 @@
#define skyflatnum 2
extern fixed_t Map_bbox[4];
//extern fixed_t Map_bbox[4];
//

View file

@ -26,6 +26,7 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
// #include "r_sky.h"
@ -37,81 +38,6 @@ namespace vpo
// Fineangles in the SCREENWIDTH wide window.
#define FIELDOFVIEW 2048
int viewangleoffset;
// increment every time a check is made
int validcount = 1;
int centerx;
int centery;
fixed_t centerxfrac;
fixed_t centeryfrac;
fixed_t projection;
// just for profiling purposes
int framecount;
int sscount;
int linecount;
int loopcount;
fixed_t viewx;
fixed_t viewy;
fixed_t viewz;
angle_t viewangle;
fixed_t viewcos;
fixed_t viewsin;
//
// precalculated math tables
//
angle_t clipangle;
// The viewangletox[viewangle + FINEANGLES/4] lookup
// maps the visible view angles to screen X coordinates,
// flattening the arc to a flat projection plane.
// There will be many angles mapped to the same X.
int viewangletox[FINEANGLES/2];
// The xtoviewangleangle[] table maps a screen pixel
// to the lowest viewangle that maps back to x ranges
// from clipangle to -clipangle.
angle_t xtoviewangle[SCREENWIDTH+1];
// UNUSED.
// The finetangentgent[angle+FINEANGLES/4] table
// holds the fixed_t tangent values for view angles,
// ranging from INT_MIN to 0 to INT_MAX.
// fixed_t finetangent[FINEANGLES/2];
// fixed_t finesine[5*FINEANGLES/4];
const fixed_t* finecosine = &finesine[FINEANGLES/4];
// bumped light from gun blasts
int extralight;
// from R_DRAW
int viewwidth;
int scaledviewwidth;
int viewheight;
int viewwindowx;
int viewwindowy;
// from R_THINGS
fixed_t pspritescale;
fixed_t pspriteiscale;
short screenheightarray[SCREENWIDTH];
short negonearray[SCREENWIDTH];
//
@ -119,7 +45,7 @@ short negonearray[SCREENWIDTH];
// Expand a given bbox
// so that it encloses a given point.
//
void R_AddPointToBox ( int x, int y, fixed_t* box )
void Context::R_AddPointToBox ( int x, int y, fixed_t* box )
{
if (x< box[BOXLEFT])
box[BOXLEFT] = x;
@ -138,7 +64,7 @@ void R_AddPointToBox ( int x, int y, fixed_t* box )
// check point against partition plane.
// Returns side 0 (front) or 1 (back).
//
int R_PointOnSide ( fixed_t x, fixed_t y, node_t* node )
int Context::R_PointOnSide ( fixed_t x, fixed_t y, node_t* node )
{
fixed_t dx;
fixed_t dy;
@ -187,7 +113,7 @@ int R_PointOnSide ( fixed_t x, fixed_t y, node_t* node )
}
int R_PointOnSegSide ( fixed_t x, fixed_t y, seg_t* line )
int Context::R_PointOnSegSide ( fixed_t x, fixed_t y, seg_t* line )
{
fixed_t lx;
fixed_t ly;
@ -255,7 +181,7 @@ int R_PointOnSegSide ( fixed_t x, fixed_t y, seg_t* line )
// tangent (slope) value which is looked up in the
// tantoangle[] table.
angle_t R_PointToAngle ( fixed_t x, fixed_t y )
angle_t Context::R_PointToAngle ( fixed_t x, fixed_t y )
{
x -= viewx;
y -= viewy;
@ -338,7 +264,7 @@ angle_t R_PointToAngle ( fixed_t x, fixed_t y )
}
angle_t R_PointToAngle2 ( fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2 )
angle_t Context::R_PointToAngle2 ( fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2 )
{
viewx = x1;
viewy = y1;
@ -347,7 +273,7 @@ angle_t R_PointToAngle2 ( fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2 )
}
fixed_t R_PointToDist ( fixed_t x, fixed_t y )
fixed_t Context::R_PointToDist ( fixed_t x, fixed_t y )
{
int angle;
fixed_t dx;
@ -393,7 +319,7 @@ fixed_t R_PointToDist ( fixed_t x, fixed_t y )
// at the given angle.
// rw_distance must be calculated first.
//
fixed_t R_ScaleFromGlobalAngle (angle_t visangle)
fixed_t Context::R_ScaleFromGlobalAngle (angle_t visangle)
{
fixed_t scale;
angle_t anglea;
@ -445,7 +371,7 @@ fixed_t R_ScaleFromGlobalAngle (angle_t visangle)
}
void R_InitBuffer ( int width, int height )
void Context::R_InitBuffer ( int width, int height )
{
int i;
@ -482,7 +408,7 @@ void R_InitBuffer ( int width, int height )
//
// R_InitTextureMapping
//
void R_InitTextureMapping (void)
void Context::R_InitTextureMapping (void)
{
int i;
int x;
@ -548,7 +474,7 @@ void R_InitTextureMapping (void)
//
// R_SetViewSize
//
void R_SetViewSize ( int blocks, int detail )
void Context::R_SetViewSize ( int blocks, int detail )
{
fixed_t cosadj;
fixed_t dy;
@ -606,7 +532,7 @@ void R_SetViewSize ( int blocks, int detail )
//
// R_Init
//
void R_Init (void)
void Context::R_Init (void)
{
R_SetViewSize (11, 0);
@ -617,7 +543,7 @@ void R_Init (void)
//
// R_PointInSubsector
//
subsector_t* R_PointInSubsector ( fixed_t x, fixed_t y )
subsector_t* Context::R_PointInSubsector ( fixed_t x, fixed_t y )
{
node_t* node;
int side;
@ -643,7 +569,7 @@ subsector_t* R_PointInSubsector ( fixed_t x, fixed_t y )
//
// R_SetupFrame
//
void R_SetupFrame (fixed_t x, fixed_t y, fixed_t z, angle_t angle)
void Context::R_SetupFrame (fixed_t x, fixed_t y, fixed_t z, angle_t angle)
{
viewx = x;
viewy = y;
@ -664,7 +590,7 @@ void R_SetupFrame (fixed_t x, fixed_t y, fixed_t z, angle_t angle)
//
// R_RenderView
//
void R_RenderView (fixed_t x, fixed_t y, fixed_t z, angle_t angle)
void Context::R_RenderView (fixed_t x, fixed_t y, fixed_t z, angle_t angle)
{
R_SetupFrame (x, y, z, angle);

View file

@ -27,7 +27,7 @@
#ifndef __R_MAIN__
#define __R_MAIN__
/*
//
// POV related.
//
@ -51,7 +51,7 @@ extern int validcount;
extern int linecount;
extern int loopcount;
*/
//
// Lighting LUT.
@ -74,7 +74,7 @@ extern int loopcount;
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
#define NUMCOLORMAPS 32
/*
//
// Utility functions.
int R_PointOnSide ( fixed_t x, fixed_t y, node_t* node );
@ -109,5 +109,6 @@ extern short negonearray[SCREENWIDTH];
void R_Init (void);
void R_RenderView (fixed_t x, fixed_t y, fixed_t z, angle_t angle);
*/
#endif

View file

@ -26,62 +26,13 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
//
// opening
//
// Here comes the obnoxious "visplane".
visplane_t visplanes[MAXVISPLANES+10];
visplane_t* lastvisplane;
visplane_t* floorplane;
visplane_t* ceilingplane;
int total_visplanes;
short openings[MAXOPENINGS+400];
short* lastopening;
int total_openings;
//
// Clip values are the solid pixel bounding the range.
// floorclip starts out SCREENHEIGHT
// ceilingclip starts out -1
//
short floorclip[SCREENWIDTH];
short ceilingclip[SCREENWIDTH];
//
// spanstart holds the start of a plane span
// initialized to 0 at start
//
int spanstart[SCREENHEIGHT];
int spanstop[SCREENHEIGHT];
//
// texture mapping
//
fixed_t planeheight;
fixed_t yslope[SCREENHEIGHT];
fixed_t distscale[SCREENWIDTH];
fixed_t basexscale;
fixed_t baseyscale;
fixed_t cachedheight[SCREENHEIGHT];
fixed_t cacheddistance[SCREENHEIGHT];
fixed_t cachedxstep[SCREENHEIGHT];
fixed_t cachedystep[SCREENHEIGHT];
#if 0
//
// R_MapPlane
@ -158,7 +109,7 @@ void R_MapPlane ( int y, int x1, int x2 )
// R_ClearPlanes
// At begining of frame.
//
void R_ClearPlanes (void)
void Context::R_ClearPlanes (void)
{
int i;
angle_t angle;
@ -193,7 +144,7 @@ void R_ClearPlanes (void)
//
// R_FindPlane
//
visplane_t* R_FindPlane ( fixed_t height, int picnum, int lightlevel )
visplane_t* Context::R_FindPlane ( fixed_t height, int picnum, int lightlevel )
{
visplane_t* check;
@ -238,7 +189,7 @@ visplane_t* R_FindPlane ( fixed_t height, int picnum, int lightlevel )
//
// R_CheckPlane
//
visplane_t* R_CheckPlane ( visplane_t* pl, int start, int stop )
visplane_t* Context::R_CheckPlane ( visplane_t* pl, int start, int stop )
{
int intrl;
int intrh;

View file

@ -27,7 +27,7 @@
#ifndef __R_PLANE__
#define __R_PLANE__
/*
// Visplane related.
extern short * lastopening;
@ -48,6 +48,7 @@ void R_DrawPlanes (void);
visplane_t* R_FindPlane ( fixed_t height, int picnum, int lightlevel );
visplane_t* R_CheckPlane ( visplane_t* pl, int start, int stop );
*/
// #define MAXVISPLANES 128
#define MAXVISPLANES 512 // andrewj: increased for Visplane Explorer
@ -55,10 +56,11 @@ visplane_t* R_CheckPlane ( visplane_t* pl, int start, int stop );
// #define MAXOPENINGS SCREENWIDTH*64
#define MAXOPENINGS SCREENWIDTH*256 // andrewj: increased for Visplane Explorer
/*
extern int total_visplanes;
extern int total_drawsegs;
extern int total_openings;
extern int max_solidsegs;
*/
#endif

View file

@ -24,73 +24,12 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
// OPTIMIZE: closed two sided lines as single sided
// True if any of the segs textures might be visible.
boolean segtextured;
// False if the back side is the same plane.
boolean markfloor;
boolean markceiling;
boolean maskedtexture;
int toptexture;
int bottomtexture;
int midtexture;
angle_t rw_normalangle;
// angle to line origin
int rw_angle1;
//
// regular wall
//
int rw_x;
int rw_stopx;
angle_t rw_centerangle;
fixed_t rw_offset;
fixed_t rw_distance;
fixed_t rw_scale;
fixed_t rw_scalestep;
fixed_t rw_midtexturemid;
fixed_t rw_toptexturemid;
fixed_t rw_bottomtexturemid;
int worldtop;
int worldbottom;
int worldhigh;
int worldlow;
fixed_t pixhigh;
fixed_t pixlow;
fixed_t pixhighstep;
fixed_t pixlowstep;
fixed_t topfrac;
fixed_t topstep;
fixed_t bottomfrac;
fixed_t bottomstep;
short* maskedtexturecol;
// R_DRAW bits
int dc_x;
int dc_yl;
int dc_yh;
fixed_t dc_iscale;
fixed_t dc_texturemid;
//
// R_RenderSegLoop
// Draws zero, one, or two textures (and possibly a masked
@ -102,7 +41,7 @@ fixed_t dc_texturemid;
#define HEIGHTBITS 12
#define HEIGHTUNIT (1<<HEIGHTBITS)
void R_RenderSegLoop (void)
void Context::R_RenderSegLoop (void)
{
angle_t angle;
int yl;
@ -266,7 +205,7 @@ void R_RenderSegLoop (void)
// A wall segment will be drawn
// between start and stop pixels (inclusive).
//
void R_StoreWallRange ( int start, int stop )
void Context::R_StoreWallRange ( int start, int stop )
{
fixed_t hyp;
fixed_t sineval;
@ -495,7 +434,7 @@ void R_StoreWallRange ( int start, int stop )
}
// calculate rw_offset (only needed for textured lines)
segtextured = midtexture | toptexture | bottomtexture | maskedtexture;
segtextured = midtexture | toptexture | bottomtexture | (int)maskedtexture;
if (segtextured)
{

View file

@ -28,7 +28,7 @@
#ifndef __R_STATE__
#define __R_STATE__
/*
//
// Refresh internal data structures,
// for rendering.
@ -102,6 +102,6 @@ extern int sscount;
extern visplane_t* floorplane;
extern visplane_t* ceilingplane;
*/
#endif

View file

View file

@ -1,128 +1,128 @@
//------------------------------------------------------------------------
// EDGE Endian handling
//------------------------------------------------------------------------
//
// Eureka DOOM Editor
//
// Copyright (C) 2006-2008 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
//
// Using code from SDL_byteorder.h and SDL_endian.h.
// Copyright (C) 1997-2004 Sam Lantinga.
//
//------------------------------------------------------------------------
#ifndef __SYS_ENDIAN_H__
#define __SYS_ENDIAN_H__
// ---- determine byte order ----
#define UT_LIL_ENDIAN 1234
#define UT_BIG_ENDIAN 4321
#if defined(__LITTLE_ENDIAN__) || defined(WIN32) || \
defined(__i386__) || defined(__i386) || \
defined(__ia64__) || defined(__x86_64__) || \
defined(__alpha__) || defined(__alpha) || \
defined(__arm__) || defined(__SYMBIAN32__) || \
(defined(__mips__) && defined(__MIPSEL__))
#define UT_BYTEORDER UT_LIL_ENDIAN
#else
#define UT_BYTEORDER UT_BIG_ENDIAN
#endif
// ---- the gruntwork of swapping ----
#if defined(__GNUC__) && defined(__i386__)
static inline u16_t UT_Swap16(u16_t x)
{
__asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static inline u16_t UT_Swap16(u16_t x)
{
__asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static inline u16_t UT_Swap16(u16_t x)
{
u16_t result;
__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
return result;
}
#else
static inline u16_t UT_Swap16(u16_t x) {
return((x<<8)|(x>>8));
}
#endif
#if defined(__GNUC__) && defined(__i386__)
static inline u32_t UT_Swap32(u32_t x)
{
__asm__("bswap %0" : "=r" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static inline u32_t UT_Swap32(u32_t x)
{
__asm__("bswapl %0" : "=r" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static inline u32_t UT_Swap32(u32_t x)
{
u32_t result;
__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
__asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
__asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
return result;
}
#else
static inline u32_t UT_Swap32(u32_t x) {
return ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
}
#endif
// ---- byte swap from specified endianness to native ----
#if (UT_BYTEORDER == UT_LIL_ENDIAN)
#define LE_U16(X) ((u16_t)(X))
#define LE_U32(X) ((u32_t)(X))
#define BE_U16(X) UT_Swap16(X)
#define BE_U32(X) UT_Swap32(X)
#else
#define LE_U16(X) UT_Swap16(X)
#define LE_U32(X) UT_Swap32(X)
#define BE_U16(X) ((u16_t)(X))
#define BE_U32(X) ((u32_t)(X))
#endif
// signed versions of the above
#define LE_S16(X) ((s16_t) LE_U16((u16_t) (X)))
#define LE_S32(X) ((s32_t) LE_U32((u32_t) (X)))
#define BE_S16(X) ((s16_t) BE_U16((u16_t) (X)))
#define BE_S32(X) ((s32_t) BE_U32((u32_t) (X)))
#endif // __SYS_ENDIAN_H__
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab
//------------------------------------------------------------------------
// EDGE Endian handling
//------------------------------------------------------------------------
//
// Eureka DOOM Editor
//
// Copyright (C) 2006-2008 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
//
// Using code from SDL_byteorder.h and SDL_endian.h.
// Copyright (C) 1997-2004 Sam Lantinga.
//
//------------------------------------------------------------------------
#ifndef __SYS_ENDIAN_H__
#define __SYS_ENDIAN_H__
// ---- determine byte order ----
#define UT_LIL_ENDIAN 1234
#define UT_BIG_ENDIAN 4321
#if defined(__LITTLE_ENDIAN__) || defined(WIN32) || \
defined(__i386__) || defined(__i386) || \
defined(__ia64__) || defined(__x86_64__) || \
defined(__alpha__) || defined(__alpha) || \
defined(__arm__) || defined(__SYMBIAN32__) || \
(defined(__mips__) && defined(__MIPSEL__))
#define UT_BYTEORDER UT_LIL_ENDIAN
#else
#define UT_BYTEORDER UT_BIG_ENDIAN
#endif
// ---- the gruntwork of swapping ----
#if defined(__GNUC__) && defined(__i386__)
static inline u16_t UT_Swap16(u16_t x)
{
__asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static inline u16_t UT_Swap16(u16_t x)
{
__asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static inline u16_t UT_Swap16(u16_t x)
{
u16_t result;
__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
return result;
}
#else
static inline u16_t UT_Swap16(u16_t x) {
return((x<<8)|(x>>8));
}
#endif
#if defined(__GNUC__) && defined(__i386__)
static inline u32_t UT_Swap32(u32_t x)
{
__asm__("bswap %0" : "=r" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && defined(__x86_64__)
static inline u32_t UT_Swap32(u32_t x)
{
__asm__("bswapl %0" : "=r" (x) : "0" (x));
return x;
}
#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
static inline u32_t UT_Swap32(u32_t x)
{
u32_t result;
__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
__asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
__asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
return result;
}
#else
static inline u32_t UT_Swap32(u32_t x) {
return ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
}
#endif
// ---- byte swap from specified endianness to native ----
#if (UT_BYTEORDER == UT_LIL_ENDIAN)
#define LE_U16(X) ((u16_t)(X))
#define LE_U32(X) ((u32_t)(X))
#define BE_U16(X) UT_Swap16(X)
#define BE_U32(X) UT_Swap32(X)
#else
#define LE_U16(X) UT_Swap16(X)
#define LE_U32(X) UT_Swap32(X)
#define BE_U16(X) ((u16_t)(X))
#define BE_U32(X) ((u32_t)(X))
#endif
// signed versions of the above
#define LE_S16(X) ((s16_t) LE_U16((u16_t) (X)))
#define LE_S32(X) ((s32_t) LE_U32((u32_t) (X)))
#define BE_S16(X) ((s16_t) BE_U16((u16_t) (X)))
#define BE_S32(X) ((s32_t) BE_U32((u32_t) (X)))
#endif // __SYS_ENDIAN_H__
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab

View file

@ -1,62 +1,62 @@
//------------------------------------------------------------------------
// Macros
//------------------------------------------------------------------------
//
// Eureka DOOM Editor
//
// Copyright (C) 2006-2008 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
#ifndef __SYS_MACRO_H__
#define __SYS_MACRO_H__
// basic macros
#ifndef NULL
#define NULL ((void*) 0)
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef ABS
#define ABS(a) ((a) < 0 ? -(a) : (a))
#endif
#ifndef SGN
#define SGN(a) ((a) < 0 ? -1 : (a) > 0 ? +1 : 0)
#endif
#ifndef I_ROUND
#define I_ROUND(x) ((int) (((x) < 0.0f) ? ((x) - 0.5f) : ((x) + 0.5f)))
#endif
#ifndef CLAMP
#define CLAMP(low,x,high) \
((x) < (low) ? (low) : (x) > (high) ? (high) : (x))
#endif
#endif /* __SYS_MACRO_H__ */
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab
//------------------------------------------------------------------------
// Macros
//------------------------------------------------------------------------
//
// Eureka DOOM Editor
//
// Copyright (C) 2006-2008 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
#ifndef __SYS_MACRO_H__
#define __SYS_MACRO_H__
// basic macros
#ifndef NULL
#define NULL ((void*) 0)
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef ABS
#define ABS(a) ((a) < 0 ? -(a) : (a))
#endif
#ifndef SGN
#define SGN(a) ((a) < 0 ? -1 : (a) > 0 ? +1 : 0)
#endif
#ifndef I_ROUND
#define I_ROUND(x) ((int) (((x) < 0.0f) ? ((x) - 0.5f) : ((x) + 0.5f)))
#endif
#ifndef CLAMP
#define CLAMP(low,x,high) \
((x) < (low) ? (low) : (x) > (high) ? (high) : (x))
#endif
#endif /* __SYS_MACRO_H__ */
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab

View file

@ -1,39 +1,39 @@
//------------------------------------------------------------------------
// Type definitions
//------------------------------------------------------------------------
//
// Eureka DOOM Editor
//
// Copyright (C) 2006-2008 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
#ifndef __SYS_TYPE_H__
#define __SYS_TYPE_H__
// basic types
typedef char s8_t;
typedef short s16_t;
typedef int s32_t;
typedef unsigned char u8_t;
typedef unsigned short u16_t;
typedef unsigned int u32_t;
typedef u8_t byte;
#endif /* __SYS_TYPE_H__ */
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab
//------------------------------------------------------------------------
// Type definitions
//------------------------------------------------------------------------
//
// Eureka DOOM Editor
//
// Copyright (C) 2006-2008 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
#ifndef __SYS_TYPE_H__
#define __SYS_TYPE_H__
// basic types
typedef char s8_t;
typedef short s16_t;
typedef int s32_t;
typedef unsigned char u8_t;
typedef unsigned short u16_t;
typedef unsigned int u32_t;
typedef u8_t byte;
#endif /* __SYS_TYPE_H__ */
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab

View file

@ -38,6 +38,7 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo

View file

@ -56,7 +56,7 @@
extern const fixed_t finesine[5*FINEANGLES/4];
// Re-use data, is just PI/2 pahse shift.
extern const fixed_t *finecosine;
//extern const fixed_t *finecosine;
// Effective size is 4096.

View file

@ -21,53 +21,56 @@
#ifndef __VPO_API_H__
#define __VPO_API_H__
typedef void* VPOContext;
VPOContext VPO_NewContext();
void VPO_DeleteContext(VPOContext ctx);
// return error message when something fails
// (this will be a static buffer, so is not guaranteed to remain valid
// after any other API call)
const char *VPO_GetError(void);
const char *VPO_GetError(VPOContext ctx);
// try to load a wad file
// returns 0 on success, negative value on error
int VPO_LoadWAD(const char *wad_filename);
int VPO_LoadWAD(VPOContext ctx, const char *wad_filename);
// free all data associated with the wad file
// can be safely called without any loaded wad file
void VPO_FreeWAD(void);
void VPO_FreeWAD(VPOContext ctx);
// retrieve the map names in the wad, one at a time
// index starts at 0
// returns NULL when index is past the end of the list
// NOTE: return pointer is a static buffer, and is NOT guaranteed to
// remain valid once this function is called again
const char * VPO_GetMapName(unsigned int index, bool *is_hexen = NULL);
const char * VPO_GetMapName(VPOContext ctx, unsigned int index, bool *is_hexen = NULL);
// try to open a map from the current wad file
// returns 0 on success, negative value on error
int VPO_OpenMap(const char *map_name, bool *is_hexen = NULL);
int VPO_OpenMap(VPOContext ctx, const char *map_name, bool *is_hexen = NULL);
// free all data associated with a map
// can be safely called without any opened map
void VPO_CloseMap(void);
void VPO_CloseMap(VPOContext ctx);
// retrieve the linedefs in the current map, one at a time
// index starts at 0
// returns number of sides (0 to 2), or -1 for invalid index
int VPO_GetLinedef(unsigned int index, int *x1, int *y1, int *x2, int *y2);
int VPO_GetLinedef(VPOContext ctx, unsigned int index, int *x1, int *y1, int *x2, int *y2);
// retrieve a seg for the current map
// index starts at 0
// side value will be 0 for front/right, 1 for back/left
// returns a value >= 0 if valid, otherwise -1
int VPO_GetSeg(unsigned int index, int *linedef, int *side,
int *x1, int *y1, int *x2, int *y2);
int VPO_GetSeg(VPOContext ctx, unsigned int index, int *linedef, int *side, int *x1, int *y1, int *x2, int *y2);
// retrieve the bounding box of the map
void VPO_GetBBox(int *x1, int *y1, int *x2, int *y2);
void VPO_GetBBox(VPOContext ctx, int *x1, int *y1, int *x2, int *y2);
// open or close all sectors which seem to be doors
// dir must be > 0 to open them, or -1 to close them
void VPO_OpenDoorSectors(int dir);
void VPO_OpenDoorSectors(VPOContext ctx, int dir);
// test a spot and angle, returning the number of visplanes
// dz is the height above the floor (or offset from ceiling if < 0)
@ -88,7 +91,8 @@ void VPO_OpenDoorSectors(int dir);
#define RESULT_IN_VOID -2
#define RESULT_OVERFLOW -3
int VPO_TestSpot(int x, int y, int dz, int angle,
int VPO_TestSpot(VPOContext ctx,
int x, int y, int dz, int angle,
int *num_visplanes,
int *num_drawsegs,
int *num_openings,

View file

@ -0,0 +1,435 @@
//------------------------------------------------------------------------
// Visplane Overflow Library
//------------------------------------------------------------------------
//
// Copyright (C) 1993-1996 Id Software, Inc.
// Copyright (C) 2005 Simon Howard
// Copyright (C) 2012 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
#ifndef __VPO_LOCAL_H__
#define __VPO_LOCAL_H__
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable: 4244) // warning C4244: '=': conversion from '__int64' to 'int', possible loss of data
#pragma warning(disable: 4146) // warning C4146: unary minus operator applied to unsigned type, result still unsigned
#pragma warning(disable: 4267) // warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
#pragma warning(disable: 4996) // warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup.
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include "sys_type.h"
#include "sys_macro.h"
#include "sys_endian.h"
namespace vpo
{
#include "doomtype.h"
#include "doomdef.h"
#include "doomdata.h"
#include "m_bbox.h"
#include "m_fixed.h"
#include "w_file.h"
#include "w_wad.h"
#include "tables.h"
#include "r_defs.h"
#include "r_state.h"
#include "r_main.h"
#include "r_bsp.h"
#include "r_plane.h"
//------------------------------------------------------------
#define SHORT(x) LE_S16(x)
#define LONG(x) LE_S32(x)
const char * P_SetupLevel (const char *lumpname, bool *is_hexen );
void P_FreeLevelData (void);
void I_Error (const char *error, ...);
sector_t * X_SectorForPoint(fixed_t x, fixed_t y);
// exceptions thrown on overflows
class overflow_exception { };
//
// ClipWallSegment
// Clips the given range of columns
// and includes it in the new clip list.
//
typedef struct
{
int first;
int last;
} cliprange_t;
// andrewj: increased limit to 128 for Visplane Explorer
// #define MAXSOLIDSEGS 32
#define MAXSOLIDSEGS 128
typedef struct
{
// Should be "IWAD" or "PWAD".
char identification[4];
int numlumps;
int infotableofs;
} PACKEDATTR wadinfo_t;
typedef struct
{
int filepos;
int size;
char name[8];
} PACKEDATTR filelump_t;
struct Context
{
void M_ClearBox(fixed_t* box);
void M_AddToBox(fixed_t* box, fixed_t x, fixed_t y);
void LevelError(const char* msg, ...);
void P_LoadVertexes(int lump);
sector_t* GetSectorAtNullAddress();
void P_LoadSegs(int lump);
void P_LoadSubsectors(int lump);
void ValidateSubsectors();
void P_LoadSectors(int lump);
bool isChildValid(unsigned short child);
void P_LoadNodes(int lump);
void LineDef_CommonSetup(line_t* ld);
void P_LoadLineDefs(int lump);
void P_LoadLineDefs_Hexen(int lump);
void P_LoadSideDefs(int lump);
void P_GroupLines();
int HasManualDoor(const sector_t* sec);
void CalcDoorAltHeight(sector_t* sec);
void P_DetectDoorSectors();
const char* P_SetupLevel(const char* lumpname, bool* is_hexen);
void P_FreeLevelData();
void R_ClearDrawSegs();
void R_ClipSolidWallSegment(int first, int last);
void R_ClipPassWallSegment(int first, int last);
void R_ClearClipSegs();
void R_AddLine(seg_t* line);
boolean R_CheckBBox(fixed_t* bspcoord);
void R_Subsector(int num);
void R_RenderBSPNode(int bspnum);
void R_AddPointToBox(int x, int y, fixed_t* box);
int R_PointOnSide(fixed_t x, fixed_t y, node_t* node);
int R_PointOnSegSide(fixed_t x, fixed_t y, seg_t* line);
angle_t R_PointToAngle(fixed_t x, fixed_t y);
angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2);
fixed_t R_PointToDist(fixed_t x, fixed_t y);
fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
void R_InitBuffer(int width, int height);
void R_InitTextureMapping();
void R_SetViewSize(int blocks, int detail);
void R_Init();
subsector_t* R_PointInSubsector(fixed_t x, fixed_t y);
void R_SetupFrame(fixed_t x, fixed_t y, fixed_t z, angle_t angle);
void R_RenderView(fixed_t x, fixed_t y, fixed_t z, angle_t angle);
void R_ClearPlanes();
visplane_t* R_FindPlane(fixed_t height, int picnum, int lightlevel);
visplane_t* R_CheckPlane(visplane_t* pl, int start, int stop);
void R_RenderSegLoop();
void R_StoreWallRange(int start, int stop);
void ClearError();
void SetError(const char* msg, ...);
void I_Error(const char* error, ...);
int ClosestLine_CastingHoriz(fixed_t x, fixed_t y, int* side);
sector_t* X_SectorForPoint(fixed_t x, fixed_t y);
wad_file_t* W_OpenFile(const char* path);
void W_CloseFile(wad_file_t* wad);
size_t W_Read(wad_file_t* wad, unsigned int offset, void* buffer, size_t buffer_len);
int CheckMapHeader(filelump_t* lumps, int num_after);
bool W_AddFile(const char* filename);
void W_RemoveFile();
int W_NumLumps();
int W_CheckNumForName(const char* name);
int W_LumpLength(int lumpnum);
void W_ReadLump(int lump, void* dest);
byte* W_LoadLump(int lumpnum);
void W_FreeLump(byte* data);
void W_BeginRead();
void W_EndRead();
// the error message returned from P_SetupLevel()
char level_error_msg[1024] = {};
bool level_is_hexen = {};
vertex_t* vertexes = {};
int numvertexes = {};
seg_t* segs = {};
int numsegs = {};
sector_t* sectors = {};
int numsectors = {};
subsector_t* subsectors = {};
int numsubsectors = {};
node_t* nodes = {};
int numnodes = {};
line_t* lines = {};
int numlines = {};
side_t* sides = {};
int numsides = {};
fixed_t Map_bbox[4] = {};
seg_t* curline = {};
side_t* sidedef = {};
line_t* linedef = {};
sector_t* frontsector = {};
sector_t* backsector = {};
drawseg_t drawsegs[MAXDRAWSEGS + 10] = {};
drawseg_t* ds_p = {};
int total_drawsegs = {};
// newend is one past the last valid seg
cliprange_t solidsegs[MAXSOLIDSEGS + 8] = {};
cliprange_t* newend = {};
int max_solidsegs = {};
int viewangleoffset = {};
// increment every time a check is made
int validcount = 1;
int centerx = {};
int centery = {};
fixed_t centerxfrac = {};
fixed_t centeryfrac = {};
fixed_t projection = {};
// just for profiling purposes
int framecount = {};
int sscount = {};
int linecount = {};
int loopcount = {};
fixed_t viewx = {};
fixed_t viewy = {};
fixed_t viewz = {};
angle_t viewangle = {};
fixed_t viewcos = {};
fixed_t viewsin = {};
//
// precalculated math tables
//
angle_t clipangle = {};
// The viewangletox[viewangle + FINEANGLES/4] lookup
// maps the visible view angles to screen X coordinates,
// flattening the arc to a flat projection plane.
// There will be many angles mapped to the same X.
int viewangletox[FINEANGLES / 2] = {};
// The xtoviewangleangle[] table maps a screen pixel
// to the lowest viewangle that maps back to x ranges
// from clipangle to -clipangle.
angle_t xtoviewangle[SCREENWIDTH + 1] = {};
// UNUSED.
// The finetangentgent[angle+FINEANGLES/4] table
// holds the fixed_t tangent values for view angles,
// ranging from INT_MIN to 0 to INT_MAX.
// fixed_t finetangent[FINEANGLES/2];
// fixed_t finesine[5*FINEANGLES/4];
const fixed_t* finecosine = &finesine[FINEANGLES / 4];
// bumped light from gun blasts
int extralight = {};
// from R_DRAW
int viewwidth = {};
int scaledviewwidth = {};
int viewheight = {};
int viewwindowx = {};
int viewwindowy = {};
// from R_THINGS
fixed_t pspritescale = {};
fixed_t pspriteiscale = {};
short screenheightarray[SCREENWIDTH] = {};
short negonearray[SCREENWIDTH] = {};
//
// opening
//
// Here comes the obnoxious "visplane".
visplane_t visplanes[MAXVISPLANES + 10] = {};
visplane_t* lastvisplane = {};
visplane_t* floorplane = {};
visplane_t* ceilingplane = {};
int total_visplanes = {};
short openings[MAXOPENINGS + 400] = {};
short* lastopening = {};
int total_openings = {};
//
// Clip values are the solid pixel bounding the range.
// floorclip starts out SCREENHEIGHT
// ceilingclip starts out -1
//
short floorclip[SCREENWIDTH] = {};
short ceilingclip[SCREENWIDTH] = {};
//
// spanstart holds the start of a plane span
// initialized to 0 at start
//
int spanstart[SCREENHEIGHT] = {};
int spanstop[SCREENHEIGHT] = {};
//
// texture mapping
//
fixed_t planeheight = {};
fixed_t yslope[SCREENHEIGHT] = {};
fixed_t distscale[SCREENWIDTH] = {};
fixed_t basexscale = {};
fixed_t baseyscale = {};
fixed_t cachedheight[SCREENHEIGHT] = {};
fixed_t cacheddistance[SCREENHEIGHT] = {};
fixed_t cachedxstep[SCREENHEIGHT] = {};
fixed_t cachedystep[SCREENHEIGHT] = {};
// OPTIMIZE: closed two sided lines as single sided
// True if any of the segs textures might be visible.
boolean segtextured = {};
// False if the back side is the same plane.
boolean markfloor = {};
boolean markceiling = {};
boolean maskedtexture = {};
int toptexture = {};
int bottomtexture = {};
int midtexture = {};
angle_t rw_normalangle = {};
// angle to line origin
int rw_angle1 = {};
//
// regular wall
//
int rw_x = {};
int rw_stopx = {};
angle_t rw_centerangle = {};
fixed_t rw_offset = {};
fixed_t rw_distance = {};
fixed_t rw_scale = {};
fixed_t rw_scalestep = {};
fixed_t rw_midtexturemid = {};
fixed_t rw_toptexturemid = {};
fixed_t rw_bottomtexturemid = {};
int worldtop = {};
int worldbottom = {};
int worldhigh = {};
int worldlow = {};
fixed_t pixhigh = {};
fixed_t pixlow = {};
fixed_t pixhighstep = {};
fixed_t pixlowstep = {};
fixed_t topfrac = {};
fixed_t topstep = {};
fixed_t bottomfrac = {};
fixed_t bottomstep = {};
short* maskedtexturecol = {};
// R_DRAW bits
int dc_x = {};
int dc_yl = {};
int dc_yh = {};
fixed_t dc_iscale = {};
fixed_t dc_texturemid = {};
char error_buffer[1024] = {};
char mapname_buffer[16] = {};
// cache for the sector lookup
int last_x = {};
int last_y = {};
sector_t* last_sector = {};
// Location of each lump on disk.
lumpinfo_t* lumpinfo = {};
int numlumps = 0;
char* wad_filename = {};
wad_file_t* current_file = {};
};
} // namespace vpo
#endif /* __VPO_LOCAL_H__ */
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab

View file

@ -18,23 +18,16 @@
//
//------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
#include "vpo_api.h"
static char error_buffer[1024];
// cache for the sector lookup
static int last_x, last_y;
static vpo::sector_t *last_sector;
static void ClearError(void)
void vpo::Context::ClearError()
{
strcpy(error_buffer, "(No Error)");
}
static void SetError(const char *msg, ...)
void vpo::Context::SetError(const char *msg, ...)
{
va_list argptr;
@ -45,26 +38,40 @@ static void SetError(const char *msg, ...)
}
const char *VPO_GetError(void)
const char *VPO_GetError(VPOContext ctx)
{
return error_buffer;
vpo::Context* context = (vpo::Context*)ctx;
return context->error_buffer;
}
//------------------------------------------------------------------------
int VPO_LoadWAD(const char *wad_filename)
VPOContext VPO_NewContext()
{
ClearError();
return new vpo::Context();
}
void VPO_DeleteContext(VPOContext ctx)
{
vpo::Context* context = (vpo::Context*)ctx;
delete context;
}
int VPO_LoadWAD(VPOContext ctx, const char *wad_filename)
{
vpo::Context* context = (vpo::Context*)ctx;
context->ClearError();
// free any previously loaded wad
VPO_FreeWAD();
VPO_FreeWAD(ctx);
vpo::R_Init();
context->R_Init();
if (! vpo::W_AddFile(wad_filename))
if (! context->W_AddFile(wad_filename))
{
SetError("Missing or invalid wad file: %s", wad_filename);
context->SetError("Missing or invalid wad file: %s", wad_filename);
return -1;
}
@ -72,25 +79,27 @@ int VPO_LoadWAD(const char *wad_filename)
}
int VPO_OpenMap(const char *map_name, bool *is_hexen)
int VPO_OpenMap(VPOContext ctx, const char *map_name, bool *is_hexen)
{
vpo::Context* context = (vpo::Context*)ctx;
// check a wad is loaded
if (vpo::numlumps <= 0)
if (context->numlumps <= 0)
{
SetError("VPO_OpenMap called without any loaded wad");
context->SetError("VPO_OpenMap called without any loaded wad");
return -1;
}
ClearError();
context->ClearError();
// close any previously loaded map
VPO_CloseMap();
VPO_CloseMap(ctx);
const char *err_msg = vpo::P_SetupLevel(map_name, is_hexen);
const char *err_msg = context->P_SetupLevel(map_name, is_hexen);
if (err_msg)
{
SetError("%s", err_msg);
context->SetError("%s", err_msg);
return -1;
}
@ -98,43 +107,49 @@ int VPO_OpenMap(const char *map_name, bool *is_hexen)
}
void VPO_FreeWAD(void)
void VPO_FreeWAD(VPOContext ctx)
{
VPO_CloseMap();
vpo::Context* context = (vpo::Context*)ctx;
vpo::W_RemoveFile();
VPO_CloseMap(ctx);
context->W_RemoveFile();
}
void VPO_CloseMap(void)
void VPO_CloseMap(VPOContext ctx)
{
ClearError();
vpo::Context* context = (vpo::Context*)ctx;
last_x = -77777;
last_y = -77777;
last_sector = NULL;
context->ClearError();
vpo::P_FreeLevelData();
context->last_x = -77777;
context->last_y = -77777;
context->last_sector = NULL;
context->P_FreeLevelData();
}
const char * VPO_GetMapName(unsigned int index, bool *is_hexen)
const char * VPO_GetMapName(VPOContext ctx, unsigned int index, bool *is_hexen)
{
static char buffer[16];
vpo::Context* context = (vpo::Context*)ctx;
for (int lump_i = 0 ; lump_i < vpo::numlumps ; lump_i++)
char *buffer = context->mapname_buffer;
for (int lump_i = 0 ; lump_i < context->numlumps ; lump_i++)
{
if (! vpo::lumpinfo[lump_i].is_map_header)
if (! context->lumpinfo[lump_i].is_map_header)
continue;
if (index == 0)
{
// found it
memcpy(buffer, vpo::lumpinfo[lump_i].name, 8);
memcpy(buffer, context->lumpinfo[lump_i].name, 8);
buffer[8] = 0;
if (is_hexen)
*is_hexen = vpo::lumpinfo[lump_i].is_hexen;
*is_hexen = context->lumpinfo[lump_i].is_hexen;
return buffer;
}
@ -147,12 +162,14 @@ const char * VPO_GetMapName(unsigned int index, bool *is_hexen)
}
int VPO_GetLinedef(unsigned int index, int *x1, int *y1, int *x2, int *y2)
int VPO_GetLinedef(VPOContext ctx, unsigned int index, int *x1, int *y1, int *x2, int *y2)
{
if (index >= (unsigned int)vpo::numlines)
vpo::Context* context = (vpo::Context*)ctx;
if (index >= (unsigned int)context->numlines)
return -1;
const vpo::line_t *L = &vpo::lines[index];
const vpo::line_t *L = &context->lines[index];
*x1 = L->v1->x >> FRACBITS;
*y1 = L->v1->y >> FRACBITS;
@ -164,13 +181,15 @@ int VPO_GetLinedef(unsigned int index, int *x1, int *y1, int *x2, int *y2)
}
int VPO_GetSeg(unsigned int index, int *linedef, int *side,
int VPO_GetSeg(VPOContext ctx, unsigned int index, int *linedef, int *side,
int *x1, int *y1, int *x2, int *y2)
{
if (index >= (unsigned int)vpo::numsegs)
vpo::Context* context = (vpo::Context*)ctx;
if (index >= (unsigned int)context->numsegs)
return -1;
const vpo::seg_t *seg = &vpo::segs[index];
const vpo::seg_t *seg = &context->segs[index];
const vpo::line_t *L = seg->linedef;
*x1 = seg->v1->x >> FRACBITS;
@ -179,30 +198,34 @@ int VPO_GetSeg(unsigned int index, int *linedef, int *side,
*x2 = seg->v2->x >> FRACBITS;
*y2 = seg->v2->y >> FRACBITS;
*linedef = (L - vpo::lines);
*linedef = (L - context->lines);
*side = 0;
if (L->sidenum[1] >= 0 && seg->sidedef == &vpo::sides[L->sidenum[1]])
if (L->sidenum[1] >= 0 && seg->sidedef == &context->sides[L->sidenum[1]])
*side = 1;
return 0;
}
void VPO_GetBBox(int *x1, int *y1, int *x2, int *y2)
void VPO_GetBBox(VPOContext ctx, int *x1, int *y1, int *x2, int *y2)
{
*x1 = (vpo::Map_bbox[vpo::BOXLEFT] >> FRACBITS);
*y1 = (vpo::Map_bbox[vpo::BOXBOTTOM] >> FRACBITS);
*x2 = (vpo::Map_bbox[vpo::BOXRIGHT] >> FRACBITS);
*y2 = (vpo::Map_bbox[vpo::BOXTOP] >> FRACBITS);
vpo::Context* context = (vpo::Context*)ctx;
*x1 = (context->Map_bbox[vpo::BOXLEFT] >> FRACBITS);
*y1 = (context->Map_bbox[vpo::BOXBOTTOM] >> FRACBITS);
*x2 = (context->Map_bbox[vpo::BOXRIGHT] >> FRACBITS);
*y2 = (context->Map_bbox[vpo::BOXTOP] >> FRACBITS);
}
void VPO_OpenDoorSectors(int dir)
void VPO_OpenDoorSectors(VPOContext ctx, int dir)
{
for (int i = 0 ; i < vpo::numsectors ; i++)
vpo::Context* context = (vpo::Context*)ctx;
for (int i = 0 ; i < context->numsectors ; i++)
{
vpo::sector_t *sec = &vpo::sectors[i];
vpo::sector_t *sec = &context->sectors[i];
if (sec->is_door == 0)
continue;
@ -227,10 +250,12 @@ void VPO_OpenDoorSectors(int dir)
//------------------------------------------------------------------------
int VPO_TestSpot(int x, int y, int dz, int angle,
int VPO_TestSpot(VPOContext ctx, int x, int y, int dz, int angle,
int *num_visplanes, int *num_drawsegs,
int *num_openings, int *num_solidsegs)
{
vpo::Context* context = (vpo::Context*)ctx;
// the actual spot we will use
// (this prevents issues with X_SectorForPoint getting the wrong
// value when the casted ray hits a vertex)
@ -238,10 +263,10 @@ int VPO_TestSpot(int x, int y, int dz, int angle,
vpo::fixed_t ry = (y << FRACBITS) + (FRACUNIT / 2);
// check if spot is outside the map
if (rx < vpo::Map_bbox[vpo::BOXLEFT] ||
rx > vpo::Map_bbox[vpo::BOXRIGHT] ||
ry < vpo::Map_bbox[vpo::BOXBOTTOM] ||
ry > vpo::Map_bbox[vpo::BOXTOP])
if (rx < context->Map_bbox[vpo::BOXLEFT] ||
rx > context->Map_bbox[vpo::BOXRIGHT] ||
ry < context->Map_bbox[vpo::BOXBOTTOM] ||
ry > context->Map_bbox[vpo::BOXTOP])
{
return RESULT_IN_VOID;
}
@ -249,15 +274,15 @@ int VPO_TestSpot(int x, int y, int dz, int angle,
// optimization: we cache the last sector lookup
vpo::sector_t *sec;
if (x == last_x && y == last_y)
sec = last_sector;
if (x == context->last_x && y == context->last_y)
sec = context->last_sector;
else
{
sec = vpo::X_SectorForPoint(rx, ry);
sec = context->X_SectorForPoint(rx, ry);
last_x = x;
last_y = y;
last_sector = sec;
context->last_x = x;
context->last_y = y;
context->last_sector = sec;
}
if (! sec)
@ -286,17 +311,17 @@ int VPO_TestSpot(int x, int y, int dz, int angle,
// perform a no-draw render and see how many visplanes were needed
try
{
vpo::R_RenderView(rx, ry, rz, r_ang);
context->R_RenderView(rx, ry, rz, r_ang);
}
catch (vpo::overflow_exception& e)
catch (vpo::overflow_exception&)
{
result = RESULT_OVERFLOW;
}
*num_visplanes = MAX(*num_visplanes, vpo::total_visplanes);
*num_drawsegs = MAX(*num_drawsegs, vpo::total_drawsegs);
*num_openings = MAX(*num_openings, vpo::total_openings);
*num_solidsegs = MAX(*num_solidsegs, vpo::max_solidsegs);
*num_visplanes = MAX(*num_visplanes, context->total_visplanes);
*num_drawsegs = MAX(*num_drawsegs, context->total_drawsegs);
*num_openings = MAX(*num_openings, context->total_openings);
*num_solidsegs = MAX(*num_solidsegs, context->max_solidsegs);
return result;
}
@ -336,14 +361,16 @@ int main(int argc, char **argv)
printf("Loading file: %s [%s]\n", filename, map);
if (VPO_LoadWAD(filename) != 0)
VPOContext context = VPO_NewContext();
if (VPO_LoadWAD(context, filename) != 0)
{
printf("ERROR: %s\n", VPO_GetError());
fflush(stdout);
return 1;
}
if (VPO_OpenMap(map) != 0)
if (VPO_OpenMap(context, map) != 0)
{
printf("ERROR: %s\n", VPO_GetError());
fflush(stdout);
@ -351,14 +378,16 @@ int main(int argc, char **argv)
return 1;
}
int vp_num = VPO_TestSpot(TEST_VISPLANES, x, y, EYE_HEIGHT, angle);
int vp_num = VPO_TestSpot(context, TEST_VISPLANES, x, y, EYE_HEIGHT, angle);
printf("\n");
printf("Visplanes @ (%d %d) ---> %d\n", x, y, vp_num);
fflush(stdout);
VPO_CloseMap();
VPO_FreeWAD();
VPO_CloseMap(context);
VPO_FreeWAD(context);
VPO_DeleteContext(context);
return 0;
}

View file

@ -18,13 +18,14 @@
//
//------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
void I_Error (const char *error, ...)
void Context::I_Error (const char *error, ...)
{
va_list argptr;
@ -39,7 +40,7 @@ void I_Error (const char *error, ...)
}
static int ClosestLine_CastingHoriz(fixed_t x, fixed_t y, int *side)
int Context::ClosestLine_CastingHoriz(fixed_t x, fixed_t y, int *side)
{
int best_match = -1;
fixed_t best_dist = 32000 << FRACBITS;
@ -84,7 +85,7 @@ static int ClosestLine_CastingHoriz(fixed_t x, fixed_t y, int *side)
}
sector_t * X_SectorForPoint(fixed_t x, fixed_t y)
sector_t * Context::X_SectorForPoint(fixed_t x, fixed_t y)
{
/* hack, hack... I look for the first LineDef crossing
an horizontal half-line drawn from the cursor */

View file

@ -24,13 +24,14 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
wad_file_t *W_OpenFile(const char *path)
wad_file_t *Context::W_OpenFile(const char *path)
{
wad_file_t *result;
@ -53,7 +54,7 @@ wad_file_t *W_OpenFile(const char *path)
}
void W_CloseFile(wad_file_t *wad)
void Context::W_CloseFile(wad_file_t *wad)
{
fclose(wad->fstream);
@ -64,7 +65,7 @@ void W_CloseFile(wad_file_t *wad)
// Read data from the specified position in the file into the
// provided buffer. Returns the number of bytes read.
size_t W_Read(wad_file_t *wad, unsigned int offset,
size_t Context::W_Read(wad_file_t *wad, unsigned int offset,
void *buffer, size_t buffer_len)
{
size_t result;

View file

@ -36,6 +36,7 @@ typedef struct _wad_file_s
} wad_file_t;
/*
// Open the specified file. Returns a pointer to a new wad_file_t
// handle for the WAD file, or NULL if it could not be opened.
@ -51,5 +52,6 @@ void W_CloseFile(wad_file_t *wad);
size_t W_Read(wad_file_t *wad, unsigned int offset,
void *buffer, size_t buffer_len);
*/
#endif /* #ifndef __W_FILE__ */

View file

@ -23,53 +23,19 @@
//
//-----------------------------------------------------------------------------
#include "Precomp.h"
#include "vpo_local.h"
namespace vpo
{
typedef struct
{
// Should be "IWAD" or "PWAD".
char identification[4];
int numlumps;
int infotableofs;
} PACKEDATTR wadinfo_t;
typedef struct
{
int filepos;
int size;
char name[8];
} PACKEDATTR filelump_t;
//
// GLOBALS
//
// Location of each lump on disk.
lumpinfo_t *lumpinfo;
int numlumps = 0;
static char * wad_filename;
static wad_file_t * current_file;
//
// LUMP BASED ROUTINES.
//
// andrewj: added this to find level names
// returns 0 if not a level, 1 for DOOM, 2 for HEXEN format
static int CheckMapHeader(filelump_t *lumps, int num_after)
int Context::CheckMapHeader(filelump_t *lumps, int num_after)
{
static const char *level_lumps[] =
{
@ -113,7 +79,7 @@ static int CheckMapHeader(filelump_t *lumps, int num_after)
// Other files are single lumps with the base filename
// for the lump name.
bool W_AddFile (const char *filename)
bool Context::W_AddFile (const char *filename)
{
wadinfo_t header;
lumpinfo_t *lump_p;
@ -206,7 +172,7 @@ bool W_AddFile (const char *filename)
}
void W_RemoveFile(void)
void Context::W_RemoveFile(void)
{
if (wad_filename)
{
@ -225,7 +191,7 @@ void W_RemoveFile(void)
//
// W_NumLumps
//
int W_NumLumps (void)
int Context::W_NumLumps (void)
{
return numlumps;
}
@ -235,7 +201,7 @@ int W_NumLumps (void)
// W_CheckNumForName
// Returns -1 if name not found.
//
int W_CheckNumForName (const char* name)
int Context::W_CheckNumForName (const char* name)
{
int i;
@ -259,7 +225,7 @@ int W_CheckNumForName (const char* name)
// W_LumpLength
// Returns the buffer size needed to load the given lump.
//
int W_LumpLength (int lumpnum)
int Context::W_LumpLength (int lumpnum)
{
if (lumpnum >= numlumps)
{
@ -275,7 +241,7 @@ int W_LumpLength (int lumpnum)
// Loads the lump into the given buffer,
// which must be >= W_LumpLength().
//
static void W_ReadLump(int lump, void *dest)
void Context::W_ReadLump(int lump, void *dest)
{
int c;
lumpinfo_t *l;
@ -302,7 +268,7 @@ static void W_ReadLump(int lump, void *dest)
// Load a lump into memory and return a pointer to a buffer containing
// the lump data.
//
byte * W_LoadLump(int lumpnum)
byte * Context::W_LoadLump(int lumpnum)
{
byte *result;
@ -324,13 +290,13 @@ byte * W_LoadLump(int lumpnum)
}
void W_FreeLump(byte * data)
void Context::W_FreeLump(byte * data)
{
delete[] data;
}
void W_BeginRead(void)
void Context::W_BeginRead()
{
// check API usage
if (! wad_filename)
@ -348,7 +314,7 @@ void W_BeginRead(void)
}
void W_EndRead()
void Context::W_EndRead()
{
if (! current_file)
I_Error("W_EndRead called without a previous W_BeginRead.");

View file

@ -53,7 +53,7 @@ struct lumpinfo_s
bool is_hexen;
};
/*
extern lumpinfo_t *lumpinfo;
extern int numlumps;
@ -75,7 +75,7 @@ void W_EndRead();
byte * W_LoadLump(int lumpnum);
void W_FreeLump(byte * data);
*/
#endif /* __W_WAD__ */

View file

@ -58,3 +58,14 @@ EXPORTS
Matrix_RotationZ
Matrix_Scaling
Matrix_Multiply
VPO_NewContext
VPO_DeleteContext
VPO_GetError
VPO_LoadWAD
VPO_FreeWAD
VPO_GetMapName
VPO_OpenMap
VPO_CloseMap
VPO_GetLinedef
VPO_OpenDoorSectors
VPO_TestSpot

View file

@ -24,65 +24,57 @@ namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
#endregion
#region ================== APIs
#region ================== VPO bindings
[DllImport("kernel32.dll", SetLastError = true)]
private static extern IntPtr LoadLibrary(string filename);
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr VPO_NewContext();
[DllImport("kernel32.dll")]
private static extern IntPtr GetProcAddress(IntPtr modulehandle, string procedurename);
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl)]
private static extern void VPO_DeleteContext(IntPtr handle);
[DllImport("kernel32.dll")]
private static extern bool FreeLibrary(IntPtr modulehandle);
#endregion
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern string VPO_GetError(IntPtr handle);
#region ================== Delegates
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern int VPO_LoadWAD(IntPtr handle, string filename);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate string VPO_GetError();
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
private static extern int VPO_OpenMap(IntPtr handle, string mapname, ref bool isHexen);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int VPO_LoadWAD(string filename);
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl)]
private static extern void VPO_FreeWAD(IntPtr handle);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int VPO_OpenMap(string mapname, ref bool isHexen);
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl)]
private static extern void VPO_CloseMap(IntPtr handle);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void VPO_FreeWAD();
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl)]
private static extern void VPO_OpenDoorSectors(IntPtr handle, int dir);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void VPO_CloseMap();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] //mxd
private delegate void VPO_OpenDoorSectors(int dir);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int VPO_TestSpot(int x, int y, int dz, int angle,
ref int visplanes, ref int drawsegs, ref int openings, ref int solidsegs);
[DllImport("BuilderNative", CallingConvention = CallingConvention.Cdecl)]
private static extern int VPO_TestSpot(IntPtr handle, int x, int y, int dz, int angle, ref int visplanes, ref int drawsegs, ref int openings, ref int solidsegs);
#endregion
#region ================== Variables
// Main objects
private readonly string[] tempfiles;
private IntPtr[] dlls;
private Thread[] threads;
private List<Thread> threads = new List<Thread>();
// Map to load
private string filename;
private string mapname;
// Input and output queue (both require a lock on 'points' !)
// Input and output queue and stop flag (all require a lock on 'points' !)
private readonly Queue<TilePoint> points = new Queue<TilePoint>(EXPECTED_RESULTS_BUFFER);
private readonly Queue<PointData> results = new Queue<PointData>(EXPECTED_RESULTS_BUFFER);
private bool stopflag;
#endregion
#region ================== Properties
public int NumThreads { get { return Environment.ProcessorCount; } }
// Use up to 75% of CPU cores available
public int NumThreads { get { return Math.Max((Environment.ProcessorCount * 3 + 2) / 4, 1); } }
#endregion
@ -91,49 +83,12 @@ namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
// Constructor
public VPOManager()
{
// Load a DLL for each thread
dlls = new IntPtr[NumThreads];
tempfiles = new string[NumThreads];
// We must write the DLL file with a unique name for every thread,
// because LoadLibrary will share loaded libraries with the same
// names and LoadLibraryEx does not have a flag to force loading
// it multiple times.
Assembly thisasm = Assembly.GetExecutingAssembly();
Stream dllstream = thisasm.GetManifestResourceStream("CodeImp.DoomBuilder.Plugins.VisplaneExplorer.Resources.vpo.dll");
dllstream.Seek(0, SeekOrigin.Begin);
byte[] dllbytes = new byte[dllstream.Length];
dllstream.Read(dllbytes, 0, dllbytes.Length);
for(int i = 0; i < dlls.Length; i++)
{
// Write file with unique filename
tempfiles[i] = BuilderPlug.MakeTempFilename(".dll");
File.WriteAllBytes(tempfiles[i], dllbytes);
// Load it
dlls[i] = LoadLibrary(tempfiles[i]);
if(dlls[i] == IntPtr.Zero)
{
int error = Marshal.GetLastWin32Error(); //mxd
throw new Exception("Error " + error + " while loading vpo.dll: " + new Win32Exception(error).Message);
}
}
}
// Disposer
public void Dispose()
{
if(threads != null) Stop();
if(dlls != null)
{
for(int i = 0; i < dlls.Length; i++)
{
FreeLibrary(dlls[i]);
File.Delete(tempfiles[i]);
}
dlls = null;
}
Stop();
}
#endregion
@ -141,72 +96,61 @@ namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
#region ================== Processing
// The thread!
private void ProcessingThread(object index)
private void ProcessingThread()
{
// Get function pointers
//VPO_GetError GetError = (VPO_GetError)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dlls[(int)index], "VPO_GetError"), typeof(VPO_GetError));
VPO_LoadWAD LoadWAD = (VPO_LoadWAD)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dlls[(int)index], "VPO_LoadWAD"), typeof(VPO_LoadWAD));
VPO_OpenMap OpenMap = (VPO_OpenMap)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dlls[(int)index], "VPO_OpenMap"), typeof(VPO_OpenMap));
VPO_FreeWAD FreeWAD = (VPO_FreeWAD)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dlls[(int)index], "VPO_FreeWAD"), typeof(VPO_FreeWAD));
VPO_CloseMap CloseMap = (VPO_CloseMap)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dlls[(int)index], "VPO_CloseMap"), typeof(VPO_CloseMap));
VPO_OpenDoorSectors OpenDoors = (VPO_OpenDoorSectors)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dlls[(int)index], "VPO_OpenDoorSectors"), typeof(VPO_OpenDoorSectors)); //mxd
VPO_TestSpot TestSpot = (VPO_TestSpot)Marshal.GetDelegateForFunctionPointer(GetProcAddress(dlls[(int)index], "VPO_TestSpot"), typeof(VPO_TestSpot));
IntPtr context = VPO_NewContext();
try
// Load the map
bool isHexen = General.Map.HEXEN;
if(VPO_LoadWAD(context, filename) != 0) throw new Exception("VPO is unable to read this file.");
if(VPO_OpenMap(context, mapname, ref isHexen) != 0) throw new Exception("VPO is unable to open this map.");
VPO_OpenDoorSectors(context, BuilderPlug.InterfaceForm.OpenDoors ? 1 : -1); //mxd
// Processing
Queue<TilePoint> todo = new Queue<TilePoint>(POINTS_PER_ITERATION);
Queue<PointData> done = new Queue<PointData>(POINTS_PER_ITERATION);
while(true)
{
// Load the map
bool isHexen = General.Map.HEXEN;
if(LoadWAD(filename) != 0) throw new Exception("VPO is unable to read this file.");
if(OpenMap(mapname, ref isHexen) != 0) throw new Exception("VPO is unable to open this map.");
OpenDoors(BuilderPlug.InterfaceForm.OpenDoors ? 1 : -1); //mxd
// Processing
Queue<TilePoint> todo = new Queue<TilePoint>(POINTS_PER_ITERATION);
Queue<PointData> done = new Queue<PointData>(POINTS_PER_ITERATION);
while(true)
lock(points)
{
lock(points)
{
// Flush done points to the results
int numdone = done.Count;
for(int i = 0; i < numdone; i++)
results.Enqueue(done.Dequeue());
// Get points from the waiting queue into my todo queue for processing
int numtodo = Math.Min(POINTS_PER_ITERATION, points.Count);
for(int i = 0; i < numtodo; i++)
todo.Enqueue(points.Dequeue());
}
// Wait for work
if (points.Count == 0 && !stopflag)
Monitor.Wait(points);
// Don't keep locking!
if(todo.Count == 0)
Thread.Sleep(31);
// Flush done points to the results
int numdone = done.Count;
for(int i = 0; i < numdone; i++)
results.Enqueue(done.Dequeue());
if (stopflag)
break;
// Get points from the waiting queue into my todo queue for processing
int numtodo = Math.Min(POINTS_PER_ITERATION, points.Count);
for(int i = 0; i < numtodo; i++)
todo.Enqueue(points.Dequeue());
}
// Process the points
while(todo.Count > 0)
// Process the points
while(todo.Count > 0)
{
TilePoint p = todo.Dequeue();
PointData pd = new PointData();
pd.point = p;
for(int i = 0; i < TEST_ANGLES.Length; i++)
{
TilePoint p = todo.Dequeue();
PointData pd = new PointData();
pd.point = p;
for(int i = 0; i < TEST_ANGLES.Length; i++)
{
pd.result = (PointResult)TestSpot(p.x, p.y, TEST_HEIGHT, TEST_ANGLES[i],
ref pd.visplanes, ref pd.drawsegs, ref pd.openings, ref pd.solidsegs);
}
done.Enqueue(pd);
pd.result = (PointResult)VPO_TestSpot(context, p.x, p.y, TEST_HEIGHT, TEST_ANGLES[i],
ref pd.visplanes, ref pd.drawsegs, ref pd.openings, ref pd.solidsegs);
}
done.Enqueue(pd);
}
}
catch(ThreadInterruptedException)
{
}
finally
{
CloseMap();
FreeWAD();
}
VPO_CloseMap(context);
VPO_FreeWAD(context);
VPO_DeleteContext(context);
}
#endregion
@ -216,50 +160,44 @@ namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
// This loads a map
public void Start(string filename, string mapname)
{
Stop();
this.filename = filename;
this.mapname = mapname;
results.Clear();
// Start a thread on each core
threads = new Thread[dlls.Length];
for(int i = 0; i < threads.Length; i++)
for(int i = 0; i < NumThreads; i++)
{
threads[i] = new Thread(ProcessingThread);
threads[i].Priority = ThreadPriority.BelowNormal;
threads[i].Name = "Visplane Explorer " + i;
threads[i].Start(i);
var thread = new Thread(ProcessingThread);
thread.Name = "Visplane Explorer " + i;
thread.Start();
threads.Add(thread);
}
}
// This frees the map
public void Stop()
{
if(threads != null)
lock (points)
{
lock(points)
{
// Stop all threads
for(int i = 0; i < threads.Length; i++)
{
threads[i].Interrupt();
threads[i].Join();
}
threads = null;
points.Clear();
results.Clear();
}
stopflag = true;
Monitor.PulseAll(points);
}
foreach (Thread thread in threads)
{
thread.Join();
}
threads.Clear();
lock (points)
{
results.Clear();
points.Clear();
stopflag = false;
}
}
// This clears the list of enqueued points
/*public void ClearPoints()
{
lock(points)
{
points.Clear();
}
}*/
// This gives points to process and returns the total points left in the buffer
public int EnqueuePoints(IEnumerable<TilePoint> newpoints)
{
@ -267,6 +205,7 @@ namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
{
foreach(TilePoint p in newpoints)
points.Enqueue(p);
Monitor.PulseAll(points);
return points.Count;
}
}

View file

@ -159,7 +159,6 @@
<EmbeddedResource Include="Resources\Gauge.png" />
<Content Include="Resources\Gauge_large.ico" />
<None Include="Resources\Heatmap_pal.png" />
<EmbeddedResource Include="Resources\vpo.dll" />
<None Include="Resources\Solidsegs_pal.png" />
<None Include="Resources\Openings_pal.png" />
<None Include="Resources\Visplanes_pal.png" />

View file

@ -1,13 +0,0 @@
EXPORTS
VPO_GetError
VPO_LoadWAD
VPO_FreeWAD
VPO_GetMapName
VPO_OpenMap
VPO_CloseMap
VPO_GetLinedef
VPO_OpenDoorSectors
VPO_TestSpot

View file

@ -1,326 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="vpo_dll"
ProjectGUID="{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}"
RootNamespace="vpo_dll"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)\Source\Plugins\VisplaneExplorer\Resources"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\vpo.dll"
ModuleDefinitionFile="exports.def"
GenerateDebugInformation="true"
SubSystem="2"
FixedBaseAddress="1"
SupportUnloadOfDelayLoadedDLL="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)\Source\Plugins\VisplaneExplorer\Resources"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="4"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;"
PreprocessorDefinitions="WIN32;_RELEASE;_WINDOWS;_USRDLL"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="2"
FloatingPointModel="2"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)\vpo.dll"
ModuleDefinitionFile="exports.def"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
FixedBaseAddress="1"
SupportUnloadOfDelayLoadedDLL="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\m_bbox.cc"
>
</File>
<File
RelativePath=".\m_fixed.cc"
>
</File>
<File
RelativePath=".\p_setup.cc"
>
</File>
<File
RelativePath=".\r_bsp.cc"
>
</File>
<File
RelativePath=".\r_main.cc"
>
</File>
<File
RelativePath=".\r_plane.cc"
>
</File>
<File
RelativePath=".\r_segs.cc"
>
</File>
<File
RelativePath=".\tables.cc"
>
</File>
<File
RelativePath=".\vpo_main.cc"
>
</File>
<File
RelativePath=".\vpo_stuff.cc"
>
</File>
<File
RelativePath=".\w_file.cc"
>
</File>
<File
RelativePath=".\w_wad.cc"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\doomdata.h"
>
</File>
<File
RelativePath=".\doomdef.h"
>
</File>
<File
RelativePath=".\doomtype.h"
>
</File>
<File
RelativePath=".\exports.def"
>
</File>
<File
RelativePath=".\inttypes.h"
>
</File>
<File
RelativePath=".\m_bbox.h"
>
</File>
<File
RelativePath=".\m_fixed.h"
>
</File>
<File
RelativePath=".\r_bsp.h"
>
</File>
<File
RelativePath=".\r_defs.h"
>
</File>
<File
RelativePath=".\r_main.h"
>
</File>
<File
RelativePath=".\r_plane.h"
>
</File>
<File
RelativePath=".\r_state.h"
>
</File>
<File
RelativePath=".\stdint.h"
>
</File>
<File
RelativePath=".\sys_endian.h"
>
</File>
<File
RelativePath=".\sys_macro.h"
>
</File>
<File
RelativePath=".\sys_type.h"
>
</File>
<File
RelativePath=".\tables.h"
>
</File>
<File
RelativePath=".\vpo_api.h"
>
</File>
<File
RelativePath=".\vpo_local.h"
>
</File>
<File
RelativePath=".\w_file.h"
>
</File>
<File
RelativePath=".\w_wad.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -1,221 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}</ProjectGuid>
<RootNamespace>vpo_dll</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(ProjectDir)..\VisplaneExplorer\Resources\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(ProjectDir)..\VisplaneExplorer\Resources\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(ProjectDir)..\VisplaneExplorer\Resources\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(ProjectDir)..\VisplaneExplorer\Resources\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)vpo.dll</OutputFile>
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<FixedBaseAddress>false</FixedBaseAddress>
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)vpo.dll</OutputFile>
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<FixedBaseAddress>false</FixedBaseAddress>
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_RELEASE;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)vpo.dll</OutputFile>
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<FixedBaseAddress>false</FixedBaseAddress>
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_RELEASE;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)vpo.dll</OutputFile>
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<FixedBaseAddress>false</FixedBaseAddress>
<SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="m_bbox.cc" />
<ClCompile Include="m_fixed.cc" />
<ClCompile Include="p_setup.cc" />
<ClCompile Include="r_bsp.cc" />
<ClCompile Include="r_main.cc" />
<ClCompile Include="r_plane.cc" />
<ClCompile Include="r_segs.cc" />
<ClCompile Include="tables.cc" />
<ClCompile Include="vpo_main.cc" />
<ClCompile Include="vpo_stuff.cc" />
<ClCompile Include="w_file.cc" />
<ClCompile Include="w_wad.cc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="doomdata.h" />
<ClInclude Include="doomdef.h" />
<ClInclude Include="doomtype.h" />
<ClInclude Include="inttypes.h" />
<ClInclude Include="m_bbox.h" />
<ClInclude Include="m_fixed.h" />
<ClInclude Include="r_bsp.h" />
<ClInclude Include="r_defs.h" />
<ClInclude Include="r_main.h" />
<ClInclude Include="r_plane.h" />
<ClInclude Include="r_state.h" />
<ClInclude Include="stdint.h" />
<ClInclude Include="sys_endian.h" />
<ClInclude Include="sys_macro.h" />
<ClInclude Include="sys_type.h" />
<ClInclude Include="tables.h" />
<ClInclude Include="vpo_api.h" />
<ClInclude Include="vpo_local.h" />
<ClInclude Include="w_file.h" />
<ClInclude Include="w_wad.h" />
</ItemGroup>
<ItemGroup>
<None Include="exports.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,118 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="m_bbox.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="m_fixed.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="p_setup.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="r_bsp.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="r_main.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="r_plane.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="r_segs.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="tables.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="vpo_main.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="vpo_stuff.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="w_file.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="w_wad.cc">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="doomdata.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="doomdef.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="doomtype.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="inttypes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="m_bbox.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="m_fixed.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="r_bsp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="r_defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="r_main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="r_plane.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="r_state.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdint.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sys_endian.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sys_macro.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sys_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="tables.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="vpo_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="vpo_local.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="w_file.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="w_wad.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="exports.def">
<Filter>Header Files</Filter>
</None>
</ItemGroup>
</Project>

View file

@ -1,78 +0,0 @@
//------------------------------------------------------------------------
// Visplane Overflow Library
//------------------------------------------------------------------------
//
// Copyright (C) 1993-1996 Id Software, Inc.
// Copyright (C) 2005 Simon Howard
// Copyright (C) 2012 Andrew Apted
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//------------------------------------------------------------------------
#ifndef __VPO_LOCAL_H__
#define __VPO_LOCAL_H__
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include "sys_type.h"
#include "sys_macro.h"
#include "sys_endian.h"
namespace vpo
{
#include "doomtype.h"
#include "doomdef.h"
#include "doomdata.h"
#include "m_bbox.h"
#include "m_fixed.h"
#include "w_file.h"
#include "w_wad.h"
#include "tables.h"
#include "r_defs.h"
#include "r_state.h"
#include "r_main.h"
#include "r_bsp.h"
#include "r_plane.h"
//------------------------------------------------------------
#define SHORT(x) LE_S16(x)
#define LONG(x) LE_S32(x)
const char * P_SetupLevel (const char *lumpname, bool *is_hexen );
void P_FreeLevelData (void);
void I_Error (const char *error, ...);
sector_t * X_SectorForPoint(fixed_t x, fixed_t y);
// exceptions thrown on overflows
class overflow_exception { };
} // namespace vpo
#endif /* __VPO_LOCAL_H__ */
//--- editor settings ---
// vi:ts=4:sw=4:noexpandtab