Code: Select all
int ijk=0;
str teststuff[10] = {"BOSSA1","BOSSB1","BOSSC1","BOSSD1","BOSSE1","BOSSF1","BOSSG1","BOSSH1","BOSSI0","BOSSJ0"};
script 901 (void) // dummy to test hud message fixed size
{
sethudsize(640,400,1);
setfont(teststuff[ijk]);
hudmessage(s:"A";HUDMSG_PLAIN, 901, CR_UNTRANSLATED, 320.0, 200.0, 0);
sethudsize(0,0,0);
setfont("confont");
print(s:"graphic #",d:ijk,s:"='",s:teststuff[ijk]);
ijk=ijk+1; if (ijk>9) ijk=0; // loop 0-9
}
Now, what happens is that the graphic tends to dance around the screen on the x-axis, especially at first, as though it were doing some sort of relative offset from the previous time. Sometimes I don't even see it onscreen, but that's usually after it moved over to the edge, and I figure it's just being clipped by the screen dimensions. Interestingly after a few dozen cycles, it settles down for a while and consistently appears in the same place. Then a few cycles later it starts to skip around again.
There's no error, though I did manage to get it to crash when I had a roughly 200x150 graphic and a sethudsize(320,200,0). It said it was an integer overflow that time. I have a slight suspicion that it's a similar thing this time, because with a center position of 320, I think I recall that's stored internally as 320<<16, which would overflow. I'm surprised that it seems to change since I'm always using the same location value, but once something overflows, no telling what else gets borked.
Randy, if I'm actually blowing my stack is there any way around it? I'm setting hudsize to 640x400 because the eventual graphic I'm trying to overlay is too large for 320x200, so I don't have a lot of options. And of course this is for Daedalus, so I don't know if I'd have time to wait for another ZDoom version even if you think this is a bug to be fixed.