#134581 - biubid_boy - Sat Jul 14, 2007 9:53 am
I'm creating a set of functions to automatically set up things like loading sprites and backgrounds. It should make programming easier in the future and it tests my knowledge in those areas. But one problem I have is in my load_background function. There seems to be something wrong. Here is my code: (note: It's not finished yet, so there isn't any support for 8bpp etc.)
background.c
main.c
The problem is, the first expression never evaluates true! I've tried everything I can think of and I can't get it to work. Am I missing something obvious here?
Please help,
Biubid_boy.
background.c
Code: |
void load_bg_4bpp(tiledbg *bg, int bg_w, int bg_h, u16 *tiles, u16 tile_size, u16* map, u16 map_size, u16 *pal)
{ if(bg_w == 256 && bg_h == 256) {c_sbb--;} //<--PROBLEM! memcpy(BGPaletteMem, pal, 512); memcpy(SCREEN_BASE_BLOCK(c_sbb), map, map_size); memcpy(MAP_BASE_BLOCK(c_cbb), tiles, tile_size); ... |
main.c
Code: |
load_bg_4bpp(&grass, 256, 256, grassTiles, grassTilesLen, grassMap, grassMapLen, grassPal); |
The problem is, the first expression never evaluates true! I've tried everything I can think of and I can't get it to work. Am I missing something obvious here?
Please help,
Biubid_boy.