OOP: Extended types get upgraded and not forgotten

BlitzMax Forums/BlitzMax Beginners Area/OOP: Extended types get upgraded and not forgotten

Hotcakes(Posted 2008) [#1]
Here's an interesting testbed:



Well, well. I am enjoying my OOP. This testbed needs a (small; under 50x50) image file called image.png.

What I think SHOULD happen is the first image is drawn at the original size, the second image at 4 times larger and then the third image at the original size again. Well, that was the intent.

What actually happens is the third image is also drawn scaled.

I believe I understand what is actually happenning, but I wondered is this actually correct behaviour? If it is correct, is there an easy way around it? I can't set the scale while loading the image associated with for ShouldNotDrawScaled because it throws a compiler error of course.

What do y'all think?


Warpy(Posted 2008) [#2]
You're not resetting Game.Image after the second image is drawn. It's still a TScaled object.


Hotcakes(Posted 2008) [#3]
Yup, that's what I thought. Thanks.