129 Commits

Author SHA1 Message Date
Kawe Mazidjatari
55b90781ee Remove experimental CRC implementation in LZHAM
This implementation was done to calculate buffer CRC on the go, as that was what the VPK file system uses for the file crc's. But it later turned out to be unnecessary, and was never reverted.
2022-12-04 01:33:10 +01:00
Kawe Mazidjatari
d20250e436 Heavy output code cleanup
Only add to detour if the VFTable pointer didn't exist yet. Not declaring these in the anonymous namespace significantly reduces code size and unnecessary memory allocations. We might want to consider refactoring this, although it will probably require a big change.
2022-11-27 15:01:55 +01:00
Kawe Mazidjatari
ea18f30eda Fix incorrect rasterization at tile borders (recastnavigation/recastnavigation#476)
Merge recastnavigation/recastnavigation@3901c5854c
2022-11-25 00:05:36 +01:00
Kawe Mazidjatari
8dc12644be Remove unused functions 2022-11-24 11:50:21 +01:00
Kawe Mazidjatari
d3b2893cdc Change ImGui config file path and use engine's FileSystem API
'ImGuiConfig::Load()' was loading from the new path, however 'ImGuiConfig::Save()' was not. Defined path as constant expression to avoid this problem in the future. Also loading the files through the engine's API from now on.
2022-11-24 10:45:42 +01:00
Kawe Mazidjatari
90d87897f8 Improve consistency within the LZHAM library
Make CRC32 consistence with ADLER32
2022-11-17 20:35:43 +01:00
Kawe Mazidjatari
93bca826ef load imgui configs from 'cfg/imgui/*' instead 2022-11-10 15:33:35 +01:00
Kawe Mazidjatari
edd1c62352 Change vperpXZ to vperpXY 2022-10-22 21:59:57 +02:00
Kawe Mazidjatari
8709a256d9 Use closestPointOnPoly instead of getPolyHeight in dtNavMeshQuery::findRandomPoint 2022-10-22 21:59:57 +02:00
Kawe Mazidjatari
56dd3802f8 Recast & Detour XZY left overs to XYZ
Height should be set on the z axis.
2022-10-22 21:47:07 +02:00
Kawe Mazidjatari
5f84803ac6 ImGui and DirectX code improvements
* Fix history duplication by removing trailing white space characters from submitted commands in console.
* Fix out of range exception caused by caching svConVar.size() in CConsole::BuildSummary while we are modifying it.
* Fixed memory leak  caused by extraneous Strdup calls in CConsole.
* Renamed variables and structure members, static vars in id3dx.cpp are not prefixed with s_, IBrowser_Config is now m_BrowserConfig.
* Performed code cleanup in id3dx.cpp.
2022-10-20 12:29:50 +02:00
Kawe Mazidjatari
31845425d6 Only enable/disable input system on open/close events
Previously we enabled/disabled the input system each frame, depending on the state of the ImGui windows. This commit changes the behavior into only enabling/disabling when the menu's are closed (either through the keyboard or the close button).

I added a simple callback to ImGui::Begin which will be called when the close button on the ImGui panel is pressed and the callback pointer isn't nullptr, this was required as there was otherwise no way to determine when the close button was clicked.
2022-10-20 12:29:50 +02:00
Kawe Mazidjatari
c1ca5d0878 Fix spelling mistakes in Recast & Detour library 2022-10-07 22:32:08 +02:00
Kawe Mazidjatari
41f801365a CConsole: fixed color bug when missing newline
* Fixed bug where the in-game console could not color the line when no newline was found.
* Changed behavior to only newline when: '\n' has been found, or the context has changed (using a print without newline will continue to print on the same line in the console).
* Pass ImVec4 parameter in 'CTextLogger::InsertTextAt' by reference.
2022-09-19 20:21:18 +02:00
Kawe Mazidjatari
34a06147d7 Fix spelling errors
Overall spelling improvements and cleanup..
2022-09-09 19:47:31 +02:00
Kawe Mazidjatari
a3027a8fd1 Upgrade Dear ImGui from 1.87 to 1.88
Upgrade includes all the modifications we brought to the library (SetWindowScrollX/Y, autocaret end, mouse state adjustments for game, highlight around input selection, hotkeys, etc..).
2022-09-02 02:22:39 +02:00
Kawe Mazidjatari
0309d9cd6b Server browser UX improvements
* Use proper method of obtaining content regions for buttons.
* Set min and default size to (928 - 524), this improves the anti-aliasing effect even more.
* Significantly decrease the size of the private server modal.
* Removed extraneous min window size constraint set by 'ImGuiConfig::InitStyle()'.
2022-08-31 15:45:12 +02:00
Kawe Mazidjatari
45c147087a Fixed console logger selection while mutating entries bug
* Fixed bug where attempting to select text, while auto scroll is disabled, and entries are being removed, while entries are also being added, causes the start of the selection to not adjust with the number of lines being removed, which then causes it to move with the deletion.
2022-08-30 22:54:34 +02:00
Kawe Mazidjatari
d1d523fd12 Update imgui_logger.cpp 2022-08-30 21:28:26 +02:00
Kawe Mazidjatari
3414a2cd2c ImGui panel improvements
* Eliminated all forms of concurrency for CConsole logger.
* Used enum for determining which theme user loaded (DEFAULT, LEGACY, MODERN).
* Fixed issue where browser panel doesn't have the same frame padding as the console for the modern theme.
* Fixed issue where the history items count shows number higher than maximum until updated (updates vector before displaying, else this happens in g_pConsole->RunTask which is the operation that happens before we add new elements to the vector, thus showing the wrong count as this size is getting corrected the next frame after we painted, we don't update the summary each frame for performance reasons).
2022-08-22 01:10:18 +02:00
Kawe Mazidjatari
8476d22777 Fix concurrent access to several CConsole members
* Fix concurrent access to CConsole::m_Logger.
* Fix concurrent access to CConsole::m_vHistory.
* Additional DX system cleanup.
2022-08-21 19:35:06 +02:00
Kawe Mazidjatari
52e19e9ad6 Single-thread the game console
Run all task in the same thread used to run the browser/console frame and remove all mutexes.
2022-08-20 01:48:42 +02:00
Kawe Mazidjatari
329621c6ad Move all public headers into root of 'public' 2022-08-09 17:18:07 +02:00
Kawe Mazidjatari
e92b5d1300 General cleanup
Use c++ methods, remove unnecessary casts, unnecessary use of auto, etc..
2022-08-09 15:19:12 +02:00
Kawe Mazidjatari
f015667f88 Light ImGui cleanup
* CTextLogger: Explicit cast return value of size() to int when testing int value against size_t.
* CBrowser: Run think and request thread on client.dll, but for the request, only the refresh.
2022-08-09 12:13:31 +02:00
Kawe Mazidjatari
9d06a02614 General cleanup
* Use Cbuf functions for executing commands in ImGui panels.
* Use const qualifiers for all vftable indexes.
2022-08-09 02:35:00 +02:00
Kawe Mazidjatari
ea5f17b4ca Light cleanup
* Moved ConVar usage text that where part of the help string to the usage string parameter.
* Flagged ConVar 'bhit_abs_origin' as FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED.
* Flagged ConCommand 'bhit' as FCVAR_DEVELOPMENTONLY | FCVAR_GAMEDLL.
* Check 'bhit_enable' before running the 'bhit' command callback.
* Fixed spelling in a few area's.
2022-08-04 16:34:23 +02:00
Kawe Mazidjatari
9eeaebaf6a Even More XZY->XYZ changes 2022-07-28 15:45:02 +02:00
Kawe Mazidjatari
cbaf10478a More XZY->XYZ changes
* dtIntersectSegSeg2D: Calculate over zy-plane instead.
* dtOverlapPolyPoly2D: Calculate over zy-plane instead.
* dtNavMeshQuery::findRandomPoint: z = h.
* dtNavMeshQuery::raycast: Invert hit normals.
* Update all comments to use xyz vector instead (previously xzy (xz-plane z-height)).
2022-07-28 14:24:29 +02:00
Kawe Mazidjatari
34076142ba More XZY->XYZ changes 2022-07-28 03:21:20 +02:00
Kawe Mazidjatari
ce28ea2691 Even more offMeshConnections debug draw fixes 2022-07-28 02:07:13 +02:00
Kawe Mazidjatari
8af97beb57 Fix offMeshConnections debug draw 2022-07-28 01:48:17 +02:00
Kawe Mazidjatari
6a1b6c580a Increase debug arow size 2022-07-28 00:52:12 +02:00
Kawe Mazidjatari
37637bc56a Properly fix cylinder, circle and arrow debug draw for Recast. 2022-07-28 00:41:47 +02:00
Kawe Mazidjatari
87a42efd72 Uncomment and fix crowd anticipate turn debug draw
Moved internal functions to their own translation unit.
2022-07-27 21:05:27 +02:00
Kawe Mazidjatari
88a29f2770 Improve crowd speed/acceleration/braking
Changed to values comparable to game.
Added sliders for acceleration and speed.
2022-07-27 20:08:17 +02:00
Kawe Mazidjatari
03698a4a5f Fix DetourCrowd
XZY -> XYZ.
Crowd agents now traverse over the poly surfaces properly.
2022-07-27 17:48:51 +02:00
Kawe Mazidjatari
0576749de0 Use transparent area color for polymesh debug draw 2022-07-27 14:30:30 +02:00
Kawe Mazidjatari
c16d87ebc5 Fix more Recast & Detour debug drawing
* XZY -> XYZ.
2022-07-27 14:29:54 +02:00
Kawe Mazidjatari
4c8027b319 Fix duDebugDrawHeightfieldLayer and RecastDebugDraw cleanup 2022-07-27 12:38:02 +02:00
Kawe Mazidjatari
df99664d2a Working Recast convex hull 2022-07-27 11:11:41 +02:00
Kawe Mazidjatari
da77600baa More XZY->XYZ places 2022-07-27 10:58:54 +02:00
Kawe Mazidjatari
8757d0a43f NavMesh convex volume drawing somewhat working 2022-07-27 03:50:11 +02:00
Kawe Mazidjatari
112a530d5a Improve Recast & Detour and NavMesh generation
* Add missing dtQueryFilter field (some flag used in the engine but not sure yet what it does).
* Set tile->polysEnd and tile->offMeshConsEnd to end of polys and offMeshCons array pointer (if ever needed).
* Set camera perspective to 75 (previous 50).
* Improve theme.
* Lowered the climb height for all hulls (this improves NavMesh generation around low obstacles, previously it would create a poly connecting the ground on the side with the surface of the object around where it connects with the ground, causing AI to take this route instead and kind of 'glitch' onto the surface).
2022-07-26 14:23:02 +02:00
Kawe Mazidjatari
ff0ae1c13b Fix dtMeshTile structure
Removed old member that should had been removed earlier. All members align now.
2022-07-22 12:28:39 +02:00
Kawe Mazidjatari
c850d52d1b Add NavMesh poly bounds debug overlay 2022-07-21 02:21:59 +02:00
Kawe Mazidjatari
79b4d7889a Remove non-existent member
This member was actually offMeshConsEnd
2022-07-20 17:31:35 +02:00
Kawe Mazidjatari
c0d3dafa6f Update dtNavMeshQuery structure
Member 'filter' has been moved out of 'dtNavMeshQuery::dtQueryData'. New offset = 0x60 (after m_openList). Renamed to 'm_queryFilter' to maintain consistency.
2022-07-20 01:33:09 +02:00
Kawe Mazidjatari
59dd3e2228 NavMesh system improvements
* Confirmed DT_MAX_AREAS size being 32 (originally 64).
* header->offMeshEnds to -1.
* Added pointer to 'g_pHullMask'.
2022-07-19 22:00:40 +02:00
Kawe Mazidjatari
3d0162038a Improved navmesh structs
New member: header->offMeshEnds (this is used in Detour_LevelInit which sets fields to -1 starting at the pointer to end of offMeshCons array).

Currently set to 0 so the paths in opcodes.cpp could be disabled.
2022-07-18 21:38:07 +02:00