mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
*small fixes for issues introduced in previous revision (or older, I'm not sure)
This commit is contained in:
@ -706,8 +706,8 @@ void CTerrainRect::showPath(const SDL_Rect * extRect)
|
|||||||
int hvx = (x+arrows->ourImages[pn].bitmap->w)-(pos.x+pos.w),
|
int hvx = (x+arrows->ourImages[pn].bitmap->w)-(pos.x+pos.w),
|
||||||
hvy = (y+arrows->ourImages[pn].bitmap->h)-(pos.y+pos.h);
|
hvy = (y+arrows->ourImages[pn].bitmap->h)-(pos.y+pos.h);
|
||||||
|
|
||||||
SDL_Rect prevClip;
|
SDL_Rect prevClip;
|
||||||
SDL_GetClipRect(screen, &prevClip);
|
SDL_GetClipRect(screen, &prevClip);
|
||||||
SDL_SetClipRect(screen, extRect); //preventing blitting outside of that rect
|
SDL_SetClipRect(screen, extRect); //preventing blitting outside of that rect
|
||||||
|
|
||||||
if(ADVOPT.smoothMove) //version for smooth hero move, with pos shifts
|
if(ADVOPT.smoothMove) //version for smooth hero move, with pos shifts
|
||||||
|
@ -611,7 +611,7 @@ void CSDL_Ext::blitWithRotate3clip(SDL_Surface *src,SDL_Rect * srcRect, SDL_Surf
|
|||||||
dp = (Uint8 *)dst->pixels + (dstRect->y + dstRect->h - 1 - i)*dst->pitch + (dstRect->x+dstRect->w)*dst->format->BytesPerPixel;
|
dp = (Uint8 *)dst->pixels + (dstRect->y + dstRect->h - 1 - i)*dst->pitch + (dstRect->x+dstRect->w)*dst->format->BytesPerPixel;
|
||||||
for(int j=0; j<dstRect->w; j++, sp++)
|
for(int j=0; j<dstRect->w; j++, sp++)
|
||||||
{
|
{
|
||||||
if((dstRect->x+dstRect->w - j-1) >= dst->clip_rect.x && (dstRect->x+dstRect->w - j-1) <= dst->clip_rect.x + dst->clip_rect.w)
|
if((dstRect->x+dstRect->w - j) >= dst->clip_rect.x && (dstRect->x+dstRect->w - j) <= dst->clip_rect.x + dst->clip_rect.w)
|
||||||
{
|
{
|
||||||
const SDL_Color * const color = src->format->palette->colors+(*sp);
|
const SDL_Color * const color = src->format->palette->colors+(*sp);
|
||||||
*(--dp) = color->r;
|
*(--dp) = color->r;
|
||||||
|
@ -513,6 +513,10 @@ SDL_Surface * CMapHandler::terrainRect(int x, int y, int dx, int dy, int level,
|
|||||||
su = CSDL_Ext::newSurface(dx*32, dy*32, CSDL_Ext::std32bppSurface);
|
su = CSDL_Ext::newSurface(dx*32, dy*32, CSDL_Ext::std32bppSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_Rect prevClip;
|
||||||
|
SDL_GetClipRect(su, &prevClip);
|
||||||
|
if(extRect) SDL_SetClipRect(su, extRect); //preventing blitting outside of that rect
|
||||||
|
|
||||||
if (((dx+x)>((map->width+Woff)) || (dy+y)>((map->height+Hoff))) || ((x<-Woff)||(y<-Hoff) ) )
|
if (((dx+x)>((map->width+Woff)) || (dy+y)>((map->height+Hoff))) || ((x<-Woff)||(y<-Hoff) ) )
|
||||||
throw new std::string("terrainRect: out of range");
|
throw new std::string("terrainRect: out of range");
|
||||||
////printing terrain
|
////printing terrain
|
||||||
@ -757,6 +761,7 @@ SDL_Surface * CMapHandler::terrainRect(int x, int y, int dx, int dy, int level,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SDL_SetClipRect(su, &prevClip); //restoring clip_rect
|
||||||
//borders printed
|
//borders printed
|
||||||
return su;
|
return su;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user