16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +02:00

reformat: use auto on certain types

This commit is contained in:
jerrrrycho
2026-07-04 04:04:17 +02:00
parent a4c126b4ea
commit f61068ff89
53 changed files with 200 additions and 201 deletions

View File

@@ -125,7 +125,7 @@ void flip_dxt1_image(void *data, int width, int height)
{
int x, y;
struct dxt1_block temp1, temp2;
struct dxt1_block *blocks = (struct dxt1_block *)data;
auto blocks = (struct dxt1_block *)data;
width = (width + 3) / 4;
height = (height + 3) / 4;
@@ -154,7 +154,7 @@ void flip_dxt23_image(void *data, int width, int height)
{
int x, y;
struct dxt23_block temp1, temp2;
struct dxt23_block *blocks = (struct dxt23_block *)data;
auto blocks = (struct dxt23_block *)data;
width = (width + 3) / 4;
height = (height + 3) / 4;
@@ -183,7 +183,7 @@ void flip_dxt45_image(void *data, int width, int height)
{
int x, y;
struct dxt45_block temp1, temp2;
struct dxt45_block *blocks = (struct dxt45_block *)data;
auto blocks = (struct dxt45_block *)data;
width = (width + 3) / 4;
height = (height + 3) / 4;

View File

@@ -120,7 +120,7 @@ opengl33_particles::render() {
if (!m_shader) {
gl::shader vert("smoke.vert");
gl::shader frag("smoke.frag");
gl::program *prog = new gl::program({vert, frag});
auto prog = new gl::program({vert, frag});
m_shader = std::unique_ptr<gl::program>(prog);
}

View File

@@ -549,7 +549,7 @@ std::unique_ptr<gl::program> opengl33_renderer::make_shader(std::string v, std::
{
gl::shader vert(v);
gl::shader frag(f);
gl::program *prog = new gl::program({vert, frag});
auto prog = new gl::program({vert, frag});
return std::unique_ptr<gl::program>(prog);
}
@@ -2145,7 +2145,7 @@ std::shared_ptr<gl::program> opengl33_renderer::Fetch_Shader(const std::string &
if (it == m_shaders.end())
{
gl::shader fragment("mat_" + name + ".frag");
gl::program *program = new gl::program({fragment, *m_vertex_shader.get()});
auto program = new gl::program({fragment, *m_vertex_shader.get()});
m_shaders.insert({name, std::shared_ptr<gl::program>(program)});
}
@@ -5314,7 +5314,7 @@ bool opengl33_renderer::Init_caps()
WriteLog("Supported extensions:");
for (int i = 0; i < extCount; i++)
{
const char *ext = (const char *)glGetStringi(GL_EXTENSIONS, i);
auto ext = (const char *)glGetStringi(GL_EXTENSIONS, i);
WriteLog(ext);
}
WriteLog("--------");

View File

@@ -4414,7 +4414,7 @@ opengl_renderer::Init_caps() {
m_isATI = (gl_vendor.find("ATI") != -1);
char* extensions = (char*)glGetString( GL_EXTENSIONS );
auto extensions = (char*)glGetString( GL_EXTENSIONS );
if (extensions)
WriteLog( "Supported extensions: \n" + std::string(extensions));

View File

@@ -57,7 +57,7 @@ void screenshot_manager::screenshot_save_thread( char *img, int w, int h )
void screenshot_manager::make_screenshot()
{
char *img = new char[Global.fb_size.x * Global.fb_size.y * 4];
auto img = new char[Global.fb_size.x * Global.fb_size.y * 4];
glReadPixels(0, 0, Global.fb_size.x, Global.fb_size.y, Global.gfx_usegles ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, (GLvoid*)img);
//m7t: use pbo