From d748b6ad70175253035e2cba4fc2b77c2371fdc7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 29 Dec 2016 01:12:17 +0100 Subject: [PATCH 1/3] - added explicit fog density as a sector property, accessible through UDMF and ACS. - allow changing sector glow information through ACS. --- specs/udmf_zdoom.txt | 3 +++ src/gl/compatibility/gl_20.cpp | 2 +- src/gl/renderer/gl_colormap.h | 3 +++ src/gl/renderer/gl_lightdata.cpp | 33 +++++++++++++++------------ src/gl/renderer/gl_lightdata.h | 2 +- src/namedef.h | 1 + src/p_acs.cpp | 38 ++++++++++++++++++++++++++++++++ src/p_udmf.cpp | 13 ++++++++--- src/r_data/colormaps.h | 1 + 9 files changed, 77 insertions(+), 19 deletions(-) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 8a96a3ecf..0fe7b1e8e 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -220,6 +220,9 @@ Note: All fields default to false unless mentioned otherwise. floorglowheight = ; // Height of floor glow. This only has an effect for the sector's own glow color, but not for a texture based glow. ceilingglowcolor = ; // Sector's ceiling glow color as RRGGBB value, default = 'use texture's definition'. Set to -1 to disable glowing. ceilingglowheight = ; // Height of ceiling glow. This only has an effect for the sector's own glow color, but not for a texture based glow. + fogdensity = ; // Sets an explicit fog density for the sector, overriding the default calculation from the light level. Value range is 0-510, + // 0 meaning that the default is to be used, 2 equalling the density of a light level of 250, and 255 equalling the density of + // a light level of 0. portal_ceil_alpha = // translucency of ceiling portal (default is 0 (not visible)) portal_ceil_blocksound = // ceiling portal blocks sound. diff --git a/src/gl/compatibility/gl_20.cpp b/src/gl/compatibility/gl_20.cpp index 348663929..0f9ee5f43 100644 --- a/src/gl/compatibility/gl_20.cpp +++ b/src/gl/compatibility/gl_20.cpp @@ -515,7 +515,7 @@ void GLWall::RenderFogBoundaryCompat() { // without shaders some approximation is needed. This won't look as good // as the shader version but it's an acceptable compromise. - float fogdensity = gl_GetFogDensity(lightlevel, Colormap.FadeColor); + float fogdensity = gl_GetFogDensity(lightlevel, Colormap.FadeColor, Colormap.fogdensity); float dist1 = Dist2(ViewPos.X, ViewPos.Y, glseg.x1, glseg.y1); float dist2 = Dist2(ViewPos.X, ViewPos.Y, glseg.x2, glseg.y2); diff --git a/src/gl/renderer/gl_colormap.h b/src/gl/renderer/gl_colormap.h index 2122b1248..37a762970 100644 --- a/src/gl/renderer/gl_colormap.h +++ b/src/gl/renderer/gl_colormap.h @@ -32,6 +32,7 @@ struct FColormap PalEntry FadeColor; // a is fadedensity>>1 int desaturation; int blendfactor; + int fogdensity; void Clear() { @@ -39,6 +40,7 @@ struct FColormap FadeColor=0; desaturation = 0; blendfactor=0; + fogdensity = 0; } void ClearColor() @@ -55,6 +57,7 @@ struct FColormap desaturation = from->Desaturate; FadeColor = from->Fade; blendfactor = from->Color.a; + fogdensity = from->Fade.a*2; return * this; } diff --git a/src/gl/renderer/gl_lightdata.cpp b/src/gl/renderer/gl_lightdata.cpp index ca2d32c41..d09484a1f 100644 --- a/src/gl/renderer/gl_lightdata.cpp +++ b/src/gl/renderer/gl_lightdata.cpp @@ -294,43 +294,48 @@ void gl_SetColor(int sectorlightlevel, int rellight, const FColormap &cm, float // //========================================================================== -float gl_GetFogDensity(int lightlevel, PalEntry fogcolor) +float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity) { float density; - if (glset.lightmode&4) + if (glset.lightmode & 4) { // uses approximations of Legacy's default settings. - density = fogdensity? fogdensity : 18; + density = fogdensity ? fogdensity : 18; } else if ((fogcolor.d & 0xffffff) == 0) { // case 1: black fog if (glset.lightmode != 8) { - density=distfogtable[glset.lightmode!=0][gl_ClampLight(lightlevel)]; + density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)]; } else { density = 0; } } - else if (outsidefogdensity != 0 && outsidefogcolor.a!=0xff && (fogcolor.d & 0xffffff) == (outsidefogcolor.d & 0xffffff)) + else if (sectorfogdensity != 0) { - // case 2. outsidefogdensity has already been set as needed - density=outsidefogdensity; + // case 2: Sector has an explicit fog density set. + density = sectorfogdensity; } - else if (fogdensity!=0) + else if (outsidefogdensity != 0 && outsidefogcolor.a != 0xff && (fogcolor.d & 0xffffff) == (outsidefogcolor.d & 0xffffff)) { - // case 3: level has fog density set - density=fogdensity; + // case 3. outsidefogdensity has already been set as needed + density = outsidefogdensity; + } + else if (fogdensity != 0) + { + // case 4: level has fog density set + density = fogdensity; } else if (lightlevel < 248) { - // case 4: use light level - density=clamp(255-lightlevel,30,255); + // case 5: use light level + density = clamp(255 - lightlevel, 30, 255); } - else + else { density = 0.f; } @@ -487,7 +492,7 @@ void gl_SetFog(int lightlevel, int rellight, const FColormap *cmap, bool isaddit else if (cmap != NULL && gl_fixedcolormap == 0) { fogcolor = cmap->FadeColor; - fogdensity = gl_GetFogDensity(lightlevel, fogcolor); + fogdensity = gl_GetFogDensity(lightlevel, fogcolor, cmap->fogdensity); fogcolor.a=0; } else diff --git a/src/gl/renderer/gl_lightdata.h b/src/gl/renderer/gl_lightdata.h index 4cc7a7d04..a1abf8c82 100644 --- a/src/gl/renderer/gl_lightdata.h +++ b/src/gl/renderer/gl_lightdata.h @@ -18,7 +18,7 @@ void gl_SetFogParams(int _fogdensity, PalEntry _outsidefogcolor, int _outsidefog int gl_CalcLightLevel(int lightlevel, int rellight, bool weapon); void gl_SetColor(int light, int rellight, const FColormap &cm, float alpha, bool weapon=false); -float gl_GetFogDensity(int lightlevel, PalEntry fogcolor); +float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity); struct sector_t; bool gl_CheckFog(FColormap *cm, int lightlevel); bool gl_CheckFog(sector_t *frontsector, sector_t *backsector); diff --git a/src/namedef.h b/src/namedef.h index e08aec1e2..bb9d27f40 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -581,6 +581,7 @@ xx(floorglowcolor) xx(floorglowheight) xx(ceilingglowcolor) xx(ceilingglowheight) +xx(fogdensity) // USDF keywords xx(Amount) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 87db324cc..20313785a 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -85,6 +85,7 @@ #include "a_pickups.h" #include "a_armor.h" #include "a_ammo.h" +#include "r_data/colormaps.h" extern FILE *Logfile; @@ -4411,6 +4412,11 @@ enum EACSFunctions ACSF_SetActorFlag, ACSF_SetTranslation, + + // OpenGL stuff + ACSF_SetSectorGlow = 400, + ACSF_SetFogDensity, + // ZDaemon ACSF_GetTeamScore = 19620, // (int team) ACSF_SetTeamScore, // (int team, int value @@ -6065,6 +6071,38 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) return 1; } + // OpenGL exclusive functions + case ACSF_SetSectorGlow: + { + int which = !!args[1]; + PalEntry color(args[2], args[3], args[4]); + float height = float(args[5]); + if (args[2] == -1) color = -1; + + FSectorTagIterator it(args[0]); + int s; + while ((s = it.Next()) >= 0) + { + sectors[s].planes[which].GlowColor = color; + sectors[s].planes[which].GlowHeight = height; + } + break; + } + + case ACSF_SetFogDensity: + { + FSectorTagIterator it(args[0]); + int s; + int d = clamp(args[1]/2, 0, 255); + while ((s = it.Next()) >= 0) + { + auto f = sectors[s].ColorMap->Fade; + sectors[s].ColorMap = GetSpecialLights(sectors[s].ColorMap->Color, PalEntry(d, f.r, f.g, f.b), sectors[s].ColorMap->Desaturate); + } + break; + } + + default: break; } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 15d1b48d3..b0427045c 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1279,8 +1279,9 @@ public: void ParseSector(sector_t *sec, int index) { - int lightcolor = -1; - int fadecolor = -1; + PalEntry lightcolor = -1; + PalEntry fadecolor = -1; + int fogdensity = -1; int desaturation = -1; int fplaneflags = 0, cplaneflags = 0; double fp[4] = { 0 }, cp[4] = { 0 }; @@ -1461,6 +1462,10 @@ public: desaturation = int(255*CheckFloat(key)); continue; + case NAME_fogdensity: + fogdensity = clamp(CheckInt(key), 0, 511); + break; + case NAME_Silent: Flag(sec->Flags, SECF_SILENT, key); continue; @@ -1682,7 +1687,7 @@ public: sec->ceilingplane.set(n.X, n.Y, n.Z, cp[3]); } - if (lightcolor == -1 && fadecolor == -1 && desaturation == -1) + if (lightcolor == -1 && fadecolor == -1 && desaturation == -1 && fogdensity == -1) { // [RH] Sectors default to white light with the default fade. // If they are outside (have a sky ceiling), they use the outside fog. @@ -1710,6 +1715,8 @@ public: fadecolor = level.fadeto; } if (desaturation == -1) desaturation = NormalLight.Desaturate; + if (fogdensity != -1) fadecolor.a = fogdensity / 2; + else fadecolor.a = 0; sec->ColorMap = GetSpecialLights (lightcolor, fadecolor, desaturation); } diff --git a/src/r_data/colormaps.h b/src/r_data/colormaps.h index 09006fc1e..9db564b60 100644 --- a/src/r_data/colormaps.h +++ b/src/r_data/colormaps.h @@ -17,6 +17,7 @@ struct FDynamicColormap void ChangeFade (PalEntry fadecolor); void ChangeColor (PalEntry lightcolor, int desaturate); void ChangeColorFade (PalEntry lightcolor, PalEntry fadecolor); + void ChangeFogDensity(int newdensity); void BuildLights (); static void RebuildAllLights(); From cab1b60ffc2a39f22cea1ebdafd52113cf3e3f72 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 13 Dec 2016 18:47:56 -0500 Subject: [PATCH 2/3] - Some cleanups for c_cmds.cpp, exported some functions as well as functions used for "print/targetinv" to their own file. --- src/CMakeLists.txt | 3 +- src/c_cmds.cpp | 34 ++++------ src/c_functions.cpp | 120 ++++++++++++++++++++++++++++++++++ src/c_functions.h | 37 +++++++++++ src/g_inventory/a_pickups.cpp | 24 ++----- 5 files changed, 174 insertions(+), 44 deletions(-) create mode 100644 src/c_functions.cpp create mode 100644 src/c_functions.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 49153f574..d006d2948 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -997,6 +997,7 @@ set (PCH_SOURCES c_cvars.cpp c_dispatch.cpp c_expr.cpp + c_functions.cpp cmdlib.cpp colormatcher.cpp compatibility.cpp @@ -1389,7 +1390,7 @@ source_group("Audio Files\\WildMidi\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRE source_group("Audio Files\\WildMidi\\Source" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/wildmidi/.+\\.cpp$") source_group("External\\Math" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/math/.+") source_group("External\\RapidJSON" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/.+") -source_group("Externak\\SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sfmt/.+") +source_group("External\\SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sfmt/.+") source_group("FraggleScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/fragglescript/.+") source_group("Games\\Strife Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_strife/.+") source_group("Intermission" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/intermission/.+") diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index c9e6dfe93..343c442fe 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -71,6 +71,7 @@ #include "v_video.h" #include "r_utility.h" #include "r_data/r_interpolate.h" +#include "c_functions.h" extern FILE *Logfile; extern bool insave; @@ -870,20 +871,17 @@ CCMD (wdir) // // //----------------------------------------------------------------------------- + CCMD(linetarget) { FTranslatedLineTarget t; if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; - P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->Angles.Yaw, MISSILERANGE, &t, 0.); + C_AimLine(&t, false); if (t.linetarget) - { - Printf("Target=%s, Health=%d, Spawnhealth=%d\n", - t.linetarget->GetClass()->TypeName.GetChars(), - t.linetarget->health, - t.linetarget->SpawnHealth()); - } - else Printf("No target found\n"); + C_PrintInfo(t.linetarget); + else + Printf("No target found\n"); } // As linetarget, but also give info about non-shootable actors @@ -892,28 +890,18 @@ CCMD(info) FTranslatedLineTarget t; if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; - P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->Angles.Yaw, MISSILERANGE, - &t, 0., ALF_CHECKNONSHOOTABLE|ALF_FORCENOSMART); + C_AimLine(&t, true); if (t.linetarget) - { - Printf("Target=%s, Health=%d, Spawnhealth=%d\n", - t.linetarget->GetClass()->TypeName.GetChars(), - t.linetarget->health, - t.linetarget->SpawnHealth()); - PrintMiscActorInfo(t.linetarget); - } - else Printf("No target found. Info cannot find actors that have " + C_PrintInfo(t.linetarget); + else + Printf("No target found. Info cannot find actors that have " "the NOBLOCKMAP flag or have height/radius of 0.\n"); } CCMD(myinfo) { if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; - Printf("Target=%s, Health=%d, Spawnhealth=%d\n", - players[consoleplayer].mo->GetClass()->TypeName.GetChars(), - players[consoleplayer].mo->health, - players[consoleplayer].mo->SpawnHealth()); - PrintMiscActorInfo(players[consoleplayer].mo); + C_PrintInfo(players[consoleplayer].mo); } typedef bool (*ActorTypeChecker) (AActor *); diff --git a/src/c_functions.cpp b/src/c_functions.cpp new file mode 100644 index 000000000..f7920ee11 --- /dev/null +++ b/src/c_functions.cpp @@ -0,0 +1,120 @@ +/* +** c_functions.cpp +** Miscellaneous console command helper functions. +** +**--------------------------------------------------------------------------- +** Copyright 2016 Rachael Alexanderson +** Copyright 2003-2016 Christoph Oelckers +** Copyright 1998-2016 Randy Heit +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1. Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** 3. The name of the author may not be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**--------------------------------------------------------------------------- +** +*/ + +#include +#include +#include +#include + +#ifdef _WIN32 +#include +#else +#include +#endif + +#include "version.h" +#include "c_console.h" +#include "c_dispatch.h" + +#include "i_system.h" + +#include "doomerrors.h" +#include "doomstat.h" +#include "gstrings.h" +#include "s_sound.h" +#include "g_game.h" +#include "g_level.h" +#include "w_wad.h" +#include "g_level.h" +#include "gi.h" +#include "r_defs.h" +#include "d_player.h" +#include "templates.h" +#include "p_local.h" +#include "r_sky.h" +#include "p_setup.h" +#include "cmdlib.h" +#include "d_net.h" +#include "v_text.h" +#include "p_lnspec.h" +#include "v_video.h" +#include "r_utility.h" +#include "r_data/r_interpolate.h" +#include "c_functions.h" + +void C_PrintInfo(AActor *target) +{ + if (target->player) + Printf("Player=%s, ", target->player->userinfo.GetName()); + Printf("Class=%s, Health=%d, Spawnhealth=%d\n", + target->GetClass()->TypeName.GetChars(), + target->health, + target->SpawnHealth()); + PrintMiscActorInfo(target); +} + +void C_AimLine(FTranslatedLineTarget *t, bool nonshootable) +{ + P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->Angles.Yaw, MISSILERANGE, t, 0., + (nonshootable) ? ALF_CHECKNONSHOOTABLE|ALF_FORCENOSMART : 0); +} + +void C_PrintInv(AActor *target) +{ + AInventory *item; + int count = 0; + + if (target == NULL) + { + Printf("No target found!\n"); + return; + } + + if (target->player) + Printf("Inventory for Player '%s':\n", target->player->userinfo.GetName()); + else + Printf("Inventory for Target '%s':\n", target->GetClass()->TypeName.GetChars()); + + for (item = target->Inventory; item != NULL; item = item->Inventory) + { + Printf (" %s #%u (%d/%d)\n", item->GetClass()->TypeName.GetChars(), + item->InventoryID, + item->Amount, item->MaxAmount); + count++; + } + Printf (" List count: %d\n", count); +} + diff --git a/src/c_functions.h b/src/c_functions.h new file mode 100644 index 000000000..5f3d1e585 --- /dev/null +++ b/src/c_functions.h @@ -0,0 +1,37 @@ +/* +** c_functions.h +** Miscellaneous console command helper functions. +** +**--------------------------------------------------------------------------- +** Copyright 2016 Rachael Alexanderson +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1. Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** 3. The name of the author may not be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**--------------------------------------------------------------------------- +** +*/ + +void C_PrintInv(AActor *target); +void C_AimLine(FTranslatedLineTarget *t, bool nonshootable); +void C_PrintInfo(AActor *target); diff --git a/src/g_inventory/a_pickups.cpp b/src/g_inventory/a_pickups.cpp index f019a8053..3c1d32d42 100644 --- a/src/g_inventory/a_pickups.cpp +++ b/src/g_inventory/a_pickups.cpp @@ -21,6 +21,7 @@ #include "serializer.h" #include "virtual.h" #include "a_ammo.h" +#include "c_functions.h" EXTERN_CVAR(Bool, sv_unlimited_pickup) @@ -1567,7 +1568,6 @@ bool AInventory::CanPickup (AActor *toucher) CCMD (printinv) { - AInventory *item; int pnum = consoleplayer; #ifdef _DEBUG @@ -1581,37 +1581,21 @@ CCMD (printinv) } } #endif - if (players[pnum].mo == NULL) - { - return; - } - for (item = players[pnum].mo->Inventory; item != NULL; item = item->Inventory) - { - Printf ("%s #%u (%d/%d)\n", item->GetClass()->TypeName.GetChars(), - item->InventoryID, - item->Amount, item->MaxAmount); - } + C_PrintInv(players[pnum].mo); } CCMD (targetinv) { - AInventory *item; FTranslatedLineTarget t; if (CheckCheatmode () || players[consoleplayer].mo == NULL) return; - P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->Angles.Yaw, MISSILERANGE, - &t, 0., ALF_CHECKNONSHOOTABLE|ALF_FORCENOSMART); + C_AimLine(&t, true); if (t.linetarget) { - for (item = t.linetarget->Inventory; item != NULL; item = item->Inventory) - { - Printf ("%s #%u (%d/%d)\n", item->GetClass()->TypeName.GetChars(), - item->InventoryID, - item->Amount, item->MaxAmount); - } + C_PrintInv(t.linetarget); } else Printf("No target found. Targetinv cannot find actors that have " "the NOBLOCKMAP flag or have height/radius of 0.\n"); From 605a60d1d68840edd63c52d9d8c1cf3cb7664167 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 14 Dec 2016 05:26:12 -0500 Subject: [PATCH 3/3] - Removed headers from c_functions.cpp, added forward struct declaration for FTranslatedLineTarget in c_functions.h. --- src/c_functions.cpp | 38 +------------------------------------- src/c_functions.h | 2 ++ 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/c_functions.cpp b/src/c_functions.cpp index f7920ee11..1d1b35a45 100644 --- a/src/c_functions.cpp +++ b/src/c_functions.cpp @@ -34,45 +34,9 @@ ** */ -#include -#include -#include -#include - -#ifdef _WIN32 -#include -#else -#include -#endif - -#include "version.h" -#include "c_console.h" -#include "c_dispatch.h" - -#include "i_system.h" - -#include "doomerrors.h" -#include "doomstat.h" -#include "gstrings.h" -#include "s_sound.h" -#include "g_game.h" -#include "g_level.h" -#include "w_wad.h" -#include "g_level.h" -#include "gi.h" -#include "r_defs.h" #include "d_player.h" -#include "templates.h" #include "p_local.h" -#include "r_sky.h" -#include "p_setup.h" -#include "cmdlib.h" -#include "d_net.h" -#include "v_text.h" -#include "p_lnspec.h" -#include "v_video.h" -#include "r_utility.h" -#include "r_data/r_interpolate.h" + #include "c_functions.h" void C_PrintInfo(AActor *target) diff --git a/src/c_functions.h b/src/c_functions.h index 5f3d1e585..3d8ab6fc8 100644 --- a/src/c_functions.h +++ b/src/c_functions.h @@ -35,3 +35,5 @@ void C_PrintInv(AActor *target); void C_AimLine(FTranslatedLineTarget *t, bool nonshootable); void C_PrintInfo(AActor *target); + +struct FTranslatedLineTarget; \ No newline at end of file