Commits

Anonymous committed a5882cd

moved data inside subproject for memory

  • Participants
  • Parent commits f69d6e2

Comments (0)

Files changed (35)

File data/memory/0.png

Removed
Old image

File data/memory/1.png

Removed
Old image

File data/memory/10.png

Removed
Old image

File data/memory/11.png

Removed
Old image

File data/memory/2.png

Removed
Old image

File data/memory/3.png

Removed
Old image

File data/memory/4.png

Removed
Old image

File data/memory/5.png

Removed
Old image

File data/memory/6.png

Removed
Old image

File data/memory/7.png

Removed
Old image

File data/memory/8.png

Removed
Old image

File data/memory/9.png

Removed
Old image

File data/memory/back.png

Removed
Old image

File data/memory/background.jpg

Removed
Old image

File data/memory/sfx/bleep.wav

Binary file removed.

File data/memory/sfx/success.wav

Binary file removed.

File data/memory/sfx/turn.wav

Binary file removed.

File memory/images/0.png

Added
New image

File memory/images/1.png

Added
New image

File memory/images/10.png

Added
New image

File memory/images/11.png

Added
New image

File memory/images/2.png

Added
New image

File memory/images/3.png

Added
New image

File memory/images/4.png

Added
New image

File memory/images/5.png

Added
New image

File memory/images/6.png

Added
New image

File memory/images/7.png

Added
New image

File memory/images/8.png

Added
New image

File memory/images/9.png

Added
New image

File memory/images/back.png

Added
New image

File memory/images/background.jpg

Added
New image

File memory/memory.ml

 module Sfx = struct
   open Sdlmixer
   
+  let datadir = if Sys.file_exists "sfx" then "sfx/" else "memory/sfx/"
+  
   let turn = ref None
   let bleep = ref None
   let success = ref None
   
   let load () =
-    turn := Some (loadWAV "data/memory/sfx/turn.wav");
-    bleep := Some (loadWAV "data/memory/sfx/bleep.wav");
-    success := Some (loadWAV "data/memory/sfx/success.wav")
+    turn := Some (loadWAV (datadir ^ "turn.wav"));
+    bleep := Some (loadWAV (datadir ^ "bleep.wav"));
+    success := Some (loadWAV (datadir ^ "success.wav"))
   
   let play sfxref = match !sfxref with
     | None -> failwith "sound not initialized"
   open Sdlvideo
   open Sdlloader
   
+  let datadir = if Sys.file_exists "images" then "images/" else "memory/images/"
   let imgsize = 115
   
   let back = ref None
   let images = Array.make 12 None
   
   let load () =
-    back := Some (load_image "data/memory/back.png");
-    background := Some (load_image "data/memory/background.jpg");
+    back := Some (load_image (datadir ^ "back.png"));
+    background := Some (load_image (datadir ^ "background.jpg"));
     for i = 0 to (Array.length images -1) do
-      images.(i) <- Some (load_image ("data/memory/" ^ string_of_int i ^ ".png"))
+      images.(i) <- Some (load_image (datadir ^ (string_of_int i) ^ ".png"))
     done
   
   let blit dst dst_rect img = match img with

File memory/sfx/bleep.wav

Binary file added.

File memory/sfx/success.wav

Binary file added.

File memory/sfx/turn.wav

Binary file added.