Ejemplo n.º 1
0
static void R_ShowTainted(pwindow_t *window)
{
   static byte taintcolor = 0;
   int y1, y2, count;

   for(int i = window->minx; i <= window->maxx; i++)
   {
      byte *dest;

      y1 = (int)window->top[i];
      y2 = (int)window->bottom[i];

      count = y2 - y1 + 1;
      if(count <= 0)
         continue;

      dest = R_ADDRESS(i, y1);

      while(count > 0)
      {
         *dest = taintcolor;
         dest += video.pitch;

         count--;
      }
   }
   taintcolor += 16;
}
Ejemplo n.º 2
0
static void R_ShowTainted(pwindow_t *window)
{
   int y1, y2, count;

   if(window->line)
   {
      const sector_t *sector = window->line->frontsector;
      float floorangle = sector->floorbaseangle + sector->floorangle;
      float ceilingangle = sector->ceilingbaseangle + sector->ceilingangle;
      visplane_t *topplane = R_FindPlane(sector->ceilingheight, 
         sector->ceilingpic, sector->lightlevel, sector->ceiling_xoffs, 
         sector->ceiling_yoffs, ceilingangle, nullptr, 0, 255, nullptr);
      visplane_t *bottomplane = R_FindPlane(sector->floorheight,
         sector->floorpic, sector->lightlevel, sector->floor_xoffs,
         sector->floor_yoffs, floorangle, nullptr, 0, 255, nullptr);
      topplane = R_CheckPlane(topplane, window->minx, window->maxx);
      bottomplane = R_CheckPlane(bottomplane, window->minx, window->maxx);

      for(int x = window->minx; x <= window->maxx; x++)
      {
         if(window->top[x] > window->bottom[x])
            continue;
         if(window->top[x] <= view.ycenter - 1.0f && 
            window->bottom[x] >= view.ycenter)
         {
            topplane->top[x] = static_cast<int>(window->top[x]);
            topplane->bottom[x] = centery - 1;
            bottomplane->top[x] = centery;
            bottomplane->bottom[x] = static_cast<int>(window->bottom[x]);
         }
         else if(window->top[x] <= view.ycenter - 1.0f)
         {
            topplane->top[x] = static_cast<int>(window->top[x]);
            topplane->bottom[x] = static_cast<int>(window->bottom[x]);
         }
         else if(window->bottom[x] > view.ycenter - 1.0f)
         {
            bottomplane->top[x] = static_cast<int>(window->top[x]);
            bottomplane->bottom[x] = static_cast<int>(window->bottom[x]);
         }
      }
      
      return;
   }

   for(int i = window->minx; i <= window->maxx; i++)
   {
      byte *dest;

      y1 = (int)window->top[i];
      y2 = (int)window->bottom[i];

      count = y2 - y1 + 1;
      if(count <= 0)
         continue;

      dest = R_ADDRESS(i, y1);

      while(count > 0)
      {
         *dest = GameModeInfo->blackIndex;
         dest += video.pitch;

         count--;
      }
   }
}