/* ==================== = = RTS_GetSound = ==================== */ void *RTS_GetSound (int32 lump) { lump++; if ((uint32)lump >= numlumps) Error ("RTS_GetSound: %i >= %i\n",lump,numlumps); if (lumpcache[lump] == NULL) { lumplockbyte[lump] = 200; allocache((char *)&lumpcache[lump],(long)RTS_SoundLength(lump-1),&lumplockbyte[lump]); RTS_ReadLump(lump, lumpcache[lump]); } else { if (lumplockbyte[lump] < 200) lumplockbyte[lump] = 200; else lumplockbyte[lump]++; } return lumpcache[lump]; }
void *RTS_GetSound(int32_t lump) { lump++; if (RTS_BAD_LUMP(lump)) return NULL; if (rts_lumpcache[lump] == NULL) { rts_lumplockbyte[lump] = 200; allocache((intptr_t *)&rts_lumpcache[lump], RTS_SoundLength(lump-1), &rts_lumplockbyte[lump]); // JBF 20030910: char * => int32_t * RTS_ReadLump(lump, rts_lumpcache[lump]); } else { if (rts_lumplockbyte[lump] < 200) rts_lumplockbyte[lump] = 200; else rts_lumplockbyte[lump]++; } return rts_lumpcache[lump]; }