Skip to content

Commit be12fec

Browse files
ice floe animation
1 parent 7aed1d0 commit be12fec

1 file changed

Lines changed: 7 additions & 30 deletions

File tree

CSurface.cpp

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,6 @@ void CSurface::DrawTriangle(SDL_Surface* display, const DisplayRectangle& displa
789789
return;
790790

791791
// for moving water, lava, objects and so on
792-
// This is very tricky: there are ice floes in the winterland and the water under this floes is moving.
793-
// I don't know how this works in original settlers 2 but i solved it this way:
794-
// i texture the triangle with normal water and then draw the floe over it. To Extract the floe
795-
// from it's surrounded water, i use this color keys below. These are the color values for the water texture.
796-
// I wrote a special SGE-Function that uses these color keys and ignores them in the Surf_Tileset.
797-
static std::array<Uint32, 5> colorkeys = {14191, 14195, 13167, 13159, 11119};
798792
static int roundCount = 0;
799793
static Uint32 roundTimeObjects = SDL_GetTicks();
800794
if(SDL_GetTicks() - roundTimeObjects > 30)
@@ -828,30 +822,13 @@ void CSurface::DrawTriangle(SDL_Surface* display, const DisplayRectangle& displa
828822
left.y, right.x, right.y);
829823
else
830824
{
831-
// draw special winterland textures with moving water (ice floe textures)
832-
if(type == MAP_WINTERLAND && (texture == TRIANGLE_TEXTURE_SNOW || texture == TRIANGLE_TEXTURE_SWAMP))
833-
{
834-
sge_TexturedTrigon(display, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, Surf_Tileset, upper2.x, upper2.y,
835-
left2.x, left2.y, right2.x, right2.y);
836-
if(global::s2->getMapObj()->getBitsPerPixel() == 8)
837-
sge_PreCalcFadedTexturedTrigonColorKeys(display, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, Surf_Tileset,
838-
upper.x, upper.y, left.x, left.y, right.x, right.y,
839-
P1.shading << 8, P2.shading << 8, P3.shading << 8,
840-
gouData[type], colorkeys.data(), colorkeys.size());
841-
else
842-
sge_FadedTexturedTrigonColorKeys(display, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, Surf_Tileset, upper.x,
843-
upper.y, left.x, left.y, right.x, right.y, P1.i, P2.i, P3.i,
844-
colorkeys.data(), colorkeys.size());
845-
} else
846-
{
847-
if(global::s2->getMapObj()->getBitsPerPixel() == 8)
848-
sge_PreCalcFadedTexturedTrigon(display, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, Surf_Tileset, upper.x,
849-
upper.y, left.x, left.y, right.x, right.y, P1.shading << 8,
850-
P2.shading << 8, P3.shading << 8, gouData[type]);
851-
else
852-
sge_FadedTexturedTrigon(display, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, Surf_Tileset, upper.x, upper.y,
853-
left.x, left.y, right.x, right.y, P1.i, P2.i, P3.i);
854-
}
825+
if(global::s2->getMapObj()->getBitsPerPixel() == 8)
826+
sge_PreCalcFadedTexturedTrigon(display, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, Surf_Tileset, upper.x,
827+
upper.y, left.x, left.y, right.x, right.y, P1.shading << 8,
828+
P2.shading << 8, P3.shading << 8, gouData[type]);
829+
else
830+
sge_FadedTexturedTrigon(display, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, Surf_Tileset, upper.x, upper.y,
831+
left.x, left.y, right.x, right.y, P1.i, P2.i, P3.i);
855832
}
856833
return;
857834
}

0 commit comments

Comments
 (0)