for(s = 0 ; s < allocSize; s++) coordVec[s] = false;
coordVec[size * sideWidth + size] = true;
+ /*
for(y = -size; y <= size; y++)
{
for(x = -size; x <= size; x++)
if(Coordinates::Distance(0, 0, x, y) <= size) coordVec[(y+size) * sideWidth + (x+size)] = true;
}
}
+ */
- /*
for(s = size; s >= 1; s--)
{
for(x = baseX - s; x <= baseX + s; x++)
int ty1 = baseY - s;
int ty2 = baseY + s;
- if(Coordinates::Distance(baseX, baseY, tx, ty1) > size) continue;
+ if(Coordinates::Distance(baseX, baseY, tx, ty1) >= size) continue;
if(tx >= 0 && ty1 >= 0 && tx < this->width && ty1 < this->height)
{
int tx2 = baseX + s;
int ty = y;
- if(Coordinates::Distance(baseX, baseY, tx1, ty) > size) continue;
+ if(Coordinates::Distance(baseX, baseY, tx1, ty) >= size) continue;
if(tx1 >= 0 && ty >= 0 && tx1 < this->width && ty < this->height)
}
}
- */
}
bool Field::HaveSight(int bx, int by, int tx, int ty)
framesPerSecond = 0;
frameDeltaTimeLast = frameTimeLast = SDL_GetTicks();
+ SDL_SetRenderDrawBlendMode(this->renderer, SDL_BLENDMODE_NONE);
+
this->rectTitleDst.Set(10, 10, 266, 266);
this->rectTitleSrc.Set(0, 0, 256, 256);
this->rectFpsDst.Set(0, 0, 50, 20);
if(px >= 0 && py >= 0 && px < fieldPtr->GetWidth() && py < fieldPtr->GetHeight())
{
SDL_Rect blitRect = {(px - x) * squareGraphicWidth - sx, (py - y) * squareGraphicHeight - sy, squareGraphicWidth, squareGraphicHeight};
- /*
- SDL_Rect checkRect1 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 2 + 12, 30 + (py - y) * squareGraphicHeight - 2 + 12, 4, 4};
- SDL_Rect checkRect2 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 2, 30 + (py - y) * squareGraphicHeight - 2, 4, 4};
- SDL_Rect checkRect3 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 6 + 12, 30 + (py - y) * squareGraphicHeight - 1, 12, 2};
- SDL_Rect checkRect4 = {GameSurfaceSDL::sideBarWidth + (px - x) * squareGraphicWidth - 1, 30 + (py - y) * squareGraphicHeight - 6 + 12, 2, 12};
- */
+
+ SDL_Rect checkRect1 = {(px - x) * squareGraphicWidth - sx - 2 + 12, 30 + (py - y) * squareGraphicHeight - 2 - sy + 12, 4, 4};
+ SDL_Rect checkRect2 = {(px - x) * squareGraphicWidth - sx - 2, 30 + (py - y) * squareGraphicHeight - 2 - sy , 4, 4};
+ SDL_Rect checkRect3 = {(px - x) * squareGraphicWidth - sx - 6 + 12, 30 + (py - y) * squareGraphicHeight - 1 - sy , 12, 2};
+ SDL_Rect checkRect4 = {(px - x) * squareGraphicWidth - sx - 1, 30 + (py - y) * squareGraphicHeight - 6 + 12 - sy , 2, 12};
if(subJectCreaturePtr->InSight(px, py))
{
SDL_RenderCopy(this->renderer, unknownFieldTexture, &fieldRect, &blitRect);
}
-/*
-
+ /*
if(fieldPtr->GetSightPass(px * 2 + 1, py * 2 + 1))
- SDL_FillRect(windowSurface, &checkRect1, SDL_MapRGBA(windowSurface->format, 255, 255, 255, 255));
+ SDL_SetRenderDrawColor(this->renderer, 255, 255, 255, 255);
else
- SDL_FillRect(windowSurface, &checkRect1, SDL_MapRGBA(windowSurface->format, 255, 0, 0, 255));
+ SDL_SetRenderDrawColor(this->renderer, 255, 0, 0, 255);
+ */
+ SDL_RenderFillRect(this->renderer, &checkRect1);
if(fieldPtr->GetSightPass(px * 2, py * 2))
SDL_FillRect(windowSurface, &checkRect2, SDL_MapRGBA(windowSurface->format, 255, 255, 255, 255));
SDL_FillRect(windowSurface, &checkRect4, SDL_MapRGBA(windowSurface->format, 255, 255, 255, 255));
else
SDL_FillRect(windowSurface, &checkRect4, SDL_MapRGBA(windowSurface->format, 255, 0, 0, 255));
-*/
}
}
}