From 4c67a717f872a78c284b7c8c1aa1c883024f9d0d Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 9 Jan 2017 14:56:29 +0100 Subject: [PATCH] Remove drawerargs from r_things --- src/swrenderer/scene/r_things.cpp | 5 ++--- src/swrenderer/scene/r_things.h | 2 +- src/swrenderer/things/r_particle.cpp | 6 ++---- src/swrenderer/things/r_sprite.cpp | 2 +- src/swrenderer/things/r_wallsprite.cpp | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/swrenderer/scene/r_things.cpp b/src/swrenderer/scene/r_things.cpp index 4f2da52f3..569e9be10 100644 --- a/src/swrenderer/scene/r_things.cpp +++ b/src/swrenderer/scene/r_things.cpp @@ -77,7 +77,6 @@ CVAR(Bool, r_splitsprites, true, CVAR_ARCHIVE) namespace swrenderer { - using namespace drawerargs; bool DrewAVoxel; @@ -144,7 +143,7 @@ static inline void R_CollectPortals() } } -bool R_ClipSpriteColumnWithPortals(vissprite_t* spr) +bool R_ClipSpriteColumnWithPortals(int x, vissprite_t* spr) { RenderPortal *renderportal = RenderPortal::Instance(); @@ -165,7 +164,7 @@ bool R_ClipSpriteColumnWithPortals(vissprite_t* spr) continue; // now if current column is covered by this drawseg, we clip it away - if ((dc_x >= seg->x1) && (dc_x < seg->x2)) + if ((x >= seg->x1) && (x < seg->x2)) return true; } diff --git a/src/swrenderer/scene/r_things.h b/src/swrenderer/scene/r_things.h index 6db9f3f4e..04685d8bb 100644 --- a/src/swrenderer/scene/r_things.h +++ b/src/swrenderer/scene/r_things.h @@ -38,7 +38,7 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor); namespace swrenderer { -bool R_ClipSpriteColumnWithPortals(vissprite_t* spr); +bool R_ClipSpriteColumnWithPortals(int x, vissprite_t* spr); void R_CacheSprite (spritedef_t *sprite); diff --git a/src/swrenderer/things/r_particle.cpp b/src/swrenderer/things/r_particle.cpp index c6dd2d5df..4daf1d799 100644 --- a/src/swrenderer/things/r_particle.cpp +++ b/src/swrenderer/things/r_particle.cpp @@ -252,8 +252,7 @@ namespace swrenderer { for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx) { - dc_x = x; - if (R_ClipSpriteColumnWithPortals(vis)) + if (R_ClipSpriteColumnWithPortals(x, vis)) continue; uint32_t *dest = ylookup[yl] + x + (uint32_t*)dc_destorg; DrawerCommandQueue::QueueCommand(dest, yl, spacing, ycount, fg, alpha, fracposx); @@ -263,8 +262,7 @@ namespace swrenderer { for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx) { - dc_x = x; - if (R_ClipSpriteColumnWithPortals(vis)) + if (R_ClipSpriteColumnWithPortals(x, vis)) continue; uint8_t *dest = ylookup[yl] + x + dc_destorg; DrawerCommandQueue::QueueCommand(dest, yl, spacing, ycount, fg, alpha, fracposx); diff --git a/src/swrenderer/things/r_sprite.cpp b/src/swrenderer/things/r_sprite.cpp index 0a87d45e4..c998b3575 100644 --- a/src/swrenderer/things/r_sprite.cpp +++ b/src/swrenderer/things/r_sprite.cpp @@ -116,7 +116,7 @@ namespace swrenderer { while (x < x2) { - if (ispsprite || !R_ClipSpriteColumnWithPortals(vis)) + if (ispsprite || !R_ClipSpriteColumnWithPortals(x, vis)) R_DrawMaskedColumn(x, iscale, tex, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, false); x++; frac += xiscale; diff --git a/src/swrenderer/things/r_wallsprite.cpp b/src/swrenderer/things/r_wallsprite.cpp index fe1aabb64..d3ba5fee9 100644 --- a/src/swrenderer/things/r_wallsprite.cpp +++ b/src/swrenderer/things/r_wallsprite.cpp @@ -221,7 +221,7 @@ namespace swrenderer { // calculate lighting R_SetColorMapLight(usecolormap, light, shade); } - if (!R_ClipSpriteColumnWithPortals(spr)) + if (!R_ClipSpriteColumnWithPortals(x, spr)) R_WallSpriteColumn(x, WallSpriteTile, maskedScaleY, sprflipvert, mfloorclip, mceilingclip); light += lightstep; x++;