-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[examples] models_decals : Fixed unload crash, refactored flow, added buttons
#5306
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
Merged
Conversation
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
| return position; | ||
| } | ||
|
|
||
| static Mesh GenMeshDecal(Model inputModel, Matrix projection, float decalSize, float decalOffset) |
Check notice
Code scanning / CodeQL
Large object passed by value Note
This parameter of type is 120 bytes - consider passing a const pointer/reference instead.
Model
Error loading related location
Loading
Comment on lines
+481
to
+551
| switch (total) | ||
| { | ||
| case 0: | ||
| { | ||
| // The entire face lies inside of the plane, no clipping needed | ||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){inMesh->vertices[i], inMesh->vertices[i+1], inMesh->vertices[i+2]}); | ||
| } break; | ||
| case 1: | ||
| { | ||
| // One vertex lies outside of the plane, perform clipping | ||
| if (v1Out) | ||
| { | ||
| nV1 = inMesh->vertices[i + 1]; | ||
| nV2 = inMesh->vertices[i + 2]; | ||
| nV3 = ClipSegment(inMesh->vertices[i], nV1, planes[face], s); | ||
| nV4 = ClipSegment(inMesh->vertices[i], nV2, planes[face], s); | ||
| } | ||
|
|
||
| if (v2Out) | ||
| { | ||
| nV1 = inMesh->vertices[i]; | ||
| nV2 = inMesh->vertices[i + 2]; | ||
| nV3 = ClipSegment(inMesh->vertices[i + 1], nV1, planes[face], s); | ||
| nV4 = ClipSegment(inMesh->vertices[i + 1], nV2, planes[face], s); | ||
|
|
||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){nV3, nV2, nV1}); | ||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){nV2, nV3, nV4}); | ||
| break; | ||
| } | ||
|
|
||
| if (v3Out) | ||
| { | ||
| nV1 = inMesh->vertices[i]; | ||
| nV2 = inMesh->vertices[i + 1]; | ||
| nV3 = ClipSegment(inMesh->vertices[i + 2], nV1, planes[face], s); | ||
| nV4 = ClipSegment(inMesh->vertices[i + 2], nV2, planes[face], s); | ||
| } | ||
|
|
||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){nV1, nV2, nV3}); | ||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){nV4, nV3, nV2}); | ||
| } break; | ||
| case 2: | ||
| { | ||
| // Two vertices lies outside of the plane, perform clipping | ||
| if (!v1Out) | ||
| { | ||
| nV1 = inMesh->vertices[i]; | ||
| nV2 = ClipSegment(nV1, inMesh->vertices[i + 1], planes[face], s); | ||
| nV3 = ClipSegment(nV1, inMesh->vertices[i + 2], planes[face], s); | ||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){nV1, nV2, nV3}); | ||
| } | ||
|
|
||
| if (!v2Out) | ||
| { | ||
| nV1 = inMesh->vertices[i + 1]; | ||
| nV2 = ClipSegment(nV1, inMesh->vertices[i + 2], planes[face], s); | ||
| nV3 = ClipSegment(nV1, inMesh->vertices[i], planes[face], s); | ||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){nV1, nV2, nV3}); | ||
| } | ||
|
|
||
| if (!v3Out) | ||
| { | ||
| nV1 = inMesh->vertices[i + 2]; | ||
| nV2 = ClipSegment(nV1, inMesh->vertices[i], planes[face], s); | ||
| nV3 = ClipSegment(nV1, inMesh->vertices[i + 1], planes[face], s); | ||
| AddTriangleToMeshBuilder(outMesh, (Vector3[3]){nV1, nV2, nV3}); | ||
| } | ||
| } break; | ||
| case 3: // The entire face lies outside of the plane, so let's discard the corresponding vertices | ||
| default: break; | ||
| } |
Check notice
Code scanning / CodeQL
Long switch case Note
Switch has at least one case that is too long: .
1 (33 lines)
Error loading related location
Loading
Owner
|
@themushroompirates thanks for the review, I'm reviewing formating myself... |
raysan5
added a commit
that referenced
this pull request
Oct 26, 2025
examples_model_decals : Fixed unload crash, refactored flow, added buttonsmodels_decals : Fixed unload crash, refactored flow, added buttons
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.