Commit graph

14763 commits

Author SHA1 Message Date
Kevin Caccamo
a628cff085 Calculate normals for OBJ models with smooth groups
Add smoothGroup member to OBJFace struct, and assign the current smooth group number to it
Move face normal calculation code to CalculateNormalFlat
Add AddVertFaces method, which initializes and populates the vertFaces array of arrays, which holds references to triangle references per vertex
Only initialize and populate vertFaces if the model has missing normals and smooth groups
Assign smooth groups to triangle data
Add CalculateNormalSmooth method, which calculates the normals for each face the vertex is attached to, depending on whether or not the faces are part of the given smooth group, and averages them out
Add OBJTriRef struct, which holds references to triangles on OBJ surfaces

Make {agg,cur}SurfFaceCount unsigned ints
Change nvec to a value instead of a pointer
2018-10-05 22:24:26 +02:00
Christoph Oelckers
6df918341a - be more thorough with 'in menu' checks for certain protected functions.
They would also pass the test if a menu just was open but not the actual invoker.
Also error out if this happens so that modders can see that they are doing unsupported things. Silent failure is not a good idea here.
2018-10-05 22:24:25 +02:00
Christoph Oelckers
4cd4e01fff - fixed some warnings in OBJ model code.
(This clearly shows that using 'long' as parameters in any interface must be stopped. It is fundamentally unsafe to have a type whose size is not reliable - it's either an int-sized nor a pointer sized value, depending on the platform, and essentially worthless.)
2018-10-05 22:24:23 +02:00
Magnus Norddahl
33180fd4e8 - remove shadow acne from PCF shadowmap filter and add three quality levels 2018-10-05 10:20:02 +02:00
drfrag666
dfe032dc8a - Fixed no rendering with shadowmaps enabled and render buffers disabled. 2018-10-05 01:56:28 +02:00
Marisa Kirisame
c674c3ff72 Computed facet normals for UE1 models were not normalized when they were supposed to. 2018-10-05 01:23:38 +02:00
drfrag666
9d10545ff2 - Fixed non valid value. 2018-10-04 21:10:05 +02:00
Vitaly Novichkov
72affb2c2e Upgrade libADLMIDI and libOPNMIDI
Added full-panning stereo, improvement of channel management, and many other things.

Also, I have implemented an ability to use custom WOPL (for libADLMIDI) and WOPN (for libOPNMIDI) banks from the same path as "soundfonts", but also, in the same environment, the "fm_banks" folder was added for WOPL/WOPN storing purposes.
To toggle usage of embedded or custom bank, I have added togglable booleans. When bank fails to be loaded, the default embedded bank is getting to be used as fallback.

ADLMIDI 1.4.0   2018-10-01
 * Implemented a full support for Portamento! (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Added support for SysEx event handling! (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Added support for GS way of custom drum channels (through SysEx events)
 * Ignore some NRPN events and lsb bank number when using GS standard (after catching of GS Reset SysEx call)
 * Added support for CC66-Sostenuto controller (Pedal hold of currently-pressed notes only while CC64 holds also all next notes)
 * Added support for CC67-SoftPedal controller (SoftPedal lowers the volume of notes played)
 * Fixed correctness of CMF files playing
 * Fixed unnecessary overuse of chip channels by blank notes
 * Added API to disable specific MIDI tracks or play one of MIDI tracks solo
 * Added support for more complex loop (loopStart=XX, loopEnd=0). Where XX - count of loops, or 0 - infinite. Nested loops are supported without of any limits.
 * Added working implementation of TMB's velocity offset
 * Added support for full-panning stereo option (Thanks to [Christopher Snowhill](https://github.com/kode54) for a work!)
 * Fixed inability to play high notes due physical tone frequency out of range on the OPL3 chip

OPNMIDI 1.4.0   2018-10-01
 * Implemented a full support for Portamento! (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Added support for SysEx event handling! (Thanks to [Jean Pierre Cimalando](https://github.com/jpcima) for a work!)
 * Added support for GS way of custom drum channels (through SysEx events)
 * Ignore some NRPN events and lsb bank number when using GS standard (after catching of GS Reset SysEx call)
 * Added support for CC66-Sostenuto controller (Pedal hold of currently-pressed notes only while CC64 holds also all next notes)
 * Added support for CC67-SoftPedal controller (SoftPedal lowers the volume of notes played)
 * Resolved a trouble which sometimes makes a junk noise sound and unnecessary overuse of chip channels
 * Volume models support taken from libADLMIDI has been adapted to OPN2's chip speficis
 * Fixed inability to play high notes due physical tone frequency out of range on the OPN2 chip
 * Added support for full-panning stereo option

ADL&OPN Hotfix: re-calculated default banks
The fix on side of measurer of OPL3-BE and OPN2-BE where some instruments getting zero releasing time.

# Conflicts:
#	src/sound/mididevices/music_adlmidi_mididevice.cpp
#	src/sound/mididevices/music_opnmidi_mididevice.cpp
#	wadsrc/static/menudef.txt
2018-10-04 20:25:02 +02:00
Christoph Oelckers
48bf320570 - fixed warning in ADLMidi. 2018-10-04 19:53:21 +02:00
Marisa Kirisame
5877c0248d Exports various resurrection-related functions to ZScript. 2018-10-04 19:30:39 +02:00
Magnus Norddahl
8997d5effb - fix the nearest shadow map filter to have no shadow acne and replace linear with nearest in the menu 2018-10-04 19:27:20 +02:00
Magnus Norddahl
7124ba8216 - add some comments to shadowmap.fp 2018-10-04 19:24:22 +02:00
Magnus Norddahl
9ad56a9f66 - fix diagonal linear shadow map artifact 2018-10-04 19:24:12 +02:00
Christoph Oelckers
ee278db86f - toned down the intensity of the dynamic lights for Doom's torches. 2018-10-04 19:23:58 +02:00
Christoph Oelckers
24d09fe56a - some tweaking of shadowmap filter setting to allow changing the PCF filter's number of samplings.
# Conflicts:
#	src/gl/system/gl_cvars.h
#	src/gl/system/gl_menu.cpp
2018-10-04 19:19:56 +02:00
Christoph Oelckers
62c11cd1a5 - add new option to menu 2018-10-04 19:09:48 +02:00
drfrag666
58b7967eea - enabled the linear shadowmap filter.
Although this doesn't look as good as the PCF version it is a lot less calculation intensive and therefore more suitable for weaker hardware.
It also tends to bleed through walls a lot less.
(refactored patch by Graf)
2018-10-04 19:08:49 +02:00
drfrag666
a51151d563 - Bumped ZScript version number so it's the same as in GZDoom. 2018-09-30 21:23:38 +02:00
Rachael Alexanderson
92d631deb7 - changed macro into a regular function 2018-09-29 21:26:56 +02:00
Rachael Alexanderson
f06501da22 - implement normalNx scaling
# Conflicts:
#	wadsrc/static/menudef.txt
2018-09-29 21:26:54 +02:00
drfrag666
c1f0335bb4 - Do not allow the TC_USE_SSE2 option on 64 bit targets. 2018-09-28 13:04:32 +02:00
Marisa Kirisame
7b28c224f0 Fix a major oversight that caused UE1 models to use the normals of the first frame for all frames. 2018-09-26 10:34:45 +02:00
Marisa Kirisame
a7952bc49b Hotfix: The output from CheckReplacement no longer permanently overrides an actor's replacement. 2018-09-24 01:07:14 +02:00
Magnus Norddahl
f9f81cdb32 - clamp the software light to never get brighter than the initial light level 2018-09-23 21:00:51 +02:00
Marisa Kirisame
9028bbd473 Adds OnDrop virtual to inventory items. Called on the dropped item at the end of AActor::DropInventory. 2018-09-17 01:18:51 +02:00
Rachael Alexanderson
7227f54d1c - archive 'multiplayer' flag in savegames. https://forum.zdoom.org/viewtopic.php?f=2&t=61980 2018-09-15 20:41:18 +02:00
Major Cooke
78d4a87cd1 Added DMG_EXPLOSION flag.
- This allows modders to determine if damage is caused by an actual explosion, assigned by P_RadiusAttack and BlastActor for +TOUCHY actors.
2018-09-15 20:41:17 +02:00
Major Cooke
3d52b093a5 Allow LineAttack's LAF_NOINTERACT to fill FTranslatedLineTarget's information.
- Originally when the flag was made, LineAttack was not yet exported. This can now be benefitted directly from ZScript.
2018-09-15 20:41:16 +02:00
ZippeyKeys12
c0cb8659b7 Make StatusScreen::End virtual
https://forum.zdoom.org/viewtopic.php?t=59419
2018-09-15 20:33:14 +02:00
ZippeyKeys12
b26aad2741 Add NewGame to EventHandler
https://forum.zdoom.org/viewtopic.php?t=61908
2018-09-15 20:33:13 +02:00
alexey.lysiuk
7736504a22 Fixed code generation of infinite for loop
https://forum.zdoom.org/viewtopic.php?t=62023
2018-09-15 20:33:10 +02:00
drfrag666
c320a92dcf - Fixed gcc warning. 2018-09-09 13:35:50 +02:00
Christoph Oelckers
f039fabfb8 - fixed the use of Doom-Legacy-style 3D floor lighting in light mode 8.
Legacy used some strange blending formula to calculate its colormaps for colored 3D floor lighting, this is not available in the software lighting mode, so for these the engine has to temporarily revert to light mode 2 to render them correctly.

# Conflicts:
#	src/gl/compatibility/gl_20.cpp
#	src/gl/renderer/gl_lightdata.cpp
#	src/gl/renderer/gl_renderstate.h
#	src/gl/scene/gl_sprite.cpp
#	src/hwrenderer/scene/hw_weapon.cpp
#	src/hwrenderer/utility/hw_lighting.cpp
#	src/hwrenderer/utility/hw_lighting.h
#	src/v_2ddrawer.cpp
2018-09-09 13:09:31 +02:00
Christoph Oelckers
7848bab7b3 - fixed math imprecisions in horizon vertex generation.
Floats are not precise enough to be used as a loop counter.
2018-09-09 11:29:19 +02:00
Christoph Oelckers
f557fa4296 - fixed incorrect trigger types in compatibility setter.
These were caused by some bogus comment in the original compatibility.txt which erroneously added a "SPAC_PCross" remark to a line which actually set "SPAC_Cross".
2018-09-04 01:30:14 +02:00
Christoph Oelckers
608e5f5bcf - fixed bad code for OP_SRL_KR. 2018-09-02 18:47:42 +02:00
Christoph Oelckers
1e487ee30a - added profiling for postprocessing code.
# Conflicts:
#	src/gl/scene/gl_scene.cpp
#	src/gl/utility/gl_clock.cpp
#	src/hwrenderer/utility/hw_clock.h
2018-09-02 13:07:02 +02:00
drfrag666
a2674eb4cf - Added fake DrawThickLine action function so mods using it don't crash. DrawLine will be called instead. 2018-09-02 00:29:11 +02:00
Kevin Caccamo
50327255ed Update usage of LastIndexOf
Now that LastIndexOf works properly, update the code that uses it to find OBJ models

Also, make UE1 model finder use LastIndexOf
2018-09-01 11:15:18 +02:00
Kevin Caccamo
639d68277e Fix OBJ rendering in software renderers, and other things
Pass surf->vbStart to SetupFrame instead of 0, and pass 0 to DrawArrays instead of surf->vbStart.

Use a potentially faster method of modifying the OBJ file text buffer by modifying it directly.

Add RealignVector and FixUV methods to begin work on re-aligning OBJ models to the same orientation as MD3 models.

Re-align OBJ models to match MD3 models

Fix normal calculation for re-aligned OBJs

Ensure AddSkins does not go out of bounds of surfaceskinIDs

Do not precache skins that were replaced by the user.

Fix OBJs with a large number of materials not being fully rendered

Print a warning message if a material referenced by the OBJ could not be found.

Free surface triangles once they are no longer needed

Also, use continue instead of return so that surfaces after those with missing materials are still rendered.

Fail if a face side has no vertex reference. Vertex references are required for a valid OBJ.

Clean up OBJ model code

Remove commented code, mainly Printf's that aren't used any more.

Add more documentation comments, and tweak existing documentation comments

Replace ParseVector2 and ParseVector3 with a template ParseVector function
2018-09-01 11:15:16 +02:00
Kevin Caccamo
f785886c4b Fix rendering and parsing of OBJ models
Create a new surface for each 'usemtl' statement in the OBJ file, and fix memory errors caused by TriangulateQuad.

Calculate missing normals, and fix incorrect UV coordinates

Fix construction of vertex buffer for objects with multiple surfaces

Localize curMtl, curSurface, aggSurfFaceCount, and curSurfFaceCount to FOBJModel::Load(), since they are not used anywhere else.

Fix parsing of OBJs without UV references

Internally, I replaced hashtag line comments with C-style line comments, and I replaced each forward slash with newSideSep.

If no UV coordinates are available, add a default vector of (0,0).

Also, remove "this->" from ResolveIndex to make the code a bit cleaner, and fix a minor garbage issue I failed to notice earlier (normref would pick up garbage if there was no normal reference).

Ensure usemtl statements remain intact

It may be a bit inefficient, but I tried modifying the buffer directly, and I got memory corruption errors. In this case, it's a lot better to be safe than sorry.
2018-09-01 11:15:15 +02:00
Kevin Caccamo
188d8704e1 Initial work on OBJ model support
What works:
- Parsing the model
- Constructing geometry (surfaces) for triangulated models

What doesn't:
- Rendering the model
- Building the vertex buffer
- Triangulating quads
2018-09-01 11:15:13 +02:00
Rachael Alexanderson
a1b6d6a280 - update french language translation from Tapwave 2018-09-01 11:13:53 +02:00
ZippeyKeys12
564d0af331 Moved FConfigFile over to FileReader/FileWriter
Don't use new operator, use value instead
2018-08-31 21:04:17 +02:00
alexey.lysiuk
a75cd861c2 - fixed: always initialize active colors in special font
https://forum.zdoom.org/viewtopic.php?t=61859
2018-08-31 11:11:57 +02:00
Rachael Alexanderson
94696c1c70 - add menu sliders for vr_ipd and vr_screendist 2018-08-30 11:02:09 +02:00
Braden Obrzut
870228c833 - Added paths for all games on Steam for Linux since they now offer the ability to download all games for Proton/Wine.
- Check ~/.steam on Linux for the config since either they moved it at some point or my setup changed and that's where it is for me now.
2018-08-29 19:28:43 +02:00
Christoph Oelckers
4efb5187c7 - defaulted constructors and assignment operators of several trivial types.
# Conflicts:
#	src/hwrenderer/textures/hw_material.cpp
2018-08-28 13:43:51 +02:00
drfrag666
9677ffe5b0 - Bumped ZScript version. 2018-08-26 14:04:33 +02:00
Rachael Alexanderson
342b476781 - fixed: sound from poly objects through portals will now propegate properly 2018-08-26 13:52:25 +02:00