mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-26 06:01:14 +00:00
- GZDoom project files and GZDoom related changes to main ZDoom code
This commit is contained in:
parent
a73d1b792c
commit
b2bb24ea0a
7 changed files with 7355 additions and 12 deletions
7159
gzdoom.vcproj
Normal file
7159
gzdoom.vcproj
Normal file
File diff suppressed because it is too large
Load diff
|
@ -8,6 +8,7 @@ include( CheckCXXSourceCompiles )
|
||||||
include( CheckFunctionExists )
|
include( CheckFunctionExists )
|
||||||
include( CheckCXXCompilerFlag )
|
include( CheckCXXCompilerFlag )
|
||||||
include( FindPkgConfig )
|
include( FindPkgConfig )
|
||||||
|
include( FindOpenGL )
|
||||||
|
|
||||||
option( NO_ASM "Disable assembly code" )
|
option( NO_ASM "Disable assembly code" )
|
||||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||||
|
@ -201,6 +202,22 @@ else( WIN32 )
|
||||||
endif( FPU_CONTROL_DIR )
|
endif( FPU_CONTROL_DIR )
|
||||||
endif( WIN32 )
|
endif( WIN32 )
|
||||||
|
|
||||||
|
if( X64 )
|
||||||
|
set( NO_ASM ON )
|
||||||
|
endif( X64 )
|
||||||
|
|
||||||
|
# Check if we have OpenGL
|
||||||
|
|
||||||
|
if( NOT OPENGL_FOUND )
|
||||||
|
message( FATAL_ERROR "OpenGL is required for building." )
|
||||||
|
endif( NOT OPENGL_FOUND )
|
||||||
|
if( NOT OPENGL_GLU_FOUND )
|
||||||
|
message( FATAL_ERROR "OpenGL GLU is required for building." )
|
||||||
|
endif( NOT OPENGL_GLU_FOUND )
|
||||||
|
|
||||||
|
set( ZDOOM_LIBS ${ZDOOM_LIBS} ${OPENGL_LIBRARIES} )
|
||||||
|
include_directories( ${OPENGL_INCLUDE_DIR} )
|
||||||
|
|
||||||
# Decide on the name of the FMOD library we want to use.
|
# Decide on the name of the FMOD library we want to use.
|
||||||
|
|
||||||
if( NOT FMOD_LIB_NAME AND MSVC )
|
if( NOT FMOD_LIB_NAME AND MSVC )
|
||||||
|
@ -528,6 +545,7 @@ if( WIN32 )
|
||||||
win32/i_movie.cpp
|
win32/i_movie.cpp
|
||||||
win32/i_system.cpp
|
win32/i_system.cpp
|
||||||
win32/st_start.cpp
|
win32/st_start.cpp
|
||||||
|
win32/win32gliface.cpp
|
||||||
win32/win32video.cpp )
|
win32/win32video.cpp )
|
||||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||||
# CMake is not set up to compile and link rc files with GCC. :(
|
# CMake is not set up to compile and link rc files with GCC. :(
|
||||||
|
@ -549,6 +567,7 @@ else( WIN32 )
|
||||||
sdl/i_main.cpp
|
sdl/i_main.cpp
|
||||||
sdl/i_movie.cpp
|
sdl/i_movie.cpp
|
||||||
sdl/i_system.cpp
|
sdl/i_system.cpp
|
||||||
|
sdl/sdlglvideo.cpp
|
||||||
sdl/sdlvideo.cpp
|
sdl/sdlvideo.cpp
|
||||||
sdl/st_start.cpp )
|
sdl/st_start.cpp )
|
||||||
if( APPLE )
|
if( APPLE )
|
||||||
|
@ -841,6 +860,57 @@ add_executable( zdoom WIN32
|
||||||
menu/playermenu.cpp
|
menu/playermenu.cpp
|
||||||
menu/readthis.cpp
|
menu/readthis.cpp
|
||||||
menu/videomenu.cpp
|
menu/videomenu.cpp
|
||||||
|
gl/data/gl_sections.cpp
|
||||||
|
gl/data/gl_data.cpp
|
||||||
|
gl/data/gl_portaldata.cpp
|
||||||
|
gl/data/gl_setup.cpp
|
||||||
|
gl/data/gl_vertexbuffer.cpp
|
||||||
|
gl/dynlights/a_dynlight.cpp
|
||||||
|
gl/utility/gl_clock.cpp
|
||||||
|
gl/utility/gl_cycler.cpp
|
||||||
|
gl/utility/gl_geometric.cpp
|
||||||
|
gl/renderer/gl_renderer.cpp
|
||||||
|
gl/renderer/gl_renderstate.cpp
|
||||||
|
gl/renderer/gl_lightdata.cpp
|
||||||
|
gl/textures/gl_hwtexture.cpp
|
||||||
|
gl/textures/gl_texture.cpp
|
||||||
|
gl/textures/gl_material.cpp
|
||||||
|
gl/textures/gl_hirestex.cpp
|
||||||
|
gl/textures/gl_bitmap.cpp
|
||||||
|
gl/textures/gl_translate.cpp
|
||||||
|
gl/textures/gl_hqresize.cpp
|
||||||
|
gl/textures/gl_skyboxtexture.cpp
|
||||||
|
gl/scene/gl_bsp.cpp
|
||||||
|
gl/scene/gl_fakeflat.cpp
|
||||||
|
gl/scene/gl_clipper.cpp
|
||||||
|
gl/scene/gl_decal.cpp
|
||||||
|
gl/scene/gl_drawinfo.cpp
|
||||||
|
gl/scene/gl_flats.cpp
|
||||||
|
gl/scene/gl_walls.cpp
|
||||||
|
gl/scene/gl_sprite.cpp
|
||||||
|
gl/scene/gl_skydome.cpp
|
||||||
|
gl/scene/gl_renderhacks.cpp
|
||||||
|
gl/scene/gl_weapon.cpp
|
||||||
|
gl/scene/gl_scene.cpp
|
||||||
|
gl/scene/gl_sky.cpp
|
||||||
|
gl/scene/gl_portal.cpp
|
||||||
|
gl/scene/gl_walls_draw.cpp
|
||||||
|
gl/scene/gl_vertex.cpp
|
||||||
|
gl/scene/gl_spritelight.cpp
|
||||||
|
gl/dynlights/gl_dynlight.cpp
|
||||||
|
gl/dynlights/gl_glow.cpp
|
||||||
|
gl/dynlights/gl_dynlight1.cpp
|
||||||
|
gl/dynlights/gl_lightbuffer.cpp
|
||||||
|
gl/shaders/gl_shader.cpp
|
||||||
|
gl/shaders/gl_texshader.cpp
|
||||||
|
gl/system/gl_interface.cpp
|
||||||
|
gl/system/gl_framebuffer.cpp
|
||||||
|
gl/system/gl_menu.cpp
|
||||||
|
gl/system/gl_wipe.cpp
|
||||||
|
gl/models/gl_models_md3.cpp
|
||||||
|
gl/models/gl_models_md2.cpp
|
||||||
|
gl/models/gl_models.cpp
|
||||||
|
gl/models/gl_voxels.cpp
|
||||||
oplsynth/fmopl.cpp
|
oplsynth/fmopl.cpp
|
||||||
oplsynth/mlopl.cpp
|
oplsynth/mlopl.cpp
|
||||||
oplsynth/mlopl_io.cpp
|
oplsynth/mlopl_io.cpp
|
||||||
|
|
|
@ -1013,6 +1013,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasSpecialDeathStates () const;
|
bool HasSpecialDeathStates () const;
|
||||||
|
|
||||||
|
// begin of GZDoom specific additions
|
||||||
|
TArray<TObjPtr<AActor> > dynamiclights;
|
||||||
|
void * lightassociations;
|
||||||
|
bool hasmodel;
|
||||||
|
// end of GZDoom specific additions
|
||||||
|
|
||||||
|
size_t PropagateMark();
|
||||||
};
|
};
|
||||||
|
|
||||||
class FActorIterator
|
class FActorIterator
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "r_data/colormaps.h"
|
#include "r_data/colormaps.h"
|
||||||
|
|
||||||
#ifdef _3DFLOORS
|
#ifdef _3DFLOORS
|
||||||
|
EXTERN_CVAR(Int, vid_renderer)
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -200,7 +201,7 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag
|
||||||
|
|
||||||
// kg3D - software renderer only hack
|
// kg3D - software renderer only hack
|
||||||
// this is really required because of ceilingclip and floorclip
|
// this is really required because of ceilingclip and floorclip
|
||||||
if(flags & FF_BOTHPLANES)
|
if((vid_renderer == 0) && (flags & FF_BOTHPLANES))
|
||||||
{
|
{
|
||||||
P_Add3DFloor(sec, sec2, master, FF_EXISTS | FF_THISINSIDE | FF_RENDERPLANES | FF_NOSHADE | FF_SEETHROUGH | FF_SHOOTTHROUGH |
|
P_Add3DFloor(sec, sec2, master, FF_EXISTS | FF_THISINSIDE | FF_RENDERPLANES | FF_NOSHADE | FF_SEETHROUGH | FF_SHOOTTHROUGH |
|
||||||
(flags & (FF_INVERTSECTOR | FF_TRANSLUCENT | FF_ADDITIVETRANS)), alpha);
|
(flags & (FF_INVERTSECTOR | FF_TRANSLUCENT | FF_ADDITIVETRANS)), alpha);
|
||||||
|
|
|
@ -389,6 +389,9 @@ void P_SerializeWorld (FArchive &arc)
|
||||||
<< desaturate;
|
<< desaturate;
|
||||||
sec->ColorMap = GetSpecialLights (color, fade, desaturate);
|
sec->ColorMap = GetSpecialLights (color, fade, desaturate);
|
||||||
}
|
}
|
||||||
|
// begin of GZDoom additions
|
||||||
|
arc << sec->reflect[sector_t::ceiling] << sec->reflect[sector_t::floor];
|
||||||
|
// end of GZDoom additions
|
||||||
}
|
}
|
||||||
|
|
||||||
// do lines
|
// do lines
|
||||||
|
|
100
src/r_defs.h
100
src/r_defs.h
|
@ -35,6 +35,9 @@
|
||||||
// to handle sound origins in sectors.
|
// to handle sound origins in sectors.
|
||||||
// SECTORS do store MObjs anyway.
|
// SECTORS do store MObjs anyway.
|
||||||
#include "actor.h"
|
#include "actor.h"
|
||||||
|
struct FLightNode;
|
||||||
|
struct FGLSection;
|
||||||
|
struct seg_t;
|
||||||
|
|
||||||
#include "dthinker.h"
|
#include "dthinker.h"
|
||||||
|
|
||||||
|
@ -81,15 +84,43 @@ struct vertex_t
|
||||||
{
|
{
|
||||||
fixed_t x, y;
|
fixed_t x, y;
|
||||||
|
|
||||||
|
float fx, fy; // Floating point coordinates of this vertex (excluding polyoblect translation!)
|
||||||
|
angle_t viewangle; // precalculated angle for clipping
|
||||||
|
int angletime; // recalculation time for view angle
|
||||||
|
bool dirty; // something has changed and needs to be recalculated
|
||||||
|
int numheights;
|
||||||
|
int numsectors;
|
||||||
|
sector_t ** sectors;
|
||||||
|
float * heightlist;
|
||||||
|
|
||||||
|
vertex_t()
|
||||||
|
{
|
||||||
|
x = y = 0;
|
||||||
|
fx = fy = 0;
|
||||||
|
angletime = 0;
|
||||||
|
viewangle = 0;
|
||||||
|
dirty = true;
|
||||||
|
numheights = numsectors = 0;
|
||||||
|
sectors = NULL;
|
||||||
|
heightlist = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator== (const vertex_t &other)
|
bool operator== (const vertex_t &other)
|
||||||
{
|
{
|
||||||
return x == other.x && y == other.y;
|
return x == other.x && y == other.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator!= (const vertex_t &other)
|
||||||
|
{
|
||||||
|
return x != other.x || y != other.y;
|
||||||
|
}
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
x = y = 0;
|
x = y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
angle_t GetClipAngle();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Forward of LineDefs, for Sectors.
|
// Forward of LineDefs, for Sectors.
|
||||||
|
@ -319,6 +350,12 @@ FArchive &operator<< (FArchive &arc, secplane_t &plane);
|
||||||
|
|
||||||
|
|
||||||
#include "p_3dfloors.h"
|
#include "p_3dfloors.h"
|
||||||
|
struct subsector_t;
|
||||||
|
struct sector_t;
|
||||||
|
struct side_t;
|
||||||
|
extern bool gl_plane_reflection_i;
|
||||||
|
struct FPortal;
|
||||||
|
|
||||||
// Ceiling/floor flags
|
// Ceiling/floor flags
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -723,6 +760,41 @@ struct sector_t
|
||||||
int sectornum; // for comparing sector copies
|
int sectornum; // for comparing sector copies
|
||||||
|
|
||||||
extsector_t * e; // This stores data that requires construction/destruction. Such data must not be copied by R_FakeFlat.
|
extsector_t * e; // This stores data that requires construction/destruction. Such data must not be copied by R_FakeFlat.
|
||||||
|
|
||||||
|
// GL only stuff starts here
|
||||||
|
float reflect[2];
|
||||||
|
|
||||||
|
int dirtyframe[3]; // last frame this sector was marked dirty
|
||||||
|
bool dirty; // marked for recalculation
|
||||||
|
bool transdoor; // For transparent door hacks
|
||||||
|
fixed_t transdoorheight; // for transparent door hacks
|
||||||
|
int subsectorcount; // list of subsectors
|
||||||
|
subsector_t ** subsectors;
|
||||||
|
FPortal * portals[2]; // floor and ceiling portals
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
vbo_fakefloor = floor+2,
|
||||||
|
vbo_fakeceiling = ceiling+2,
|
||||||
|
};
|
||||||
|
|
||||||
|
int vboindex[4]; // VBO indices of the 4 planes this sector uses during rendering
|
||||||
|
fixed_t vboheight[2]; // Last calculated height for the 2 planes of this actual sector
|
||||||
|
int vbocount[2]; // Total count of vertices belonging to this sector's planes
|
||||||
|
#ifdef IBO_TEST
|
||||||
|
int iboindex[4]; // VBO indices of the 4 planes this sector uses during rendering
|
||||||
|
int ibocount;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
float GetReflect(int pos) { return gl_plane_reflection_i? reflect[pos] : 0; }
|
||||||
|
bool VBOHeightcheck(int pos) const { return vboheight[pos] == GetPlaneTexZ(pos); }
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
INVALIDATE_PLANES = 1,
|
||||||
|
INVALIDATE_OTHER = 2
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FArchive &operator<< (FArchive &arc, sector_t::splane &p);
|
FArchive &operator<< (FArchive &arc, sector_t::splane &p);
|
||||||
|
@ -877,6 +949,13 @@ struct side_t
|
||||||
|
|
||||||
vertex_t *V1() const;
|
vertex_t *V1() const;
|
||||||
vertex_t *V2() const;
|
vertex_t *V2() const;
|
||||||
|
|
||||||
|
//For GL
|
||||||
|
FLightNode * lighthead[2]; // all blended lights that may affect this wall
|
||||||
|
|
||||||
|
seg_t **segs; // all segs belonging to this sidedef in ascending order. Used for precise rendering
|
||||||
|
int numsegs;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FArchive &operator<< (FArchive &arc, side_t::part &p);
|
FArchive &operator<< (FArchive &arc, side_t::part &p);
|
||||||
|
@ -957,6 +1036,11 @@ struct seg_t
|
||||||
// Sector references. Could be retrieved from linedef, too.
|
// Sector references. Could be retrieved from linedef, too.
|
||||||
sector_t* frontsector;
|
sector_t* frontsector;
|
||||||
sector_t* backsector; // NULL for one-sided lines
|
sector_t* backsector; // NULL for one-sided lines
|
||||||
|
|
||||||
|
seg_t* PartnerSeg;
|
||||||
|
subsector_t* Subsector;
|
||||||
|
|
||||||
|
float sidefrac; // relative position of seg's ending vertex on owning sidedef
|
||||||
};
|
};
|
||||||
|
|
||||||
struct glsegextra_t
|
struct glsegextra_t
|
||||||
|
@ -965,6 +1049,9 @@ struct glsegextra_t
|
||||||
subsector_t *Subsector;
|
subsector_t *Subsector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern seg_t *segs;
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// A SubSector.
|
// A SubSector.
|
||||||
// References a Sector.
|
// References a Sector.
|
||||||
|
@ -979,6 +1066,12 @@ enum
|
||||||
SSECF_POLYORG = 4,
|
SSECF_POLYORG = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct FPortalCoverage
|
||||||
|
{
|
||||||
|
DWORD * subsectors;
|
||||||
|
int sscount;
|
||||||
|
};
|
||||||
|
|
||||||
struct subsector_t
|
struct subsector_t
|
||||||
{
|
{
|
||||||
sector_t *sector;
|
sector_t *sector;
|
||||||
|
@ -990,6 +1083,13 @@ struct subsector_t
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
void BuildPolyBSP();
|
void BuildPolyBSP();
|
||||||
|
// subsector related GL data
|
||||||
|
FLightNode * lighthead[2]; // Light nodes (blended and additive)
|
||||||
|
int validcount;
|
||||||
|
short mapsection;
|
||||||
|
char hacked; // 1: is part of a render hack
|
||||||
|
// 2: has one-sided walls
|
||||||
|
FPortalCoverage portalcoverage[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,12 @@ const char *GetVersionString();
|
||||||
|
|
||||||
/** Lots of different version numbers **/
|
/** Lots of different version numbers **/
|
||||||
|
|
||||||
#define VERSIONSTR "2.8pre"
|
#define VERSIONSTR "1.9pre"
|
||||||
|
|
||||||
// The version as seen in the Windows resource
|
// The version as seen in the Windows resource
|
||||||
#define RC_FILEVERSION 2,7,9999,0
|
#define RC_FILEVERSION 1,8,9999,0
|
||||||
#define RC_PRODUCTVERSION 2,7,9999,0
|
#define RC_PRODUCTVERSION 1,8,9999,0
|
||||||
#define RC_PRODUCTVERSION2 "2.8pre"
|
#define RC_PRODUCTVERSION2 "1.9pre"
|
||||||
|
|
||||||
// Version identifier for network games.
|
// Version identifier for network games.
|
||||||
// Bump it every time you do a release unless you're certain you
|
// Bump it every time you do a release unless you're certain you
|
||||||
|
@ -82,21 +82,23 @@ const char *GetVersionString();
|
||||||
#define SAVEVERSTRINGIFY(x) #x
|
#define SAVEVERSTRINGIFY(x) #x
|
||||||
#define SAVESIG "ZDOOMSAVE" SAVEVERSTRINGIFY(SAVEVER)
|
#define SAVESIG "ZDOOMSAVE" SAVEVERSTRINGIFY(SAVEVER)
|
||||||
|
|
||||||
|
#define DYNLIGHT
|
||||||
|
|
||||||
// This is so that derivates can use the same savegame versions without worrying about engine compatibility
|
// This is so that derivates can use the same savegame versions without worrying about engine compatibility
|
||||||
#define GAMESIG "ZDOOM"
|
#define GAMESIG "GZDOOM"
|
||||||
#define BASEWAD "zdoom.pk3"
|
#define BASEWAD "gzdoom.pk3"
|
||||||
|
|
||||||
// More stuff that needs to be different for derivatives.
|
// More stuff that needs to be different for derivatives.
|
||||||
#define GAMENAME "ZDoom"
|
#define GAMENAME "GZDoom"
|
||||||
#define FORUM_URL "http://forum.zdoom.org"
|
#define FORUM_URL "http://forum.drdteam.org"
|
||||||
#define BUGS_FORUM_URL "http://forum.zdoom.org/index.php?c=3"
|
#define BUGS_FORUM_URL "http://forum.drdteam.org/viewforum.php?f=24"
|
||||||
|
|
||||||
#ifdef unix
|
#ifdef unix
|
||||||
#define GAME_DIR ".config/zdoom"
|
#define GAME_DIR ".config/gzdoom"
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#define GAME_DIR GAMENAME
|
#define GAME_DIR GAMENAME
|
||||||
#else
|
#else
|
||||||
#define CDROM_DIR "C:\\ZDOOMDAT"
|
#define CDROM_DIR "C:\\GZDOOMDAT"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue