Page 1 of 2

sethudsize, setfont, hudmessage

Posted: Fri Dec 05, 2003 1:35 am
by Ty Halderman
Okay, I'm playing around with putting a graphic on the screen using sethudsize to get the scaling right, then setfont(graphic), then hudmessage(s:"A"; ...) to display that graphic. Here's a bit of testing code:

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
}
As you can see, with a 640x400 screen from sethudsize, I'm centering the hudmessage at [320,200] by using 320.0 and 200.0. I've bound "puke 901" to a key and I press it repeatedly to get the graphic to cycle.

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 :roll: 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 :shock: 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.

Posted: Fri Dec 05, 2003 1:42 am
by Cyb
five days, Ty, five days and it'll all be over

breathe

; )

Posted: Fri Dec 05, 2003 1:55 am
by Ty Halderman
No. Time. To. Breathe.

...how many? :shock:

Posted: Fri Dec 05, 2003 12:10 pm
by cccp_leha
Ty Halderman wrote:No. Time. To. Breathe.

...how many? :shock:
You know I just realised that as well. WOW time nucking flies.

Posted: Fri Dec 05, 2003 1:59 pm
by HotWax
Nucking?

Posted: Fri Dec 05, 2003 2:00 pm
by Ty Halderman
I think he misspelled *bleep*.

Posted: Fri Dec 05, 2003 2:01 pm
by Kate
HotWax wrote:Nucking?
Alternate way of saying "[CENSORED]".

Posted: Fri Dec 05, 2003 2:05 pm
by Enjay
Ty Halderman wrote:I think he misspelled *bleep*.
Don't be silly. You'd have to have missed all the keys to spell *bleep* as "Nucking". :roll:

Posted: Fri Dec 05, 2003 4:10 pm
by cccp_leha
I don't like to curse like heck, fucking OK? :D I recall someone saying somethign similar to this. Hey Ty, I know I asked before, but what's up with Ragnarok, Doom Revisited and Puzzleworld? *ducks for cover*

Posted: Fri Dec 05, 2003 4:13 pm
by Ty Halderman
That sound you hear is a BFG warming up, aimed at NJ, USA.

One thing at a time... Then I can bail on all the other projects and pretend we never existed.

Heck, Randy's going to look at this thread, think it's just a crap discussion thread, and ignore my plight. Assuming Randy didn't go to an anime conference or something :D

Posted: Fri Dec 05, 2003 4:16 pm
by cccp_leha
Ty Halderman wrote:...Heck, Randy's going to look at this thread, think it's just a crap discussion thread, and ignore my plight.
...and thus delaying Doom2000 for four more years? I'm terribly sorry I asked. I'm soooo sorry. :oops:

Posted: Fri Dec 05, 2003 4:49 pm
by randi
Strange, it works fine with the debug build but not the release one. :-(

Posted: Fri Dec 05, 2003 4:50 pm
by Ty Halderman
Some sort of optimization for release that isn't there for debug?

Posted: Fri Dec 05, 2003 5:32 pm
by randi
Fixed. I forgot to initialize a variable when creating a font from an image. I also realized you couldn't load PNGs this way, so I fixed that too.

Posted: Fri Dec 05, 2003 5:33 pm
by Ty Halderman
Think we'll have a 2.0.58 before the weekend's out? (pant, pant) :oops: