forked from jaildesigner-jailgames/jaildoctors_dilemma
Eliminado el resto de accesos a vector mediante at()
This commit is contained in:
@@ -469,13 +469,13 @@ void Ending2::placeSprites()
|
||||
{
|
||||
const int x = i % 2 == 0 ? firstCol : secondCol;
|
||||
const int y = (i / 1) * (maxSpriteHeight + distSpriteText + text->getCharacterSize() + distSpriteSprite) + GAMECANVAS_HEIGHT + 40;
|
||||
const int w = sprites.at(i)->getAnimationClip(0, 0).w;
|
||||
const int h = sprites.at(i)->getAnimationClip(0, 0).h;
|
||||
const int w = sprites[i]->getAnimationClip(0, 0).w;
|
||||
const int h = sprites[i]->getAnimationClip(0, 0).h;
|
||||
const int dx = -(w / 2);
|
||||
const int dy = i % 1 == 0 ? maxSpriteHeight - h : (int)(maxSpriteHeight * 1.5f) - h;
|
||||
|
||||
sprites.at(i)->setRect({x + dx, y + dy, w, h});
|
||||
sprites.at(i)->setVelY(despSpeed);
|
||||
sprites[i]->setRect({x + dx, y + dy, w, h});
|
||||
sprites[i]->setVelY(despSpeed);
|
||||
}
|
||||
|
||||
// Recoloca el último sprite, que es el del jugador
|
||||
@@ -497,14 +497,14 @@ void Ending2::createSpriteTexts()
|
||||
for (int i = 0; i < (int)spriteList.size(); ++i)
|
||||
{
|
||||
// Calcula constantes
|
||||
std::string txt = spriteList.at(i);
|
||||
std::string txt = spriteList[i];
|
||||
std::replace(txt.begin(), txt.end(), '_', ' ');
|
||||
txt = txt == "player" ? "JAILDOCTOR" : txt; // Reemplaza el texto
|
||||
const int w = text->lenght(txt, 1);
|
||||
const int h = text->getCharacterSize();
|
||||
const int x = i % 2 == 0 ? firstCol : secondCol;
|
||||
const int dx = -(w / 2);
|
||||
const int y = sprites.at(i)->getPosY() + sprites.at(i)->getHeight() + distSpriteText;
|
||||
const int y = sprites[i]->getPosY() + sprites[i]->getHeight() + distSpriteText;
|
||||
|
||||
// Cambia la posición del último sprite
|
||||
const int X = (i == (int)spriteList.size() - 1) ? GAMECANVAS_CENTER_X - (w / 2) : x + dx;
|
||||
@@ -536,7 +536,7 @@ void Ending2::createTexts()
|
||||
for (int i = 0; i < (int)list.size(); ++i)
|
||||
{
|
||||
// Calcula constantes
|
||||
const int w = text->lenght(list.at(i), 1);
|
||||
const int w = text->lenght(list[i], 1);
|
||||
const int h = text->getCharacterSize();
|
||||
const int x = GAMECANVAS_CENTER_X;
|
||||
const int dx = -(w / 2);
|
||||
@@ -547,7 +547,7 @@ void Ending2::createTexts()
|
||||
texture->createBlank(renderer, w, h, SDL_TEXTUREACCESS_TARGET);
|
||||
texture->setAsRenderTarget(renderer);
|
||||
texture->setBlendMode(SDL_BLENDMODE_BLEND);
|
||||
text->write(0, 0, list.at(i));
|
||||
text->write(0, 0, list[i]);
|
||||
|
||||
// Crea el sprite
|
||||
MovingSprite *sprite = new MovingSprite(x + dx, y, w, h, 0.0f, despSpeed, 0.0f, 0.0f, texture, renderer);
|
||||
@@ -565,7 +565,7 @@ void Ending2::createTexts()
|
||||
for (int i = 0; i < (int)list.size(); ++i)
|
||||
{
|
||||
// Calcula constantes
|
||||
const int w = text->lenght(list.at(i), 1);
|
||||
const int w = text->lenght(list[i], 1);
|
||||
const int h = text->getCharacterSize();
|
||||
const int x = GAMECANVAS_CENTER_X;
|
||||
const int dx = -(w / 2);
|
||||
@@ -576,7 +576,7 @@ void Ending2::createTexts()
|
||||
texture->createBlank(renderer, w, h, SDL_TEXTUREACCESS_TARGET);
|
||||
texture->setAsRenderTarget(renderer);
|
||||
texture->setBlendMode(SDL_BLENDMODE_BLEND);
|
||||
text->write(0, 0, list.at(i));
|
||||
text->write(0, 0, list[i]);
|
||||
|
||||
// Crea el sprite
|
||||
MovingSprite *sprite = new MovingSprite(x + dx, y, w, h, 0.0f, despSpeed, 0.0f, 0.0f, texture, renderer);
|
||||
@@ -624,7 +624,7 @@ void Ending2::updateFinalFade()
|
||||
|
||||
for (auto t : texts)
|
||||
{
|
||||
t->getTexture()->setColor(colors.at(index).r, colors.at(index).g, colors.at(index).b);
|
||||
t->getTexture()->setColor(colors[index].r, colors[index].g, colors[index].b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user