11 void R_DrawColumn (void);
12 void R_DrawFuzzColumn (void);
25 Sprite rotation 0 is facing the viewer, rotation 1 is one angle turn CLOCKWISE around the axis.
26 This is not the same as the angle, which increases counter clockwise
27 (protractor). There was a lot of stuff grabbed wrong, so I changed it...
32 fixed_t pspritescale, pspriteiscale;
34 lighttable_t **spritelights;
36 // constant arrays used for psprite clipping and initializing clipping
37 short negonearray[SCREENWIDTH];
38 short screenheightarray[SCREENWIDTH];
41 ===============================================================================
43 INITIALIZATION FUNCTIONS
45 ===============================================================================
48 // variables used to look up and range check thing_t sprites patches
52 spriteframe_t sprtemp[26];
63 = Local function for R_InitSprites
67 void R_InstallSpriteLump (int lump, unsigned frame, unsigned rotation, boolean flipped)
71 if (frame >= 26 || rotation > 8)
72 I_Error ("R_InstallSpriteLump: Bad frame characters in lump %i", lump);
74 if ((int)frame > maxframe)
79 // the lump should be used for all rotations
80 if (sprtemp[frame].rotate == false)
81 I_Error ("R_InitSprites: Sprite %s frame %c has multip rot=0 lump"
82 , spritename, 'A'+frame);
83 if (sprtemp[frame].rotate == true)
84 I_Error ("R_InitSprites: Sprite %s frame %c has rotations and a rot=0 lump"
85 , spritename, 'A'+frame);
87 sprtemp[frame].rotate = false;
90 sprtemp[frame].lump[r] = lump - firstspritelump;
91 sprtemp[frame].flip[r] = (byte)flipped;
96 // the lump is only used for one rotation
97 if (sprtemp[frame].rotate == false)
98 I_Error ("R_InitSprites: Sprite %s frame %c has rotations and a rot=0 lump"
99 , spritename, 'A'+frame);
101 sprtemp[frame].rotate = true;
103 rotation--; // make 0 based
104 if (sprtemp[frame].lump[rotation] != -1)
105 I_Error ("R_InitSprites: Sprite %s : %c : %c has two lumps mapped to it"
106 ,spritename, 'A'+frame, '1'+rotation);
108 sprtemp[frame].lump[rotation] = lump - firstspritelump;
109 sprtemp[frame].flip[rotation] = (byte)flipped;
117 = Pass a null terminated list of sprite names (4 chars exactly) to be used
118 = Builds the sprite rotation matrixes to account for horizontally flipped
119 = sprites. Will report an error if the lumps are inconsistant
120 =Only called at startup
122 = Sprite lump names are 4 characters for the actor, a letter for the frame,
123 = and a number for the rotation, A sprite that is flippable will have an
124 = additional letter/number appended. The rotation character can be 0 to
125 = signify no rotations
129 void R_InitSpriteDefs (char **namelist)
132 int i, l, intname, frame, rotation;
135 // count the number of sprite names
137 while (*check != NULL)
139 numsprites = check-namelist;
144 sprites = Z_Malloc(numsprites *sizeof(*sprites), PU_STATIC, NULL);
146 start = firstspritelump-1;
147 end = lastspritelump+1;
149 // scan all the lump names for each of the names, noting the highest
151 // Just compare 4 characters as ints
152 for (i=0 ; i<numsprites ; i++)
154 spritename = namelist[i];
155 memset (sprtemp,-1, sizeof(sprtemp));
158 intname = *(int *)namelist[i];
161 // scan the lumps, filling in the frames for whatever is found
163 for (l=start+1 ; l<end ; l++)
164 if (*(int *)lumpinfo[l].name == intname)
166 frame = lumpinfo[l].name[4] - 'A';
167 rotation = lumpinfo[l].name[5] - '0';
168 R_InstallSpriteLump (l, frame, rotation, false);
169 if (lumpinfo[l].name[6])
171 frame = lumpinfo[l].name[6] - 'A';
172 rotation = lumpinfo[l].name[7] - '0';
173 R_InstallSpriteLump (l, frame, rotation, true);
178 // check the frames that were found for completeness
183 sprites[i].numframes = 0;
186 I_Error ("R_InitSprites: No lumps found for sprite %s"
191 for (frame = 0 ; frame < maxframe ; frame++)
193 switch ((int)sprtemp[frame].rotate)
195 case -1: // no rotations were found for that frame at all
196 I_Error ("R_InitSprites: No patches found for %s frame %c"
197 , namelist[i], frame+'A');
198 case 0: // only the first rotation is needed
201 case 1: // must have all 8 frames
202 for (rotation=0 ; rotation<8 ; rotation++)
203 if (sprtemp[frame].lump[rotation] == -1)
204 I_Error ("R_InitSprites: Sprite %s frame %c is missing rotations"
205 , namelist[i], frame+'A');
210 // allocate space for the frames present and copy sprtemp to it
212 sprites[i].numframes = maxframe;
213 sprites[i].spriteframes =
214 Z_Malloc (maxframe * sizeof(spriteframe_t), PU_STATIC, NULL);
215 memcpy (sprites[i].spriteframes, sprtemp, maxframe*sizeof(spriteframe_t));
222 ===============================================================================
226 ===============================================================================
229 vissprite_t vissprites[MAXVISSPRITES], *vissprite_p;
238 = Called at program start
242 void R_InitSprites (char **namelist)
246 for (i=0 ; i<SCREENWIDTH ; i++)
251 R_InitSpriteDefs (namelist);
260 = Called at frame start
264 void R_ClearSprites (void)
266 vissprite_p = vissprites;
278 vissprite_t overflowsprite;
280 vissprite_t *R_NewVisSprite (void)
282 if (vissprite_p == &vissprites[MAXVISSPRITES])
283 return &overflowsprite;
285 return vissprite_p-1;
294 = Used for sprites and masked mid textures
301 fixed_t sprtopscreen;
302 fixed_t sprbotscreen;
304 void R_DrawMaskedColumn (column_t *column, signed int baseclip)
306 int topscreen, bottomscreen;
307 fixed_t basetexturemid;
309 basetexturemid = dc_texturemid;
311 for ( ; column->topdelta != 0xff ; )
313 // calculate unclipped screen coordinates for post
314 topscreen = sprtopscreen + spryscale*column->topdelta;
315 bottomscreen = topscreen + spryscale*column->length;
316 dc_yl = (topscreen+FRACUNIT-1)>>FRACBITS;
317 dc_yh = (bottomscreen-1)>>FRACBITS;
319 if (dc_yh >= mfloorclip[dc_x])
320 dc_yh = mfloorclip[dc_x]-1;
321 if (dc_yl <= mceilingclip[dc_x])
322 dc_yl = mceilingclip[dc_x]+1;
324 if(dc_yh >= baseclip && baseclip != -1)
329 dc_source = (byte *)column + 3;
330 dc_texturemid = basetexturemid - (column->topdelta<<FRACBITS);
331 // dc_source = (byte *)column + 3 - column->topdelta;
332 colfunc (); // either R_DrawColumn or R_DrawFuzzColumn
334 column = (column_t *)( (byte *)column + column->length + 4);
337 dc_texturemid = basetexturemid;
346 = mfloorclip and mceilingclip should also be set
350 void R_DrawVisSprite (vissprite_t *vis, int x1, int x2)
359 patch = W_CacheLumpNum(vis->patch+firstspritelump, PU_CACHE);
361 dc_colormap = vis->colormap;
364 // colfunc = fuzzcolfunc; // NULL colormap = shadow draw
366 if(vis->mobjflags&MF_SHADOW)
368 if(vis->mobjflags&MF_TRANSLATION)
370 colfunc = R_DrawTranslatedFuzzColumn;
371 dc_translation = translationtables - 256 +
372 ((vis->mobjflags & MF_TRANSLATION) >> (MF_TRANSSHIFT-8));
375 { // Draw using shadow column function
376 colfunc = fuzzcolfunc;
379 else if(vis->mobjflags&MF_TRANSLATION)
381 // Draw using translated column function
382 colfunc = R_DrawTranslatedColumn;
383 dc_translation = translationtables - 256 +
384 ( (vis->mobjflags & MF_TRANSLATION) >> (MF_TRANSSHIFT-8) );
387 dc_iscale = abs(vis->xiscale)>>detailshift;
388 dc_texturemid = vis->texturemid;
389 frac = vis->startfrac;
390 spryscale = vis->scale;
392 sprtopscreen = centeryfrac - FixedMul(dc_texturemid,spryscale);
394 // check to see if weapon is a vissprite
397 dc_texturemid += FixedMul(((centery-viewheight/2)<<FRACBITS),
399 sprtopscreen += (viewheight/2-centery)<<FRACBITS;
402 if(vis->footclip && !vis->psprite)
404 sprbotscreen = sprtopscreen+FixedMul(patch->height<<FRACBITS,
406 baseclip = (sprbotscreen-FixedMul(vis->footclip<<FRACBITS,
407 spryscale))>>FRACBITS;
414 for (dc_x=vis->x1 ; dc_x<=vis->x2 ; dc_x++, frac += vis->xiscale)
416 texturecolumn = frac>>FRACBITS;
418 if (texturecolumn < 0 || texturecolumn >= SHORT(patch->width))
419 I_Error ("R_DrawSpriteRange: bad texturecolumn");
421 column = (column_t *) ((byte *)patch +
422 LONG(patch->columnofs[texturecolumn]));
423 R_DrawMaskedColumn (column, baseclip);
426 colfunc = basecolfunc;
436 = Generates a vissprite for a thing if it might be visible
441 void R_ProjectSprite (mobj_t *thing)
449 spriteframe_t *sprframe;
462 float sinrv, cosrv, thangle; // rv = real value
465 if(thing->flags2&MF2_DONTDRAW)
466 { // Never make a vissprite when MF2_DONTDRAW is flagged.
471 // transform the origin point
473 trx = thing->x - viewx;
474 try = thing->y - viewy;
476 gxt = FixedMul(trx,viewcos);
477 gyt = -FixedMul(try,viewsin);
482 tz = -tz; // Make it positive. The clipper will handle backside.
487 return; // thing is behind view plane
489 xscale = FixedDiv(projection, tz);
491 gxt = -FixedMul(trx,viewsin);
492 gyt = FixedMul(try,viewcos);
497 return; // too far off the side
501 // decide which patch to use for sprite reletive to player
504 if ((unsigned)thing->sprite >= numsprites)
505 I_Error ("R_ProjectSprite: invalid sprite number %i ",thing->sprite);
507 sprdef = &sprites[thing->sprite];
509 if ( (thing->frame&FF_FRAMEMASK) >= sprdef->numframes )
510 I_Error ("R_ProjectSprite: invalid sprite frame %i : %i "
511 ,thing->sprite, thing->frame);
513 sprframe = &sprdef->spriteframes[ thing->frame & FF_FRAMEMASK];
515 if (sprframe->rotate)
516 { // choose a different rotation based on player view
517 ang = R_PointToAngle (thing->x, thing->y);
518 rot = (ang-thing->angle+(unsigned)(ANG45/2)*9)>>29;
519 lump = sprframe->lump[rot];
520 flip = (boolean)sprframe->flip[rot];
523 { // use single rotation for all views
524 lump = sprframe->lump[0];
525 flip = (boolean)sprframe->flip[0];
529 // calculate edges of the shape
532 v1[VX] = FIX2FLT(thing->x);
533 v1[VY] = FIX2FLT(thing->y);
534 //thangle = BANG2RAD(bamsAtan2((v1[VY]-FIX2FLT(viewy))*10,
535 //(v1[VX]-FIX2FLT(viewx))*10)) - PI/2;
536 thangle = BANG2RAD(bamsAtan2(FIX2FLT(try)*10, FIX2FLT(trx)*10)) - PI/2;
537 sinrv = sin(thangle);
538 cosrv = cos(thangle);
539 v1[VX] -= cosrv*(spriteoffset[lump]>>FRACBITS);
540 v1[VY] -= sinrv*(spriteoffset[lump]>>FRACBITS);
541 v2[VX] = v1[VX] + cosrv*(spritewidth[lump]>>FRACBITS);
542 v2[VY] = v1[VY] + sinrv*(spritewidth[lump]>>FRACBITS);
544 // Check for visibility.
545 if(!C_CheckViewRelSeg(v1[VX], v1[VY], v2[VX], v2[VY]))
546 //if(!C_IsAngleVisible(RAD2BANG(thangle+PI/2)))
547 return; // Isn't visible.
549 tx -= spriteoffset[lump];
550 x1 = (centerxfrac + FixedMul (tx,xscale) ) >>FRACBITS;
552 return; // off the right side
553 tx += spritewidth[lump];
554 x2 = ((centerxfrac + FixedMul (tx,xscale) ) >>FRACBITS) - 1;
556 return; // off the left side
560 // store information in a vissprite
562 vis = R_NewVisSprite ();
563 vis->mobjflags = thing->flags;
564 vis->psprite = false;
565 vis->scale = xscale<<detailshift;
569 vis->gzt = thing->z + spritetopoffset[lump];
572 vis->secfloor = FIX2FLT(thing->subsector->sector->floorheight);
573 vis->secceil = FIX2FLT(thing->subsector->sector->ceilingheight);
577 if(thing->flags2&MF2_FEETARECLIPPED
578 && thing->z <= thing->subsector->sector->floorheight)
582 else vis->footclip = 0;
583 vis->texturemid = vis->gzt - viewz - (vis->footclip<<FRACBITS);
586 // The start and end vertices.
587 vis->v1[VX] = v1[VX];
588 vis->v1[VY] = v1[VY];
589 vis->v2[VX] = v2[VX];
590 vis->v2[VY] = v2[VY];
593 vis->x1 = x1 < 0 ? 0 : x1;
594 vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
595 iscale = FixedDiv (FRACUNIT, xscale);
598 vis->startfrac = spritewidth[lump]-1;
599 vis->xiscale = -iscale;
604 vis->xiscale = iscale;
607 vis->startfrac += vis->xiscale*(vis->x1-x1);
613 // if (thing->flags & MF_SHADOW)
614 // vis->colormap = NULL; // shadow draw
618 if( thing->frame & FF_FULLBRIGHT )
620 vis->lightlevel = -1;
623 { // diminished light
624 vis->lightlevel = thing->subsector->sector->lightlevel;
628 vis->colormap = fixedcolormap; // fixed map
629 else if (thing->frame & FF_FULLBRIGHT)
630 vis->colormap = colormaps; // full bright
632 { // diminished light
633 index = xscale>>(LIGHTSCALESHIFT-detailshift);
634 if (index >= MAXLIGHTSCALE)
635 index = MAXLIGHTSCALE-1;
636 vis->colormap = spritelights[index];
645 ========================
649 ========================
652 void R_AddSprites (sector_t *sec)
657 if (sec->validcount == validcount)
658 return; // already added
660 sec->validcount = validcount;
662 lightnum = (sec->lightlevel >> LIGHTSEGSHIFT)+extralight;
664 spritelights = scalelight[0];
665 else if (lightnum >= LIGHTLEVELS)
666 spritelights = scalelight[LIGHTLEVELS-1];
668 spritelights = scalelight[lightnum];
671 for (thing = sec->thinglist ; thing ; thing = thing->snext)
672 R_ProjectSprite (thing);
677 ========================
681 ========================
684 int PSpriteSY[NUMWEAPONS] =
687 5*FRACUNIT, // goldwand
688 15*FRACUNIT, // crossbow
689 15*FRACUNIT, // blaster
690 15*FRACUNIT, // skullrod
691 15*FRACUNIT, // phoenix rod
693 15*FRACUNIT, // gauntlets
697 void R_DrawPSprite (pspdef_t *psp)
705 spriteframe_t *sprframe;
712 vissprite_t *vis, avis;
718 // decide which patch to use
721 if ( (unsigned)psp->state->sprite >= numsprites)
722 I_Error ("R_ProjectSprite: invalid sprite number %i "
723 , psp->state->sprite);
725 sprdef = &sprites[psp->state->sprite];
727 if ( (psp->state->frame & FF_FRAMEMASK) >= sprdef->numframes)
728 I_Error ("R_ProjectSprite: invalid sprite frame %i : %i "
729 , psp->state->sprite, psp->state->frame);
731 sprframe = &sprdef->spriteframes[ psp->state->frame & FF_FRAMEMASK ];
733 lump = sprframe->lump[0];
734 flip = (boolean)sprframe->flip[0];
737 // calculate edges of the shape
739 tx = psp->sx-160*FRACUNIT;
741 tx -= spriteoffset[lump];
744 tempangle = ((centerxfrac/1024)*(viewangleoffset>>ANGLETOFINESHIFT));
750 x1 = (centerxfrac + FixedMul (tx,pspritescale)+tempangle ) >>FRACBITS;
752 // Set the OpenGL color & alpha.
755 //vis->colormap = spritelights[MAXLIGHTSCALE-1];
756 if(viewplayer->powers[pw_invulnerability] > 4*32)
758 if(viewplayer->mo->flags2&MF2_DONTDRAW)
759 { // don't draw the psprite
760 //vis->mobjflags |= MF_SHADOW;
763 else if(viewplayer->mo->flags&MF_SHADOW)
765 //vis->mobjflags |= MF_ALTSHADOW;
769 else if(viewplayer->powers[pw_invulnerability]&8)
771 //vis->mobjflags |= MF_SHADOW;
777 //vis->colormap = fixedcolormap;
780 else if(psp->state->frame & FF_FULLBRIGHT)
783 //vis->colormap = colormaps;
789 //vis->colormap = spritelights[MAXLIGHTSCALE-1];
790 light = viewplayer->mo->subsector->sector->lightlevel / 255.0;
793 // do some OpenGL rendering, oh yeah
795 y = -(spritetopoffset[lump]>>FRACBITS)+(psp->sy>>FRACBITS);
796 if(viewheight == SCREENHEIGHT)
798 y += PSpriteSY[players[consoleplayer].readyweapon]
804 light += .1f; // Add some extra light.
805 OGL_SetColorAndAlpha(light, light, light, alpha);
806 OGL_DrawPSprite(x1, y, 1, flip, lump);
811 return; // off the right side
812 tx += spritewidth[lump];
813 x2 = ((centerxfrac + FixedMul (tx, pspritescale)+tempangle ) >>FRACBITS) - 1;
815 return; // off the left side
818 // store information in a vissprite
823 vis->texturemid = (BASEYCENTER<<FRACBITS)+FRACUNIT/2-(psp->sy-spritetopoffset[lump]);
824 if(viewheight == SCREENHEIGHT)
826 vis->texturemid -= PSpriteSY[players[consoleplayer].readyweapon];
828 vis->x1 = x1 < 0 ? 0 : x1;
829 vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2;
830 vis->scale = pspritescale<<detailshift;
833 vis->xiscale = -pspriteiscale;
834 vis->startfrac = spritewidth[lump]-1;
838 vis->xiscale = pspriteiscale;
842 vis->startfrac += vis->xiscale*(vis->x1-x1);
845 if(viewplayer->powers[pw_invisibility] > 4*32 ||
846 viewplayer->powers[pw_invisibility] & 8)
849 vis->colormap = spritelights[MAXLIGHTSCALE-1];
850 vis->mobjflags |= MF_SHADOW;
852 else if(fixedcolormap)
855 vis->colormap = fixedcolormap;
857 else if(psp->state->frame & FF_FULLBRIGHT)
860 vis->colormap = colormaps;
865 vis->colormap = spritelights[MAXLIGHTSCALE-1];
867 R_DrawVisSprite(vis, vis->x1, vis->x2);
872 ========================
874 = R_DrawPlayerSprites
876 ========================
879 void R_DrawPlayerSprites (void)
887 lightnum = (viewplayer->mo->subsector->sector->lightlevel >> LIGHTSEGSHIFT)
890 spritelights = scalelight[0];
891 else if (lightnum >= LIGHTLEVELS)
892 spritelights = scalelight[LIGHTLEVELS-1];
894 spritelights = scalelight[lightnum];
896 // clip to screen bounds
899 mfloorclip = screenheightarray;
900 mceilingclip = negonearray;
904 // add all active psprites
906 for (i=0, psp=viewplayer->psprites ; i<NUMPSPRITES ; i++,psp++)
914 ========================
918 ========================
921 vissprite_t vsprsortedhead;
923 void R_SortVisSprites (void)
926 vissprite_t *ds, *best;
927 vissprite_t unsorted;
930 count = vissprite_p - vissprites;
932 unsorted.next = unsorted.prev = &unsorted;
936 for (ds=vissprites ; ds<vissprite_p ; ds++)
941 vissprites[0].prev = &unsorted;
942 unsorted.next = &vissprites[0];
943 (vissprite_p-1)->next = &unsorted;
944 unsorted.prev = vissprite_p-1;
947 // pull the vissprites out by scale
949 best = 0; // shut up the compiler warning
950 vsprsortedhead.next = vsprsortedhead.prev = &vsprsortedhead;
951 for (i=0 ; i<count ; i++)
954 for (ds=unsorted.next ; ds!= &unsorted ; ds=ds->next)
956 if (ds->scale < bestscale)
958 bestscale = ds->scale;
962 best->next->prev = best->prev;
963 best->prev->next = best->next;
964 best->next = &vsprsortedhead;
965 best->prev = vsprsortedhead.prev;
966 vsprsortedhead.prev->next = best;
967 vsprsortedhead.prev = best;
975 ========================
979 ========================
982 void R_DrawSprite (vissprite_t *spr)
985 short clipbot[SCREENWIDTH], cliptop[SCREENWIDTH];
987 fixed_t scale, lowscale;
990 for (x = spr->x1 ; x<=spr->x2 ; x++)
991 clipbot[x] = cliptop[x] = -2;
994 // scan drawsegs from end to start for obscuring segs
995 // the first drawseg that has a greater scale is the clip seg
997 for (ds=ds_p-1 ; ds >= drawsegs ; ds--)
1000 // determine if the drawseg obscures the sprite
1002 if (ds->x1 > spr->x2 || ds->x2 < spr->x1 ||
1003 (!ds->silhouette && !ds->maskedtexturecol) )
1004 continue; // doesn't cover sprite
1006 r1 = ds->x1 < spr->x1 ? spr->x1 : ds->x1;
1007 r2 = ds->x2 > spr->x2 ? spr->x2 : ds->x2;
1008 if (ds->scale1 > ds->scale2)
1010 lowscale = ds->scale2;
1015 lowscale = ds->scale1;
1019 if (scale < spr->scale || ( lowscale < spr->scale
1020 && !R_PointOnSegSide (spr->gx, spr->gy, ds->curline) ) )
1022 if (ds->maskedtexturecol) // masked mid texture
1023 R_RenderMaskedSegRange (ds, r1, r2);
1024 continue; // seg is behind sprite
1028 // clip this piece of the sprite
1030 silhouette = ds->silhouette;
1031 if (spr->gz >= ds->bsilheight)
1032 silhouette &= ~SIL_BOTTOM;
1033 if (spr->gzt <= ds->tsilheight)
1034 silhouette &= ~SIL_TOP;
1036 if (silhouette == 1)
1038 for (x=r1 ; x<=r2 ; x++)
1039 if (clipbot[x] == -2)
1040 clipbot[x] = ds->sprbottomclip[x];
1042 else if (silhouette == 2)
1044 for (x=r1 ; x<=r2 ; x++)
1045 if (cliptop[x] == -2)
1046 cliptop[x] = ds->sprtopclip[x];
1048 else if (silhouette == 3)
1050 for (x=r1 ; x<=r2 ; x++)
1052 if (clipbot[x] == -2)
1053 clipbot[x] = ds->sprbottomclip[x];
1054 if (cliptop[x] == -2)
1055 cliptop[x] = ds->sprtopclip[x];
1062 // all clipping has been performed, so draw the sprite
1065 // check for unclipped columns
1066 for (x = spr->x1 ; x<=spr->x2 ; x++)
1068 if (clipbot[x] == -2)
1069 clipbot[x] = viewheight;
1070 if (cliptop[x] == -2)
1074 mfloorclip = clipbot;
1075 mceilingclip = cliptop;
1076 R_DrawVisSprite (spr, spr->x1, spr->x2);
1082 ========================
1086 ========================
1089 void R_DrawMasked (void)
1093 extern boolean willRenderSprites;
1095 if( willRenderSprites )
1099 if( vissprite_p > vissprites )
1101 // draw all vissprites back to front
1102 glDepthMask(GL_FALSE);
1104 for( spr = vsprsortedhead.next; spr != &vsprsortedhead;
1107 //R_DrawSprite (spr);
1108 R_RenderSprite(spr);
1111 glDepthMask(GL_TRUE);
1117 R_SortVisSprites ();
1119 if (vissprite_p > vissprites)
1121 // draw all vissprites back to front
1123 for (spr = vsprsortedhead.next ; spr != &vsprsortedhead
1129 // render any remaining masked mid textures
1131 for (ds=ds_p-1 ; ds >= drawsegs ; ds--)
1132 if (ds->maskedtexturecol)
1133 R_RenderMaskedSegRange (ds, ds->x1, ds->x2);
1136 // draw the psprites on top of everything
1138 // Added for the sideviewing with an external device
1139 if (viewangleoffset <= 1024<<ANGLETOFINESHIFT || viewangleoffset >=
1140 -1024<<ANGLETOFINESHIFT)
1141 { // don't draw on side views
1142 R_DrawPlayerSprites ();
1145 // if (!viewangleoffset) // don't draw on side views
1146 // R_DrawPlayerSprites ();