17 Commits

Author SHA1 Message Date
Kawe Mazidjatari
72289f9f33 CMDLCache::GetStudioHardware improvements
Slightly mapped out the structure more.
The function should now be compatible with earlier game dll's.
CStudioHWDataRef::SetFlags has to be rebuild as these are declared inline for earlier game dll's.
2022-05-06 00:51:49 +02:00
Kawe Mazidjatari
31c4f36aa3 CMDLCache::FindUncachedMDL cleanup 2022-05-05 20:36:13 +02:00
Kawe Mazidjatari
ec7956622b Make CMDLCache::FindMDL and CMDLCache::FindCachedMDL backwards compatible
Mapped out some of the structs
2022-05-05 17:53:05 +02:00
Kawe Mazidjatari
4d2c819544 Fix statement not getting compiled into the resulting binary 2022-05-05 14:53:48 +02:00
Kawe Mazidjatari
24dae59cb8 Improve CMDLCache::FindMDL 2022-05-05 02:54:17 +02:00
Kawe Mazidjatari
325fee107b Some mdlcache error handling improvements 2022-05-04 12:44:01 +02:00
Kawe Mazidjatari
c3f31d694a Improved mod RPak loading between changelevel
Note: this does not work reliably still.

The only way we could make this work 100% reliable would be to fully rebuild '0x140341D40' in the SDK and load our pak files among with the pre-existing g_pakLoadApi->AsyncLoad() call in this function, as this will ensure everything will be ran synchronously.

The current approach by taking some JT fifolock wrapper will only work reliably between one level change, unsure why the second and up fail.
2022-05-04 02:25:27 +02:00
Kawe Mazidjatari
26af720f7d Fill out cull map 2022-05-03 13:17:42 +02:00
PixieCore
096ecdd333 IClientEntityList and CUtlDict.
* IClientEntityList is the full virtual function table.
* CUtlDict "implementation" is temporary.
2022-05-01 23:03:20 +02:00
Kawe Mazidjatari
a479b4ac78 See description
Fixed rare crash in CMDLCache when buffer itteration returns invalid pointer (not null!) for handle.

Made all variables and functions used by BuildPropStaticFrustumCullMap searched dynamically (these should also work on s0, s1 and s2, they are compared but at the moment untested).

TODO: Fix deref crash properly (see bsplib.cpp l291).
2022-05-01 05:38:51 +02:00
Kawe Mazidjatari
97fb3fd8d4 Also lock the upgrade error behind already known bad model handles
Reduce console verbosity
2022-04-30 05:06:59 +02:00
Kawe Mazidjatari
a496254b93 Add mutex for CMDLCache methods
Als fall back to old GatherProps when at least one model is replaced with mdl/error.rmdl as the new GatherProps function does not support this yet.
2022-04-30 03:30:16 +02:00
Kawe Mazidjatari
1bf7b96641 Only print out missing models once
Don't print duplicated
2022-04-29 22:46:37 +02:00
Kawe Mazidjatari
7441bf156b Return proper studio hardware for mdl/error.rmdl
Now mdl/error.rmdl draws properly
2022-04-29 22:11:35 +02:00
Kawe Mazidjatari
d569d58378 Made missing model error handling more robust 2022-04-29 21:05:26 +02:00
Kawe Mazidjatari
827641b9b1 Early working implementation of the 'mdl/error.rmdl' fallback
Only works for prop_static (for the time being)
Only works for the S3 game_dll.

In order to get this to work: you must set 'old_gather_props' to nun-null and (for certain maps) perform the patch to prevent the frustum culling code to deref a bad pointer (see command 'opcodes test').
2022-04-29 18:25:54 +02:00
Kawe Mazidjatari
3cb4976c23 Start or 'mdl/error.rmdl' fallback implementation (see description)
In 'datacache/mdlcache.cpp' the function 'CMDLCache::FindMDL' attempts to find 'mdl/error.rmdl' and assigns the studiohdr and handle to the members of CMDLFallback.

In 'CMDLCache::FindUncachedMDL' we check if a model exists, if a model does not exist, we replace the studiohdr with the one of error.rmdl we stored in the CMDLFallback structure.

This does actually work (on the dedicated server it doesn't crash at all!), but on the client it crashes when trying to gather props (right before rendering), setting the ConVar* 'old_gather_props' does interesting things (check IDA around this ConVar*). setting this to 1 causes it to crash in another CMDLCache method when trying to deref something in the global cache pool.

This method is easy to rebuild. I will do this soon and attempt to return error.rmdl parts from here as well if results are null (this might actually just work).

Leaving 'old_gather_props' to 0 causes it to crash in the middle of the function which is supposed to gather the props the 'new' way.

The gather props functions are kind of daunting

NOTE: Currently only confirmed to work somewhat properly on the dedicated server for prop_static. prop_dynamic is unconfirmed. And (almost?) works on the client.
2022-04-29 05:30:06 +02:00