Browse Source

simplify inclusion of personal animations which not meant to be included in the official repo

feature/2017
Christian Kroll 9 years ago
parent
commit
d41ada0c45
  1. 1
      Makefile
  2. 7
      config.in
  3. 4
      src/display_loop.c
  4. 25
      src/user/Makefile
  5. 18
      src/user/config.in
  6. 23
      src/user/user_loop.c
  7. 11
      src/user/user_loop.h

1
Makefile

@ -43,6 +43,7 @@ include $(MAKETOPDIR)/defaults.mk
@ echo "SUBDIRS += $(TOPDIR)/animations" >> $@
@ echo "SUBDIRS += $(TOPDIR)/animations/bitmapscroller" >> $@
@ echo "SUBDIRS += $(TOPDIR)/smallani" >> $@
@ echo "SUBDIRS += $(TOPDIR)/user" >> $@
@ (for subdir in `grep -e "^#define .*_SUPPORT" $(TOPDIR)/autoconf.h \
| sed -e "s/^#define /$(TOPDIR)\//" -e "s/_SUPPORT.*//" \
| tr "[A-Z]\\n" "[a-z] " `; do \

7
config.in

@ -90,6 +90,11 @@ source src/animations/config.in
###############################################################################
### small Animations Menu #####################################################
### Small Animations Menu #####################################################
source src/smallani/config.in
###############################################################################
### User Menu #################################################################
source src/user/config.in
###############################################################################

4
src/display_loop.c

@ -51,6 +51,8 @@
# include "joystick/joystick.h"
#endif
#include "user/user_loop.h"
volatile unsigned char oldMode, oldOldmode, reverseMode, mode;
jmp_buf newmode_jmpbuf;
@ -320,6 +322,8 @@ void display_loop(){
break;
#endif
#include "user/user_loop.c"
#ifdef MENU_SUPPORT
case 0xFDu:
mode = 1;

25
src/user/Makefile

@ -0,0 +1,25 @@
# This file eases the integration of your personal animations which are not
# meant to be included in the official Borgware-2D repository.
#
# Just add your own source files to the SRC variable (checking for options
# introduced in your config.in file) as shown in the commented samples.
MAKETOPDIR = ../..
TARGET = libuser.a
include $(MAKETOPDIR)/defaults.mk
# ifeq ($(ANIMATION_MY_SIMPLE_ANIM),y)
# SRC += my_simple_anim.c
# endif
# ifeq ($(ANIMATION_MY_COMPLEX_ANIM),y)
# SRC += my_complex_anim.c
# endif
include $(MAKETOPDIR)/rules.mk
include $(MAKETOPDIR)/depend.mk

18
src/user/config.in

@ -0,0 +1,18 @@
# This file eases the integration of your personal animations which are not
# meant to be included in the official Borgware-2D repository.
#
# Just add configurations options for your animations here as shown in the
# commented samples.
mainmenu_option next_comment
comment "User Animations"
comment "Insert config options for your own animations here!"
# bool "A simple anim" ANIMATION_MY_SIMPLE_ANIM $RANDOM_SUPPORT
# dep_bool_menu "A complex anim" ANIMATION_MY_COMPLEX_ANIM $RANDOM_SUPPORT
# int "Sample integer config value" MY_SAMPLE_INT 100
# bool "Sample boolean config value" MY_SAMPLE_BOOL y
# endmenu
endmenu

23
src/user/user_loop.c

@ -0,0 +1,23 @@
/* This file eases the integration of your personal animations which are not
meant to be included in the official Borgware-2D repository.
It is inserted at the middle of the big switch/case block of the
src/display_loop.c file. Please make sure that your use a mode number
greater or equal than 200 to avoid conflicts with newer upstream
animations.
Just add your header #include directives as shown in the commented
samples. */
// #ifdef ANIMATION_MY_SIMPLE_ANIM
// case 200:
// my_simple_animation();
// break;
// #endif
// #ifdef ANIMATION_MY_COMPLEX_ANIM
// case 201:
// my_complex_animation(MY_SAMPLE_INT, MY_SAMPLE_BOOL);
// break;
// #endif

11
src/user/user_loop.h

@ -0,0 +1,11 @@
/* This file eases the integration of your personal animations which are not
meant to be included in the official Borgware-2D repository.
It is inserted at the beginning of the src/display_loop.c file.
Just add your header #include directives as shown in the commented
samples. */
// #include "my_simple_animation.h"
// #include "my_complex_animation.h"
Loading…
Cancel
Save