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

View File

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

View File

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

View File

@ -10,5 +10,13 @@ ifeq ($(SMALLANIMATION_COLWALK),y)
SRC += colwalk.c
endif
ifeq ($(SMALLANIMATION_ROWBOUNCE),y)
SRC += rowbounce.c
endif
ifeq ($(SMALLANIMATION_COLBOUNCE),y)
SRC += colbounce.c
endif
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"
bool "rowwalk" SMALLANIMATION_ROWWALK
bool "colwalk" SMALLANIMATION_COLWALK
bool "rowbounce" SMALLANIMATION_ROWBOUNCE
bool "colbounce" SMALLANIMATION_COLBOUNCE
endmenu