comparison clojure/com/aurellem/run/image.clj @ 486:3f0156038802

added image.clj
author Robert McIntyre <rlm@mit.edu>
date Mon, 07 May 2012 11:15:44 -0500
parents
children 09b3bc0b71b5
comparison
equal deleted inserted replaced
482:346b91ae503a 486:3f0156038802
1 (ns com.aurellem.run.music
2 (:use (com.aurellem.gb saves gb-driver util constants
3 items vbm characters money
4 rlm-assembly))
5 (:use (com.aurellem.run util title save-corruption
6 bootstrap-0 bootstrap-1))
7 (:require clojure.string)
8 (:import [com.aurellem.gb.gb_driver SaveState])
9 (:import java.io.File))
10
11
12
13
14
15 ;; want to display an image onto the screen.
16 ;; probably will be the six ponies, possibly with scrolling.
17
18 ;; probably don't need hi-color mode since the images shuld be
19 ;; simple.
20
21 ;; use background tiles? they provide greater color depth than
22 ;; sprites, and can still be scrolled, so why not?
23
24
25 ;; First of all, RGB colors in an image are not the same as those in a
26 ;; GameBoy, so I need to convert them. Fortunately, this code is
27 ;; already written for me in this C-code from the public domain
28 ;; hi-color converter by Glen Cook, Jeff Frohwein, and Rob Jones.
29
30 ;; the code snipped itself is by Brett Bibby and is translated here
31 ;; from C into clojure.
32
33 ;; TODO include original code
34
35
36 (def intensity [
37
38 (defn rgb->gb-rb [[r g b]]
39