mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 00:59:19 +02:00
reformat: set variables to constexpr where possible
This commit is contained in:
@@ -120,11 +120,11 @@ void render_task::run()
|
||||
const int screenWidth = static_cast<int>(PyLong_AsLong(outputWidth));
|
||||
const int screenHeight = static_cast<int>(PyLong_AsLong(outputHeight));
|
||||
|
||||
const bool useRgb = false && !Global.gfx_usegles;
|
||||
constexpr bool useRgb = false && !Global.gfx_usegles;
|
||||
|
||||
const int glFormat = useRgb ? GL_SRGB8 : GL_SRGB8_ALPHA8;
|
||||
const int glComponents = useRgb ? GL_RGB : GL_RGBA;
|
||||
const size_t bytesPerPixel = useRgb ? 3u : 4u;
|
||||
constexpr int glFormat = useRgb ? GL_SRGB8 : GL_SRGB8_ALPHA8;
|
||||
constexpr int glComponents = useRgb ? GL_RGB : GL_RGBA;
|
||||
constexpr size_t bytesPerPixel = useRgb ? 3u : 4u;
|
||||
const size_t expectedBytes = static_cast<size_t>(screenWidth) * static_cast<size_t>(screenHeight) * bytesPerPixel;
|
||||
|
||||
Py_ssize_t pythonBufferBytes = 0;
|
||||
|
||||
@@ -126,7 +126,7 @@ class python_taskqueue
|
||||
|
||||
private:
|
||||
// types
|
||||
static int const WORKERCOUNT{1};
|
||||
static constexpr int WORKERCOUNT{1};
|
||||
using worker_array = std::array<std::jthread, WORKERCOUNT>;
|
||||
using rendertask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
|
||||
using uploadtask_sequence = threading::lockable<std::deque<std::shared_ptr<render_task>>>;
|
||||
|
||||
@@ -288,7 +288,7 @@ int lua::scriptapi_dynobj_putvalues(lua_State *L)
|
||||
auto [str, num1, num2] = get_memcell_values(L, 2);
|
||||
if (!dyn)
|
||||
return 0;
|
||||
const TLocation loc{};
|
||||
constexpr TLocation loc{};
|
||||
if (dyn->Mechanik)
|
||||
dyn->Mechanik->PutCommand(str, num1, num2, loc);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user