diff --git a/client/CAdvmapInterface.cpp b/client/CAdvmapInterface.cpp index 16b52e89c..9877c72bd 100644 --- a/client/CAdvmapInterface.cpp +++ b/client/CAdvmapInterface.cpp @@ -459,6 +459,7 @@ CTerrainRect::CTerrainRect() pos.h=ADVOPT.advmapH; moveX = moveY = 0; arrows = CDefHandler::giveDef("ADAG.DEF"); + for(size_t y=0; y < arrows->ourImages.size(); ++y) { CSDL_Ext::alphaTransform(arrows->ourImages[y].bitmap); diff --git a/hch/CDefHandler.cpp b/hch/CDefHandler.cpp index bc88574b6..e5dd48c50 100644 --- a/hch/CDefHandler.cpp +++ b/hch/CDefHandler.cpp @@ -235,21 +235,15 @@ SDL_Surface * CDefHandler::getSprite (int SIndex, const unsigned char * FDef, co if (SegmentType==0xFF) { - for (unsigned int k=0; k(ret->pixels))[ftcp++]=FDef[BaseOffset+k]; - if ((TotalRowLength+k)>=SpriteWidth) - break; - } + memcpy(reinterpret_cast(ret->pixels)+ftcp, FDef + BaseOffset, SegmentLength); BaseOffset+=SegmentLength; - TotalRowLength+=SegmentLength; } else { memset(reinterpret_cast(ret->pixels)+ftcp, SegmentType, SegmentLength); - ftcp += SegmentLength; - TotalRowLength += SegmentLength; } + ftcp += SegmentLength; + TotalRowLength += SegmentLength; }while(TotalRowLength(value, SpriteWidth - TotalRowLength) - std::max(0, -LeftMargin); + amax(len, 0); if(code==7) {