Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cochrane committed May 5, 2024
1 parent 6249c0b commit f438a52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions GLLara/GLLModelMesh.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import simd
let numTextures = Int(stream.readUint32())
for i in 0..<numTextures {
let textureName = stream.readPascalString()
stream.readUint32() // UV layer. Ignored; the shader always has the UV layer for the texture hardcoded.
_ = stream.readUint32() // UV layer. Ignored; the shader always has the UV layer for the texture hardcoded.
guard let finalPathComponent = textureName.components(separatedBy: "\\").last else {
throw NSError()
}
Expand Down Expand Up @@ -146,7 +146,7 @@ import simd
let numTextures = Int(scanner.readUint32())
for i in 0..<numTextures {
let textureName = scanner.readPascalString()
scanner.readUint32() // UV layer. Ignored; the shader always has the UV layer for the texture hardcoded.
_ = scanner.readUint32() // UV layer. Ignored; the shader always has the UV layer for the texture hardcoded.
guard let finalPathComponent = textureName.components(separatedBy: "\\").last else {
throw NSError()
}
Expand Down
4 changes: 2 additions & 2 deletions GLLara/HUDTextDrawer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ struct HUDTextDrawer {
let block = occupiedSpace[i]
if block.remainingSpace >= drawnText.width && block.coveredLines >= drawnText.height {
let xBegin = texture.width - block.remainingSpace
drawnText.data.withUnsafeBytes { bytes in
texture.replace(region: MTLRegionMake2D(xBegin, beginLine, drawnText.width, drawnText.height), mipmapLevel: 0, withBytes: bytes, bytesPerRow: drawnText.width * 4)
drawnText.data.withUnsafeBytes { (bytes: UnsafeRawBufferPointer) in
texture.replace(region: MTLRegionMake2D(xBegin, beginLine, drawnText.width, drawnText.height), mipmapLevel: 0, withBytes: bytes.baseAddress!, bytesPerRow: drawnText.width * 4)
}

// Split block if new height isn't that big
Expand Down

0 comments on commit f438a52

Please sign in to comment.