fix: tidy statics, instance, stretch43, fill/find_if ranges, NOLINT externs
This commit is contained in:
@@ -56,18 +56,18 @@ namespace {
|
||||
} // namespace
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
std::unique_ptr<Screen> Screen::instance_;
|
||||
std::unique_ptr<Screen> Screen::instance;
|
||||
|
||||
void Screen::init() {
|
||||
instance_ = std::unique_ptr<Screen>(new Screen());
|
||||
instance = std::unique_ptr<Screen>(new Screen());
|
||||
}
|
||||
|
||||
void Screen::destroy() {
|
||||
instance_.reset();
|
||||
instance.reset();
|
||||
}
|
||||
|
||||
auto Screen::get() -> Screen* {
|
||||
return instance_.get();
|
||||
return instance.get();
|
||||
}
|
||||
|
||||
Screen::Screen() {
|
||||
@@ -178,7 +178,7 @@ void Screen::initShaders() {
|
||||
shader_backend_->setScalingMode(Options::video.scaling_mode);
|
||||
shader_backend_->setVSync(Options::video.vsync);
|
||||
shader_backend_->setTextureFilter(Options::video.texture_filter);
|
||||
shader_backend_->setStretch4_3(Options::video.aspect_ratio_4_3);
|
||||
shader_backend_->setStretch43(Options::video.aspect_ratio_4_3);
|
||||
shader_backend_->setDownscaleAlgo(Options::video.downscale_algo);
|
||||
|
||||
if (Options::video.supersampling) {
|
||||
@@ -346,7 +346,7 @@ auto Screen::toggleSupersampling() -> bool {
|
||||
void Screen::toggleAspectRatio() {
|
||||
Options::video.aspect_ratio_4_3 = !Options::video.aspect_ratio_4_3;
|
||||
if (shader_backend_) {
|
||||
shader_backend_->setStretch4_3(Options::video.aspect_ratio_4_3);
|
||||
shader_backend_->setStretch43(Options::video.aspect_ratio_4_3);
|
||||
} else {
|
||||
applyFallbackPresentation();
|
||||
}
|
||||
@@ -560,7 +560,7 @@ auto Screen::getActiveShaderName() const -> const char* {
|
||||
}
|
||||
|
||||
void Screen::updateRenderInfo() {
|
||||
static const Uint32 start_ticks = SDL_GetTicks();
|
||||
static const Uint32 START_TICKS = SDL_GetTicks();
|
||||
std::string driver = gpu_driver_.empty() ? "sdl" : toLower(gpu_driver_);
|
||||
|
||||
// Segment 0: FPS + driver (sempre visible)
|
||||
@@ -578,7 +578,7 @@ void Screen::updateRenderInfo() {
|
||||
// Segment 3: hora (només si show_time)
|
||||
char time_buf[32] = {0};
|
||||
if (Options::render_info.show_time) {
|
||||
Uint32 elapsed = SDL_GetTicks() - start_ticks;
|
||||
Uint32 elapsed = SDL_GetTicks() - START_TICKS;
|
||||
int minutes = elapsed / 60000;
|
||||
int seconds = (elapsed / 1000) % 60;
|
||||
int centis = (elapsed / 10) % 100;
|
||||
|
||||
Reference in New Issue
Block a user