1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 17:53:47 +00:00
Commit graph

101 commits

Author SHA1 Message Date
fgenesis
5a6810e063 integrate directory watching for mod gfx in dev mode, and reload texture files that change 2024-06-25 04:49:44 +02:00
fgenesis
bcffbac2b5 remove RenderObjectLayer::update. now all layers are updated, always.
The original use case of the update flag was to prevent those layers that
only had map Element tiles on them to update each tile, which would be
very slow and most tiles never had any reason to be updated.
(Those that needed to were tracked in a separate list.)

Since the map Element class does no longer exist and tiles are handled
much more efficiently now, it makes sense to not arbitarily disable
object updates for layers that used to have only map tiles on them.

Note to self: This fixes the skeleton entities properly reacting to
shots now when placed on tile layers.
2024-05-12 18:01:43 +02:00
fgenesis
0326800940 fix broken scrolling in mod selector in vertical mode 2024-04-28 13:15:41 +02:00
fgenesis
8d1a0a1a8a don't update render water surface framebuffer when off screen
more accurate check than previously; because the normal isOnScreen()
uses a bounding circle check... which gets pretty large for something
that spans the entire screen width.
2024-04-28 04:04:30 +02:00
fgenesis
2cf5932eb3 Preliminary support for vertial orientation:
- remove top & bottom black bars
- fix minimap position to take virtual y offset into account
- same for editor bar, and version label
- fix grid render errorneously assuming that core->cameraPos.y was always 0
- fix typo in gradient height adjustment
- don't slide minimap when there's enough virtual space so that it's not in the way
2024-04-28 02:08:38 +02:00
fgenesis
d47aeea2ce Cleanup to world<->window coord conversion; add toWorldFromWindow() Lua func 2024-04-28 00:03:51 +02:00
fgenesis
09edbf49fd Changes to rendering logic, incl water surface flicker fix, plus other fixes.
This commit changes a bunch of internal rendering logic to
use FBOs in a way that doesn't violate the GL spec.
The water surface FBO's output texture was bound for reading
while at the same time rendering the water surface back into the
same FBO! Depending on the card/driver/load/zoom factor/moon phase,
this could lead to water surface flickering, chessboard effects,
and other visual glitches.
In order to fix this an extra FBO is needed.
In theory this is a simple fix but in practice this is the Aquaria
codebase and everything is more complicated than it has any right to be.

Couple other things:

- FBOs no longer have a depth renderbuffer. Aquaria never uses the depth
buffer for anything, so this can go to save some memory.
Also remove renderbuffer GL function pointers.

- Make FBOs multi-"paged". This is supposedly more efficient on desktop GL,
if glDrawBuffer() supports GL_COLOR_ATTACHMENTn. This is currently checked
via the presence of glDrawBuffersARB().

- Main core FBO now has 2 pages becaus it's needed for the water surface.
The same 2 pages are later used by the after effect manager to ping-pong
postprocessing shaders. Remove private after effect FBO.

TODO:
- There's still a bug in the one-fbo-multiple-binding-points code path.
-> for now glDrawBuffersARB must be NULL to work properly.
2024-04-25 03:33:02 +02:00
fgenesis
f641764765 Merge branch 'experimental' into tile-optimization 2023-12-21 14:20:22 +01:00
fgenesis
4dc374c367 forgot to make a method const 2023-11-17 01:39:46 +01:00
fgenesis
ec5f50e41e fix jittering when moving the camera around in map editor mode.
This is related to a494a3f411 and should hopefully
fix the last issues with this for good.
Seems fine with SDL versions from 2022 and 2023 on windows;
untested on linux.

(The second window->handleInput() that got removed broke the sing circle
if it was there. It was previously added as a mitigation and is no longer
needed.)
2023-10-28 06:08:19 +02:00
fgenesis
a111bfc17f use VBO to render tile borders
Also fix oversight in DynamicGPUBuffer::drawElements(); first wasn't used
2023-08-26 00:14:05 +02:00
fgenesis
3c48349e94 remove tiny unused things 2023-08-25 01:57:28 +02:00
fgenesis
f9a91e87e4 Move CombinedRenderAndGPUState up one level 2023-08-25 00:39:35 +02:00
fgenesis
368271c40e More work on tile rendering:
- Use indexed triangle rendering, no more GL_QUADS for tiles
- Fix aquarian text on maps
- Tile tex repeat mode works again

Known broken:
- Editor
- Tile repeat with grid effects
2023-08-09 02:41:04 +02:00
fgenesis
704981dd00 initial support for static vertex buffers. TileRender uses that now. 2023-07-20 23:11:18 +02:00
fgenesis
dc5d385864 remove self-refs (core->...) in Core 2023-05-31 17:40:41 +02:00
fgenesis
fd1ac85af3 remove pointless self-refs (dsq->... and core->...) in DSQ 2023-05-31 17:37:20 +02:00
fgenesis
70b8dcdc3a Rework texture loading, part 1
Major code/logic cleanups + it has a multithreaded batch mode now.
The VFS code doesn't like multiple threads at all,
so for now there's a big lock in front of where it matters.
Changed precacher, map/tileset, and worldmap loading to batched mode.

Still TODO:
- fix broken mod preview images
- reloading resources on debug key
- make mod recache entirely unnecessary
- actually drop resources when no longer needed
2023-05-31 00:55:16 +02:00
fgenesis
74ad8f7804 Build fixes for Linux, some warnings and compatibility fixes for C++17 and up 2023-05-25 16:58:08 +02:00
fgenesis
0a3f57486b Simplify RenderObject::followCamera math, remove branches, cleanup followCamera related code.
It also appears that a RenderObject is always on a layer when rendered.
Assert this in the code. This saves some extra branches.
2023-03-05 21:25:59 +01:00
fgenesis
28766f0d5a make RenderObject::followCamera not modified during rendering
This takes out the last of the RenderObject mutables.

This also fixes the long-standing editor bug that map tiles
that are once moved to parallax layers and then back to a
normal layer keep their scroll factor until the tile is deleted
or the map saved and reloaded.
2023-03-02 03:41:00 +01:00
fgenesis
a494a3f411 ignore mouse motion events generated by SDL_WarpMouse().
Also fix bug that mouse.change got stuck on a tiny value and constantly
move the camera in editor mode.
This is a continuation of 764d106d50 and seems to fix the
previous issues with SDL2 >= 2.0.17

Also remove some unused vars.
2022-08-24 14:16:25 +02:00
fgenesis
f01db61292 show better errors when we fail to start up 2022-06-20 04:25:18 +02:00
fgenesis
1a90625979 refactor rendering logic to be a lot less wasteful
Observations:
- Entity::renderPass was never set to RENDER_ALL -> can simplify some things
- The initial pass check in RenderObject::render() was constant for each pass
-> All logic that is per-pass-constant can be moved to a renderability pre-check
- Core::overrideStartLayer, Core::overrideEndLayer, Core::rlayer were never used
- Should be possible eventually to prepare & render layers in parallel

I am not sure if the changes in this commit are 100% correct, but layer passes
are still working and the hug looks like it should.

Thinking about it, the overrideRenderPass functionality should never have existed.
The game scripts don't actually use entity_setRenderPass
(which in turn calls Entity::setOverrideRenderPass())
so I might remove that function in a future commit,
together with the rest of the "override" functionality.
2022-05-22 17:26:16 +02:00
fgenesis
da23098692 remove PostProcessingFX
It was broken on modern graphics cards anyway and should rather be re-introduced
in a cleaner way once the renderer is ready for it
2022-05-21 18:56:27 +02:00
fgenesis
5c558c122f Remove RenderObject::setColorMult() hack and related members 2022-05-21 16:31:10 +02:00
fgenesis
68b3c61852 Add RenderState to be passed through the scene graph
This will eventually handle all mutable state during rendering
2022-05-20 01:04:19 +02:00
fgenesis
b6fb6944f6 first step towards making the render process const 2022-05-19 05:17:00 +02:00
fgenesis
4db7990ac2 remove displaylist support
i'd rather trim all possible fat off the renderer and then modularize it
into multiple backends. gotta start somewhere.
2022-05-18 03:39:33 +02:00
fgenesis
9290acd379 fix taking screenshots 2022-04-29 10:26:25 +02:00
fgenesis
988c8c79e4 set better default compiler options; optional console in release mode on windows 2022-04-08 19:31:16 +02:00
fgenesis
96216503c4 remove zlib, libpng, glpng and related code; add some stb libs; rework texture loading 2022-03-31 21:03:40 +02:00
fgenesis
04c557f5e8 Refactor Window functionality out of Core. Minor cleanups.
SDL2 impl seems to work, SDL1 impl finalization pending.
2019-01-29 00:36:48 +01:00
fgenesis
3a96c775db work around dev warning message; fix compiler warning 2018-01-02 16:18:50 +01:00
fgenesis
78352d4402 Multi-display fixes
- Enumerate display modes to show in the resolution selector based on the
  screen we're on
- Correct graphics init code to use the display index specified in
  user settings
2017-06-26 08:34:30 +02:00
fgenesis
3dda97d32a Hopefully fix build against SDL 1.2. Does not yet run!
Also: Recently introduced key names in usersettings.xml will no longer work.
But this should automatically detect key names as they used to be,
and convert automatically. Needs testing.
2017-02-15 04:41:52 +01:00
fgenesis
58e3a247e4 Fix build on osx 2017-02-06 03:37:07 +01:00
Valentin Ochs
9245bee717 Fix some warnings
mostly sign-related, but also some about commas after the last item in
an enum list, usage of default in switches, implicit or old-style casts
2017-01-20 19:10:40 +01:00
Valentin Ochs
f9357e7fca Merge branch 'gccwarn' into controllerfixup 2017-01-17 11:15:47 +01:00
fgenesis
9d80077754 Preparations to get rid of DSQ::inputMode -- Pass device to action() methods. 2017-01-14 22:53:20 +01:00
Valentin Ochs
fe0ab0418b Get rid of a lot of gcc warnings
Mostly signed/unsigned comparisons. Also some bugs, but I don't remember
where :D
2017-01-14 18:10:20 +01:00
fgenesis
eb8ef1fdf7 Use refresh rate setting + attempt to improve window/fullscreen apply logic 2017-01-14 00:06:04 +01:00
fgenesis
b781b45789 Implement "Desktop" resolution (0x0, default). Also fix music slider update in options menu
This makes the window resizable in desktop mode, and fixed size otherwise.
Fullscreen desktop has always the dame resolution as the desktop.
Add config setting to specify initial display.
Add config setting for the refresh rate (not yet properly integrated)

Closes #17
2017-01-13 18:20:35 +01:00
fgenesis
8af953cb63 Replace spaces with tabs (future self: i'm sorry)
In most places, that is. Left some files unchanges because they are a mess.
2017-01-12 22:51:46 +01:00
fgenesis
0d8a5c191c More graphics init cleanup. Remove aspect ratio check. Fix screen transition effect that broke in prev. commits. 2016-11-15 13:00:30 +01:00
fgenesis
6d4f1175ba Fix input grabbing logic, add related user setting, minor cleanup 2016-11-14 03:42:11 +01:00
fgenesis
e92b76cf40 Some more opengl setup cleanup and fullscreen switching improvement 2016-11-14 03:42:10 +01:00
fgenesis
fe7c6ee048 Better fullscreen switching behavior, minor cleanup 2016-11-14 03:42:10 +01:00
fgenesis
1bad4d006d Avoid recreating the GL context on Alt+Tab, resolution change, or windowed/fullscreen switch 2016-11-09 01:17:23 +01:00
fgenesis
4751b31653 Save screenshots in PNG instead of TGA format. Closes #34. 2016-09-26 03:44:15 +02:00