bugBos Wars - Bugs: bug #28736, DrawCosts draws mana as frame 3 of...

 
 

bug #28736: DrawCosts draws mana as frame 3 of graphics/ui/ui_res_icons.png, which has only two frames

Submitted by:  Kalle Olavi Niemitalo <kon>
Submitted on:  Mon 25 Jan 2010 10:36:38 PM UTC  
 
Severity: 4 - ImportantItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: François Beerten <feb>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 17 Feb 2010 09:11:23 PM UTC, comment #4:

Duh, I'm dumb. Fixed again.

Thanks.

François Beerten <feb>
Project AdministratorIn charge of this item.
Tue 16 Feb 2010 10:08:14 PM UTC, comment #3:

The fix in svn r9634 is wrong. If NumFrames == 3, then the frames are numbered 0, 1, and 2, but r9634 lets DrawCost call DrawFrameClip(3, ...); that number is still out of range. The test thus needs to be NumFrames > 3 rather than NumFrames >= 3. In practice though, NumFrames is 2, so this remaining bug does not trigger.

Kalle Olavi Niemitalo <kon>
Project Member
Tue 16 Feb 2010 05:42:56 PM UTC, comment #2:

Quick fix applied in SVN. Thank you for the report.

François Beerten <feb>
Project AdministratorIn charge of this item.
Mon 15 Feb 2010 10:25:58 PM UTC, comment #1:

The quick fix for this is to check if the frame is valid before drawing it. Longer term we should consider making it configurable or changing the way mana is handled since Bos no longer has magic/spells.

Jimmy Salmon <jsalmon3>
Mon 25 Jan 2010 10:36:38 PM UTC, original submission:

In Bos Wars 2.5, DrawCosts draws the mana icon like this:

// FIXME: hardcoded image!!!
UI.Resources[EnergyCost].G->DrawFrameClip(3, x, UI.StatusLine.TextY);

The graphic for this icon is set up in scripts/uilayout.lua:

-- energy
UI.Resources[0].G = CGraphic:New("graphics/ui/ui_res_icons.png", 14, 14)
UI.Resources[0].IconFrame = 0

However, graphics/ui/ui_res_icons.png is 14x28, so only two 14x14 frames fit in it: frame 0 for energy and frame 1 for magma. Thus, when DrawCosts asks DrawFrameClip to draw frame number 3, that argument is out of range.

This bug triggers one of the assertions added in <http://savannah.nongnu.org/support/download.php?file_id=19543>.

Kalle Olavi Niemitalo <kon>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by feb (Posted a comment)
  • -unavailable- added by kon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 16 Feb 2010 05:42:56 PM UTCfebStatusNone=>Fixed
      Assigned toNone=>feb
      Open/ClosedOpen=>Closed
    Tue 16 Feb 2010 01:56:16 AM UTCkonAttached File-=>Added 0001-Let-Lua-set-a-separate-UI.ManaCost-icon.patch, #19715
    Mon 15 Feb 2010 10:25:58 PM UTCjsalmon3Severity3 - Normal=>4 - Important
    Mon 15 Feb 2010 09:27:54 PM UTCfebDependencies-=>bugs #28728 is dependent

    Back to the top


    Powered by Savane 3.1-cleanup1