Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/coelckers/gzdoom into cli…
Browse files Browse the repository at this point in the history
…entserver
  • Loading branch information
Rachael Alexanderson committed Apr 19, 2018
2 parents 7a42c58 + e77cba1 commit 3e33804
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 73 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -11,7 +11,12 @@ git:
matrix:
include:
- os: osx
osx_image: xcode9.2
osx_image: xcode8
env:
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7"

- os: osx
osx_image: xcode9.3
env:
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7"

Expand Down
21 changes: 2 additions & 19 deletions src/CMakeLists.txt
Expand Up @@ -62,21 +62,6 @@ if( WIN32 )
set( DX_dinput8_LIBRARY dinput8 )
else()

find_path( D3D_INCLUDE_DIR d3d9.h
PATHS ENV DXSDK_DIR
PATH_SUFFIXES Include )
if( NOT D3D_INCLUDE_DIR )
# Modern versions of the Windows SDK include d3d9.h. Unfortunately,
# CMake cannot find this file via find_path, so we check for it using
# CHECK_INCLUDE_FILE.
CHECK_INCLUDE_FILE( d3d9.h D3D9_H_FOUND )
if ( NOT D3D9_H_FOUND )
message( SEND_ERROR "Could not find DirectX 9 header files" )
endif()
else()
include_directories( ${D3D_INCLUDE_DIR} )
endif()

find_path( XINPUT_INCLUDE_DIR xinput.h
PATHS ENV DXSDK_DIR
PATH_SUFFIXES Include )
Expand Down Expand Up @@ -713,8 +698,9 @@ file( GLOB HEADER_FILES
polyrenderer/math/*.h
polyrenderer/drawers/*.h
polyrenderer/scene/*.h
hwrenderer/data/*.h
hwrenderer/dynlights/*.h
gl/*.h
gl/api/*.h
gl/data/*.h
gl/dynlights/*.h
gl/models/*.h
Expand Down Expand Up @@ -1287,9 +1273,6 @@ set_source_files_properties( ${FASTMATH_SOURCES} PROPERTIES COMPILE_FLAGS ${ZD_F
set_source_files_properties( xlat/parse_xlat.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c" )
set_source_files_properties( sc_man.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h" )
set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE )
if ( WIN32 )
set_source_files_properties( win32/fb_d3d9.cpp win32/fb_d3d9_wipe.cpp PROPERTIES COMPILE_FLAGS ${ZD_FASTMATH_FLAG} )
endif()


if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
Expand Down
7 changes: 6 additions & 1 deletion src/r_data/a_dynlightdata.cpp
Expand Up @@ -137,7 +137,7 @@ void FLightDefaults::ApplyProperties(ADynamicLight * light) const

extern int ScriptDepth;

void AddLightDefaults(FLightDefaults *defaults)
void AddLightDefaults(FLightDefaults *defaults, double attnFactor)
{
FLightDefaults *temp;
unsigned int i;
Expand All @@ -153,6 +153,11 @@ void AddLightDefaults(FLightDefaults *defaults)
break;
}
}
if (defaults->GetAttenuate())
{
defaults->SetArg(LIGHT_INTENSITY, int(defaults->GetArg(LIGHT_INTENSITY) * attnFactor));
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, int(defaults->GetArg(LIGHT_SECONDARY_INTENSITY) * attnFactor));
}

LightDefaults.Push(defaults);
}
Expand Down
22 changes: 14 additions & 8 deletions src/r_data/gldefs.cpp
Expand Up @@ -52,7 +52,7 @@
#include "textures/skyboxtexture.h"
#include "gl/shaders/gl_postprocessshader.h"

void AddLightDefaults(FLightDefaults *defaults);
void AddLightDefaults(FLightDefaults *defaults, double attnFactor);
void AddLightAssociation(const char *actor, const char *frame, const char *light);
void InitializeActorLights(TArray<FLightAssociation> &LightAssociations);

Expand Down Expand Up @@ -193,6 +193,7 @@ static const char *CoreKeywords[]=
"detail",
"#include",
"material",
"lightsizefactor",
nullptr
};

Expand All @@ -215,7 +216,8 @@ enum
TAG_HARDWARESHADER,
TAG_DETAIL,
TAG_INCLUDE,
TAG_MATERIAL
TAG_MATERIAL,
TAG_LIGHTSIZEFACTOR,
};

//==========================================================================
Expand All @@ -230,6 +232,7 @@ class GLDefsParser
int workingLump;
int ScriptDepth = 0;
TArray<FLightAssociation> &LightAssociations;
double lightSizeFactor = 1.;

//==========================================================================
//
Expand Down Expand Up @@ -470,7 +473,7 @@ class GLDefsParser
sc.ScriptError("Unknown tag: %s\n", sc.String);
}
}
AddLightDefaults(defaults);
AddLightDefaults(defaults, lightSizeFactor);
}
else
{
Expand Down Expand Up @@ -565,7 +568,7 @@ class GLDefsParser
}
defaults->OrderIntensities();

AddLightDefaults(defaults);
AddLightDefaults(defaults, lightSizeFactor);
}
else
{
Expand Down Expand Up @@ -660,7 +663,7 @@ class GLDefsParser
}
}
defaults->OrderIntensities();
AddLightDefaults(defaults);
AddLightDefaults(defaults, lightSizeFactor);
}
else
{
Expand Down Expand Up @@ -760,7 +763,7 @@ class GLDefsParser
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, defaults->GetArg(LIGHT_INTENSITY));
defaults->SetArg(LIGHT_INTENSITY, v);
}
AddLightDefaults(defaults);
AddLightDefaults(defaults, lightSizeFactor);
}
else
{
Expand Down Expand Up @@ -846,7 +849,7 @@ class GLDefsParser
sc.ScriptError("Unknown tag: %s\n", sc.String);
}
}
AddLightDefaults(defaults);
AddLightDefaults(defaults, lightSizeFactor);
}
else
{
Expand Down Expand Up @@ -1427,7 +1430,6 @@ class GLDefsParser
}
}
}



public:
Expand Down Expand Up @@ -1461,6 +1463,7 @@ class GLDefsParser
sc.ScriptError("Lump '%s' not found", sc.String);

GLDefsParser newscanner(lump, LightAssociations);
newscanner.lightSizeFactor = lightSizeFactor;
newscanner.DoParseDefs();
break;
}
Expand Down Expand Up @@ -1508,6 +1511,9 @@ class GLDefsParser
case TAG_DETAIL:
ParseDetailTexture();
break;
case TAG_LIGHTSIZEFACTOR:
lightSizeFactor = ParseFloat(sc);
break;
case TAG_DISABLE_FB:
{
/* not implemented.
Expand Down
12 changes: 0 additions & 12 deletions src/v_draw.cpp
Expand Up @@ -367,17 +367,11 @@ static inline double ListGetDouble(Va_List &tags)
return va_arg(tags.list, double);
}

// These two options are only being used by the D3D version of the HUD weapon drawer, they serve no purpose anywhere else.
static inline FSpecialColormap * ListGetSpecialColormap(Va_List &tags)
{
return va_arg(tags.list, FSpecialColormap *);
}

static inline FColormapStyle * ListGetColormapStyle(Va_List &tags)
{
return va_arg(tags.list, FColormapStyle *);
}

static void ListEnd(VMVa_List &tags)
{
}
Expand Down Expand Up @@ -411,12 +405,6 @@ static inline FSpecialColormap * ListGetSpecialColormap(VMVa_List &tags)
return nullptr;
}

static inline FColormapStyle * ListGetColormapStyle(VMVa_List &tags)
{
ThrowAbortException(X_OTHER, "Invalid tag in draw function");
return nullptr;
}

//==========================================================================
//
// Main taglist parsing
Expand Down
33 changes: 1 addition & 32 deletions src/win32/win32video.cpp
Expand Up @@ -32,46 +32,15 @@
**
*/

#ifdef _DEBUG
#define D3D_DEBUG_INFO
#endif
#define DIRECTDRAW_VERSION 0x0300
#define DIRECT3D_VERSION 0x0900

#define _WIN32_WINNT 0x0501
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <mmsystem.h>
#include <ddraw.h>
#include <d3d9.h>

// HEADER FILES ------------------------------------------------------------

#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <ddraw.h>
#include <d3d9.h>
#include <stdio.h>
#include <ctype.h>

#include "doomtype.h"

#include "c_dispatch.h"
#include "templates.h"
#include "c_cvars.h"
#include "i_system.h"
#include "i_video.h"
#include "v_video.h"
#include "v_pfx.h"
#include "stats.h"
#include "doomerrors.h"
#include "m_argv.h"
#include "r_defs.h"
#include "v_text.h"
#include "version.h"


#include "optwin32.h"

// MACROS ------------------------------------------------------------------

Expand Down

0 comments on commit 3e33804

Please sign in to comment.