Commit graph

313 commits

Author SHA1 Message Date
Vsevolod Kremianskii
76bb4113dc Convert featureutil into Features class 2021-05-22 15:24:13 +07:00
Vsevolod Kremianskii
abe9aabc96 Convert stateutil to Context
Fits better into the new DI architecture.
2021-05-22 13:24:42 +07:00
Vsevolod Kremianskii
fe6abcc412 Refactor dependency injection
- Add Service class per module
- Services store and initialize dependencies
- To reduce number of dependenices passed, Service Locator pattern is
  used
2021-05-22 11:20:24 +07:00
45de5e7699 fixup! Add install commands to CMake 2021-05-22 08:38:29 +07:00
05cdef97c8 Add install commands to CMake
Signed-off-by: William Brawner <me@wbrawner.com>
2021-05-22 08:38:29 +07:00
Vsevolod Kremianskii
f5c0837fc3 Add service locator classes 2021-05-21 12:12:57 +07:00
Vsevolod Kremianskii
ec065ab68b Simplify null checks in ctors 2021-05-20 21:07:35 +07:00
Vsevolod Kremianskii
e9d0aeac5f Replace all remaining singletons with dependency injection
Needs major cleanup, but allegedly the code is more controllable now.
2021-05-20 20:26:54 +07:00
Vsevolod Kremianskii
1fee22c581 Convert all game singletons to injectable dependencies 2021-05-19 15:59:41 +07:00
Vsevolod Kremianskii
609afc7cf7 Rename SceneLeaf to SceneNodeElement 2021-05-19 12:42:26 +07:00
Vsevolod Kremianskii
8688e9d37b Load Force Powers from 2DA 2021-05-19 12:06:27 +07:00
Vsevolod Kremianskii
081b4877b8 Load feats from 2DA 2021-05-19 10:10:55 +07:00
Vsevolod Kremianskii
95f9fce3c4 Fix render order between particles and grass clusters 2021-05-19 01:22:05 +07:00
Vsevolod Kremianskii
e27a77b1e9 Combine Object and ActionQueue 2021-05-18 12:21:07 +07:00
Vsevolod Kremianskii
6c47a9de8e Make ObjectSelector, CreatureFinder and Perception part of Area 2021-05-18 11:44:51 +07:00
Vsevolod Kremianskii
eaaaa834bb Remove unused DebugOverlay class 2021-05-18 11:22:41 +07:00
Vsevolod Kremianskii
3ea7c3f869 Flatten CreatureAttributes/Abilities/Skills structure 2021-05-18 11:15:26 +07:00
Vsevolod Kremianskii
2113d13a0d Use Bezier curves for emitter constraints 2021-05-18 08:37:04 +07:00
Vsevolod Kremianskii
fc32d64642 Revert StateManager to stateutil
It's just easier to use that way.
2021-05-18 06:01:05 +07:00
Vsevolod Kremianskii
c4985f8684 Disable back-face culling for particles, grass and etc. 2021-05-16 14:08:25 +07:00
Vsevolod Kremianskii
740440ca78 Major refactoring of the scene management system 2021-05-14 23:31:05 +07:00
Vsevolod Kremianskii
aeffc4b453 Rename ModelNodeSceneNode to MeshSceneNode 2021-05-13 15:16:49 +07:00
Vsevolod Kremianskii
366d8d739d Major graphics/model refactoring
- Decouple Model and ModelNode from MdlReader
- Make Emitter a nested struct under ModelNode
- Read all known controller types
2021-05-13 14:54:23 +07:00
Vsevolod Kremianskii
640b5a3c8e Improve grass lightmapping
- Read face materials from MDL
- Use AABB model node, not walkmesh, to create grass clusters
- Use barycentric coordinates to interpolate texture coordinates

While at it, add Mesh methods to draw a subset of triangles.
2021-05-12 12:05:04 +07:00
Vsevolod Kremianskii
2843761be0 Add mesh and texture subdirectories to engine/graphics 2021-05-11 23:05:34 +07:00
Vsevolod Kremianskii
214aded7a4 Refactor ModelMesh
- Make it a struct, given how it doesn't have a behavior
- Place it under ModelNode
2021-05-11 22:25:52 +07:00
Vsevolod Kremianskii
0e2ffbee9d Refactor VertexOffsets
- Extract from Mesh
- Rename to VertexAttributes
- Move stride on top
2021-05-11 19:17:34 +07:00
Vsevolod Kremianskii
ad399815b7 Refactor collision detection
- Drop CollisionDetector class as unnecessary abstraction
- Move collision detection code from area.cpp into area_collision.cpp
- Implement sliding along obstacle normals
- Temporarily disable collision between creatures
2021-05-10 21:57:21 +07:00
Vsevolod Kremianskii
e8ff1d9ece Revise PBR shaders
While at it, move GLSL sources into a separate folder. Also split them
into multiple files: common, Blinn-Phong and PBR.
2021-05-07 18:55:17 +07:00
Vsevolod Kremianskii
a0e72164ed Convert stateutil into StateManager
Apparently, application-side caching of GL states improves performance.
2021-05-06 08:07:12 +07:00
Vsevolod Kremianskii
ae7dc8eb12 Move GLSL shaders into a separate CPP file 2021-05-06 07:42:28 +07:00
Vsevolod Kremianskii
62ed8f58e2 Move tools, launcher, external and tests under src directory 2021-05-05 08:08:12 +07:00
Vsevolod Kremianskii
67076473b2 Rename librender to libgraphics 2021-05-05 00:24:53 +07:00
Vsevolod Kremianskii
e3d49fd3b2 Implement footstep sounds 2021-05-04 23:21:18 +07:00
Vsevolod Kremianskii
ae47b3de64 Replace libtga with a custom TGAWriter 2021-05-04 16:22:22 +07:00
Vsevolod Kremianskii
d78bd29e6d Add basic lens flare implementation 2021-05-03 22:48:46 +07:00
Vsevolod Kremianskii
2212f0ff00 Merge ScriptObject and Object
ScriptObject is redundant, now, that variables store id, not pointers.
2021-05-03 13:52:22 +07:00
Vsevolod Kremianskii
25253405ce Revert to storing object id, not object pointer in scripts
- This is how vanilla does it
- It will supposedly be easier to save delayed actions this way
2021-04-22 17:53:55 +07:00
Vsevolod Kremianskii
0e0f018b5b Add tool to convert LIP to JSON and vice versa 2021-04-22 14:02:43 +07:00
Vsevolod Kremianskii
b6c5a9a8cd Refactor save games
SAV file is now an ERF archive with GFF (and later TGA) files.
2021-04-22 11:00:11 +07:00
Vsevolod Kremianskii
1c6e3e05cc Revert to reading individual fields in MdlReader
This is to account for endianess.
2021-04-11 12:20:37 +07:00
Vsevolod Kremianskii
e21f3c66bf Use Boost::Endian for byte order conversion
Less code to maintain and faster due to intristics.
2021-04-11 06:39:03 +07:00
Vsevolod Kremianskii
b00bb7bb00 Add tool to "unwrap" audio files 2021-04-10 16:49:12 +07:00
Vsevolod Kremianskii
6905d35e1f Implement JSON to TLK tool
While at it, make TLK to JSON tool output SoundResRef.
2021-04-10 15:13:52 +07:00
Vsevolod Kremianskii
ddb680c120 Separate TalkTable and TlkReader classes 2021-04-10 12:15:46 +07:00
Vsevolod Kremianskii
1c91fc707f Replace portraitutil with Portraits class 2021-04-07 11:20:57 +07:00
Vsevolod Kremianskii
8b2613b717 Refactor blueprints
Blueprint loading is once again part of respective object classes. This
is because blueprints are not stateful and thus there is no need to
cache them separately.
2021-04-06 23:33:55 +07:00
Vsevolod Kremianskii
9f955664fb Add tool to convert ASCII PTH to PTH
This is inteded to be used alongside KotorBlender.
2021-03-31 13:55:15 +07:00
Vsevolod Kremianskii
fb876e216f Make animation resolving and model building part of Creature 2021-03-28 09:39:15 +07:00
Vsevolod Kremianskii
40e48cc02c Refactor combat to take advantage of k_ai_master
Still doesn't work properly.
2021-03-27 18:49:33 +07:00