void DrawWindow(WINDOW *win)
int werase(WINDOW *win)
Two lines. Which line is mixing your bag?
All you have to do is remove the first and uncomment the second line to prove to yourself it is irrelevant to this bug.
And to prove to yourself what is causing the lag is indeed function I told you it is comment it out and see for yourself.
Don’t you have a PC at home? Why waste weeks trying to blame my code when it takes two minutes to test it?
Last time I checked, his version also had graphical glitches under Linux (stuff not redrawing when it should, at a minimum), which is a significant problem.
As I told you already:
http://www.cataclysmdda.com/smf/index.php?topic=541.msg12646#msg12646
… my build is optimised for Windows, it is not supposed to work on Linux at all, but I also gave you a link to my original bug-fix proposal which is intended to work on Linux and so it does without any glitches:
It was not merged, so I discarded optimisations and other secondary changes to point out the essence of the problem and how to fix it, which is completely isolated and independent of Linux build, it’s just those two lines:
That is what finally got merged and what you were supposed to have tried last. It was discussed and tested before it was merged, it did pass your code reviewing process:
https://github.com/TheDarklingWolf/Cataclysm-DDA/pull/925
I also then explained here:
http://www.cataclysmdda.com/smf/index.php?topic=1213.msg13897#msg13897
… that you still have to address those secondary changes, none of which has anything to do with this bug.
Although... actually, you remind me that there's a mention of fire being somewhat more sensible in his mod now. THAT I might be interested in.
mapdata.h
[code]struct field {
field_id type;
signed char density;
int age;
int lastUpdate;
field()
{
type = fd_null;
density = 1;
age = 0;
// lastUpdate= 0;
}
field(field_id t, unsigned char d, unsigned int a)
{
type = t;
density = d;
age = a;
// lastUpdate= 0;
}
[/code]
field.cpp
case fd_fire: {
//CAT-mgs: fire burn outside view
if(cur->lastUpdate > 10)
{
int trm= int(g->turn) - cur->lastUpdate;
if(trm < 1) trm= 1;
if(trm > 100)
cur->density= -1;
// g->add_msg("TRM: %d AGE: %d", trm, cur->age);
}
cur->lastUpdate= int(g->turn);
.
.
What it does is to store the turn count a field was last updated and compares it with the current turn. The difference is supposed to always be 1 as it is updated every turn when in bounds of player’s view. Therefore if the difference is greater than 1 it means it was put on hold, went out of player’s view.
As you can see what I decided to do about it is to check if player spent more than 100 turns away from the fire before it returned to the place, and if so the fire turn off, as if it burned out in the meantime. From players point of view, if you want fire to burn and spread then stay nearby, if you want to put it off go away for at least 100 turns.
This of course can be done to work fully realistically, but it would cause glitches when you suddenly have to get fires up to date for the last 100 or more turns in a single turn, so I decided not to do it, but you can try and maybe the glitches will not be so terrible without need to render all those meanwhile updates but just the last state you end up with.