components/prboom/p_setup.c
/*
 * P_LoadThings
 *
 * killough 5/3/98: reformatted, cleaned up
 * cph 2001/07/07 - don't write into the lump cache, especially non-idepotent
 * changes like byte order reversals. Take a copy to edit.
 */
P_LoadThings
killough 5/3/98: reformatted, cleaned up
cph 2001/07/07 - don't write into the lump cache, especially non-idepotent
changes like byte order reversals. Take a copy to edit.
P_LoadThings killough 5 / 3 / 98 : reformatted cleaned up cph 2001 / 07 / 07 - don ' t write into the lump cache especially non - idepotent changes like byte order reversals . Take a copy to edit .
static void P_LoadThings (int lump)
{
  int  i, numthings = W_LumpLength (lump) / sizeof(mapthing_t);
  const mapthing_t *data = W_CacheLumpNum (lump);
  if ((!data) || (!numthings))
    I_Error("P_LoadThings: no things in level");
  for (i=0; i<numthings; i++)
    {
      mapthing_t mt = data[i];
      mt.x = SHORT(mt.x);
      mt.y = SHORT(mt.y);
      mt.angle = SHORT(mt.angle);
      mt.type = SHORT(mt.type);
      mt.options = SHORT(mt.options);
      if (!P_IsDoomnumAllowed(mt.type))
        continue;
      P_SpawnMapThing(&mt);
    }
  W_UnlockLumpNum(lump); 
}
static void P_LoadThings ( int lump ) { int i , numthings = W_LumpLength ( lump ) / sizeof ( mapthing_t ) ; const mapthing_t * data = W_CacheLumpNum ( lump ) ; if ( ( ! data ) || ( ! numthings ) ) I_Error ( " " ) ; for ( i = 0 ; i < numthings ; i ++ ) { mapthing_t mt = data [ i ] ; mt . x = SHORT ( mt . x ) ; mt . y = SHORT ( mt . y ) ; mt . angle = SHORT ( mt . angle ) ; mt . type = SHORT ( mt . type ) ; mt . options = SHORT ( mt . options ) ; if ( ! P_IsDoomnumAllowed ( mt . type ) ) continue ; P_SpawnMapThing ( & mt ) ; } W_UnlockLumpNum ( lump ) ; }
P_LoadThings
 killough 5/3/98: reformatted, cleaned up
 cph 2001/07/07 - don't write into the lump cache, especially non-idepotent
 changes like byte order reversals.
P_LoadThings killough 5 / 3 / 98 : reformatted cleaned up cph 2001 / 07 / 07 - don ' t write into the lump cache especially non - idepotent changes like byte order reversals .
// Do spawn all other stuff. // cph - release the data