forked from Shirakumo/harmony
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoolkit.lisp
More file actions
43 lines (35 loc) · 967 Bytes
/
toolkit.lisp
File metadata and controls
43 lines (35 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#|
This file is a part of harmony
(c) 2017 Shirakumo http://tymoon.eu (shinmera@tymoon.eu)
Author: Nicolas Hafner <shinmera@tymoon.eu>
|#
(in-package #:org.shirakumo.fraf.harmony)
(cffi:defcfun (memcpy "memcpy") :pointer
(dest :pointer)
(source :pointer)
(num cl-mixed-cffi:size_t))
(cffi:defcfun (memset "memset") :pointer
(dest :pointer)
(source :int)
(num cl-mixed-cffi:size_t))
(declaim (inline memclear))
(defun memclear (dest num)
(memset dest 0 num))
(defun ease-linear (x)
(declare (optimize speed))
(declare (type single-float x))
x)
(defun ease-cubic-in (x)
(declare (optimize speed))
(declare (type single-float x))
(expt x 3))
(defun ease-cubic-out (x)
(declare (optimize speed))
(declare (type single-float x))
(1+ (expt (1- x) 3)))
(defun ease-cubic-in-out (x)
(declare (optimize speed))
(declare (type single-float x))
(if (< x 0.5)
(/ (expt (* 2 x) 3) 2)
(1+ (/ (expt (* 2 (1- x)) 3) 2))))