ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Tue Jan 23, 2018 5:53 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Jan 21, 2017 8:56 pm 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1429
Location: A shallow water area south of Bree
This isn't technically a bug, since neither the Minimalist nor Classic UI use the engine's built-in log flasher, but it appears in the example module and T2 uses it, and there's something odd in it that I think must be wrong. Here's the code for the LogFlasher:toScreen() method:
Code:
function _M:toScreen(nb_keyframe)
        nb_keyframe = nb_keyframe or 1
--(1)>  self.changed = false

        -- Erase and the display the map
        if self.flashing_style == BAD then
                core.display.drawQuad(self.display_x, self.display_y, self.w, self.h, self.bgcolor[1] + self.flashing * 10, self.bgcolor[2], self.bgcolor[3], 255)
        elseif self.flashing_style == NEUTRAL then
                core.display.drawQuad(self.display_x, self.display_y, self.w, self.h, self.bgcolor[1], self.bgcolor[2], self.bgcolor[3] + self.flashing * 10, 255)
        else
                core.display.drawQuad(self.display_x, self.display_y, self.w, self.h, self.bgcolor[1], self.bgcolor[2] + self.flashing * 10, self.bgcolor[3], 255)
        end
        self.texture:toScreenFull(self.display_x, self.display_y, self.w, self.h, self.texture_w, self.texture_h)

        if self.flashing > 0 then self.flashing = self.flashing - nb_keyframe
--(2)>  elseif self.changed then self:getNext(true) end
end

Now, if I'm reading this right, because of self.changed being cleared in line (1), the elseif branch at line (2) can never be followed. What's happening here is that the log flasher accumulates log messages side by side and line-wraps them into as many screen-width lines as needed, presumably to display them one line at a time, and that call to self:getNext() in line (2) is where the next line is supposed to be gotten to be displayed (hence the name…); with that line (1) thing, though, it looks like the next line of messages never gets pulled, so only one screen width's worth of log messages ever gets shown, which tracks with my testing. Which in turn means that if a lot of log messages are displayed at once before the log flasher is reset, the ones at the end will be lost.

The question is, what's the intended behavior here? My initial assumption (which I'm going to be implementing in the next T2 module release) is that the flasher is supposed to continue to the next line when the first line is done "flashing" — i.e. when self.flashing counts down to zero. Now, self.flashing is set to 20 when a new log message is added, so at 30fps, that works out to ⅔ second for each line of messages; too fast? too slow?

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Sat Jan 21, 2017 11:45 pm 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10147
Location: Angolwen
Oh yes that was the intention indeed :)
And yes this is bugged, I've not used Flasher in a really long time :)

_________________
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)


Top
 Profile  
 
PostPosted: Mon Jan 30, 2017 12:32 pm 
Offline
Archmage

Joined: Tue Jun 18, 2013 7:24 pm
Posts: 449
Will this be fixed?

This bug made me drop flasher from Veins months ago...

_________________
Working on a T-Engine game
Veins of the Earth

Veins of the Earth ModDB page


Top
 Profile  
 
PostPosted: Wed Feb 01, 2017 12:02 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1429
Location: A shallow water area south of Bree
Zireael wrote:
Will this be fixed?

This bug made me drop flasher from Veins months ago...

[sound F/X: source diving] No change so far, at least as of beta1. In the meantime, feel free to poach from my T2 modified version.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group