Skip to content

Instantly share code, notes, and snippets.

@psilord
Created August 2, 2023 03:26
Show Gist options
  • Select an option

  • Save psilord/b7f0e7ecee01d6923cf5b844ea9e78a0 to your computer and use it in GitHub Desktop.

Select an option

Save psilord/b7f0e7ecee01d6923cf5b844ea9e78a0 to your computer and use it in GitHub Desktop.
Unstaged changes (4)
modified src/core-early/clock.lisp
@@ -8,12 +8,12 @@
(defun (setf pause-time) (value clock)
(setf (clock-pause-time clock) value))
-(defun make-clock (core)
+(defun make-clock ()
(let ((clock (%make-clock)))
(setf (clock-start-time clock) (sb-ext:get-time-of-day)
(clock-current-time clock) (get-time clock)
- (clock-delta-time clock) (float =delta= 1d0)
- (slot-value core '%clock) clock)))
+ (clock-delta-time clock) (float =delta= 1d0))
+ clock))
(defun get-time (clock)
#+sbcl
modified src/core-early/core.lisp
@@ -44,6 +44,7 @@ structures in CORE."
;; done. When it is remove this comment. CL is ok with this, but from a code
;; understandability point of view it is horrible.
(let ((core (make-instance 'core
+ :clock (make-clock)
:config config
:materials (make-materials-table)
:tables (make-instance 'bookkeeping-tables)
modified src/core-late/engine.lisp
@@ -17,7 +17,7 @@
(load-call-flows core)
(initialize-shaders core)
(tex::load-texture-descriptors core)
- (make-clock core)
+ ;;(make-clock core)
(load-materials core)
(initialize-collider-system core)
(make-scene-tree core)
modified src/datatype/core-defs.lisp
@@ -44,6 +44,7 @@
(%resource-cache :reader resource-cache
:initform (u:dict #'eq))
(%clock :reader clock
+ :initarg :clock
:initform nil)
(%display :reader display
:initform nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment