Skip to content

Commit

Permalink
elapsed_seconds -> elapsed_secs
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-ie authored and rparrett committed Nov 20, 2024
1 parent c81f0c8 commit 6d1480d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/accessing_tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn update_map(
)>,
mut tile_query: Query<&mut TileTextureIndex>,
) {
let current_time = time.elapsed_seconds_f64();
let current_time = time.elapsed_secs_f64();
for (mut current_color, mut last_update, tile_storage, map_size) in tilemap_query.iter_mut() {
if current_time - last_update.0 > 0.1 {
current_color.0 += 1;
Expand Down
2 changes: 1 addition & 1 deletion examples/game_of_life.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn update(
mut tile_storage_query: Query<(&TileStorage, &TilemapSize, &mut LastUpdate)>,
tile_query: Query<(Entity, &TilePos, &TileVisible)>,
) {
let current_time = time.elapsed_seconds_f64();
let current_time = time.elapsed_secs_f64();
let (tile_storage, map_size, mut last_update) = tile_storage_query.single_mut();
if current_time - last_update.0 > 0.1 {
for (entity, position, visibility) in tile_query.iter() {
Expand Down
2 changes: 1 addition & 1 deletion examples/random_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct LastUpdate {
// In this example it's better not to use the default `MapQuery` SystemParam as
// it's faster to do it this way:
fn random(time: ResMut<Time>, mut query: Query<(&mut TileTextureIndex, &mut LastUpdate)>) {
let current_time = time.elapsed_seconds_f64();
let current_time = time.elapsed_secs_f64();
let mut random = thread_rng();
for (mut tile, mut last_update) in query.iter_mut() {
if (current_time - last_update.value) > 0.2 {
Expand Down
2 changes: 1 addition & 1 deletion examples/remove_tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn remove_tiles(
time: Res<Time>,
mut last_update_query: Query<(&mut LastUpdate, &mut TileStorage)>,
) {
let current_time = time.elapsed_seconds_f64();
let current_time = time.elapsed_secs_f64();
for (mut last_update, mut tile_storage) in last_update_query.iter_mut() {
// Remove a tile every half second.
if (current_time - last_update.value) > 0.1 {
Expand Down
2 changes: 1 addition & 1 deletion examples/visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn remove_tiles(
mut last_update_query: Query<(&mut LastUpdate, &TileStorage)>,
mut tile_query: Query<&mut TileVisible>,
) {
let current_time = time.elapsed_seconds_f64();
let current_time = time.elapsed_secs_f64();
for (mut last_update, tile_storage) in last_update_query.iter_mut() {
// Remove a tile every half second.
if (current_time - last_update.value) > 0.1 {
Expand Down
2 changes: 1 addition & 1 deletion src/render/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ pub fn extract(
commands.insert_or_spawn_batch(extracted_tiles);
commands.insert_or_spawn_batch(extracted_tilemaps);
commands.insert_or_spawn_batch(extracted_tilemap_textures);
commands.insert_resource(SecondsSinceStartup(time.elapsed_seconds_f64() as f32));
commands.insert_resource(SecondsSinceStartup(time.elapsed_secs_f64() as f32));
}

pub fn extract_removal(
Expand Down

0 comments on commit 6d1480d

Please sign in to comment.