Browse Source

weiter animationen - nen paar sonderzeichen entfernt

feature/2015
asklepios 14 years ago
parent
commit
7acc4a8cd8
  1. 2
      Makefile
  2. 8
      display_loop.c
  3. 2
      rules.mk
  4. 8
      smallani/Makefile
  5. 32
      smallani/colbounce.c
  6. 6
      smallani/colbounce.h
  7. 2
      smallani/config.in

2
Makefile

@ -39,8 +39,8 @@ include defaults.mk
.subdirs: autoconf.h .subdirs: autoconf.h
@ echo "checking in which subdirs to build" @ echo "checking in which subdirs to build"
@ $(RM) -f $@ @ $(RM) -f $@
@ echo "SUBDIRS += smallani" >> $@
@ echo "SUBDIRS += animations" >> $@ @ echo "SUBDIRS += animations" >> $@
@ echo "SUBDIRS += smallani" >> $@
@ (for subdir in `grep -e "^#define .*_SUPPORT" autoconf.h \ @ (for subdir in `grep -e "^#define .*_SUPPORT" autoconf.h \
| sed -e "s/^#define //" -e "s/_SUPPORT.*//" \ | sed -e "s/^#define //" -e "s/_SUPPORT.*//" \
| tr "[A-Z]\\n" "[a-z] " `; do \ | tr "[A-Z]\\n" "[a-z] " `; do \

8
display_loop.c

@ -30,6 +30,9 @@
#ifdef SMALLANIMATION_COLWALK #ifdef SMALLANIMATION_COLWALK
# include "smallani/colwalk.h" # include "smallani/colwalk.h"
#endif #endif
#ifdef SMALLANIMATION_COLBOUNCE
# include "smallani/colbounce.h"
#endif
#ifdef JOYSTICK_SUPPORT #ifdef JOYSTICK_SUPPORT
# include "joystick/joystick.h" # include "joystick/joystick.h"
@ -223,6 +226,11 @@ void display_loop(){
colwalk(10,50); colwalk(10,50);
break; break;
#endif #endif
#ifdef SMALLANIMATION_COLBOUNCE
case 38:
colbounce(10,25);
break;
#endif
#ifdef MENU_SUPPORT #ifdef MENU_SUPPORT
case 42: case 42:

2
rules.mk

@ -20,7 +20,6 @@ objects_avr: $(OBJECTS)
@ echo "writing object ineventory" @ echo "writing object ineventory"
@ echo $(OBJECTS) > obj_avr/.objects @ echo $(OBJECTS) > obj_avr/.objects
############################################################################## ##############################################################################
# rules for buildung simulator objects # rules for buildung simulator objects
@ -50,5 +49,4 @@ clean: clean-common
all: all:
make -C $(TOPDIR) all make -C $(TOPDIR) all
include $(TOPDIR)/depend.mk include $(TOPDIR)/depend.mk

8
smallani/Makefile

@ -10,5 +10,13 @@ ifeq ($(SMALLANIMATION_COLWALK),y)
SRC += colwalk.c SRC += colwalk.c
endif endif
ifeq ($(SMALLANIMATION_ROWBOUNCE),y)
SRC += rowbounce.c
endif
ifeq ($(SMALLANIMATION_COLBOUNCE),y)
SRC += colbounce.c
endif
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk

32
smallani/colbounce.c

@ -0,0 +1,32 @@
#include <inttypes.h>
#include "../config.h"
#include "../pixel.h"
#include "../util.h"
#include "colbounce.h"
void colbounce(uint8_t times,uint8_t speed)
{
uint8_t i, j,k,h;
for(k=0;k<times;k++){
clear_screen(0);
for (h=0;h<NUM_COLS;h++){
for (i=0;i<NUM_COLS;i++){
for (j=0;j<NUM_ROWS;j++){
setpixel( (pixel){i,j},(h==i) ? 1:0);
}
}
wait(speed*10);
}
for (h=NUM_COLS;h>0;h--){
for (i=0;i<NUM_COLS;i++){
for (j=0;j<NUM_ROWS;j++){
setpixel( (pixel){i,j},((h-1)==i) ? 1:0);
}
}
wait(speed*10);
}
}
}

6
smallani/colbounce.h

@ -0,0 +1,6 @@
#ifndef COLBOUNCE_H_
#define COLBOUNCE_H_
void colbounce(uint8_t times,uint8_t speed);
#endif /* COLBOUNCE_H_ */

2
smallani/config.in

@ -2,4 +2,6 @@ mainmenu_option next_comment
comment "small Animations" comment "small Animations"
bool "rowwalk" SMALLANIMATION_ROWWALK bool "rowwalk" SMALLANIMATION_ROWWALK
bool "colwalk" SMALLANIMATION_COLWALK bool "colwalk" SMALLANIMATION_COLWALK
bool "rowbounce" SMALLANIMATION_ROWBOUNCE
bool "colbounce" SMALLANIMATION_COLBOUNCE
endmenu endmenu

Loading…
Cancel
Save