I just made a BMP with some dots (kind of a colored heightmap) to place some objects on a terrain - the object being defined by the pixel color.
The problem is: everything works fine on windowed mode, 32bpp - but not if the desktop is 16bpp.
A point that should be 0,255,0, in 16bpp returns 0,252,0!
Just try for yourselves:
Create a image with a single dot in RGB 0,255,0 and save it as mapinfo.bmp, then run the program below:
Even using the "getcolor" command I get the same problem! Does anyone know anything about this?
Changing the mode to Graphics3D 640,480,16,1 also returns 0,252,0...
EDIT: just remembered that 16bpp has 5 bits per color... but shouldnt it convert/return values beetween 0-255, specially when using ColorRed/ColorBlue/ColorGreen?
The problem is: everything works fine on windowed mode, 32bpp - but not if the desktop is 16bpp.
A point that should be 0,255,0, in 16bpp returns 0,252,0!
Just try for yourselves:
Create a image with a single dot in RGB 0,255,0 and save it as mapinfo.bmp, then run the program below:
Graphics3d 640,480, 0, 2 Tex = LoadTexture("mapinfo.bmp") LockBuffer TextureBuffer(Tex) rgb = ReadPixelFast(0,0,TextureBuffer(Tex)) UnlockBuffer TextureBuffer(Tex) R = rgb Shr 16 And %11111111 G = rgb Shr 8 And %11111111 B = rgb And %11111111 while not keyhit(1) cls updateworld renderworld text 10,10, str$(r) + "-" + str$(g) + "-" + str$(b) flip wend end
Even using the "getcolor" command I get the same problem! Does anyone know anything about this?
Changing the mode to Graphics3D 640,480,16,1 also returns 0,252,0...
EDIT: just remembered that 16bpp has 5 bits per color... but shouldnt it convert/return values beetween 0-255, specially when using ColorRed/ColorBlue/ColorGreen?