Jump to content
Search Community

Argument Error 2015: Invalid BitMapData

vossiewulf test
Moderator Tag

Recommended Posts

Am getting this in testing now:

ArgumentError: Error #2015: Invalid BitmapData.
	at flash.display::BitmapData/ctor()
	at flash.display::BitmapData()
	at com.greensock::BlitMask/_captureTargetBitmap()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\com\greensock\BlitMask.as:240]
	at com.greensock::BlitMask/update()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\com\greensock\BlitMask.as:297]
	at com.greensock::BlitMask/set bitmapMode()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\com\greensock\BlitMask.as:591]
	at com.greensock::BlitMask/set target()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\com\greensock\BlitMask.as:660]
	at com.greensock::BlitMask()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\com\greensock\BlitMask.as:189]
	at Function/LOB_Core/$construct/updateShipList()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\LOB_Core.as:1562]
	at Function/LOB_Core/$construct/applyDamage()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\LOB_Core.as:12942]
	at Function/LOB_Core/$construct/calcGunDamage()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\LOB_Core.as:10895]
	at Function/LOB_Core/$construct/broadsideConfirmButtonHandler()[C:\Users\Vossie\Documents\Fex Line of Battle Project\trunk\line_of_battle\LOB_Core.as:6767]
Cannot display source code at this location.

First screenshot,below is where it happens, it's triggered by clicking on either the fire at rigging or fire at hull button. The second screenshot shows that the ship list BlitMask it's complaining about is behind the Spanish ship info screen at the time we get the error. 

 

Note that the minimap right above the ship list is also a GSAP BlitMask but whatever is happening causes no issues with the minimap.

 

The strange thing is that it doesn't happen until somewhere after turn 6 but before turn 10, and the operation we're doing when it fails has been done dozens of times already successfully before this one fails. There's nothing unusual about the shots, the damage isn't crossing any thresholds that would send us down different paths, as far as I can see right now this click of the fire button is no different than all of the previous successful ones.

 

EDIT - thinking about this more- you should see updateShipList() in the call stack - it's called every time during gun combat, after applyDamage(), for the obvious reason of updating the ship list display to reflect the damage. Looking at the ship hull damage, it's possible this shot is crossing a threshold that so that ship's hull damage will switch to three yellow squares from four green ones. The updateShipList() function always blows away the previous ship list and builds a new one from scratch, so I'm not sure why it would matter, but thinking about it in detail the ship list we're trying to draw this time is slightly different than all of the previous successful ones - this is the point in a scenario where for the first time those four green squares under each dam category in the ship list start shrinking in number and turning yellow orange red etc. Previous testing had involved forced values, this is first testing with those values changing real time in game.

 

The result is the ship list dialog dies a horrible death, and even though the game itself doesn't crash it's going to throw null object reference errors until the game progresses to the next turn step and the shiplist is rebuilt.

 

I don't have the slightest clue what the issue could be or what to do about it, other than possibly killing the minimap and shiplist dialogs while a gun combat sequence is active and we are displaying a ship info screen on the right. Do you have any suggestions?

 

 

WTwQGS4.jpg

 

 

wKWT21G.jpg

Link to comment
Share on other sites

Hm, kinda tough to troubleshoot but a quick Google search indicated that that particular error gets thrown in Flash when you exceed the max size that Adobe allows for BitmapData. Might that be the issue here? Are you going beyond 2880px in either dimension? 

 

Not the ship list, no- it's 430 x 800 or so. I wasn't aware of that limitation, I'm not sure I understand that - do you mean total size covered or the size of the bitmapdata being tiled? Because my main map is 1k x 1k tiles, final size set by number of rows and columns in scenario file, and I've tested up to 20k x 20k successfully. 

 

Wait on this error - I think what I'm going to do is remove the minimap and the shiplist during the combat sequence and then reload them after we remove the ship info screens, I'm guessing that may solve the problem and is probably the smarter thing to do anyway. Let me try that, I'll post the results either way.

Link to comment
Share on other sites

Looks like this was fixed by removing and re-instancing the mini-map and ship list during this sequence where the second ship info screen will overlay them.  No clue what caused it but happy it has gone away, clearing me to release a new alpha version.

 

I'm not sure you guys have given me any answers to these questions, but that's because I either figure them out or I solve it a different way. Bottom line is I come here with a problem and I leave with a solution and I'm good with that. :)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...