Browse Source

sdl back in x86; simplify repl/editor spawn funcs

mntmn 8 years ago
parent
commit
567d5c69e4
2 changed files with 8 additions and 9 deletions
  1. 1 2
      sledge/build_x86.sh
  2. 7 7
      sledge/os/shell.l

+ 1 - 2
sledge/build_x86.sh

@@ -1,4 +1,3 @@
 
-gcc -m32 -g -o sledge --std=gnu99 -I. sledge.c reader.c writer.c alloc.c strmap.c stream.c ../devices/posixfs.c -lm -DCPU_X86 -DDEV_POSIXFS
+gcc -m32 -g -o sledge --std=gnu99 -I. sledge.c reader.c writer.c alloc.c strmap.c stream.c ../devices/posixfs.c ../devices/sdl2.c -lSDL2 -DDEV_SDL -lm -DCPU_X86 -DDEV_POSIXFS
 
-#  ../devices/sdl2.c -lSDL2 -DDEV_SDL

+ 7 - 7
sledge/os/shell.l

@@ -190,25 +190,25 @@
 
 (def max-task-id 0)
 
-(def spawn-editor (fn x y title focused (do
+(def spawn-editor (fn x y title (do
   (let my-editor (new editor))
   (let my-editor-task (new task))
   (sput my-editor-task id (+ max-task-id 1))
   (sput my-editor-task name title)
   (sput my-editor buffer " ")
-  (sput my-editor-task focused focused)
+  (sput my-editor-task focused 0)
   (sput my-editor-task surface (make-surface x y 400 240))
   (add-task editor-task my-editor-task my-editor)
   (def mask-task-id (+ max-task-id 1))
 )))
 
-(def spawn-repl (fn x y title focused (do
+(def spawn-repl (fn x y title (do
   (let my-repl (new repl))
   (let my-task (new task))
   (sput my-task id (+ max-task-id 1))
   (sput my-task name title)
   ;(sput my-repl buffer " ")
-  (sput my-task focused focused)
+  (sput my-task focused 0)
   (sput my-task surface (make-surface x y 400 240))
   (let s (sget my-task surface))
   (boxfill s 0 0 400 240 0xffff)
@@ -217,8 +217,8 @@
   (def mask-task-id (+ max-task-id 1))
 )))
 
-(spawn-editor 32 32 "editor               " 0)
-(spawn-repl 32 300 "repl               " 1)
+(spawn-editor 32 32 "editor               ")
+(spawn-repl 32 300 "repl               ")
 
 (def mouse-task (new task))
 (sput mouse-task id (+ max-task-id 1))
@@ -231,7 +231,7 @@
   (let f (sget t focused))
   (if (* f (* (not launched) mouse-btn)) (do
     (def launched 1)
-    (spawn-editor 100 100 "new editor" 0)
+    (spawn-editor 100 100 "new editor")
   ) 0)
   (if (not mouse-btn) (def launched 0) 0)
   0