Skip to content

Commit

Permalink
[BgfxCallback|GameState] Fixed screenshot extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Oct 29, 2023
1 parent fcb8515 commit 252561c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/client/graphics/BgfxCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void BgfxCallback::screenShot(const char* _filePath, uint32_t _width, uint32_t _
const int32_t len = bx::strLen(_filePath)+5;
char* filePath = (char*)alloca(len);
bx::strCopy(filePath, len, _filePath);
bx::strCat(filePath, len, ".tga");
bx::strCat(filePath, len, ".png");

bx::FileWriter writer;
if (bx::open(&writer, filePath)) {
Expand Down
4 changes: 2 additions & 2 deletions source/client/states/GameState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ void GameState::onEvent(const SDL_Event &event) {
std::time_t now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());

char filename[100];
std::strftime(filename, sizeof(filename), "Screenshot-%Y-%m-%d-%H-%M-%S.png", std::localtime(&now));
std::strftime(filename, sizeof(filename), "Screenshot-%Y-%m-%d-%H-%M-%S", std::localtime(&now));

Window::saveScreenshot(filename);
m_hud.chat().addChatMessage(0, "Screenshot saved: " + std::string(filename));
m_hud.chat().addChatMessage(0, "Screenshot saved: " + std::string(filename) + ".png");
}

for (auto &key : Registry::getInstance().keys()) {
Expand Down

0 comments on commit 252561c

Please sign in to comment.