Skip to content

Comments recommendation #10

Description

@web-coder-of-rpi

In Examples/CastleCreator/Source/Editor.cpp, line 37:55 (and many other parts) single-line comments are being used over the more appropriate multi-line comments.

Current:
//Pi3Cmodel Editor::createScene(const uint32_t width, const uint32_t depth, Pi3Cmodel usemodel, const vec3f &grid)
//{
// float hw = width * grid.x * 0.5f;
// float hd = depth * grid.z * 0.5f;
// Pi3Cmodel model;
// //Pi3Cmodel findModel = modelsLib.find(modelname);
// if (!usemodel) return model;
//
// for (uint32_t z = 0; z < depth; z++)
// {
// for (uint32_t x = 0; x < width; x++)
// {
// vec3f position = { x
grid.x-hw, 0, z
grid.z-hd };
// vec3f rotation = { 0, 0, 0 };
// model.append(*usemodel, position, rotation);
// }
// }
// return model;
//}

Fix:
/*
Pi3Cmodel Editor::createScene(const uint32_t width, const uint32_t depth, Pi3Cmodel *usemodel, const vec3f &grid)
{
float hw = width * grid.x * 0.5f;
float hd = depth * grid.z * 0.5f;
Pi3Cmodel model;
//Pi3Cmodel *findModel = modelsLib.find(modelname);
if (!usemodel) return model;

for (uint32_t z = 0; z < depth; z++)
{
	for (uint32_t x = 0; x < width; x++)
	{
		vec3f position = { x*grid.x-hw, 0, z*grid.z-hd };
		vec3f rotation = { 0, 0, 0 };
		model.append(*usemodel, position, rotation);
	}
}
return model;

}
*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions