Making callstack resolving operational will require a little bit more effort
src/scripting/vm/jit_runtime.cpp:900:31: error: use of undeclared identifier 'frames'
src/scripting/vm/jit_runtime.cpp:903:23: error: use of undeclared identifier 'cnt'
Since unfortunately this cannot be set as a general default, let's at least make it as easy as possible to disable that panning+scaling madness without having to edit the texture data.
# Conflicts:
# src/swrenderer/textures/r_swtexture.h
# src/textures/texture.cpp
# Conflicts:
# src/textures/texture.cpp
This needs to be handled by the caller for all use cases because the translation parser lacks the context to do a proper error report.
# Conflicts:
# src/textures/multipatchtexture.cpp
These always come from open-sector render hacks where the renderer tries to fill in some gaps
# Conflicts:
# src/hwrenderer/scene/hw_walls.cpp
# Conflicts:
# src/gl/scene/gl_walls_draw.cpp
This particular case incorrectly factored in the sidedef's scaling factor for how to calculate the offset.
Fortunately this is a very rare case - a quick check yielded no maps depending on it.
Should any map surface that depends on this bug a compatibility option may be needed but it doesn't seem likely that this may be the case.
For ad-hoc Dehacked state functions no ArgFlags are created, in this case they can just be assumed to not be relevant here, because none of these function produces reference arguments.
Initially, settings controller flag was false by default
It was not touched during construction and destruction of player_t instances though
Now, with all members initialized in class definition, this flag must be saved and restored manually
https://forum.zdoom.org/viewtopic.php?t=62830
- disallow bool as a return value for direct native calls because it only sets the lowest 8 bits of the return register.
- changed return type for several functions from bool to int where the return type was the only thing blocking use as direct native call.
CMakeFiles/zdoom.dir/r_utility.cpp.o: In function `R_SetupFrame(FRenderViewpoint&, FViewWindow&, AActor*)':
/home/travis/build/coelckers/gzdoom/src/r_utility.cpp:832: undefined reference to `AActor::GetCameraHeight() const'
CMakeFiles/zdoom.dir/g_shared/a_action.cpp.o: In function `A_Unblock(AActor*, bool)':
/home/travis/build/coelckers/gzdoom/src/g_shared/a_action.cpp:64: undefined reference to `AActor::GetDropItems() const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Distance2DSquared(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x6ab): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Distance3DSquared(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x75f): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Vec3To(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x850): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Vec2To(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x930): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_DistanceBySpeed(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0xa00): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o:vmthunks_actors.cpp:(.text+0xad3): more undefined references to `AActor::PosRelative(AActor const*) const' follow
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_PosRelative(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x1200): undefined reference to `AActor::PosRelative(sector_t*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_ClearInterpolation(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x127d): undefined reference to `AActor::ClearInterpolation()'
vmthunks_actors.cpp:(.text+0x1298): undefined reference to `AActor::ClearInterpolation()'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_GetBobOffset(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x135a): undefined reference to `AActor::GetBobOffset(double) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Distance2D(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x222b): undefined reference to `AActor::PosRelative(AActor const*) const'
* use I_Error instead of I_FatalError to abort. I_FatalError is only for things that are not recoverable and should not be handled outside of error cleanup and rethrowing.
* only catch CRecoverableError in JitCompile. Everything else should fall through to the outermost catch block.
* Do not I_FatalError out after handling the exception locally. Just print an error and return null, indicating failure.
Temple of the Lizardmen 3 has segs lumps in every level that seem to use a different data format and are completely unusable, up to triggering undefined behavior.
* The functions had no prototype and caused crashes.
* even after creating a prototype it didn't work because CreateAnonymousFunction was set up incorrectly for the case where a known return type was given.
The easiest part was the type checks which could be changed to the name variant with a global search and replace.
# Conflicts:
# src/hwrenderer/scene/hw_sprites.cpp
# Conflicts:
# src/hwrenderer/scene/hw_sprites.cpp
- fixed: P_PoisonDamage's check for Buddha2 and the Buddha powerup were inverted.
- fixed: P_PoisonDamage checked the modified damage instead of the raw, allowing amplifiers to boost the damage beyond telefrag and circumventing regular buddha.
This was the last bit of code standing in the way of making AInventory a fully scripted class.
All that's left to sort out is some variable accesses - the vast majority of them in SBARINFO.
- moved the ALTHUDCF parser PClass::StaticInit, so that it gets done right after creating the actor definitions.
All left to do is not to reallocate the AltHud object for each frame but store it in a better suited place.
# Conflicts:
# src/d_main.cpp
# Conflicts:
# src/info.cpp
Instead of overriding the Massacre method it is preferable to clear the flags causing the bad behavior, most notably ISMONSTER.
# Conflicts:
# src/g_inventory/a_pickups.cpp
# src/g_inventory/a_pickups.h
Now a child type can decide for itself how to treat 'amount'.
The scripting interfaces to this function in ACS and FraggleScript have been consolidated and also scriptified.
- offloaded key list generation for alternative HUD to non-UI parts.
This change also revealed a problem with handling empty sprites in the key list so this got fixed, too.
# Conflicts:
# src/g_shared/shared_hud.cpp
- changed PARAM_STRING to use the passed string by reference instead of by value. The 3 instances where passing by value was needed now use PARAM_STRING_VAL.
# Conflicts:
# src/v_video.h
* Attempts to fix errors introduced by merging of asmjit branch and weapons scripting branch
* This didn't work. The others should work though.
* fix scriptutil.cpp:(.text+0x18d): undefined reference to `PClass::FindActor(FName)'
* Attempt to fix compilation on macOS
# Conflicts:
# src/m_cheat.cpp
On Windows none of this is needed, because we can generate a proper unwind frame for the JITed functions, but even on Linux, it would require manual additions to each single piece of native code that ever gets called from inside a JIT compiled function.
This is an utterly prohibitive proposition because it makes direct native calls a virtual impossibility
So, in order to get the thrown error properly presented both I_Error and ThrowAbortException will now forward to I_FatalError if it is called from inside a JIT context.
# Conflicts:
# src/scripting/vm/vmframe.cpp
This was by far the largest block of native virtuals, and they were only native to be able to allow checking if the event was implemented for the current handler. This can easily be done by looking at the byte code, just like VMCall also does but in turn it removes more than half of the existing native virtuals from the interface.
For a few larger functions I took them out of sector_t and made them global functions to avoid creating more unnecessary stubs.
# Conflicts:
# src/p_sectors.cpp
It has been like this initially but was changed when ZDoom gained an overly complicated polymorphic class descriptor object that required a lot of support code. All these complications have long been removed but these methods remained. Since they prevent a class from being moved to the script side entirely they had to be removed.
This was the last major blocker to make Weapon a purely scripted class, the only remaining native method is Serialize which is of no concern for the coming work.
This stuff is now kept locally in the bot code so that it doesn't infest the rest of the engine.
And please don't read the new botsupp.txt file as some new means to configure bots! This was merely done to get this data out of the way.
The bots are still broken beyond repair and virtually unusable, even if proper data is provided for all weapons.
This seriously needs to be independent from the data store and better abstracted. More work to come to move this to its proper place.
# Conflicts:
# src/g_inventory/a_pickups.cpp
In both cases, having this flag on will render the monster-backing-off-check for melee attacks ineffective because it would misinterpret these weapons as close range only - which they aren't. Even for the PhoenixRod the range is longer than what gets checked here.
As a consequence, the bot's check for missile shooting melee weapons has also become pointless because no such weapon is defined anymore.
Since it forwards directly to FindState and has no script bindings there is no need to keep it, it'd only complicate the full scriptification of the weapon class if it stuck around.
* it was never saved in savegames, leaving the state of dead bodies undefined
* it shouldn't be subjected to pointer substitution because all it contains is old dead bodies, not live ones.
# Conflicts:
# src/r_data/r_translate.cpp
Since the only thing it gets used for is swapping out PlayerPawns it can safely skip all global variables that never point to a live player, which allowed to remove quite a bit of code here that stood in the way of scriptifying more content
For the varargs functions that used the Type field to validate their parameters, now a hidden additional argument is passed which contains a byte array with the type info for the current call's arguments. Since this is static per call location it can be better prepared once when the code is being compiled instead of being put in a runtime created array for each invocation. Everything else uses the per-function instance of the same data.
The only thing that still needed the type field with a VMValue is the defaults array, so this uses a different struct type now to store its data.
# Conflicts:
# src/v_draw.cpp
Currently used for loading parameters into registers.
For checking parameters of native functions some more work is needed to get the info to the function. Currently it doesn't receive the function descriptor.
src/scripting/vm/jit_call.cpp:164:38: warning: offset of on non-standard-layout type 'VMScriptFunction' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:87:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:96:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:257:53: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
The amount of support code for this minor optimization was quite large and this stood in the way of streamlining the VM's calling convention, so it was preferable to remove it before moving on.
With a proper count value available this can be done properly. The only relevant targets are the jumps immediately succeeding the IJMP instructions, nothing else.
This removes the last non-vararg cases where a native VM function checks 'numparam'. As of this commit all function calls will pass the complete list of arguments.
This isn't used for the 3 action function calls because it requires an array allocation which would be a bit too costly for something as frequently called as action functions.
They will need a different approach.
This allows retaining the functionality, even if for the JIT compiler's benefit all default arguments are pushed onto the stack instead of reading them from the defaults array.
# Conflicts:
# src/r_data/r_sections.h
Since this function creates dynamic copies for 3D floors that need to be split it requires the vertex buffer index to be set up.
In older versions this did not produce errors because there was a fallback render path that was less efficient.
Now with that fallback removed this resulted in temporary 3D floors being created without valid vertex data.
# Conflicts:
# src/p_setup.cpp
# Conflicts:
# src/p_setup.cpp
The destination mode sould be 'One', not 'InvSrcColor'.
Now both of these are available as explicit modes, not just through the optional mapping.
# Conflicts:
# src/hwrenderer/scene/hw_sprites.cpp
# src/r_data/renderstyle.cpp
# src/r_data/renderstyle.h
With additional render styles from " - abstraction of render style in render state.". drfrag
# Conflicts:
# src/r_data/renderstyle.cpp
# src/r_data/renderstyle.h
With additional render styles from "- made the screen blend work for the software renderer.". drfrag
src/doomerrors.h:74:14: error: exception specification of overriding function is more lax than base version
src/posix/sdl/i_main.cpp:272:28: error: 'class std::exception' has no member named 'GetMessage'
Null pointers must be allowed and non-object pointers which are not null must be explicitly checked for because the code could crash on them when performing a static_cast on an incorrect type.
Both need the bMasked flag, or some code will think that the texture is not fully opaque if no holes were found.
# Conflicts:
# src/gl/textures/gl_material.h
# src/textures/texture.cpp
This reuses the FTexCoordInfo class the hardware renderer had been using to calculate wall texture offsetting.
The software renderers still need this sorted out to bring them in line with the rest of the code, though, but they do not have this code sufficiently well organized to make this a straightforward task.
# Conflicts:
# src/hwrenderer/textures/hw_material.cpp
# src/textures/textures.h
There were some issues here:
* a check for mismatching count is too strict because it is legal to omit return values
* it failed to detect returning multiple values in a single expression.
Since CallStateChain is a public member in CustomInventory we cannot really be sure that the given state is valid so it needs checking as well.
# Conflicts:
# .gitignore
This can happen if a state that's retrieved with FindState gets used with a different actor type and can lead to hard to trace problems if not checked.
- Works similarly to CanCollideWith.
- Passive means the caller is trying to be resurrected by 'other'.
- Non-passive means the caller is trying to resurrect 'other'.
* Colors can npw be defined per sidedef, not only per sector.
* Gradients can be selectively disabled or vertically flipped per wall tier.
* Gradients can be clamped to their respective tier, i.e top and bottom of the tier, not the front sector defines where it starts.
The per-wall colors are implemented for hardware and softpoly renderer only, but not for the classic software renderer, because its code is far too scattered to do this efficiently.
# Conflicts:
# src/hwrenderer/scene/hw_renderstate.h
# src/hwrenderer/scene/hw_walls.cpp
# Conflicts:
# src/gl/scene/gl_walls_draw.cpp
Until now this wasn't doable because these could have come from hw_FakeFlat which only were local copies on the stack.
With the recent change these faked sectors live long enough so that they can be passed around here.
# Conflicts:
# src/hwrenderer/scene/hw_decal.cpp
# src/hwrenderer/scene/hw_walls.cpp
# Conflicts:
# src/gl/scene/gl_wall.h
# src/gl/scene/gl_walls.cpp
# src/gl/scene/gl_walls_draw.cpp
# src/hwrenderer/scene/hw_decal.cpp
An exception is made for the sprite drawer which needs to call this in the worker thread on some occasions for as-yet unprocessed sectors.
This case may not alter the cache to avoid having to add thread synchronization to it.
The main reason for this change is that pointers to such manipulated sectors can now be considered static in the renderer.
Due to them being short lived local buffers it was not possible to carry them along with the render data for information retrieval.
# Conflicts:
# src/gl/renderer/gl_renderer.cpp
# src/hwrenderer/scene/hw_bsp.cpp
# src/hwrenderer/scene/hw_drawinfo.h
# src/hwrenderer/scene/hw_drawlist.cpp
# src/hwrenderer/scene/hw_fakeflat.cpp
# src/hwrenderer/scene/hw_renderhacks.cpp
# Conflicts:
# src/gl/renderer/gl_renderer.cpp
# src/gl/renderer/gl_renderer.h
# src/gl/scene/gl_bsp.cpp
# src/gl/scene/gl_drawinfo.cpp
# src/gl/scene/gl_fakeflat.cpp
# src/gl/scene/gl_renderhacks.cpp
# src/gl/scene/gl_scene.cpp
# src/hwrenderer/scene/hw_drawinfo.h
# src/hwrenderer/scene/hw_drawlist.cpp
# src/hwrenderer/scene/hw_fakeflat.h
# src/hwrenderer/scene/hw_sprites.cpp
# src/hwrenderer/scene/hw_weapon.cpp
src/p_udmf.cpp:2052:6: error: no matching member function for call to 'OpenMem'
src/sc_man.h:24:7: note: candidate function not viable: expects an l-value for 2nd argument
src/sc_man.h:23:7: note: candidate function not viable: requires 3 arguments, but 2 were provided
src/resourcefiles/file_directory.cpp:198:32: error: use of undeclared identifier 'Filename'; did you mean 'FileName'?
Otherwise this may contain residual data from the last call.
One can only hope that this doesn't cause other side effects - this entire code is one horrendous mess of bad ideas.
- Added a function to the Actor class to get its spawn time relative to the current level.
- Added spawn time information to the output of the "info" console command.
This had absolutely no sanity checks and unconditionally picked the source texture if one existed.
It should only be done for wall textures, only for those defined in TEXTUREx and only for those where the scale is identical with the underlying texture.
- Uses the same code as Thing_ProjectileIntercept to aim and move the projectile.
- targ: The actor the caller will aim at.
- speed: Used for calculating the new angle/pitch and adjusts the speed accordingly. Default is -1 (current speed).
- aimpitch: If true, aims the pitch in the travelling direction. Default is true.
- oldvel: If true, does not replace the velocity with the specified speed. Default is false.
- Split the code from Thing_ProjectileIntercept and have that function call VelIntercept.
Calling the old method with a pointer to an array of unspecified length 'dirty' would be an understatement.
Now it uses a TArray to store the single elements
# Conflicts:
# src/g_shared/hudmessages.cpp
# src/v_font.cpp
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