Jump to content
Posted 25 September 2003 - 12:01 PM
Posted 25 September 2003 - 01:36 PM
Posted 26 September 2003 - 08:18 AM
Posted 26 September 2003 - 09:12 AM
Sig as string *2 'Always BM
FileSize as long
Reserved as long
DataOffset as long
InfoHeaderSize as long 'Normally 40
Width as long
Height as long
Planes as integer
BitCount as short
Compression as long '0=none, 1=8-bit, 2=24-bit
ImageSize as long 'size of image, set to 0 if compression=0
XPixelsPerM as long 'Horizontale pixels per meter
YPixelsPerM as long 'Vertical pixels per meter
ColorsUsed as long 'Number of actual colors used
ColorsImportant as long 'Colors that are important, 0=all
Sub SetPalEntry(Index as integer, r as byte, g as byte, b as byte)
out &h3c8, Index
out &h3c9, r/4
out &h3c9, g/4
out &h3c9, b/4
sub LoadBitmap(bName as string)
Dim tmpHeader as BMPInfoHeader
Dim Ctr as integer, x as integer, y as integer
Dim r as byte, g as byte, b as byte, tmpByte as byte
open nName for binary as #1
Get #1, , tmpHeader 'Read in our info!
if not (tmpHeader.BitDepth = 8) 'Something other than 8-bit??
for Ctr = 0 to 255
'Windows stores them b,g,r instead of r,g,b for some reason!
call SetPalEntry(ctr, r,g,b) 'Setup the pallete!
'And they're stored upside down!!
for y = tmpHeader.Height to 0 step -1
for x = 0 to tmpHeader.Width
get #1,, tmpByte
pset (x,y),tmpByte 'Put our pixel!
'***** Program starts here *****
Screen 13 '320x200x256 colors
Dim tmpStr as string
input tmpStr 'Input some crap for now
Posted 26 September 2003 - 09:27 AM
Posted 26 September 2003 - 02:40 PM
Original post by quasar3d
my qbasic is also a bit rusty, but I know that if you want to use 256 colours, you can use screen 13, or with some libraries you can get higher resolutions with 256 colours. but libraries won't work in qbasic, only in quickbasic, which is the professional edition of qbasic.
click here for the libraries
Posted 27 September 2003 - 04:22 AM
Posted 27 September 2003 - 04:43 AM
Posted 27 September 2003 - 02:26 PM
Posted 27 September 2003 - 02:44 PM
Posted 27 September 2003 - 03:31 PM
Original post by Iron Eye
Alright I''ve got a pretty good idea of whats happening in your code. But why do you loop 255 times? Are you just assuming its a bitmap thats 253 (theres 2 extra ones right?) pixels wide?
Posted 28 September 2003 - 11:05 AM
Original post by Ready4Dis
If you want a more generic method of rendering sprites (in QBasic anyways), you can either look at bload and bsave, or extend my method to support sprites as well.
Posted 28 September 2003 - 03:24 PM