void RemoveBullet( INT32 iBullet ) { CHECKV( iBullet < NUM_BULLET_SLOTS ); //afp-start // remove any tail first if exists for (int i = 0; i < BULLET_TRACER_MAX_LENGTH; i++) if (gBullets[iBullet].pNodes[i] != NULL) { RemoveStructFromLevelNode(gBullets[ iBullet ].sGridNo, gBullets[iBullet].pNodes[i]); gBullets[iBullet].pNodes[i] = NULL; } //afp-end // decrease soldier's bullet count if (gBullets[ iBullet ].fReal) { // set to be deleted at next update gBullets[ iBullet ].fToDelete = TRUE; // decrement reference to bullet in the firer // gBullets[ iBullet ].pFirer->bBulletsLeft--; // DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Ending bullet, bullets left %d", gBullets[ iBullet ].pFirer->bBulletsLeft ) ); // DebugAttackBusy( String( "Deleting a bullet for %d. Total count now %d\n", gBullets[ iBullet].ubFirerID, gBullets[ iBullet ].pFirer->bBulletsLeft) ); // Nah, just decrement the attack busy count and be done with it DebugAttackBusy( String( "Deleting a bullet for %d.\n", gBullets[ iBullet].ubFirerID ) ); // HEADROCK HAM 5: Fragments do not need reducing. if (gBullets[iBullet].fFragment == false) { ReduceAttackBusyCount( ); } // if ( gBullets[ iBullet ].usFlags & ( BULLET_FLAG_KNIFE ) ) // { // Delete ani tile if ( gBullets[ iBullet ].pAniTile != NULL ) { DeleteAniTile( gBullets[ iBullet ].pAniTile ); gBullets[ iBullet ].pAniTile = NULL; } // Delete shadow // if ( gBullets[ iBullet ].usFlags & ( BULLET_FLAG_KNIFE ) ) // { if ( gBullets[ iBullet ].pShadowAniTile != NULL ) { DeleteAniTile( gBullets[ iBullet ].pShadowAniTile ); gBullets[ iBullet ].pShadowAniTile = NULL; } // } // } } else { // delete this fake bullet right away! gBullets[ iBullet ].fAllocated = FALSE; RecountBullets(); } }
void FlicClearBitmap( HBITMAP hBitmap, INT iColourIndex ) { DIBSECTION dibSection; INT i; CHECKV(hBitmap); CHECKV(GetObject(hBitmap, sizeof(DIBSECTION), &dibSection)); CHECKV(dibSection.dsBm.bmBits); CHECKV(dibSection.dsBm.bmHeight); CHECKV(dibSection.dsBm.bmWidth); for ( i=0 ; i<dibSection.dsBm.bmHeight*dibSection.dsBm.bmWidth ; i++ ) { ((CHAR *)dibSection.dsBm.bmBits)[i] = iColourIndex; } }