Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SpecularBitmapTexture initialized default bitmap data with invalid dimensions #308

Closed
pants97 opened this issue Jun 25, 2012 · 2 comments
Closed
Assignees
Labels

Comments

@pants97
Copy link
Contributor

pants97 commented Jun 25, 2012

when creating SpecularBitmapTexture without a bitmap data object (i.e. null value) a BitmapData object is created with dimensions w:1, h:1 causing an exception w/text "Invalid bitmapData: Width and height must be power of 2 and cannot exceed 2048" in its parent class BitmapTexture in property setter bitmapData as TextureUtils.isBitmapDataValid returns false; fix: change default dimensions to w:2, h:2;

@ghost ghost assigned DerSchmale Jun 25, 2012
@richardolsson
Copy link
Member

Thanks for reporting!

@DerSchmale I could probably fix this but am assigning it to you just to make sure the suggested fix is a good one from your point of view. Let me know if you want me to fix it!

@pants97
Copy link
Contributor Author

pants97 commented Jun 25, 2012

constructor
bmd = bmd? new BitmapData(bmd.width, bmd.height, false, 0xffffff) : new BitmapData(1, 1, false, 0xffffff);

and in
private function testSize() : void
w = 1;
h = 1;

ow, and line 80:
super.bitmapData = new BitmapData(_specularMap.width, specularMap.height, false, 0xffffff);
there's a missing _ for the second specularMap reference, calling getter instead and causing call stack to grow =)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants