Skip to content

Commit

Permalink
Run clang-format on recently checked in code
Browse files Browse the repository at this point in the history
  • Loading branch information
kavika13 committed Mar 16, 2024
1 parent 2b5e1c7 commit 880ebbb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Source/Graphics/graphics.cpp
Expand Up @@ -302,7 +302,7 @@ void Graphics::framebufferDepthTexture2D(TextureRef t, int mipmap_level) {
CHECK_GL_ERROR();
}

//#pragma optimize("",off)
// #pragma optimize("",off)
void Graphics::framebufferColorTexture2D(TextureRef t, int mipmap_level) {
/*if(Textures::Instance()->IsCompressed(t)){
Textures::Instance()->Uncompress(t);
Expand All @@ -324,7 +324,7 @@ void Graphics::framebufferColorTexture2D(TextureRef t, int mipmap_level) {
PROFILER_LEAVE(g_profiler_ctx);
CHECK_GL_ERROR();
}
//#pragma optimize("",on)
// #pragma optimize("",on)

void Graphics::genRenderbuffers(GLuint* rb) {
CHECK_GL_ERROR();
Expand Down
2 changes: 1 addition & 1 deletion Source/Graphics/shaders.cpp
Expand Up @@ -741,7 +741,7 @@ void Shaders::GetProgramOvergrowthVersion(int which_program, int &vertex_version
vertex_version_major = vertex_shader.og_version_major;
vertex_version_minor = vertex_shader.og_version_minor;

const Shader& fragment_shader = shaders[programs[which_program].shader_ids[_fragment]];
const Shader &fragment_shader = shaders[programs[which_program].shader_ids[_fragment]];
fragment_version_major = fragment_shader.og_version_major;
fragment_version_minor = fragment_shader.og_version_minor;
}
Expand Down
3 changes: 1 addition & 2 deletions Source/Main/scenegraph.cpp
Expand Up @@ -574,8 +574,7 @@ static void UpdateShaderSuffix(SceneGraph* scenegraph, Object::DrawType object_d

for (int length = strlen(shader_str[0]), i = 0;
i < length && shader_str[0][0] == ' ';
++i, shader_str[0]++)
;
++i, shader_str[0]++);

FormatString(global_shader_suffix_storage, kGlobalShaderSuffixLen, "%s", shader_str[0]);
}
Expand Down
22 changes: 11 additions & 11 deletions Source/Objects/envobject.cpp
Expand Up @@ -263,8 +263,8 @@ static int attrib_ids[kAttribIdCountVboInstancing];
static void SetupAttribPointers(bool shader_changed, bool shader_is_v1_5_or_greater, Model* model, VBORingContainer& env_object_model_translation_instance_vbo, VBORingContainer& env_object_model_scale_instance_vbo, VBORingContainer& env_object_model_rotation_quat_instance_vbo, VBORingContainer& env_object_color_tint_instance_vbo, VBORingContainer& env_object_detail_scale_instance_vbo, Shaders* shaders, int the_shader, Graphics* graphics) {
bool attrib_envobj_instancing = g_attrib_envobj_instancing_support && g_attrib_envobj_instancing_enabled;
int attrib_count = shader_is_v1_5_or_greater
? (attrib_envobj_instancing ? kAttribIdCountVboInstancing : kAttribIdCountUboInstancing)
: kAttribIdCountLegacyShader;
? (attrib_envobj_instancing ? kAttribIdCountVboInstancing : kAttribIdCountUboInstancing)
: kAttribIdCountLegacyShader;
if (shader_changed) {
for (int i = 0; i < attrib_count; ++i) {
const char* attrib_str;
Expand Down Expand Up @@ -732,8 +732,8 @@ void EnvObject::DrawInstances(EnvObject** instance_array, int num_instances, con
bool shader_is_v1_5_or_greater = vertex_version_major >= 1 && vertex_version_minor >= 5 && fragment_version_major >= 1 && fragment_version_minor >= 5;

int kBatchSize = shader_is_v1_5_or_greater
? (256 * (!g_ubo_batch_multiplier_force_1x ? ubo_batch_size_multiplier : 1))
: 100;
? (256 * (!g_ubo_batch_multiplier_force_1x ? ubo_batch_size_multiplier : 1))
: 100;
const bool ignore_multiplier = true;
static VBORingContainer env_object_model_translation_instance_vbo(sizeof(vec3) * kBatchSize * 16, kVBOFloat | kVBOStream, ignore_multiplier);
static VBORingContainer env_object_model_scale_instance_vbo(sizeof(vec3) * kBatchSize * 15, kVBOFloat | kVBOStream, ignore_multiplier);
Expand All @@ -745,7 +745,7 @@ void EnvObject::DrawInstances(EnvObject** instance_array, int num_instances, con
PROFILER_LEAVE(g_profiler_ctx); // Setup

bool attrib_envobj_instancing = shader_is_v1_5_or_greater &&
g_attrib_envobj_instancing_support && g_attrib_envobj_instancing_enabled;
g_attrib_envobj_instancing_support && g_attrib_envobj_instancing_enabled;

int instance_block_index = shaders->GetUBOBindIndex(the_shader, "InstanceInfo");
if (attrib_envobj_instancing || (unsigned)instance_block_index != GL_INVALID_INDEX) {
Expand Down Expand Up @@ -839,18 +839,18 @@ void EnvObject::DrawInstances(EnvObject** instance_array, int num_instances, con
} else {
// For legacy shaders
*model_mat = obj->transform_;
if(plant_component && plant_component->IsActive()){
if(!plant_component->IsPivotCalculated()){
if (plant_component && plant_component->IsActive()) {
if (!plant_component->IsPivotCalculated()) {
plant_component->SetPivot(*scenegraph_->bullet_world_,
obj->sphere_center_, obj->sphere_radius_);
obj->sphere_center_, obj->sphere_radius_);
}
const vec3 &pivot = plant_component->GetPivot();
const vec3& pivot = plant_component->GetPivot();

mat4 base_mat = obj->transform_;
vec3 base_trans = base_mat.GetTranslationPart();
base_mat.SetTranslationPart(base_trans-pivot);
base_mat.SetTranslationPart(base_trans - pivot);
mat4 transform = plant_component->GetTransform(obj->sphere_radius_) * base_mat;
transform.AddTranslation(pivot-base_trans);
transform.AddTranslation(pivot - base_trans);
transform.AddTranslation(base_trans);
*model_mat = transform;
}
Expand Down

0 comments on commit 880ebbb

Please sign in to comment.