04-07-2005, 10:12 PM
While I am on my adventures in arcade game programming I started to play with loading bitmaps. When I load and run the following, the colors of the bitmap change. What gives?
Here is a link to the bitmap.
Or here it is:
Notice it should be yellow. This is an 8 bit bitmap because I can not get anything higher to work (I've tried in PaintShop Pro 7 and Paint, in each case either it shows the whole image (no masking) or nothing.
Here is the test code:
Changing the background color changes the color of the loaded image.
Now to question 2:
How can I slow down the getmouse routine. Before I can get my finger off of the button it has scrolled through dozens of rows or columns.
1) Why the color change?
1a) Any advice on getting bitmaps to work in 16, 24, or 32 depths (I know about magic pink $HFF00FF)
2) The mouse bit.
Here is a link to the bitmap.
Or here it is:
Notice it should be yellow. This is an 8 bit bitmap because I can not get anything higher to work (I've tried in PaintShop Pro 7 and Paint, in each case either it shows the whole image (no masking) or nothing.
Here is the test code:
Code:
SCREEN 18,8,2,1
DIM image(272*272+4) AS UBYTE
BLOAD "groovy.bmp", @image(0)
color 0,4
cls
dim letter(32*32+4) as ubyte
dim r as integer
dim c as integer
dim x as integer
dim y as integer
dim m as integer
dim oldx as integer
dim oldy as integer
r=0
c=0
get image, (C*32,r*32)-((C+1)*32-1,(R+1)*32-1), letter
do
screenset 1,0
getmouse x,y,,m
if m<>0 then
select case m
case 1
r+=1
case 2
c+=1
case 4
r=0
c=0
end select
if r>7 then r=0
if c>7 then c=0
get image, (C*32,r*32)-((C+1)*32-1,(R+1)*32-1), letter
end if
if x<>oldx or y<>oldy or m<>0 then
cls
put (x,y),letter
screencopy
oldx=x
oldy=y
? m
end if
loop until multikey(&h1)
Changing the background color changes the color of the loaded image.
Now to question 2:
How can I slow down the getmouse routine. Before I can get my finger off of the button it has scrolled through dozens of rows or columns.
1) Why the color change?
1a) Any advice on getting bitmaps to work in 16, 24, or 32 depths (I know about magic pink $HFF00FF)
2) The mouse bit.