Browse Source

Don't download clibs everyt ime

Nathaniel van Diepen 3 years ago
parent
commit
cb7c23b26e
3 changed files with 10 additions and 6 deletions
  1. 3 2
      makefile
  2. BIN
      src/gfx/bm15.png
  3. 7 4
      src/main.c

+ 3 - 2
makefile

@@ -23,8 +23,9 @@ deploy: bin/${NAME}.8xp
 	tilp --cable=usb -n bin/${NAME}.8xp
 
 bin/clibs.8xg:
-	wget https://github.com/CE-Programming/libraries/releases/download/v8.8/clibs.8xg \
-		-O bin/clibs.8xg
+	 test ! -f bin/clibs.8xg && wget \
+		 https://github.com/CE-Programming/libraries/releases/download/v8.8/clibs.8xg \
+		 -O bin/clibs.8xg
 
 emulator: bin/${NAME}.8xp bin/clibs.8xg
 	CEmu -a bin/clibs.8xg -s bin/${NAME}.8xp --launch ${NAME}

BIN
src/gfx/bm15.png


+ 7 - 4
src/main.c

@@ -4,10 +4,11 @@
 
 #include "gfx/main_gfx.h"
 
+
+float scale = 3.0;
+int frameskip = 10;
+
 gfx_sprite_t* sprite;
-float scale = 3;
-int max_width = LCD_WIDTH;
-int max_height = LCD_HEIGHT;
 kb_key_t arrows;
 int x = 0;
 int y = 0;
@@ -19,6 +20,8 @@ void draw_sprite(){
     gfx_BlitBuffer();
 }
 int main(void){
+    int max_width = LCD_WIDTH;
+    int max_height = LCD_HEIGHT;
     if(bm3->height > bm5->height){
         max_height -= bm3->height * scale;
     }else{
@@ -80,7 +83,7 @@ int main(void){
         }
         draw_sprite();
         frame++;
-        if(frame > 5){
+        if(frame > frameskip){
             frame = 0;
         }
     }while (arrows != sk_Enter);