Two possibilities come to my mind,
1st describe the blocked areas with polygons and do a point in polygone test to determine whether the sprite may move to this position.
2nd like in an image manipulation programm create some kind of a mask (layer), where zero bits indicate the position where you can move and ones for the blocked areas. This can be extended to indicated depth see also z-buffer to partially hide a sprite,
EDIT:
if ( mask[ nextY ][ nextX ] == 0 ) {
currX = nextX;
currY = nextY;
}
assuming all variables are int and mask is a 2d int array.