| This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/566/ |
|
Review request for Viewer.
By Vaalith Jinn.
Description
Bugs:
STORM-64
Diffs
|
| This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/566/ |
A couple of things to look at, but overall very very nice looking code.
| indra/newview/lllocalbitmaps.h (Diff revision 1) | |||
|---|---|---|---|
class LLLocalBitmap |
|||
| 42 | bool updateSelf(bool first_update = false); |
||
Minor point ... it would be clearer to have the parameter be an enum whose values were first_use and texture_updated or something. Just because something only has two values doesn't make it a 'bool'.
| indra/newview/lllocalbitmaps.cpp (Diff revision 1) | |||
|---|---|---|---|
bool LLLocalBitmap::updateSelf(bool first_update) |
|||
| 230 | mLinkStatus = LS_BROKEN; |
||
Would an LL_WARN be appropriate here?
| indra/newview/lllocalbitmaps.cpp (Diff revision 1) | |||
|---|---|---|---|
bool LLLocalBitmap::updateSelf(bool first_update) |
|||
| 250 | switch (mExtension) |
||
| 251 | { |
||
| 252 | case ET_IMG_BMP: |
||
| 253 | { |
||
| 254 | LLPointer<LLImageBMP> bmp_image = new LLImageBMP; |
||
| 255 | if (bmp_image->load(mFilename) && bmp_image->decode(rawimg, 0.0f)) |
||
| 256 | { |
||
| 257 | rawimg->biasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT); |
||
| 258 | decode_successful = true; |
||
| 259 | break; |
||
| 260 | } |
||
| 261 | } |
||
The cases in this switch all fall through if something unexpected happens... and there's no code to handle the unexpected. If falling through is intentional, there should be a comment saying so, and if not the break should follow the end of the (missing) else block.
| indra/newview/lllocalbitmaps.cpp (Diff revision 1) | |||
|---|---|---|---|
bool LLLocalBitmap::updateSelf(bool first_update) |
|||
| 368 | for(; objlist_iter != obj_list.end(); objlist_iter++) |
||
you could shorten this loop by adding ' && add_object ' to the termination condition
| indra/newview/lllocalbitmaps.cpp (Diff revision 1) | |||
|---|---|---|---|
bool LLLocalBitmap::updateSelf(bool first_update) |
|||
| 395 | std::vector<LLViewerObject*>::iterator object_iterator = objectlist.begin(); |
||
clearer to put the assignment in the first clause of the for loop
| indra/newview/lllocalbitmaps.cpp (Diff revision 1) | |||
|---|---|---|---|
bool LLLocalBitmap::updateSelf(bool first_update) |
|||
| 493 | switch(type) |
||
I'd prefer a single 'return result;' at the bottom, replacing all those scattered ones with 'break;' because it's easier to set breakpoints on.
- Oz
On March 23rd, 2012, 9:01 a.m., Vaalith Jinn wrote:
|
Review request for Viewer.
By Vaalith Jinn.
|
Updated March 23, 2012, 9:01 a.m. |
| This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/566/ |
|
Review request for Viewer, Callum Linden and Richard Nelson.
By Vaalith Jinn.
Updated March 28, 2012, 9:59 a.m. |
| This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/566/ |
|
Review request for Viewer, Callum Linden and Richard Nelson.
By Vaalith Jinn.
|
Updated March 29, 2012, 5:12 a.m. Changes
|
Description
Bugs:
STORM-64
|
Diffs (updated) |
| This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/566/ |
| indra/newview/lllocalbitmaps.h (Diff revision 1) | |||
|---|---|---|---|
class LLLocalBitmap |
|||
| 42 | bool updateSelf(bool first_update = false); |
||
For clarity's sake i kept private enums block below where it's currently at. If i were to add an enum value in here i'd have to either move the whole block up to keep consistency or break consistency and write in a single enum below the main public block.. Neither is a really pretty solution as far as readability is concerned. Is it really worth it?
- Vaalith
On March 29th, 2012, 5:12 a.m., Vaalith Jinn wrote:
|
Review request for Viewer, Callum Linden and Richard Nelson.
By Vaalith Jinn.
Updated March 29, 2012, 5:12 a.m. |
Description |
Bugs:
STORM-64
Diffs |
| This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/566/ |
| indra/newview/lllocalbitmaps.cpp (Diff revision 2) | |||
|---|---|---|---|
LLVOAvatarDefines::ETextureIndex LLLocalBitmap::getTexIndex( |
|||
| 554 | |||
Need 'break;' here.
| indra/newview/lllocalbitmaps.cpp (Diff revision 2) | |||
|---|---|---|---|
LLVOAvatarDefines::ETextureIndex LLLocalBitmap::getTexIndex( |
|||
| 648 | } |
||
Need 'break;' here.
| indra/newview/lllocalbitmaps.cpp (Diff revision 2) | |||
|---|---|---|---|
LLVOAvatarDefines::ETextureIndex LLLocalBitmap::getTexIndex( |
|||
| 697 | } |
||
Need 'break;' here.
| indra/newview/lllocalbitmaps.cpp (Diff revision 2) | |||
|---|---|---|---|
LLVOAvatarDefines::ETextureIndex LLLocalBitmap::getTexIndex( |
|||
| 721 | } |
||
log the fact that it's an unknown wearable type here?
- Oz
On March 29th, 2012, 5:12 a.m., Vaalith Jinn wrote:
|
Review request for Viewer, Callum Linden and Richard Nelson.
By Vaalith Jinn.
Updated March 29, 2012, 5:12 a.m. |
Description |
Bugs:
STORM-64
Diffs |
| This is an automatically generated e-mail. To reply, visit: http://codereview.secondlife.com/r/566/ |
|
Review request for Viewer, Callum Linden and Richard Nelson.
By Vaalith Jinn.
|
Updated March 30, 2012, 4:06 p.m. Changes
|