-
Notifications
You must be signed in to change notification settings - Fork 10
New api #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
New api #15
Conversation
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
|
||
func (e *Entity) SetVersion(version EntityVersion) { | ||
assert.True(version <= MaxEntityGenerationId, "version is too high") | ||
*e = Entity(entityType(*e) - entityType(e.GetVersion()<<(entityPower-generationPower)) | entityType(version)<<(entityPower-generationPower)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
|
||
func (e *Entity) SetVersion(version EntityVersion) { | ||
assert.True(version <= MaxEntityGenerationId, "version is too high") | ||
*e = Entity(entityType(*e) - entityType(e.GetVersion()<<(entityPower-generationPower)) | entityType(version)<<(entityPower-generationPower)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
chore(dev): adds more asserts on SpatialAudioSystem
…ssing docs(audio): clarify comment for Clip
style(audio-system): go fmt
Removed allocs and changed 1% to lowest
# Conflicts: # pkg/ecs/int-log.go # pkg/ecs/int-log_test.go # pkg/ecs/slice.go
fast log2
// Iterate only set bits in mask | ||
for mask != 0 { | ||
// Get the least significant raised bit position | ||
layer := stdcomponents.CollisionLayer(bits.TrailingZeros32(uint32(mask))) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
// Iterate only set bits in mask | ||
for mask != 0 { | ||
// Get the least significant raised bit position | ||
layer := stdcomponents.CollisionLayer(bits.TrailingZeros32(uint32(mask))) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
Refactor/audio system
fix window resize
c.Camera2D.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5)) | ||
fb := s.FrameBuffer2D.GetUnsafe(s.mainCamera) | ||
rl.UnloadRenderTexture(fb.Texture) | ||
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
c.Camera2D.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5)) | ||
fb := s.FrameBuffer2D.GetUnsafe(s.mainCamera) | ||
rl.UnloadRenderTexture(fb.Texture) | ||
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
c.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5)) | ||
fb := s.FrameBuffer2D.GetUnsafe(s.minimapCamera) | ||
rl.UnloadRenderTexture(fb.Texture) | ||
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
c.Offset = rl.Vector2(vectors.Vec2{X: float32(width), Y: float32(height)}.Scale(0.5)) | ||
fb := s.FrameBuffer2D.GetUnsafe(s.minimapCamera) | ||
rl.UnloadRenderTexture(fb.Texture) | ||
fb.Texture = rl.LoadRenderTexture(int32(width), int32(height)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
s.monitorHeight = rl.GetScreenHeight() | ||
fb := s.FrameBuffer2D.GetUnsafe(s.frameBuffer) | ||
rl.UnloadRenderTexture(fb.Texture) | ||
fb.Texture = rl.LoadRenderTexture(int32(s.monitorWidth), int32(s.monitorHeight)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
s.monitorHeight = rl.GetScreenHeight() | ||
fb := s.FrameBuffer2D.GetUnsafe(s.frameBuffer) | ||
rl.UnloadRenderTexture(fb.Texture) | ||
fb.Texture = rl.LoadRenderTexture(int32(s.monitorWidth), int32(s.monitorHeight)) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
textSize := rl.MeasureTextEx(rl.GetFontDefault(), text, 96, 0) | ||
x := (s.monitorWidth - int(textSize.X)) / 2 | ||
y := (s.monitorHeight - int(textSize.Y)) / 2 | ||
rl.DrawText(text, int32(x), int32(y), 96, rl.Red) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
textSize := rl.MeasureTextEx(rl.GetFontDefault(), text, 96, 0) | ||
x := (s.monitorWidth - int(textSize.X)) / 2 | ||
y := (s.monitorHeight - int(textSize.Y)) / 2 | ||
rl.DrawText(text, int32(x), int32(y), 96, rl.Red) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
} | ||
|
||
start := time.Now() | ||
results, err := fn.Call(c.Context(), api.EncodeU32(uint32(a)), api.EncodeU32(uint32(b))) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
} | ||
|
||
start := time.Now() | ||
results, err := fn.Call(c.Context(), api.EncodeU32(uint32(a)), api.EncodeU32(uint32(b))) |
Check failure
Code scanning / gosec
integer overflow conversion uint64 -> uint32 Error
} | ||
|
||
func (nm *NodeManager) LoadWasm(ctx context.Context, file string) error { | ||
wasm, err := os.ReadFile(file) |
Check failure
Code scanning / gosec
Potential file inclusion via variable Error
var sizeOfGame = int(unsafe.Sizeof(game)) | ||
var getGameModule = Module{ | ||
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) { | ||
gameBytes := unsafe.Slice((*byte)(unsafe.Pointer(&game)), sizeOfGame) |
Check warning
Code scanning / gosec
Use of unsafe calls should be audited Warning
var sizeOfGame = int(unsafe.Sizeof(game)) | ||
var getGameModule = Module{ | ||
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) { | ||
gameBytes := unsafe.Slice((*byte)(unsafe.Pointer(&game)), sizeOfGame) |
Check warning
Code scanning / gosec
Use of unsafe calls should be audited Warning
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) { | ||
gameRef := api.DecodeU32(stack[0]) | ||
r, _ := mod.Memory().Read(gameRef, uint32(unsafe.Sizeof(game))) | ||
localGame := (*wasyan.Game)(unsafe.Pointer(unsafe.SliceData(r))) |
Check warning
Code scanning / gosec
Use of unsafe calls should be audited Warning
Fn: api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) { | ||
gameRef := api.DecodeU32(stack[0]) | ||
r, _ := mod.Memory().Read(gameRef, uint32(unsafe.Sizeof(game))) | ||
localGame := (*wasyan.Game)(unsafe.Pointer(unsafe.SliceData(r))) |
Check warning
Code scanning / gosec
Use of unsafe calls should be audited Warning
func set_game(gameRef uint32) | ||
|
||
func GetGame(game *wasyan.Game) { | ||
get_game(uint32(uintptr(unsafe.Pointer(game)))) |
Check warning
Code scanning / gosec
Use of unsafe calls should be audited Warning
} | ||
|
||
func SetGame(game *wasyan.Game) { | ||
set_game(uint32(uintptr(unsafe.Pointer(game)))) |
Check warning
Code scanning / gosec
Use of unsafe calls should be audited Warning
revert old iterators
No description provided.