Commit graph

15181 commits

Author SHA1 Message Date
Kevin Caccamo
525ab8eda3 Attempt to fix warnings from VS2017 Win64 compiler 2018-09-22 12:49:54 -04:00
Kevin Caccamo
7d4895d9df 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-09-22 10:24:01 -04:00
Christoph Oelckers
bc1e659c7b Revert "- reworked fog uniforms to move the global fog mode setting to the viewpoint buffer."
This reverts commit 8b26b6dd1e.

This was causing problems with light mode 2 because some edge cases were no longer handled properly.
2018-09-16 22:38:20 +02:00
Marisa Kirisame
38c8f0d585 Adds OnDrop virtual to inventory items. Called on the dropped item at the end of AActor::DropInventory. 2018-09-16 17:58:57 +02:00
Christoph Oelckers
4c13a8df6e Merge branch 'master' of https://github.com/coelckers/gzdoom 2018-09-16 13:52:13 +02:00
Christoph Oelckers
e13d1e4d0d - do not render lights from uninitialized data. 2018-09-16 13:52:02 +02:00
David Carlier
58c6614c03 silent few warnings 2018-09-16 09:09:47 +02:00
Rachael Alexanderson
74d939c0d2 - archive 'multiplayer' flag in savegames. https://forum.zdoom.org/viewtopic.php?f=2&t=61980 2018-09-15 08:16:02 -04:00
Major Cooke
1210e1a951 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 13:23:11 +02:00
Major Cooke
c988a0b3a4 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 13:22:26 +02:00
ZippeyKeys12
60f82d1eb9 Make StatusScreen::End virtual
https://forum.zdoom.org/viewtopic.php?t=59419
2018-09-15 13:21:13 +02:00
ZippeyKeys12
7885a22cad Add NewGame to EventHandler
https://forum.zdoom.org/viewtopic.php?t=61908
2018-09-15 13:20:41 +02:00
alexey.lysiuk
7d1af25b46 Fixed code generation of infinite for loop
https://forum.zdoom.org/viewtopic.php?t=62023
2018-09-15 13:19:28 +02:00
Christoph Oelckers
3046a7dd81 - 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-09-15 12:30:05 +02:00
Christoph Oelckers
53ee7cfc7b - 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-09-15 12:27:14 +02:00
Christoph Oelckers
2d53ad6f10 - fixed misplaced parenthesis. 2018-09-09 19:18:22 +02:00
Christoph Oelckers
1eb1d8d280 - fixed math imprecisions in horizon vertex generation.
Floats are not precise enough to be used as a loop counter.
2018-09-09 08:57:50 +02:00
Christoph Oelckers
1c3d4b46c6 - 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.
2018-09-08 13:08:04 +02:00
Christoph Oelckers
3dcaa509ef Merge branch 'master' of https://github.com/coelckers/gzdoom 2018-09-08 12:10:34 +02:00
Christoph Oelckers
dd971805af - fixed: The viewpoint buffer was mapped write only but read from. On old hardware it wasn't even mapped.
Changed to cache the needed value in a CPU-side array so that the buffer access is not needed.
2018-09-08 10:16:31 +02:00
Christoph Oelckers
8b26b6dd1e - reworked fog uniforms to move the global fog mode setting to the viewpoint buffer. 2018-09-06 19:14:30 +02:00
alexey.lysiuk
0e6af71376 - improved SDL_GetWindowBordersSize() pointer loading
https://forum.zdoom.org/viewtopic.php?t=61913
2018-09-04 18:19:01 +03:00
Christoph Oelckers
7cbc98e1d0 - 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-03 23:06:32 +02:00
Christoph Oelckers
f007473a9f - fixed memory leak with wipes set to pff.
In this case the start screen's texture wasn't destroyed.
2018-09-02 21:13:58 +02:00
Christoph Oelckers
22e8c57a59 - reset the viewpoint buffer only once per scene, not per viewpoint.
This doesn't work for camera textures because they are a separate viewpoint.
2018-09-02 20:05:36 +02:00
Christoph Oelckers
5e39890118 - use a uniform buffer for per-scene data like rotation matrices. 2018-09-02 18:40:36 +02:00
Christoph Oelckers
4571aa52f0 - fixed bad code for OP_SRL_KR. 2018-09-02 18:20:38 +02:00
alexey.lysiuk
207988bb1b - fixed crash when wipe type is set to none 2018-09-02 15:15:38 +03:00
Christoph Oelckers
b570f28597 - restored block of code that got deleted by a bad merge of a cherry-picked commit. 2018-09-02 12:43:13 +02:00
Christoph Oelckers
bec1825e8c - fixed: The wipe textures need to be rendered with DTA_Masked set to false because they contain bogus alpha values where a stencil got rendered. 2018-09-02 12:30:40 +02:00
Christoph Oelckers
bec588eaf4 - moved the two remaining functions from gl_wipe.cpp to gl_framebuffer.cpp and deleted the file.
The single most hideous thing in the GL renderer is finally gone. :)
2018-09-02 12:03:18 +02:00
Christoph Oelckers
775ddfa0a8 - fixed the melt wipe. 2018-09-02 12:03:18 +02:00
Christoph Oelckers
6e0ed3e930 - crossfade wipe is working again.
The other two types still need work.
2018-09-02 12:03:17 +02:00
Christoph Oelckers
29a54c33b2 - temporarily disabled wipe code and removed old function stubs.
This still needs work.

# Conflicts:
#	src/gl/data/gl_attributebuffer.cpp
2018-09-02 12:02:59 +02:00
Christoph Oelckers
e4a40c98ce - wasn't saved 2018-09-02 12:02:36 +02:00
Christoph Oelckers
9af01c4667 - Untested wipe refactor
# Conflicts:
#	src/gl/renderer/gl_renderer.cpp
#	src/gl/system/gl_wipe.cpp
#	src/hwrenderer/scene/hw_attributebuffer.cpp
2018-09-02 12:02:36 +02:00
Christoph Oelckers
ecf6e3f620 Sanitized the Being/End2D interface so that it can be used to keep the attribute buffer mapped while processing 2D commands.
For this to work the 2D mode has to be properly set and unset at the right places so that no double mapping occurs and no render operation can happen while in 2D mode.

# Conflicts:
#	src/d_main.cpp
#	src/v_video.h
2018-09-02 11:59:01 +02:00
Christoph Oelckers
2d1043d1d3 - added profiling for postprocessing code. 2018-09-02 11:35:02 +02:00
Kevin Caccamo
55d1613ea4 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 07:28:26 +02:00
Kevin Caccamo
a38b0813cf 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 07:28:26 +02:00
Kevin Caccamo
bb8c66b3a0 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 07:28:26 +02:00
Kevin Caccamo
1c15fb2408 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 07:28:26 +02:00
Rachael Alexanderson
7c4dd9408d - update french language translation from Tapwave 2018-08-31 18:01:51 -04:00
ZippeyKeys12
c8e55fed46 Moved FConfigFile over to FileReader/FileWriter
Don't use new operator, use value instead
2018-08-31 14:29:37 +02:00
alexey.lysiuk
050d72724f - fixed: always initialize active colors in special font
https://forum.zdoom.org/viewtopic.php?t=61859
2018-08-31 10:42:53 +03:00
Jonathan Russell
ea81ab4097 - added Screen.DrawThickLine for drawing lines with thickness 2018-08-30 19:21:57 +02:00
Rachael Alexanderson
e428f6948e - add menu sliders for vr_ipd and vr_screendist 2018-08-29 19:13:44 -04:00
Braden Obrzut
aaee655eba - 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:08:54 +02:00
Rachael Alexanderson
4d3249496a - fixed: sound from poly objects through portals will now propegate properly 2018-08-25 18:23:59 -04:00
Christoph Oelckers
5b7d3c91f9 - defaulted constructors and assignment operators of several trivial types. 2018-08-25 23:51:36 +02:00