mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Keep -vet happy
This commit is contained in:
Vendored
+3
-3
@@ -146,7 +146,7 @@ Init :: proc(using ctx: ^FontContext, w, h: int, loc: QuadLocation) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Destroy :: proc(using ctx: ^FontContext) {
|
Destroy :: proc(using ctx: ^FontContext) {
|
||||||
for font in &fonts {
|
for font in fonts {
|
||||||
if font.freeLoadedData {
|
if font.freeLoadedData {
|
||||||
delete(font.loadedData)
|
delete(font.loadedData)
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ Reset :: proc(using ctx: ^FontContext) {
|
|||||||
__dirtyRectReset(ctx)
|
__dirtyRectReset(ctx)
|
||||||
mem.zero_slice(textureData)
|
mem.zero_slice(textureData)
|
||||||
|
|
||||||
for font in &fonts {
|
for &font in fonts {
|
||||||
__lutReset(&font)
|
__lutReset(&font)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,7 +722,7 @@ ResetAtlas :: proc(ctx: ^FontContext, width, height: int, allocator := context.a
|
|||||||
ctx.dirtyRect[3] = 0
|
ctx.dirtyRect[3] = 0
|
||||||
|
|
||||||
// reset fonts
|
// reset fonts
|
||||||
for font in &ctx.fonts {
|
for &font in ctx.fonts {
|
||||||
clear(&font.glyphs)
|
clear(&font.glyphs)
|
||||||
__lutReset(&font)
|
__lutReset(&font)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+4
-4
@@ -255,7 +255,7 @@ __blendFuncSeparate :: proc(ctx: ^Context, blend: ^Blend) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__allocTexture :: proc(ctx: ^Context) -> (tex: ^Texture) {
|
__allocTexture :: proc(ctx: ^Context) -> (tex: ^Texture) {
|
||||||
for texture in &ctx.textures {
|
for &texture in ctx.textures {
|
||||||
if texture.id == 0 {
|
if texture.id == 0 {
|
||||||
tex = &texture
|
tex = &texture
|
||||||
break
|
break
|
||||||
@@ -275,7 +275,7 @@ __allocTexture :: proc(ctx: ^Context) -> (tex: ^Texture) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__findTexture :: proc(ctx: ^Context, id: int) -> ^Texture {
|
__findTexture :: proc(ctx: ^Context, id: int) -> ^Texture {
|
||||||
for texture in &ctx.textures {
|
for &texture in ctx.textures {
|
||||||
if texture.id == id {
|
if texture.id == id {
|
||||||
return &texture
|
return &texture
|
||||||
}
|
}
|
||||||
@@ -285,7 +285,7 @@ __findTexture :: proc(ctx: ^Context, id: int) -> ^Texture {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__deleteTexture :: proc(ctx: ^Context, id: int) -> bool {
|
__deleteTexture :: proc(ctx: ^Context, id: int) -> bool {
|
||||||
for texture, i in &ctx.textures {
|
for &texture, i in ctx.textures {
|
||||||
if texture.id == id {
|
if texture.id == id {
|
||||||
if texture.tex != 0 && (.NO_DELETE not_in texture.flags) {
|
if texture.tex != 0 && (.NO_DELETE not_in texture.flags) {
|
||||||
gl.DeleteTextures(1, &texture.tex)
|
gl.DeleteTextures(1, &texture.tex)
|
||||||
@@ -1302,7 +1302,7 @@ __renderDelete :: proc(uptr: rawptr) {
|
|||||||
gl.DeleteBuffers(1, &ctx.vertBuf)
|
gl.DeleteBuffers(1, &ctx.vertBuf)
|
||||||
}
|
}
|
||||||
|
|
||||||
for texture in &ctx.textures {
|
for &texture in ctx.textures {
|
||||||
if texture.tex != 0 && (.NO_DELETE not_in texture.flags) {
|
if texture.tex != 0 && (.NO_DELETE not_in texture.flags) {
|
||||||
gl.DeleteTextures(1, &texture.tex)
|
gl.DeleteTextures(1, &texture.tex)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+8
-8
@@ -326,7 +326,7 @@ DeleteInternal :: proc(ctx: ^Context) {
|
|||||||
__deletePathCache(ctx.cache)
|
__deletePathCache(ctx.cache)
|
||||||
fontstash.Destroy(&ctx.fs)
|
fontstash.Destroy(&ctx.fs)
|
||||||
|
|
||||||
for image in &ctx.fontImages {
|
for &image in ctx.fontImages {
|
||||||
if image != 0 {
|
if image != 0 {
|
||||||
DeleteImage(ctx, image)
|
DeleteImage(ctx, image)
|
||||||
}
|
}
|
||||||
@@ -1874,7 +1874,7 @@ __calculateJoins :: proc(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Calculate which joins needs extra vertices to append, and gather vertex count.
|
// Calculate which joins needs extra vertices to append, and gather vertex count.
|
||||||
for path in &cache.paths {
|
for &path in cache.paths {
|
||||||
pts := cache.points[path.first:]
|
pts := cache.points[path.first:]
|
||||||
p0 := &pts[path.count-1]
|
p0 := &pts[path.count-1]
|
||||||
p1 := &pts[0]
|
p1 := &pts[0]
|
||||||
@@ -1968,7 +1968,7 @@ __expandStroke :: proc(
|
|||||||
|
|
||||||
// Calculate max vertex usage.
|
// Calculate max vertex usage.
|
||||||
cverts := 0
|
cverts := 0
|
||||||
for path in &cache.paths {
|
for &path in cache.paths {
|
||||||
loop := path.closed
|
loop := path.closed
|
||||||
|
|
||||||
// TODO check if f32 calculation necessary?
|
// TODO check if f32 calculation necessary?
|
||||||
@@ -2097,7 +2097,7 @@ __expandFill :: proc(
|
|||||||
|
|
||||||
// Calculate max vertex usage.
|
// Calculate max vertex usage.
|
||||||
cverts := 0
|
cverts := 0
|
||||||
for path in &cache.paths {
|
for &path in cache.paths {
|
||||||
cverts += path.count + path.nbevel + 1
|
cverts += path.count + path.nbevel + 1
|
||||||
|
|
||||||
if fringe {
|
if fringe {
|
||||||
@@ -2109,7 +2109,7 @@ __expandFill :: proc(
|
|||||||
verts := __allocTempVerts(ctx, cverts)
|
verts := __allocTempVerts(ctx, cverts)
|
||||||
dst_index: int
|
dst_index: int
|
||||||
|
|
||||||
for path in &cache.paths {
|
for &path in cache.paths {
|
||||||
pts := cache.points[path.first:]
|
pts := cache.points[path.first:]
|
||||||
p0, p1: ^Point
|
p0, p1: ^Point
|
||||||
rw, lw, woff: f32
|
rw, lw, woff: f32
|
||||||
@@ -2542,7 +2542,7 @@ Fill :: proc(ctx: ^Context) {
|
|||||||
ctx.cache.paths[:],
|
ctx.cache.paths[:],
|
||||||
)
|
)
|
||||||
|
|
||||||
for path in &ctx.cache.paths {
|
for &path in ctx.cache.paths {
|
||||||
ctx.fillTriCount += len(path.fill) - 2
|
ctx.fillTriCount += len(path.fill) - 2
|
||||||
ctx.fillTriCount += len(path.stroke) - 2
|
ctx.fillTriCount += len(path.stroke) - 2
|
||||||
ctx.drawCallCount += 2
|
ctx.drawCallCount += 2
|
||||||
@@ -2588,7 +2588,7 @@ Stroke :: proc(ctx: ^Context) {
|
|||||||
ctx.cache.paths[:],
|
ctx.cache.paths[:],
|
||||||
)
|
)
|
||||||
|
|
||||||
for path in &ctx.cache.paths {
|
for &path in ctx.cache.paths {
|
||||||
ctx.strokeTriCount += len(path.stroke) - 2
|
ctx.strokeTriCount += len(path.stroke) - 2
|
||||||
ctx.drawCallCount += 1
|
ctx.drawCallCount += 1
|
||||||
}
|
}
|
||||||
@@ -2597,7 +2597,7 @@ Stroke :: proc(ctx: ^Context) {
|
|||||||
DebugDumpPathCache :: proc(ctx: ^Context) {
|
DebugDumpPathCache :: proc(ctx: ^Context) {
|
||||||
fmt.printf("~~~~~~~~~~~~~Dumping %d cached paths\n", len(ctx.cache.paths))
|
fmt.printf("~~~~~~~~~~~~~Dumping %d cached paths\n", len(ctx.cache.paths))
|
||||||
|
|
||||||
for path, i in &ctx.cache.paths {
|
for &path, i in ctx.cache.paths {
|
||||||
fmt.printf(" - Path %d\n", i)
|
fmt.printf(" - Path %d\n", i)
|
||||||
|
|
||||||
if len(path.fill) != 0 {
|
if len(path.fill) != 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user