-
Notifications
You must be signed in to change notification settings - Fork 104
resolve mesh face_count discrepancy with server (#853 #1901) #5413
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
Open
AndrewMeadows
wants to merge
7
commits into
develop
Choose a base branch
from
leviathan/ghi-1901
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+411
−449
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6623579
resolve mesh face_count discrepancy with server (#853 #1901)
AndrewMeadows 83dbf06
fix LLPrimTextureList stubbery for tests
AndrewMeadows ef0005c
fix bad comparison of U8 to negative number
AndrewMeadows bdb468c
restore getExpectedNumTEs()
AndrewMeadows ed147f2
fix comment
AndrewMeadows 253d5a1
fix unit test
AndrewMeadows 9b30663
remove cruft, add comments and assserts
AndrewMeadows File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -609,7 +609,7 @@ LLProfile::Face* LLProfile::addHole(const LLProfileParams& params, bool flat, F3 | |||||||||||||||||||||||||
| mProfile[i] = pt[j--]; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| for (S32 i=0;i<(S32)mFaces.size();i++) | ||||||||||||||||||||||||||
| for (U8 i=0;i<mFaces.size();i++) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| if (mFaces[i].mCap) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
|
|
@@ -752,7 +752,6 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai | |||||||||||||||||||||||||
| mFaces.resize(0); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| // Generate the face data | ||||||||||||||||||||||||||
| S32 i; | ||||||||||||||||||||||||||
| F32 begin = params.getBegin(); | ||||||||||||||||||||||||||
| F32 end = params.getEnd(); | ||||||||||||||||||||||||||
| F32 hollow = params.getHollow(); | ||||||||||||||||||||||||||
|
|
@@ -776,14 +775,14 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai | |||||||||||||||||||||||||
| addCap (LL_FACE_PATH_BEGIN); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| for (i = llfloor(begin * 4.f); i < llfloor(end * 4.f + .999f); i++) | ||||||||||||||||||||||||||
| for (S32 i = llfloor(begin * 4.f); i < llfloor(end * 4.f + .999f); i++) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| addFace((face_num++) * (split +1), split+2, 1, LL_FACE_OUTER_SIDE_0 << i, true); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| LLVector4a scale(1,1,4,1); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| for (i = 0; i <(S32) mProfile.size(); i++) | ||||||||||||||||||||||||||
| for (S32 i = 0; i <(S32) mProfile.size(); i++) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| // Scale by 4 to generate proper tex coords. | ||||||||||||||||||||||||||
| mProfile[i].mul(scale); | ||||||||||||||||||||||||||
|
|
@@ -821,7 +820,7 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai | |||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| genNGon(params, 3,0, 0, 1, split); | ||||||||||||||||||||||||||
| LLVector4a scale(1,1,3,1); | ||||||||||||||||||||||||||
| for (i = 0; i <(S32) mProfile.size(); i++) | ||||||||||||||||||||||||||
| for (S32 i = 0; i <(S32) mProfile.size(); i++) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| // Scale by 3 to generate proper tex coords. | ||||||||||||||||||||||||||
| mProfile[i].mul(scale); | ||||||||||||||||||||||||||
|
|
@@ -833,7 +832,7 @@ bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detai | |||||||||||||||||||||||||
| addCap(LL_FACE_PATH_BEGIN); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| for (i = llfloor(begin * 3.f); i < llfloor(end * 3.f + .999f); i++) | ||||||||||||||||||||||||||
| for (S32 i = llfloor(begin * 3.f); i < llfloor(end * 3.f + .999f); i++) | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| addFace((face_num++) * (split +1), split+2, 1, LL_FACE_OUTER_SIDE_0 << i, true); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
@@ -2769,9 +2768,9 @@ bool LLVolume::cacheOptimize(bool gen_tangents) | |||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| S32 LLVolume::getNumFaces() const | ||||||||||||||||||||||||||
| U8 LLVolume::getNumFaces() const | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| return mIsMeshAssetLoaded ? getNumVolumeFaces() : (S32)mProfilep->mFaces.size(); | ||||||||||||||||||||||||||
| return mIsMeshAssetLoaded ? getNumVolumeFaces() : static_cast<U8>(mProfilep->mFaces.size()); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| return mIsMeshAssetLoaded ? getNumVolumeFaces() : static_cast<U8>(mProfilep->mFaces.size()); | |
| // Clamp face count to maximum value representable by U8 to avoid truncation. | |
| U32 num_faces = mIsMeshAssetLoaded | |
| ? static_cast<U32>(getNumVolumeFaces()) | |
| : static_cast<U32>(mProfilep->mFaces.size()); | |
| if (num_faces > 255u) | |
| { | |
| num_faces = 255u; | |
| } | |
| return static_cast<U8>(num_faces); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm changing almost all of the "face count" variables to use
U8instead of a mix of types (S32,U32,size_t). There are a few places I didn't change because in context the logic was expecting invalid values (-1).