Skip to content

Commit ed40544

Browse files
committed
Fix incorrect range
1 parent ca7c85a commit ed40544

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/GateEngine/Resources/Geometry/Raw/RawGeometry.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,12 @@ public struct RawGeometry: Codable, Sendable, Equatable, Hashable {
170170
var optimizedIndicies: [UInt16]
171171
switch optimization {
172172
case .dontOptimize:
173-
assert(inVertices.count < UInt16.max, "Exceeded the maximum number of indices (\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
173+
assert(inVertices.count < UInt16.max, "Exceeded the maximum number of indices (\(inVertices.count)\\\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
174174
optimizedIndicies = Array(0 ..< UInt16(inVertices.count))
175175
case .byEquality:
176176
optimizedIndicies = Array(repeating: 0, count: inVertices.count)
177177
for index in 0 ..< inVertices.count {
178-
assert(index < UInt16.max, "Exceeded the maximum number of indices (\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
178+
assert(index <= UInt16.max, "Exceeded the maximum number of indices (\(index)\\\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
179179
let vertex = inVertices[index]
180180
if let similarIndex = inVertices.firstIndex(where: {$0 == vertex}) {
181181
optimizedIndicies[index] = UInt16(similarIndex)
@@ -186,7 +186,7 @@ public struct RawGeometry: Codable, Sendable, Equatable, Hashable {
186186
case .byThreshold(let threshold):
187187
optimizedIndicies = Array(repeating: 0, count: inVertices.count)
188188
for index in 0 ..< inVertices.count {
189-
assert(index < UInt16.max, "Exceeded the maximum number of indices (\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
189+
assert(index <= UInt16.max, "Exceeded the maximum number of indices (\(index)\\\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
190190
let vertex = inVertices[index]
191191
if let similarIndex = inVertices.firstIndex(where: {$0.isSimilar(to: vertex, threshold: threshold)}) {
192192
optimizedIndicies[index] = UInt16(similarIndex)
@@ -197,7 +197,7 @@ public struct RawGeometry: Codable, Sendable, Equatable, Hashable {
197197
case .usingComparator(let comparator):
198198
optimizedIndicies = Array(repeating: 0, count: inVertices.count)
199199
for index in 0 ..< inVertices.count {
200-
assert(index < UInt16.max, "Exceeded the maximum number of indices (\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
200+
assert(index <= UInt16.max, "Exceeded the maximum number of indices (\(index)\\\(UInt16.max)) for a single geometry. This geometry needs to be spilt up.")
201201
let vertex = inVertices[index]
202202
if let similarIndex = inVertices.firstIndex(where: { comparator($0, vertex)}) {
203203
optimizedIndicies[index] = UInt16(similarIndex)

0 commit comments

Comments
 (0)