So I'm making a game (this isn't a game-related
question, though)... This may sound simple, but
I haven't been able to figure out how to do this.
I have a function that reads the information
from a bitmap, minus the palette. I'm trying to
write a function that would read only the
palette-information, and store it in a global-
array that is passed through the function. This
is what I tried (I'm still new), but it didn't
work...
Code:BYTE g_GamePalette[256][3]; class Graphic{ public: ReadImageInfo(char *name); ReadPalette(char *name, BYTE &palette[256][3]); ... private: ... }; int main(){ Graphic *image = new Graphic; image->ReadBitmapInfo{"bitmap.bmp"); image->ReadPalette("bitmap.bmp", g_GamePalette[256][3]); /********************************************* *How would I pass the entire global array, by* *reference, though the ReadPalette() functio?* *********************************************/ return 0; }
Project: 13h Game.
Compiler: DJGPP.
Operating System: Windows 95.
Thanks a lot,
ethic.



LinkBack URL
About LinkBacks



