Nico de Poel
10e54f10ca
Added a separate code path for converting frame group animations, and renamed some variables to use the correct frame/pose terminology
5 years ago
Nico de Poel
428eebb941
Pass along alias frame type and correctly count the total number of poses in a model, so that the correct number of pose vertices are marshaled and we can identify models that use group frame animations instead of typical single frames. Quake's model formats are weird.
5 years ago
Nico de Poel
0978e0490e
- Added the option to shut down a UniQuake instance from outside of Quake itself. Useful for when Quake is running headless.
- Added shader variant collection to allow use of the URP simple lit shader in a standalone build
5 years ago
Nico de Poel
96d2a1fe7b
First setup to upload brush models (specifically: the world model) from Quake to Unity. Updated the QWorld class to include the fields added by QuakeSpasm.
5 years ago
Nico de Poel
dec2be66c6
Keep track of already duplicated vertices and reuse those for triangles that need them. Fixes vertex counts being way too high because seam vertices would get duplicated multiple times.
5 years ago
Nico de Poel
a19d9b546e
Added disposal code for alias models
5 years ago
Nico de Poel
08c16f71a1
Moved importing and conversion of mesh data into AliasModel class. Also:
- Do not create blend shapes if a model does not have any animations
- Handle cases when mesh does not have any blend shapes
5 years ago
Nico de Poel
4d974bf6cd
Solved the UV correcting problem for backside triangles by pre-processing the model input data, whereby vertices on the seam are duplicated and adjusted. The rest of the mesh conversion process then remains as it was.
5 years ago
Nico de Poel
ab880f9cfb
Added a custom marshaler to decode screen texts received from Quake, which uses single-byte characters and a non-standard character set. Fixes string conversion errors and a fatal exception whenever the "ö" character is printed in the Zerstörer mod.
5 years ago
Nico de Poel
e8a3313d88
Some cleanup
5 years ago
Nico de Poel
4138290723
Further mesh research: create an individual mesh for each animation sequence, with a single blend shape animation per mesh. Added an AliasModel class to manage meshes and find the correct animations. With this we can smoothly animate looped animation cycles.
5 years ago
Nico de Poel
61a845338e
Further mesh conversion research: animation frames are now converted into blend shape animations, which can be played back either with or without smoothing.
5 years ago
Nico de Poel
834ff9a794
First test converting models from Quake into Unity meshes, including normals and UVs. It's still far from perfect (back side UVs are not handled at all yet) but it's a good demonstration of what will be possible.
5 years ago
Nico de Poel
75b9427296
Fixed compatibility issues with Scourge Done Slick:
- Implement Sys_DoubleTime with a clock function that keeps running and doesn't update only once per frame. Fixes infinite loop in Host_ShutdownServer.
- Readded missing "play" and "playvol" console commands.
- Ignore console messages that contain only whitespace.
5 years ago
Nico de Poel
11cdaf7a75
Allow passing of player number to FMOD for split-screen purposes. Not used for anything yet, but it's handy to have it in there already.
5 years ago
Nico de Poel
756420c5f9
Set channels with 0 volume to automatically become virtual. This greatly reduces the number of real channels that are being used.
5 years ago
Nico de Poel
0d4043e444
Properly set max real and virtual channels on FMOD initialization. Fixes sounds noticeably cutting out when the default max of 64 real channels is exceeded.
5 years ago
Nico de Poel
64b4ac812b
Split off native interop code for the main UniQuake class into a separate partial class file as well
5 years ago
Nico de Poel
12faa0c8a1
Allow FMOD system to be re-created during hot code compile & reload, and added some debug UI to inspect what FMOD is doing
5 years ago
Nico de Poel
1a5ff9b64b
Send normal logs to Unity again, but for the Update loop collect all logs and flush the contents only once per frame
5 years ago
Nico de Poel
78f42d9c9a
Return result of directory creation, so that the game may handle creation errors
5 years ago
Nico de Poel
548b72aed1
Minor bits:
- Consolidate FMOD closing code into a single method
- Added some experimental (commented-out) code to test running multiple instances of Quake
- Extra validation checks in FMOD music code
- Removed QuakeSpasm "feature" that skipped the demo reel at startup
5 years ago
Nico de Poel
754812d63e
Split all of the callback modules' native interop boilerplate code off into separate partial class files, to keep the actual logic code clean and easy to read.
5 years ago
Nico de Poel
243bb70613
Rewrote the BGM system using FMOD, making the whole codec system rather obsolete
5 years ago
Nico de Poel
e416868650
Modifications to make UniQuake work with a new engine DLL based on QuakeSpasm:
- Extended QuakeParms with additional fields required by QuakeSpasm, and marshal it to a fixed memory block so that the engine can hold on to a reference.
- Increased heap size to 128 MB
- Some minor renaming and refactoring
5 years ago
Nico de Poel
303f064f52
Added the ability to start one of the mission packs and to test mods
5 years ago
Nico de Poel
404f19a56d
Renamed mod* to gl* to reflect that it's about rendering in general, and cleaned up & rearranged some code
5 years ago
Nico de Poel
0f02005c58
Reimplemented uploading of alias model data, which now includes all vertex, triangle index and UV data
5 years ago
Nico de Poel
264848f832
Integrated FMOD (just Core, not Studio) into the Unity project and initialize it through a new AudioManager. The FMOD Core system handle is shared between Unity and Quake, so that both may produce sound through the same audio device.
5 years ago
Nico de Poel
3b4382954a
Some renaming and reorganization
5 years ago
Nico de Poel
b19df802c7
Reworked library loading so that the native DLL and its functions are now loaded dynamically using native LoadLibrary/GetProcAddress calls and can be freed again with FreeLibrary. This allows the library to be unloaded while in the Unity Editor, making iteration on native code easier, and it's a first step on the way to loading multiple Quake instances simultaneously.
5 years ago
Nico de Poel
276d66434e
Moved time registration to the main UniQuake class
5 years ago
Nico de Poel
fa50659490
Use custom exceptions to stop control flow in the Quake engine on Error and Quit, and shut down the engine. Doesn't work quite as intended yet (Quit will terminate the entire Unity application for some reason, instead of just Quake) but it's a step in the right direction.
5 years ago
Nico de Poel
ec8951fa7c
First test to upload model data (brush models and alias models) from Quake to Unity
5 years ago
Nico de Poel
cb8bb17c63
Replaced native file I/O functions with managed versions implemented in Unity. Worked first try! :D
5 years ago
Nico de Poel
d268e8794a
Declare callback delegates as using Cdecl calling convention, so it's consistent with the rest of the code and also consistent across all platforms.
5 years ago
Nico de Poel
14f7b78f1d
Removed delegate handles list as that wasn't necessary for anything at all
5 years ago
Nico de Poel
0fafaf32ad
Callback target pointer is now contained within the struct passed to native. Organized yet more code to move generic GCHandle stuff into the base class.
5 years ago
Nico de Poel
b3d419d1ad
More code organization; putting QuakeParms in its own file and encapsulating the nitty gritty unmanaged code details, to make things overall more readable.
5 years ago
Nico de Poel
c2f4d854e0
Moved all of the callbacks interop code into a separate class with a base class for some common abstractions. Allows for better organization of callbacks as the list grows.
5 years ago
Nico de Poel
b2ad8a5074
Added an opaque target pointer to each callback function, so that Unity can pass an object instance and use that instance when processing callbacks.
5 years ago
Nico de Poel
9c5e00b8a0
Modified callback conventions so that the paradigm is more Unity implementing system calls required by Quake in whatever way works best, rather than Quake calling specific Unity functions.
5 years ago
Nico de Poel
3f74b45969
Renamed UniQuake files and functions to have consistent casing
5 years ago
Nico de Poel
6a06621b90
Added some fun stuff that allows you to play with the time scale in Quake, either speeding it up or slowing it down from Unity.
5 years ago
Nico de Poel
2ef1b24042
Further simplified mechanism for creating and pinning callbacks. We don't care about the individual GCHandles so just throw them into a list for easy management.
5 years ago
Nico de Poel
38840fa7c3
Reorganized callbacks so that the function pointers and the containing class are all pinned, which makes them safe to store inside the DLL and reuse them on subsequent update calls.
5 years ago
Nico de Poel
0928173a43
Fixed command-line argument passing, and simplified code to set up callbacks
5 years ago
Nico de Poel
79b8f0d221
Added Unity code to interop with Quake DLL and test initialization from a Unity scene.
5 years ago