Skip to content

Commit

Permalink
all: convert a few TODO entries to BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed May 1, 2024
1 parent 9ec4fc5 commit f449ee5
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion easy/easy.api.v
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub mut:
origin shy.Origin = shy.Anchor.top_left
align shy.TextAlign = .baseline | .left
offset vec.Vec2[f32]
color shy.Color = shy.rgba(255, 255, 255, 255) // BUG shy.defaults.font.color
color shy.Color = shy.rgba(255, 255, 255, 255) // BUG: shy.defaults.font.color
blur f32
}

Expand Down
2 changes: 1 addition & 1 deletion examples/ui/ui.v
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn (mut a App) event(e shy.Event) {

ui_event := ui.shy_to_ui_event(e) or { panic('${@STRUCT}.${@FN}: ${err}') }
if handled_by_node := a.ui.event(ui_event) {
// TODO BUG printing the whole node will make things crash at runtime...
// BUG: printing the whole node will make things crash at runtime...
println('Event was handled by ui.Node.id(${handled_by_node.id})')
}
}
14 changes: 7 additions & 7 deletions lib/animation.v
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fn (mut a Anims) p_new_animator[T](config AnimatorConfig) &Animator[T] {
}
mut animator := &Animator[T]{
shy: a.shy
// TODO BUG ...config <- doesn't work for generics
// BUG: ...config <- doesn't work for generics
}
animator.config_update(config)
return animator
Expand All @@ -164,7 +164,7 @@ fn (mut a Anims) p_new_follow_animator[T](config FollowAnimatorConfig) &FollowAn
}
mut animator := &FollowAnimator[T]{
shy: a.shy
// TODO BUG ...config <- doesn't work for generics
// BUG: ...config <- doesn't work for generics
}
// animator.reset()
animator.config_update(config)
Expand Down Expand Up @@ -305,7 +305,7 @@ pub fn (a &Animator[T]) t() f64 {
}

pub fn (ima Animator[T]) reset() {
mut a := unsafe { ima } // TODO BUG workaround mutable generic interfaces
mut a := unsafe { ima } // BUG: workaround mutable generic interfaces
a.running = false
a.elapsed = 0
a.value = a.from
Expand Down Expand Up @@ -353,7 +353,7 @@ fn (mut a Animator[T]) ended() {
fn (a &Animator[T]) touch() {}

fn (ima &Animator[T]) step(dt f64) {
mut a := unsafe { ima } // TODO BUG workaround mutable generic interfaces
mut a := unsafe { ima } // BUG: workaround mutable generic interfaces
a.elapsed += dt * 1000
if a.elapsed >= a.duration {
a.ended()
Expand Down Expand Up @@ -401,7 +401,7 @@ mut:
}

fn (fa FollowAnimator[T]) touch() {
mut a := unsafe { fa } // TODO BUG workaround mutable generic interfaces
mut a := unsafe { fa } // BUG: workaround mutable generic interfaces
should_run := mth.round_to_even(utils.manhattan_distance(a.value, 0, a.target, 0)) != 0
if should_run {
a.running = should_run
Expand All @@ -416,7 +416,7 @@ fn (fa FollowAnimator[T]) restart() {
}

fn (fa FollowAnimator[T]) reset() {
mut a := unsafe { fa } // TODO BUG workaround mutable generic interfaces
mut a := unsafe { fa } // BUG: workaround mutable generic interfaces
a.value = a.target
}

Expand Down Expand Up @@ -445,7 +445,7 @@ pub fn (a &FollowAnimator[T]) value() T {
}

fn (fa &FollowAnimator[T]) step(dt f64) {
mut a := unsafe { fa } // TODO BUG workaround mutable generic interfaces
mut a := unsafe { fa } // BUG: workaround mutable generic interfaces

value := a.value + ((a.target - a.value) * 0.1 * (dt * (dt * 1000)) * a.multiply)
// value := utils.remap(a.t, 0, 1.0, a.from, a.to)
Expand Down
2 changes: 1 addition & 1 deletion lib/api.default.v
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub fn (a &ShyAPI) scripts() &Scripts {
}

// V embeds with generics is not quite ready yet?!
// TODO BUG MAY NEED WORKAROUND
// BUG: MAY NEED WORKAROUND
// pub fn api_main<T>(mut ctx T, mut s Shy) ! {
pub fn (mut a ShyAPI) main[T](mut ctx T, mut s Shy) ! {
s.log.gdebug('${@MOD}.${@FN}', 'entering core loop')
Expand Down
4 changes: 2 additions & 2 deletions lib/assets.v
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn (mut a Assets) shutdown() ! {
a.async_load_queue.clear()
a.loader.shutdown()!

// TODO BUG there's invalid memory access upon Assets.shutdown() if too many of the same asset has been unloaded and loaded again for some reason, see Assets.unload that may, or may not, be the function that causes it
// BUG: there's invalid memory access upon Assets.shutdown() if too many of the same asset has been unloaded and loaded again for some reason, see Assets.unload that may, or may not, be the function that causes it
// keys := a.ass.keys()
// values := a.ass.values()
// println('Keys ${keys} ${keys.len} vs ${values.len}')
Expand Down Expand Up @@ -139,7 +139,7 @@ pub fn (mut a Assets) unload(auo AssetUnloadOptions) ! {
analyse.count('${@MOD}.${@STRUCT}.${@FN}()', 1)
source := auo.source
source_cache_key := source.cache_key(mut a.sb)
// TODO BUG there's invalid memory access upon Assets.shutdown() if too many of the same asset has been unloaded and loaded again for some reason, see Asset.shutdown / Assets.shutdown
// BUG: there's invalid memory access upon Assets.shutdown() if too many of the same asset has been unloaded and loaded again for some reason, see Asset.shutdown / Assets.shutdown
if mut asset := a.ass[source_cache_key] {
a.shy.vet_issue(.warn, .hot_code, '${@STRUCT}.${@FN}', 'memory fragmentation can happen when deallocating in hot code paths. It is, in general, better to unload data on shutdown. Unloading "${source.str()}"')

Expand Down
2 changes: 1 addition & 1 deletion lib/config.v
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub:
pub:
name string = 'default'
size f32 = 20
color Color = Color{255, 255, 255, 255} // TODO BUG is really 0,0,0,0 :(
color Color = Color{255, 255, 255, 255} // BUG: is really 0,0,0,0 :(
// align TextAlign = .baseline | .left // TODO V BUG
}

Expand Down
6 changes: 3 additions & 3 deletions lib/shy.api.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
module lib

import shy.vec
// TODO BUG see consts below // import shy.mth
// BUG: see consts below // import shy.mth

pub const deg2rad = f32(0.017453292519943295) // TODO BUG with `-live` mth.deg2rad
pub const deg2rad = f32(0.017453292519943295) // BUG: with `-live` mth.deg2rad

pub const rad2deg = f32(57.29577951308232) // TODO BUG with `-live` mth.rad2deg
pub const rad2deg = f32(57.29577951308232) // BUG: with `-live` mth.rad2deg

// ticks returns the amount of milliseconds passed since the app was started.
@[inline]
Expand Down
4 changes: 2 additions & 2 deletions ui/item.v
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub fn (mut i Item) update() {
// parent returns this `Item`'s parent.
pub fn (i &Item) parent() &Node {
//assert i != unsafe { nil }
// TODO BUG returning ?&Node is not possible currently: if isnil(i.parent) { return none }
// BUG: returning ?&Node is not possible currently: if isnil(i.parent) { return none }
return i.parent
}
*/
Expand Down Expand Up @@ -250,7 +250,7 @@ pub fn (mut pea PointerEventArea) event(e Event) ?&Node {
y: ey
}

// TODO BUG pea pointer address is not the same in userspace callbacks?!
// BUG: pea pointer address is not the same in userspace callbacks?!
/*
eprintln('${@STRUCT}.${@FN} ea: ${ptr_str(pea.EventArea)}')
eprintln('${@STRUCT}.${@FN} ea.this: ${ptr_str(pea.EventArea.this)}')
Expand Down

0 comments on commit f449ee5

Please sign in to comment.