mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-17 20:10:21 +03:00
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:
@@ -15,6 +15,9 @@
|
||||
#include "materialsub.h"
|
||||
#include "fgdlib/fgdlib.h"
|
||||
#include "manifest.h"
|
||||
#ifdef PARALLAX_CORRECTED_CUBEMAPS
|
||||
#include "matrixinvert.h"
|
||||
#endif
|
||||
|
||||
#ifdef VSVMFIO
|
||||
#include "VmfImport.h"
|
||||
@@ -1618,9 +1621,16 @@ ChunkFileResult_t CMapFile::LoadEntityCallback(CChunkFile *pFile, int nParam)
|
||||
if( ( g_nDXLevel == 0 ) || ( g_nDXLevel >= 70 ) )
|
||||
{
|
||||
const char *pSideListStr = ValueForKey( mapent, "sides" );
|
||||
#ifdef PARALLAX_CORRECTED_CUBEMAPS
|
||||
char *pParallaxObbStr = ValueForKey( mapent, "parallaxobb" );
|
||||
#endif
|
||||
int size;
|
||||
size = IntForKey( mapent, "cubemapsize" );
|
||||
#ifdef PARALLAX_CORRECTED_CUBEMAPS
|
||||
Cubemap_InsertSample( mapent->origin, size, pParallaxObbStr );
|
||||
#else
|
||||
Cubemap_InsertSample( mapent->origin, size );
|
||||
#endif
|
||||
Cubemap_SaveBrushSides( pSideListStr );
|
||||
}
|
||||
// clear out this entity
|
||||
@@ -1628,6 +1638,88 @@ ChunkFileResult_t CMapFile::LoadEntityCallback(CChunkFile *pFile, int nParam)
|
||||
return(ChunkFile_Ok);
|
||||
}
|
||||
|
||||
#ifdef PARALLAX_CORRECTED_CUBEMAPS
|
||||
//
|
||||
// parallax_obb brushes are removed after the transformation matrix is found and saved into
|
||||
// the entity's data (ent will be removed after data transferred to patched materials)
|
||||
//
|
||||
if (!strcmp("parallax_obb", pClassName))
|
||||
{
|
||||
matrix3x4_t obbMatrix, invObbMatrix;
|
||||
SetIdentityMatrix(obbMatrix);
|
||||
SetIdentityMatrix(invObbMatrix);
|
||||
|
||||
// Get corner and its 3 edges (scaled, local x, y, and z axes)
|
||||
mapbrush_t *brush = &mapbrushes[mapent->firstbrush];
|
||||
Vector corner, x, y, z;
|
||||
|
||||
// Find first valid winding (with these whiles, if not enough valid windings then identity matrix is passed through to vmts)
|
||||
int i = 0;
|
||||
while (i < brush->numsides)
|
||||
{
|
||||
winding_t* wind = brush->original_sides[i].winding;
|
||||
if (!wind)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
corner = wind->p[0];
|
||||
y = wind->p[1] - corner;
|
||||
z = wind->p[3] - corner;
|
||||
x = CrossProduct(y, z).Normalized();
|
||||
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
|
||||
// Skip second valid winding (opposite face from first, unusable for finding Z's length)
|
||||
while (i < brush->numsides)
|
||||
{
|
||||
winding_t* wind = brush->original_sides[i].winding;
|
||||
if (!wind)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
|
||||
// Find third valid winding
|
||||
while (i < brush->numsides)
|
||||
{
|
||||
winding_t* wind = brush->original_sides[i].winding;
|
||||
if (!wind)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Find length of x
|
||||
// Start with diagonal, then scale x by the projection of diag onto x
|
||||
Vector diag = wind->p[0] - wind->p[2];
|
||||
x *= abs(DotProduct(diag, x));
|
||||
|
||||
// Build transformation matrix (what is needed to turn a [0,0,0] - [1,1,1] cube into this brush)
|
||||
MatrixSetColumn(x, 0, obbMatrix);
|
||||
MatrixSetColumn(y, 1, obbMatrix);
|
||||
MatrixSetColumn(z, 2, obbMatrix);
|
||||
MatrixSetColumn(corner, 3, obbMatrix);
|
||||
|
||||
//find inverse (we need the world to local matrix, "transformationmatrix" is kind of a misnomer)
|
||||
MatrixInversion(obbMatrix, invObbMatrix);
|
||||
break;
|
||||
}
|
||||
|
||||
char szMatrix[1024];
|
||||
Q_snprintf(szMatrix, 1024, "[%f %f %f %f];[%f %f %f %f];[%f %f %f %f]", invObbMatrix[0][0], invObbMatrix[0][1], invObbMatrix[0][2], invObbMatrix[0][3], invObbMatrix[1][0], invObbMatrix[1][1], invObbMatrix[1][2], invObbMatrix[1][3], invObbMatrix[2][0], invObbMatrix[2][1], invObbMatrix[2][2], invObbMatrix[2][3]);
|
||||
SetKeyValue(mapent, "transformationmatrix", szMatrix);
|
||||
|
||||
return (ChunkFile_Ok);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( !strcmp( "test_sidelist", pClassName ) )
|
||||
{
|
||||
ConvertSideList(mapent, "sides");
|
||||
@@ -2615,6 +2707,30 @@ bool LoadMapFile( const char *pszFileName )
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PARALLAX_CORRECTED_CUBEMAPS
|
||||
// Fill out parallax obb matrix array
|
||||
for (int i = 0; i < g_nCubemapSamples; i++)
|
||||
{
|
||||
if (g_pParallaxObbStrs[i][0] != '\0')
|
||||
{
|
||||
entity_t* obbEnt = EntityByName(g_pParallaxObbStrs[i]);
|
||||
g_pParallaxObbStrs[i] = ValueForKey(obbEnt, "transformationmatrix");
|
||||
}
|
||||
}
|
||||
|
||||
// Remove parallax_obb entities (in a nice slow linear search)
|
||||
for (int i = 0; i < g_MainMap->num_entities; i++)
|
||||
{
|
||||
entity_t* mapent = &g_MainMap->entities[i];
|
||||
const char *pClassName = ValueForKey( mapent, "classname" );
|
||||
if ( !strcmp( "parallax_obb", pClassName ) )
|
||||
{
|
||||
mapent->numbrushes = 0;
|
||||
mapent->epairs = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((eResult == ChunkFile_Ok) || (eResult == ChunkFile_EOF))
|
||||
{
|
||||
// Update the overlay/side list(s).
|
||||
|
||||
Reference in New Issue
Block a user