Author Topic: converting FB code to bmax...[BMAX]  (Read 3518 times)

0 Members and 1 Guest are viewing this topic.

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
converting FB code to bmax...[BMAX]
« on: September 19, 2006 »
Hey guys, I have this scale2x code:

Code: [Select]
sub scale_2x(image as ubyte ptr)
    const wid = 320
    const hei = 240   
   
    dim x as integer, y as integer
    dim x2 as integer, y2 as integer
       
    'Scale2x stuff
    dim E as ubyte, E0 as ubyte, E1 as ubyte, E2 as ubyte, E3 as ubyte
    dim B as ubyte, D as ubyte, F as ubyte, H as ubyte
   
   
    dim offset as ubyte ptr
    offset = image
    offset = image + 4       
    dim voff as ubyte ptr
    voff = screenptr
   
screenlock
   
    for y = 0 to hei - 1
       
        for x = 0 to wid - 1
           
            B= *(offset - wid)     
            D= *(offset - 1)       
            E= *(offset)           
            F= *(offset + 1)       
            H= *(offset + wid)
            if B <> H and D <> F then
                if D = B then E0 = D else E0 = E
                'e0 = iif(d=b,d, e)
                if B = F then E1 = F else E1 = E
                'e1 = iif(b=f,f, e)
                if D = H then E2 = D else E2 = E
                'e2 = iif(d=h,d, e)
                if H = F then E3 = F else E3 = E
                'e3 = iif(h=f,f, e)
            else
            E0 = E
            E1 = E
            E2 = E
            E3 = E
            end if
            *voff = e0
            *(voff+1) = e1
            *(voff+640) = e2
            *(voff+641) = e3
            offset += 1
            voff += 2
        next y
        voff += 640
    next x
   
    screenunlock   
   
end sub

How would I convert this to BMAX?
I don't have Bmax though.

This is for a person coding an 8 bit shmup.

Thanks!!!


« Last Edit: July 21, 2007 by Shockwave »
Challenge Trophies Won:

Offline zparticle

  • Atari ST
  • ***
  • Posts: 168
  • Karma: 11
    • View Profile
    • ScottShaver2000
Re: converting FB code to bmax...
« Reply #1 on: September 19, 2006 »
if it's just doing a straight scale of the image you can just use:

SetScale(2,2) ' double it
DrawImage image,x,y ' draw it
SetScale(1,1) ' go back to normal scale

Offline Dad1916

  • Atari ST
  • ***
  • Posts: 112
  • Karma: 3
    • View Profile
Re: converting FB code to bmax...
« Reply #2 on: September 20, 2006 »
if it's just doing a straight scale of the image you can just use:

SetScale(2,2) ' double it
DrawImage image,x,y ' draw it
SetScale(1,1) ' go back to normal scale
don't forget to cls before and flip after

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: converting FB code to bmax...
« Reply #3 on: September 20, 2006 »
Thanks guys!!!
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: converting FB code to bmax...
« Reply #4 on: September 20, 2006 »
Hope it works for your friend :) I'm glad that there are some Bmax guys around to help when stuff like this comes up. I never played with it at all myself.
Shockwave ^ Codigos
Challenge Trophies Won: