Commit graph

293 commits

Author SHA1 Message Date
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
Vsevolod Kremianskii
c3ba96b222 Rename rp folder in libgame into d20 2021-03-27 10:27:50 +07:00
Vsevolod Kremianskii
6a17b286e9 Cleanup Routines, unify code style in routine implementations 2021-03-26 16:44:24 +07:00
Vsevolod Kremianskii
80061cc43f Drop Action source files
They were redundant.
2021-03-25 00:34:31 +07:00
Vsevolod Kremianskii
70956e438d Store ExecutionContext as a smart pointer in Variable
This is to save space.
2021-03-24 23:51:42 +07:00
Vsevolod Kremianskii
c6deb588ec Implement more combat-related routines 2021-03-23 20:46:05 +07:00
Vsevolod Kremianskii
8a7885e19e Implement get*Target combat routines 2021-03-23 19:59:16 +07:00
Vsevolod Kremianskii
581984f7c0 Implement Get/SetNPCAIStyle 2021-03-23 18:37:16 +07:00
Vsevolod Kremianskii
6d35fdb455 Implement creature perception (sight and hearing) 2021-03-23 15:01:25 +07:00
Vsevolod Kremianskii
9c5be9b87a Refactor resource management
- Move GameID into libgame
- Move resource provider registration into Game
- Move GUI background loading into GameGUI
2021-03-23 13:21:24 +07:00
Vsevolod Kremianskii
e65ecd6ca4 Refactor animation keyframes 2021-03-22 22:40:36 +07:00
Vsevolod Kremianskii
ac55ac6a8d Read Danglymesh header and AABB tree from MDL 2021-03-22 19:27:54 +07:00
Vsevolod Kremianskii
100f318c81 Refactor MDL model loading
Read structs directly from memory.
2021-03-22 18:41:33 +07:00
Vsevolod Kremianskii
48bc91a675 Add ERF/MOD writer 2021-03-20 14:24:22 +07:00
Vsevolod Kremianskii
08fc51f3aa Improve grass rendering 2021-03-19 12:31:42 +07:00
Vsevolod Kremianskii
9143e884fc perf: Make drawSingle non-virtual in SceneNode 2021-03-18 23:47:56 +07:00
Vsevolod Kremianskii
0be6771175 feat: Load surface walkability from surfacemat.2da 2021-03-18 23:17:54 +07:00
Vsevolod Kremianskii
4eda8ce7a7 refactor: Replace dynamic casts with static casts in game objects 2021-03-16 15:13:57 +07:00
Vsevolod Kremianskii
d32d974545 Replace FPS counter with ProfileOverlay 2021-03-16 00:33:24 +07:00
Vsevolod Kremianskii
4d0483f487 feat: Load faction dispositions from repute.2da 2021-03-14 14:38:51 +07:00
Vsevolod Kremianskii
a45ad2fe27 feat: Implement MoveToLocation and FollowLeader actions 2021-03-14 13:57:02 +07:00