- afegides les habitacions de tot el joc (buides)
- minimapa mostra els numeros d'habitacio - tecla per a fer captures de pantalla
This commit is contained in:
@@ -221,6 +221,40 @@ void Screen::setBorderColor(Uint8 color) {
|
||||
border_argb_color_ = border_pixel_buffer_[0];
|
||||
}
|
||||
|
||||
// Captura el contenido actual (borde + juego si el borde está activo, solo juego si no)
|
||||
void Screen::captureComposite(std::vector<Uint32>& buffer, int& out_width, int& out_height) const {
|
||||
const int GAME_W = static_cast<int>(game_surface_->getWidth());
|
||||
const int GAME_H = static_cast<int>(game_surface_->getHeight());
|
||||
|
||||
if (Options::video.border.enabled) {
|
||||
const int BORDER_W = static_cast<int>(border_surface_->getWidth());
|
||||
const int BORDER_H = static_cast<int>(border_surface_->getHeight());
|
||||
const int OFF_X = Options::video.border.width;
|
||||
const int OFF_Y = Options::video.border.height;
|
||||
|
||||
buffer.resize(static_cast<size_t>(BORDER_W) * BORDER_H);
|
||||
border_surface_->toARGBBuffer(buffer.data());
|
||||
|
||||
std::vector<Uint32> game_buf(static_cast<size_t>(GAME_W) * GAME_H);
|
||||
game_surface_->toARGBBuffer(game_buf.data());
|
||||
|
||||
for (int y = 0; y < GAME_H; ++y) {
|
||||
std::memcpy(
|
||||
&buffer[(static_cast<size_t>(OFF_Y + y) * BORDER_W) + OFF_X],
|
||||
&game_buf[static_cast<size_t>(y) * GAME_W],
|
||||
static_cast<size_t>(GAME_W) * sizeof(Uint32));
|
||||
}
|
||||
|
||||
out_width = BORDER_W;
|
||||
out_height = BORDER_H;
|
||||
} else {
|
||||
buffer.resize(static_cast<size_t>(GAME_W) * GAME_H);
|
||||
game_surface_->toARGBBuffer(buffer.data());
|
||||
out_width = GAME_W;
|
||||
out_height = GAME_H;
|
||||
}
|
||||
}
|
||||
|
||||
// Cambia entre borde visible y no visible
|
||||
void Screen::toggleBorder() {
|
||||
Options::video.border.enabled = !Options::video.border.enabled;
|
||||
|
||||
Reference in New Issue
Block a user