![]() |
|
datafile blues part2 |
Rick
Member #3,572
June 2003
![]() |
So I figured that you use "/" to seperate out nested datafiles when I use find_datafile_object. But now when I get that datafile, I want to loop through it and load all bitmaps in that datafile. My code doesn't seem to be doing that.
temp = (BITMAP*)m_direction(i).dat; is not a bitmap. The width and height are not what the bitmap w and h are. I think I'm missing something. ======================================================== |
ReyBrujo
Moderator
January 2001
![]() |
Check the type of the object before casting. It is possible you have some object that is not a bitmap, or that it is using a wide search instead of a deep search. -- |
Rick
Member #3,572
June 2003
![]() |
m_direction(i).type is type DAT_FILE, but I don't understand why. m_direction should be the datafile, where m_direction(i).dat should be the first bitmap inside this nested datafile. [EDIT] finalPath = get_datafile_property(m_direction, DAT_ID('N','A','M','E')); That comes back with WEST, which is the right datafile. hmmm finalPath = get_datafile_property((DATAFILE*)m_direction<i>.dat, DAT_ID('N','A','M','E')); Gives me the name of the first bitmap. But yet when I do: temp = (BITMAP*)m_direction<i>.dat; the width is like 21963458, where the real image width is 128 [EDIT] for(i=0;m_direction<i>.type != DAT_END;i++) { That is looping through the outer datafile. It's looping through each direction datafile, not inside the direction datafile. I know this cause if I start to load the last direction in the datafile it iterates once and exits loop, and if I start at the first direction it loops however many direction there are. Since m_direction is the direction datafile, I need to loop through that datafile. lion.dat --Stand.dat "STAND" -West.dat "WEST" (=m_direction) --00.bmp So if West.dat is m_direction wouldn't m_direction(i).dat be 00.bmp? ======================================================== |
|