[Fixed] sethudsize, setfont, hudmessage

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

sethudsize, setfont, hudmessage

Post 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.
Cyb
Posts: 912
Joined: Tue Jul 15, 2003 5:12 pm

Post by Cyb »

five days, Ty, five days and it'll all be over

breathe

; )
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

No. Time. To. Breathe.

...how many? :shock:
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post 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.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Nucking?
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

I think he misspelled *bleep*.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

HotWax wrote:Nucking?
Alternate way of saying "[CENSORED]".
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Post 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:
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post 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*
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post 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
User avatar
cccp_leha
Posts: 1816
Joined: Wed Jul 16, 2003 7:21 am
Location: NJ, USA
Contact:

Post 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:
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Strange, it works fine with the debug build but not the release one. :-(
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

Some sort of optimization for release that isn't there for debug?
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post 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.
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

Think we'll have a 2.0.58 before the weekend's out? (pant, pant) :oops:
Post Reply

Return to “Closed Bugs [GZDoom]”