-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make vacollect a full class #267
Conversation
src/engine/render/vacollect.cpp
Outdated
} | ||
if(x.tex == y.tex) | ||
{ | ||
if(x.orient < y.orient) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we return false if they're both equal, then simply go:
return x.orient < y.orient;
or even:
return x.orient != y.orient && x.orient < y.orient;
This is also applicable elsewhere in this file. It's pretty clear in my opinion, I don't think it obscures the code, yet reduces line count.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, these two options are a good way to inform the reader that the blocks are part of the same logic, by getting rid of the code blocks.
This will not only shorten the file a bit, but will make the code more legible.
src/engine/render/vacollect.cpp
Outdated
{ | ||
return true; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless "else" block
|
||
VARFN(vbosize, maxvbosize, 0, 1<<14, 1<<16, rootworld.allchanged()); | ||
|
||
//vbo (vertex buffer object) enum is local to this file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? is it literally used nowhere else?
Merges VA collection functions with the object containing its relevant data, allowing the
vacollect
object to have full encapsulation of its fields. Moves thevacollect
object into its own file, separating it from other behavior inoctarender.cpp
.No change in the outward behavior of the vertex array collection part of the code is changed; this is a pure refactor besides the changes to the class interface.