ok color looks fine now coz i found out that Load_Frame_BOB()
was meant for 8 bit. i updated it by comparing updated functions
which were provided by the cd.
then, i realize...my background image was a biltted one.
it looks alright to me but if the "crystal" bitmap was on
top of it, this "crystal" bitmap flickers.
is it due to the background bitmap that was being blitted?
considering,
if the background image was biltted in game_init(), it will oso flicker.
but if it was biltted in game_main(), it will not flicker.
there is alt way to solve this.
use > Create_Bitmap()
Load_Bitmap_File()
Load_Image_Bitmap()
Unload_Image_Bitmap()
but Create_Bitmap() & Load_Image_Bitmap() r oso catered for 8bit only. i guess so because neither background image will appear
in game_init() nor game_main().
there are no updated functions for these.
its probably due to the memory allocation which i am not sure
how to go about it, and the memcpy() that needs editing.
int Create_Bitmap(BITMAP_IMAGE_PTR image, int x, int y, int width, int height){// this function is used to intialize a bitmap// allocate the memoryif (!(image->buffer = (UCHAR *)malloc(width*height))) return(0);// initialize variablesimage->state = BITMAP_STATE_ALIVE;image->attr = 0;image->width = width;image->height = height;image->x = x;image->y = y;image->num_bytes = width*height;// clear memory outmemset(image->buffer,0,width*height);// return successreturn(1);} // end Create_Bitmap
int Load_Image_Bitmap(BITMAP_IMAGE_PTR image, // bitmap image to load with data BITMAP_FILE_PTR bitmap, // bitmap to scan image data from int cx,int cy, // cell or absolute pos. to scan image from int mode) // if 0 then cx,cy is cell position, else // cx,cy are absolute coords{// this function extracts a bitmap out of a bitmap fileUCHAR *source_ptr, // working pointers *dest_ptr;// is this a valid bobif (!image) return(0);// test the mode of extraction, cell based or absoluteif (mode==BITMAP_EXTRACT_MODE_CELL) { // re-compute x,y cx = cx*(image->width+1) + 1; cy = cy*(image->height+1) + 1; } // end if// extract bitmap datasource_ptr = (UCHAR *)bitmap->buffer + cy*bitmap->bitmapinfoheader.biWidth+cx;// assign a pointer to the bimap imagedest_ptr = (UCHAR *)image->buffer;// iterate thru each scanline and copy bitmapfor (int index_y=0; index_y<image->height; index_y++) { // copy next line of data to destination memcpy(dest_ptr, source_ptr,image->width); // advance pointers dest_ptr += image->width; source_ptr += bitmap->bitmapinfoheader.biWidth; } // end for index_y// set state to loadedimage->attr |= BITMAP_ATTR_LOADED;// return successreturn(1);} // end Load_Image_Bitmap