Get rid of warnings CS0618#2800
Open
Daneel53 wants to merge 1 commit into
Open
Conversation
Must replace obsolete AddItems() by AddItemsAsync()
Collaborator
Author
|
These changes need the modified file DaggerfallBillboardBatch.cs that is into PR #2733. |
petchema
reviewed
Jun 14, 2026
| int record = Random.Range(1, 32); | ||
| if (terrainDist > 1 || !MeshReplacement.ImportNatureGameObject(dfBillboardBatch.TextureArchive, record, terrain, x, y)) | ||
| dfBillboardBatch.AddItem(record, pos); | ||
| //dfBillboardBatch.AddItem(record, pos); |
Collaborator
There was a problem hiding this comment.
I'd remove those commented lines, that's what versioning is for
| float maxTerrainHeight = DaggerfallUnity.Instance.TerrainSampler.MaxTerrainHeight; | ||
| float beachLine = DaggerfallUnity.Instance.TerrainSampler.BeachElevation; | ||
|
|
||
| List<DaggerfallBillboardBatch.BasicInfo> basicItems = new List<DaggerfallBillboardBatch.BasicInfo>(); |
Collaborator
There was a problem hiding this comment.
Could be worth it to give that list an initial capacity, to avoid reallocations.
Otherwise, worse case when all nature billboards are present, with tDim = 128, you get log2(tDim * tDim / 4) = 12 reallocations.
tDim * tDim prevents any reallocation, and is probably okay for a temporary list
Suggested change
| List<DaggerfallBillboardBatch.BasicInfo> basicItems = new List<DaggerfallBillboardBatch.BasicInfo>(); | |
| List<DaggerfallBillboardBatch.BasicInfo> basicItems = new List<DaggerfallBillboardBatch.BasicInfo>(tDim * tDim); |
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
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.
Must replace obsolete AddItems() by AddItemsAsync()