[AD] Problems with create_rgb_table()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi all.

I have ported a game from the PC that is 99% working, except for some
palette related problems.  I am having trouble fixing them as I am not sure
what exactly it is trying to do.  It loads some palette data from its
datafile and then calls create_rgb_table() with a pointer to that data. 
When it does this, one of two things will happen:

1) create_rgb_table() will crash; or
2) create_rgb_table() doesn't crash but the game's colours are wrong.

#2 looks as though it is related to #1.  If it crashes then it is always on
line 570 of Allegro's src/color.c:

if (next[curr] == UNUSED) { 

When this happens, curr is always a large number (usually around 65000) and
the next array is only 32768 bytes long so it crashes.  I am not sure
exactly what this routine does or how it does it and even if I did it's a
complex routine so I wouldn't know how to fix it.

Does anyone have any ideas?  This one problem is stopping me from releasing
this (otherwise rather good) game as a "release game" when I release my
Allegro port this week.

-- 
/-------------------------------------------------------------------\
[Hitman/Code HQ - 6502/z80/68000/604e/80x86/ARM coder - Amiga rulez!]
[VZ-200/VIC-20/MZ-700/c16/c64*10/c128*8/Plus-4/CPC464/CD32/500*2    ]
[600/1000/1200*2/A4000/SNES/N64/Dreamcast/Athlon 1100/AmigaOne      ]
[Assembly Language: The most fun you can have with your clothes on! ]
\-------------------------------------------------------------------/





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/