From: falcovorbis <fal...@us...> - 2024-10-11 21:13:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via ee2324f6fc2a1de27033539bd088913d869df4a3 (commit) from 22c8c2063dc13ddfcf717aa3f5a335f8f0d493ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ee2324f6fc2a1de27033539bd088913d869df4a3 Author: Andy Barajas <and...@gm...> Date: Fri Oct 11 14:13:14 2024 -0700 Fix dreampresent compile error by moving constants out of the methods (#814) ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/mruby/dreampresent/page_data.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/dreamcast/mruby/dreampresent/page_data.rb b/examples/dreamcast/mruby/dreampresent/page_data.rb index e6dfadf0..05954f16 100644 --- a/examples/dreamcast/mruby/dreampresent/page_data.rb +++ b/examples/dreamcast/mruby/dreampresent/page_data.rb @@ -256,6 +256,12 @@ end # This renders a 'background' with 640x480 image # It also renders timer and page progress class PageBaseContent + PAGES_BAR_LEN = 640 - 32 + PAGES_Y_POS = 410 + DURATION = 20 * 60 # 20 mins + PROGRESS_LEN = 640 - 32 + PROGRESS_Y_POS = 440 + def initialize(path, page_count) @page_count = page_count @path = String(path).strip @@ -276,9 +282,6 @@ class PageBaseContent end def render_page_progress(dc_kos, page_count, page_index) - PAGES_BAR_LEN = 640 - 32 - PAGES_Y_POS = 410 - pos_x = if page_count <= 1 0 @@ -290,10 +293,6 @@ class PageBaseContent end def render_timer_progress(dc_kos, start_time, time_adjustment) - DURATION = 20 * 60 # 20 mins - PROGRESS_LEN = 640 - 32 - PROGRESS_Y_POS = 440 - pos_x = ((Time.now.to_i - start_time.to_i + time_adjustment) / DURATION * PROGRESS_LEN).to_i puts "#################### start_time: #{start_time}, adj: #{time_adjustment}, now: #{Time.now}, pos_x: #{pos_x}" pos_x = PROGRESS_LEN if pos_x > PROGRESS_LEN hooks/post-receive -- A pseudo Operating System for the Dreamcast. |