Mapbase v2.0; bulk commit

- Added custom map compile tools (vbsp, vvis, vrad)
- Changed blink fix (shouldn't change anything in-game)
- Added auto-completion to ent_create, npc_create, and the main set of "npc_" debug commands
- Added ent_create_aimed, an ent_create equivalent of npc_create_aimed
- Made hunters start using the "vs. player" melee animation against smaller NPCs that look weird with the "stab" attack
- Added "explosion_sparks" convar, which fixes broken code for giving explosions sparks (disabled by default because of how different it looks)
- Made interaction code capable of being dispatched on any entity, not just combat characters
- Added npc_barnacle_ignite convar, which lets barnacles be ignited by flares
- Fixed certain NPCs getting out of the way for the player when they hate them
- Fixed auto-generated "speak" scene responses not using parameters that work on real VCDs
- Made "stop_on_nonidle" capable of being used in any mod, not just HL2 episodic mods
- Selectable color for ragdoll boogie/point_ragdollboogie
- Fixed PickupWeaponInstant not firing weapon pickup outputs
- Introduced inputs and keyvalues for "lerping" to math_counter_advanced
- Fixed ClearConsole on logic_console
- logic_convar should now detect client convars correctly
- New NormalizeAngles input on math_vector
- logic_modelinfo LookupActivity input
- math_generate fixed and expanded to be more like math_counter
- Added a WIP game logging system for playtesting maps
- Introduced logic_playerinfo, an entity that can read a player's name or ID
- Fixed some new filters not working with filter_multi
- Added radius pickup spawnflag to func_physbox
- Added "Preserve name" spawnflag to weapons
- Added cc_achievement_debug message for when an achievement doesn't exist
- Made npc_combine_s not speak while in logic_choreographed_scenes
- Fixed zombie torsos/legs/headcrabs not being serverside when zombie is forced to server ragdoll
- Expanded and cleaned up npc_zombie_custom
- Fixed func_commandredirects not cleaning up correctly and sometimes crashing the game
- Allowed player squad commands to go through +USE-held objects
- Added a bunch of I/O/KV to trigger_waterydeath for better configuration
- Changed save comment system to use the chapter title from world properties, and the ability to suppress the title popup that normally results from it
- Adjusted game_convar_mod for MP planning
- Removed the func_precipitation custom particle/splash code for now, as it was causing problems
- Fixed env_global_light not accepting lightcolor
- Added "Additional Buttons" to player_speedmod
- Added save comment to RPC
- Added env_projectedtexture attenuation
- Added scripted_sequence OnPreIdleSequence
- Added OnCrab to zombies
- Added skill_changed game event (may need further testing)
- Added a fix for viewmodels flipping under extreme FOV values
- Added code that allows mappers to change the skin on shotgunners without it usually flipping back randomly
- Fixed a very, very, very major shader performance issue
- New SetAbsOrigin/Angles inputs on all entities, analogous to SetLocalOrigin/Angles
- Code improvements for I/O involving angles
- logic_entity_position improvements/fixes, including a new OutAngles output that outputs the angles on position calls
- Alternate collision/player avoidance spawnflag obsoletion enforcement disabled
- Enable/DisableHazardLights inputs on the EP2 jalopy, equivalent to the keyvalue
- Miscellaneous shader formatting adjustments and fixes
- Fixed AlwaysDrawOff on env_projectedtexture not being a valid input
This commit is contained in:
Blixibon
2019-12-14 04:20:02 +00:00
parent a1dba884a3
commit dc7f20acc8
97 changed files with 2845 additions and 485 deletions

View File

@@ -84,9 +84,15 @@ inline bool SideHasCubemapAndWasntManuallyReferenced( int iSide )
return s_aCubemapSideData[iSide].bHasEnvMapInMaterial && !s_aCubemapSideData[iSide].bManuallyPickedByAnEnvCubemap;
}
#ifdef PARALLAX_CORRECTED_CUBEMAPS
char* g_pParallaxObbStrs[MAX_MAP_CUBEMAPSAMPLES];
void Cubemap_InsertSample( const Vector& origin, int size, char* pParallaxObbStr = "" )
{
g_pParallaxObbStrs[g_nCubemapSamples] = pParallaxObbStr;
#else
void Cubemap_InsertSample( const Vector& origin, int size )
{
#endif
dcubemapsample_t *pSample = &g_CubemapSamples[g_nCubemapSamples];
pSample->origin[0] = ( int )origin[0];
pSample->origin[1] = ( int )origin[1];
@@ -529,7 +535,11 @@ static void GeneratePatchedName( const char *pMaterialName, const PatchInfo_t &i
//-----------------------------------------------------------------------------
// Patches the $envmap for a material and all its dependents, returns true if any patching happened
//-----------------------------------------------------------------------------
#ifdef PARALLAX_CORRECTED_CUBEMAPS
static bool PatchEnvmapForMaterialAndDependents( const char *pMaterialName, const PatchInfo_t &info, const char *pCubemapTexture, const char *pParallaxObbMatrix = "" )
#else
static bool PatchEnvmapForMaterialAndDependents( const char *pMaterialName, const PatchInfo_t &info, const char *pCubemapTexture )
#endif
{
// Do *NOT* patch the material if there is an $envmap specified and it's not 'env_cubemap'
@@ -547,7 +557,11 @@ static bool PatchEnvmapForMaterialAndDependents( const char *pMaterialName, cons
const char *pDependentMaterial = FindDependentMaterial( pMaterialName, &pDependentMaterialVar );
if ( pDependentMaterial )
{
#ifdef PARALLAX_CORRECTED_CUBEMAPS
bDependentMaterialPatched = PatchEnvmapForMaterialAndDependents( pDependentMaterial, info, pCubemapTexture, pParallaxObbMatrix );
#else
bDependentMaterialPatched = PatchEnvmapForMaterialAndDependents( pDependentMaterial, info, pCubemapTexture );
#endif
}
// If we have neither to patch, we're done
@@ -558,7 +572,11 @@ static bool PatchEnvmapForMaterialAndDependents( const char *pMaterialName, cons
char pPatchedMaterialName[1024];
GeneratePatchedName( pMaterialName, info, true, pPatchedMaterialName, 1024 );
#ifdef PARALLAX_CORRECTED_CUBEMAPS
MaterialPatchInfo_t pPatchInfo[6];
#else
MaterialPatchInfo_t pPatchInfo[2];
#endif
int nPatchCount = 0;
if ( bShouldPatchEnvCubemap )
{
@@ -568,6 +586,31 @@ static bool PatchEnvmapForMaterialAndDependents( const char *pMaterialName, cons
++nPatchCount;
}
#ifdef PARALLAX_CORRECTED_CUBEMAPS
// Parallax cubemap matrix
CUtlVector<char *> matRowList;
if (pParallaxObbMatrix[0] != '\0')
{
V_SplitString( pParallaxObbMatrix, ";", matRowList );
pPatchInfo[nPatchCount].m_pKey = "$envMapParallax";
pPatchInfo[nPatchCount].m_pValue = "1";
++nPatchCount;
pPatchInfo[nPatchCount].m_pKey = "$envMapParallaxOBB1";
pPatchInfo[nPatchCount].m_pValue = matRowList[0];
++nPatchCount;
pPatchInfo[nPatchCount].m_pKey = "$envMapParallaxOBB2";
pPatchInfo[nPatchCount].m_pValue = matRowList[1];
++nPatchCount;
pPatchInfo[nPatchCount].m_pKey = "$envMapParallaxOBB3";
pPatchInfo[nPatchCount].m_pValue = matRowList[2];
++nPatchCount;
pPatchInfo[nPatchCount].m_pKey = "$envMapOrigin";
pPatchInfo[nPatchCount].m_pValue = matRowList[3];
++nPatchCount;
}
#endif
char pDependentPatchedMaterialName[1024];
if ( bDependentMaterialPatched )
{
@@ -579,7 +622,14 @@ static bool PatchEnvmapForMaterialAndDependents( const char *pMaterialName, cons
++nPatchCount;
}
#ifdef PARALLAX_CORRECTED_CUBEMAPS
CreateMaterialPatch( pMaterialName, pPatchedMaterialName, nPatchCount, pPatchInfo, PATCH_INSERT );
// Clean up parallax stuff
matRowList.PurgeAndDeleteElements();
#else
CreateMaterialPatch( pMaterialName, pPatchedMaterialName, nPatchCount, pPatchInfo, PATCH_REPLACE );
#endif
return true;
}
@@ -598,7 +648,11 @@ static bool PatchEnvmapForMaterialAndDependents( const char *pMaterialName, cons
// default (skybox) cubemap into this file so the cubemap doesn't have the pink checkerboard at
// runtime before they run buildcubemaps.
//-----------------------------------------------------------------------------
#ifdef PARALLAX_CORRECTED_CUBEMAPS
static int Cubemap_CreateTexInfo( int originalTexInfo, int origin[3], int cubemapIndex )
#else
static int Cubemap_CreateTexInfo( int originalTexInfo, int origin[3] )
#endif
{
// Don't make cubemap tex infos for nodes
if ( originalTexInfo == TEXINFO_NODE )
@@ -630,6 +684,15 @@ static int Cubemap_CreateTexInfo( int originalTexInfo, int origin[3] )
char pGeneratedTexDataName[1024];
GeneratePatchedName( pMaterialName, info, true, pGeneratedTexDataName, 1024 );
#ifdef PARALLAX_CORRECTED_CUBEMAPS
// Append origin info if this cubemap has a parallax OBB
char originAppendedString[1024] = "";
if (g_pParallaxObbStrs[cubemapIndex][0] != '\0')
{
Q_snprintf(originAppendedString, 1024, "%s;[%d %d %d]", g_pParallaxObbStrs[cubemapIndex], origin[0], origin[1], origin[2]);
}
#endif
// Make sure the texdata doesn't already exist.
int nTexDataID = FindTexData( pGeneratedTexDataName );
bool bHasTexData = (nTexDataID != -1);
@@ -641,7 +704,11 @@ static int Cubemap_CreateTexInfo( int originalTexInfo, int origin[3] )
// Hook the texture into the material and all dependent materials
// but if no hooking was necessary, exit out
#ifdef PARALLAX_CORRECTED_CUBEMAPS
if ( !PatchEnvmapForMaterialAndDependents( pMaterialName, info, pTextureName, originAppendedString ) )
#else
if ( !PatchEnvmapForMaterialAndDependents( pMaterialName, info, pTextureName ) )
#endif
return originalTexInfo;
// Store off the name of the cubemap that we need to create since we successfully patched
@@ -731,7 +798,11 @@ void Cubemap_FixupBrushSidesMaterials( void )
}
#endif
#ifdef PARALLAX_CORRECTED_CUBEMAPS
pSide->texinfo = Cubemap_CreateTexInfo( pSide->texinfo, g_CubemapSamples[cubemapID].origin, cubemapID );
#else
pSide->texinfo = Cubemap_CreateTexInfo( pSide->texinfo, g_CubemapSamples[cubemapID].origin );
#endif
if ( pSide->pMapDisp )
{
pSide->pMapDisp->face.texinfo = pSide->texinfo;
@@ -947,7 +1018,11 @@ void Cubemap_AttachDefaultCubemapToSpecularSides( void )
Assert( pSide->texinfo == pSide->pMapDisp->face.texinfo );
}
#endif
#ifdef PARALLAX_CORRECTED_CUBEMAPS
pSide->texinfo = Cubemap_CreateTexInfo( pSide->texinfo, g_CubemapSamples[iCubemap].origin, iCubemap );
#else
pSide->texinfo = Cubemap_CreateTexInfo( pSide->texinfo, g_CubemapSamples[iCubemap].origin );
#endif
if ( pSide->pMapDisp )
{
pSide->pMapDisp->face.texinfo = pSide->texinfo;