Comments (6)
There is a randomization on Thunderbolt so the fix is to bound check the drawing on surface. Probably in future there should be "drawPixelSafe" and "drawPixelFast" and ThunderBolt should use "drawPixelSafe"
Please update to master
(or to this revision) and report back if the issue is fixed.
Thank you @kamiccolo for bug report.
Fix commit: 1336208
from fheroes2enh.
The issue still persists :( It feels like color overflowing as well:
#0 0x000000000041a792 in Surface::SetPixel4 (this=0x9761c0 <Display::Get()::inside>, x=2053, y=1199, color=3993042943) at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:509
#1 0x000000000041d3f8 in Surface::drawPixel (this=0x9761c0 <Display::Get()::inside>, x=2053, y=1199, brightness=0.933349609, col=65535) at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:1110
#2 0x000000000041d6c3 in Surface::drawAALine (this=0x9761c0 <Display::Get()::inside>, x0=608, y0=297, x1=20864, y1=12942, col=...) at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:1182
#3 0x00000000004c7fbf in RedrawSparksEffects (src=..., dst=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4205
#4 0x00000000004c827a in Battle::Interface::RedrawTroopWithFrameAnimation (this=0xb501d0, b=..., icn=599, m82=126, pain=true) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4256
#5 0x00000000004c4d7e in Battle::Interface::RedrawActionLightningBoltSpell (this=0xb501d0, target=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:3513
#6 0x00000000004c16fc in Battle::Interface::RedrawActionSpellCastPart1 (this=0xb501d0, spell=..., dst=54, caster=0xd6e970, name="Ranloo", targets=...)
at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:2915
#7 0x0000000000482c42 in Battle::Arena::ApplyActionSpellDefaults (this=0x7fffffffd4b0, cmd=..., spell=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:697
#8 0x000000000048067d in Battle::Arena::ApplyActionSpellCast (this=0x7fffffffd4b0, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:168
#9 0x0000000000480444 in Battle::Arena::ApplyAction (this=0x7fffffffd4b0, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:95
#10 0x0000000000488ddd in Battle::Arena::TurnTroop (this=0x7fffffffd4b0, current_troop=0xafbe70) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:358
#11 0x000000000048947c in Battle::Arena::Turns (this=0x7fffffffd4b0) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:446
#12 0x00000000004ced66 in Battle::Loader (army1=..., army2=..., mapsindex=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_main.cpp:79
#13 0x00000000005a7a0b in BattleHeroWithMonster (hero=..., army=..., dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:778
#14 0x00000000005b3dd0 in ActionToCaptureObject (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2334
#15 0x00000000005b34c1 in ActionToAbandoneMine (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2249
#16 0x00000000005a764a in Heroes::Action (this=0xd6e970, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:652
#17 0x00000000005ce4bc in Heroes::MoveStep (hero=..., index_from=1698, index_to=1699, newpos=true) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:489
#18 0x00000000005ce74f in Heroes::MoveStep (this=0xd6e970, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:533
#19 0x00000000005cf98a in Heroes::Move (this=0xd6e970, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:849
#20 0x0000000000577833 in Interface::Basic::HumanTurn (this=0x976ac0 <Interface::Basic::Get()::basic>, isload=true) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:912
#21 0x0000000000576446 in Interface::Basic::StartGame (this=0x976ac0 <Interface::Basic::Get()::basic>) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:585
#22 0x00000000005739e4 in Game::StartGame () at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:72
#23 0x00000000005594b6 in main (argc=1, argv=0x7fffffffe128) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/fheroes2.cpp:307
from fheroes2enh.
I will fix it this evening with the "setPixelSafe".
from fheroes2enh.
Mhm. I'm not sure if that's the problem.
Point interpolated = pointLerp(start, endPoint, pos);
interpolated.x += Rand::Get(-20, 20);
interpolated.y += Rand::Get(-20, 20);
Becomes {x = -10090, y = 21899}
for some weird reason o_0 So, drawPoints in populateSpark() gets fishy values.
EDIT:
Of course, Rand::Get()
is casting to uint32_t...
from fheroes2enh.
It looks fixed now. Can you test it by taking 'master' branch again?
from fheroes2enh.
Well, the master is quite messed up at the moment... ;)
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp: In function ‘int IMG_SavePNG_RW(SDL_RWops*, SDL_Surface*, int)’:
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:310:1: error: jump to label ‘savedone’ [-fpermissive]
savedone: /* clean up and return */
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:102:14: note: from here
goto savedone;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:118:22: note: crosses initialization of ‘SDL_PixelFormat* fmt’
SDL_PixelFormat* fmt = surf->format;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:310:1: error: jump to label ‘savedone’ [-fpermissive]
savedone: /* clean up and return */
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:94:14: note: from here
goto savedone;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:118:22: note: crosses initialization of ‘SDL_PixelFormat* fmt’
SDL_PixelFormat* fmt = surf->format;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:310:1: error: jump to label ‘savedone’ [-fpermissive]
savedone: /* clean up and return */
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:88:14: note: from here
goto savedone;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:118:22: note: crosses initialization of ‘SDL_PixelFormat* fmt’
SDL_PixelFormat* fmt = surf->format;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:310:1: error: jump to label ‘savedone’ [-fpermissive]
savedone: /* clean up and return */
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:81:14: note: from here
goto savedone;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:118:22: note: crosses initialization of ‘SDL_PixelFormat* fmt’
SDL_PixelFormat* fmt = surf->format;
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:310:1: error: jump to label ‘savedone’ [-fpermissive]
savedone: /* clean up and return */
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:74:14: note: from here
goto savedone; /* Nothing to do. */
^
/home/zilvinas/Compile/fheroes2enh/src/engine/IMG_savepng.cpp:118:22: note: crosses initialization of ‘SDL_PixelFormat* fmt’
SDL_PixelFormat* fmt = surf->format;
^
CMakeFiles/fheroes2.dir/build.make:278: recipe for target 'CMakeFiles/fheroes2.dir/src/engine/IMG_savepng.cpp.o' failed
make[2]: *** [CMakeFiles/fheroes2.dir/src/engine/IMG_savepng.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
from fheroes2enh.
Related Issues (20)
- Rare xcb_io assertion error while retreating HOT 3
- No install target HOT 4
- Cannot build due to missing SDL headers HOT 8
- Error: attempt to subscript container with out-of-bounds index 0 HOT 9
- HOMM2 Campaign support? HOT 6
- Windows "silent" installer/zipped version of the engine? HOT 9
- Rebalance HOT 2
- Mac OS - Game starts, doesn't load HOT 16
- Price of Loyalty Expansion / Heroes II Gold / GoG Edition HOT 3
- Assets from full game HOT 4
- Add CI pipeline to see current status of compilation HOT 2
- Proper explanation on MacOS compilation
- Fix override compilation warning HOT 1
- Linker failure for MacOS
- Why do we need C++14? HOT 1
- Why balance change was added? HOT 2
- Extract resource
- Buffered file reading HOT 1
- List wheeling bug
- Fheroes2 merge 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 fheroes2enh.