Qbasicnews.com
September 22, 2020, 07:45:12 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: screens of my map maker  (Read 6011 times)
Anonymous
Guest
« Reply #15 on: February 16, 2006, 01:28:12 AM »

heres a bit of code that i wrote that was originally inspired by rel:

Code:
Sub Block2x ( img As Any Ptr, newimg As Any Ptr, w As Integer = 16, h As Integer = 16 )


  Dim As uShort Ptr lbf
  Dim As uByte Ptr imglook, newimglook

  Dim As Integer x, y, x2, y2, i, j

  Dim As Integer im_dex, im_dex2
 
  Dim As Integer b_opt, w_opt, y_opt
 
  imglook = img
  newimglook = newimg
 
  lbf = newimg    
                       
  lbf[0] = w * 2 * 8  
  lbf[1] = h * 2      


  w_opt = w * 2

 
  For y = 0 To (H - 1)

    For x = 0 To (W - 1)
     

      im_dex = (y_opt + x) + 4
     
      b_opt = y_opt * 4 + x * 2 + 4
      newimglook[b_opt]     =  imglook[im_dex]
      newimglook[b_opt + 1] =  imglook[im_dex]
     
      b_opt +=  w_opt
      newimglook[b_opt]     =  imglook[im_dex]
      newimglook[b_opt + 1] =  imglook[im_dex]

     

     Next x

     y_opt += w

  Next y
 


End Sub
Logged
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!