This is why bitmaps aren't working the same

Description: Report bugs of SMBX-38A here.
Forum rules: https://wohlsoft.ru/forum/viewtopic.php?f=64&t=1069
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 402
Posts: 757
Joined: 9 Nov 2015
Website

Post #1by Lx Xzit » 8 Jul 2019, 1:52

To clarify, this is not necessarily a bug and doesn't mean it must be "fixed" (reverted back), but I do think I should report it because it's breaking many old scripts.

Now let's start:

Look at this code:

Code: Select all

call bmpcreate(1, 1, 1, 1, 0, 0, 32, 32, 400, 300, 1, 1, 16, 16, 0, -1)
do
    v(time) = v(time) + 1
   with bitmap(1)
      select case v(time)
         case 1 to 65
            .scry = 0
         case 66 to 65*2
            .scry = 1*32
         case else
            v(time) = 1
      end select
   end with
    call sleep(1)
loop


(You can run this code without needing to download anything)
If you run this code in SMBX 1.4.5, you will see a goomba in the center of the screen switching between two frames every second. It works as expected. However, if you run this code at SMBX 1.4.4 you will see a goomba that blinks.

Why does this happen? in SMBX 1.4.4, every time you switched to a new x or y position on the image (say, the bitmap), you were forced to set the bitmap's size again, otherwise it wouldn't work. In SMBX 1.4.5 however, this is no longer needed (presumably because it was due a bug that was fixed)

This is the same code as before, but I added the lines that resized the bitmap (it's size it's always 32x32 since it's a goomba):

Code: Select all

call bmpcreate(1, 1, 1, 1, 0, 0, 32, 32, 400, 300, 1, 1, 16, 16, 0, -1)
do
    v(time) = v(time) + 1
   with bitmap(1)
      select case v(time)
         case 1 to 65
            .scry = 0
            .scrheight = 32     'Added this
         case 66 to 65*2
            .scry = 1*32
            .scrheight = 32     'And this line
         case else
            v(time) = 1
      end select
   end with
    call sleep(1)
loop


So if you run this, this should work fine in SMBX 1.4.4.

If this don't get changed, to fix this you have fix this you have delete any redundant lines that resizes the bitmap.
Should 38a revert this back? I don't know. It is better working without this odd problem, but it means a lot of old scripts needs to be updated.
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

Return to “SMBX-38A Bug reports”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest