Comments (14)
Thanks for the PR, although it fails on the build servers, it defiantly points us in the direction of the issue. I strongly belive that this issue will be dealt with once we have dx.cpp unstubbed. I have already started this work but I'm currently away on holiday, I expect to resume (and probably finish) that work next week and if this dosen't solve it I will target the issue directly based on your findings. Once it is fixed I think it would be fitting with a new release, especially once all the upstream work is synced.
from devilutionx.
After cleaning up dx.cpp this is the conclusion I have come to.
Diablo originally rendered to a back buffer that did not contain any color information, whenever it had completed the rendering of a frame it would blit the updated parts to the framebuffer in the graphics card. The framebuffer would also have the color pallet injected, at this could be updated regardless of where in the rendering process the next frame where since this was happening in the off-screen back buffer.
The way DevilutionX currently handles things is so having the color information associated with the back buffer, the blitting is then done to a 32bit buffer (converting the colors in the process) this is done so that it is more convenient to display on modern systems via SDL/OpenGL. This is also fine, the problem occurs when the palette is changed during the rendering of a frame; since we cannot change the palette of the 32bit image (because it is full color) we apply the new palette to the back buffer and copy the new result, this can then result in an unfinished frame being presented on screen.
The solution I'm planning is to add an additional 8bit buffer where the color change can safely be performed on the latest completed image, and then do the conversion from there.
An alternate solution would be to make the pipeline 8bit, but it's not where we want to head in the future (full 32bit pipeline). The extra 500kb copy pr frame also shouldn't be much of an issue for modern systems. An alternative solution would be to make sure that all palette updates happens at the end of a frame rendering, but I would prefer not changing any parts of the engine for now.
from devilutionx.
Testing @Chance4us's workaround it appears to solve the issue satisfactorily with no noticeable side effects so going to go with it for now. Basically, it defers the updating of the pallet until the next frame is rendered (would probably not show until then anyway), except for when doing fade in/out in the menus.
from devilutionx.
I don't think this is fixed upstream, even after render.cpp cleanup. I've done a clean rebuild from 82adedb which has the most fresh upstream changes and this is still reproducible for me on a 32-bit build on macOS 10.14.4.
from devilutionx.
I have identified the issue as being related to color cycling. If disabled the mouse will stop flickering, but then you won't have animated lava.
from devilutionx.
I think this issue is almost solved.
Please try to replace "sdl_update_entire_surface();" by "memcpy(logical_palette, orig_palette, 1024);" in the file devilutionX/SourceX/storm/storm_dx.cpp
By only this change the flickering is gone completely. Unfortunately the main menu and the cutscenes are no more visible at all.
from devilutionx.
There is no need for "sdl_update_entire_surface();" or "memcpy(logical_palette, orig_palette, 1024);" at all. I'll try to workaround the SDL_BlitSurface(pal_surface, &src_rect, surface, NULL) causing flickering in devilutionX/SourceX/dx.cpp
from devilutionx.
For what it's worth, Diablo II handled Direct Draw by using two different buffers. Essentially one is just temporary and like Diablo 1, 8-bit with the palettes. This then gets copied to the front buffer which is 32-bit and is what is shown on screen.
from devilutionx.
Yes , Source Code deleted reported this to me.
I will look into it. I think the upstream might have a fix for this.
from devilutionx.
@AJenbo do we know where the code that might concern this might be located? I wonder if there is some rendering issue. Ironically, this is only an issue in DevilutionX .
from devilutionx.
I believe this issue might have been resolved, possibly by cleaned up render.
But also dx.cpp is still heavily stubbed so cleaning it might solve the problem.
If that doesn't do it then probably by the time we add hardware acceleration it should go away.
from devilutionx.
Your right and not in the https://github.com/diasurgical/devilutionX/tree/render branch either :(
That leaves cleaning up dx.cpp and rewriting the render as possibly "free" fixes.
from devilutionx.
Issue is being directly or indirectly affected by following source file / functions:
devilutionX/Source/palette.cpp
function1: void __cdecl palette_update_caves() -> color cycling for lava
function2: void __fastcall palette_update_quest_palette(int n) -> Poisoned Water Supply Quest -> change the color of poisoned water to clean blue water
I tried to comment out the content of both functions with the result as color cycling would be disabled and the flickering is gone.
from devilutionx.
Please check failed pull request #86. Maybe the code has to be a little bit modified.
from devilutionx.
Related Issues (20)
- [Issue Report]: Na-Krul error message HOT 2
- [Feature Suggestion]: LAN between Single Player characters, or "Open Multiplayer" HOT 8
- [Issue Report]: Celia "link" showing after the end of the quest (Hellfire) HOT 1
- [Issue Report]: crash on startup custscene HOT 6
- Windows: Audio distortion when running in the background of other games HOT 11
- [Feature Request]: support .mpq mods HOT 4
- [Issue Report]: Bug hole in textures (Hellfire) HOT 1
- [Feature Request]: Stash objects “center of gravity”
- [Issue Report]: New entrances/exits to the Labyrinth open in the city before they are discovered HOT 1
- [Feature Request]: Editing the interface on touch devices HOT 8
- [Issue Report]: Small errors in the operation of the map [1.6.0-dev-debug] HOT 3
- [Issue Report]: Lazarus starting sequence issues HOT 16
- [Issue Report]: Inventory problems HOT 1
- [Issue Report]: Inventory bug [1.6.0-dev] HOT 2
- [Issue Report]: Changing Item Parameters [1.6.0-dev] HOT 3
- [Issue Report]: Full screen option on Nintendo Switch HOT 5
- [Feature Request]: Shrine effect suggestion HOT 1
- [Issue Report]: Vipers / Drakes sometimes missing their lunge and slamming into walls or disappearing into the distance HOT 11
- [Issue Report]: Google Android TV - unable to acess data folder, nothing helps HOT 4
- [Feature Request]: Several proposals for innovations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devilutionx.