Fixed bug wth vefoncache storage_entry.visible, added building stb_truetype to dep update

This commit is contained in:
Edward R. Gonzalez 2025-01-12 22:03:38 -05:00
parent 9d5ac7b0d2
commit fd424c94bb
5 changed files with 53 additions and 8 deletions

View File

@ -19,6 +19,9 @@ The dependencies are:
* Added #region, #endregion directives support for editors
* I added support for 'monlithic packages' or 'uniform-across-subdirectories packages'. It allows me to organize the main package with sub-directories.
* Added the ability to debug using statements on structs (fields get dumped to the stack as ptr refs)
* Remove implicit assignments for container allocators in the Base and Core packages
* I did not enjoy bug hunting a memory corruption because I mistakenly didn't properly initialize a core container with their designated initiatizer: new, make, or init.
* See fork Readme for which procedures were changed..
* Odin repo's base, core, and vendor(raylib) libaries
* An ini parser
* backtrace (not used yet)

View File

@ -279,6 +279,9 @@ startup :: proc( ctx : ^Context, parser_kind : Parser_Kind = .STB_TrueType, // N
stroage_entry.position, error = make( [dynamic]Vec2, len = 0, cap = shape_cache_params.reserve )
assert( error == .None, "VEFontCache.init : Failed to allocate positions array for shape cache storage" )
stroage_entry.visible, error = make( [dynamic]i32, len = 0, cap = shape_cache_params.reserve )
assert( error == .None, "VEFontCache.init : Failed to allocate visible array for shape cache storage" )
stroage_entry.atlas_lru_code, error = make( [dynamic]Atlas_Key, len = 0, cap = shape_cache_params.reserve )
assert( error == .None, "VEFontCache.init : Failed to allocate atlas_lru_code array for shape cache storage" )
@ -287,9 +290,6 @@ startup :: proc( ctx : ^Context, parser_kind : Parser_Kind = .STB_TrueType, // N
stroage_entry.bounds, error = make( [dynamic]Range2, len = 0, cap = shape_cache_params.reserve )
assert( error == .None, "VEFontCache.init : Failed to allocate bounds array for shape cache storage" )
// stroage_entry.bounds_scaled, error = make( [dynamic]Range2, len = 0, cap = shape_cache_params.reserve )
// assert( error == .None, "VEFontCache.init : Failed to allocate bounds_scaled array for shape cache storage" )
}
}
@ -415,12 +415,12 @@ hot_reload :: proc( ctx : ^Context, allocator : Allocator )
lru_reload( & shape_cache.state, allocator )
for idx : i32 = 0; idx < i32(len(shape_cache.storage)); idx += 1 {
storage_entry := & shape_cache.storage[idx]
reload_array( & storage_entry.glyph, allocator)
reload_array( & storage_entry.glyph, allocator)
reload_array( & storage_entry.position, allocator)
reload_array( & storage_entry.visible, allocator)
reload_array( & storage_entry.atlas_lru_code, allocator)
reload_array( & storage_entry.region_kind, allocator)
reload_array( & storage_entry.bounds, allocator)
// reload_array( & storage_entry.bounds_scaled, allocator)
}
reload_array( & shape_cache.storage, allocator )
@ -490,10 +490,10 @@ shutdown :: proc( ctx : ^Context )
storage_entry := & shape_cache.storage[idx]
delete( storage_entry.glyph )
delete( storage_entry.position )
delete( storage_entry.visible )
delete( storage_entry.atlas_lru_code)
delete( storage_entry.region_kind)
delete( storage_entry.bounds)
// delete( storage_entry.bounds_scaled)
}
lru_free( & shape_cache.state )

View File

@ -0,0 +1,28 @@
if ($env:VCINSTALLDIR) {
return
}
$ErrorActionPreference = "Stop"
# Use vswhere to find the latest Visual Studio installation
$vswhere_out = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
if ($null -eq $vswhere_out) {
Write-Host "ERROR: Visual Studio installation not found"
exit 1
}
# Find Launch-VsDevShell.ps1 in the Visual Studio installation
$vs_path = $vswhere_out
$vs_devshell = Join-Path $vs_path "\Common7\Tools\Launch-VsDevShell.ps1"
if ( -not (Test-Path $vs_devshell) ) {
Write-Host "ERROR: Launch-VsDevShell.ps1 not found in Visual Studio installation"
Write-Host Tested path: $vs_devshell
exit 1
}
# Launch the Visual Studio Developer Shell
Push-Location
write-host @args
& $vs_devshell @args
Pop-Location

View File

@ -63,8 +63,22 @@ if ( $binaries_dirty -or $true )
$third_party_dlls = Get-ChildItem -Path $path_sokol_dlls -Filter '*.dll'
foreach ($dll in $third_party_dlls) {
$destination = join-path $path_build $dll.Name
Copy-Item $dll.FullName -Destination $destination -Force
$destination = join-path $path_build $dll.Name
Copy-Item $dll.FullName -Destination $destination -Force
}
}
pop-location
$path_helpers = join-path $PSScriptRoot 'helpers'
$path_devshell = join-path $path_helpers 'devshell.ps1'
. $path_devshell -arch amd64
$path_stb = join-path $path_thirdparty 'stb'
$path_stb_src = join-path $path_stb 'src'
push-location $path_stb_src
& '.\build.bat'
pop-location

Binary file not shown.