weiter animationen - nen paar sonderzeichen entfernt

This commit is contained in:
asklepios 2011-05-13 13:16:26 +00:00
parent 3bacdeb39e
commit 7acc4a8cd8
7 changed files with 59 additions and 5 deletions

View File

@ -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 \

View File

@ -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:

View File

@ -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

View File

@ -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 Normal file
View File

@ -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 Normal file
View File

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

View File

@ -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