This reverts commit d086c3d4dc.
# Conflicts:
# src/polyrenderer/drawers/poly_triangle.cpp
# src/polyrenderer/drawers/poly_triangle.h
The softpoly renderer crashed at high resolutions without them.
This partially reverts "- don't let the video scale let the screen end up with a client size less than 320x200, which may cause undefined behavior and trigger asserts in debug builds."
The instruction one free instruction byte so it's now using that to extend its argument's register range to 65535.
For param this is needed because it passes strings by reference and creating an implicit temporary copy for string constants does not work here.
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
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.
(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.)
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
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)
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
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
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.
What works:
- Parsing the model
- Constructing geometry (surfaces) for triangulated models
What doesn't:
- Rendering the model
- Building the vertex buffer
- Triangulating quads
RIndexOf returns the index where the substring starts, instead of the index where the substring ends - 1.
Deprecate the LastIndexOf method of StringStruct
This is for mitigating the recently discovered problem with attenuated lights getting reduced in size, even on OpenGL 3+. The intent of the shrinking was to account for higher brightness of non-attenuated lights on OpenGL 2 and was never meant to be active on more modern versions.
The factor will apply to any attenuated light defined after it and will be inherited by included sub-lumps, but it will only last for the lunp it is set in.
If you have a definition for the broken behavior, AddLightAssociation
'lightsizefactor 0.667' at the top of your GLDEFS.
- split gl_postprocessshader.h in two so that the hardware independent part can be used by GLDEFS without pulling in all of OpenGL.
# Conflicts:
# src/CMakeLists.txt
# src/gl/dynlights/gl_glow.cpp
# src/gl/renderer/gl_postprocess.cpp
# src/gl/textures/gl_texture.cpp
This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually.
This also merges the player_t constructor into the class definition as default values.