From e23f079ae9c9f9c71a76d3bd3a5e26163dbb5910 Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Sat, 28 Aug 2010 15:13:35 +0000 Subject: [PATCH] cleaned up include directives --- games/tetris/bucket.c | 7 ++++--- games/tetris/bucket.h | 2 +- games/tetris/highscore.c | 4 ++-- games/tetris/highscore.h | 2 ++ games/tetris/piece.c | 1 - games/tetris/tetris_main.c | 1 - games/tetris/variant_bastet.c | 12 ++++++------ games/tetris/variant_bastet.h | 13 +++++++------ games/tetris/variant_fp.c | 26 +++++++++----------------- games/tetris/variant_fp.h | 6 ++---- games/tetris/variant_std.c | 20 +++++++------------- games/tetris/variant_std.h | 4 ++-- games/tetris/variants.h | 7 ++++--- games/tetris/view.c | 15 +++++++-------- games/tetris/view.h | 3 ++- 15 files changed, 55 insertions(+), 68 deletions(-) diff --git a/games/tetris/bucket.c b/games/tetris/bucket.c index 5533b98..d5b5ba9 100644 --- a/games/tetris/bucket.c +++ b/games/tetris/bucket.c @@ -2,7 +2,7 @@ #include #include #include -#include "../../autoconf.h" +#include "../../config.h" #include "bucket.h" #include "piece.h" @@ -144,7 +144,7 @@ int8_t tetris_bucket_getPieceStartPos(tetris_piece_t *pPiece) void tetris_bucket_insertPiece(tetris_bucket_t *pBucket, tetris_piece_t *pPiece, - tetris_piece_t** ppOldPiece) + tetris_piece_t **ppOldPiece) { assert((pBucket != NULL) && (pPiece != NULL) && (ppOldPiece != NULL)); @@ -290,7 +290,8 @@ void tetris_bucket_advancePiece(tetris_bucket_t *pBucket) uint16_t nPiece = tetris_piece_getBitmap(pBucket->pPiece); // Is the bucket filled up? - if ((pBucket->nRow < 0) && (nPiece & (0x0FFF >> ((3 + pBucket->nRow) << 2))) != 0) + if ((pBucket->nRow < 0) && + (nPiece & (0x0FFF >> ((3 + pBucket->nRow) << 2))) != 0) { pBucket->status = TETRIS_BUS_GAMEOVER; } diff --git a/games/tetris/bucket.h b/games/tetris/bucket.h index 0b4736c..0939130 100644 --- a/games/tetris/bucket.h +++ b/games/tetris/bucket.h @@ -2,7 +2,7 @@ #define BUCKET_H_ #include -#include "../../autoconf.h" +#include "../../config.h" #include "piece.h" diff --git a/games/tetris/highscore.c b/games/tetris/highscore.c index c1a39b9..c544844 100644 --- a/games/tetris/highscore.c +++ b/games/tetris/highscore.c @@ -1,11 +1,11 @@ -#include #include +#include #include -#include "highscore.h" #include "../../config.h" #include "../../scrolltext/scrolltext.h" #include "../../joystick/joystick.h" #include "../../compat/eeprom.h" +#include "highscore.h" // global array for the high score uint16_t tetris_highscore[TETRIS_HISCORE_END] EEMEM; diff --git a/games/tetris/highscore.h b/games/tetris/highscore.h index b7f5141..757e3c2 100644 --- a/games/tetris/highscore.h +++ b/games/tetris/highscore.h @@ -1,6 +1,8 @@ #ifndef TETRIS_HIGHSCORE_H_ #define TETRIS_HIGHSCORE_H_ +#include + /** * indexes for different tetris variants */ diff --git a/games/tetris/piece.c b/games/tetris/piece.c index eafbebb..75541aa 100644 --- a/games/tetris/piece.c +++ b/games/tetris/piece.c @@ -1,7 +1,6 @@ #include #include #include - #include "../../compat/pgmspace.h" #include "piece.h" diff --git a/games/tetris/tetris_main.c b/games/tetris/tetris_main.c index 058bdad..1ff18f3 100644 --- a/games/tetris/tetris_main.c +++ b/games/tetris/tetris_main.c @@ -1,5 +1,4 @@ #include -#include #include #include diff --git a/games/tetris/variant_bastet.c b/games/tetris/variant_bastet.c index 3d5fdac..8a4d823 100644 --- a/games/tetris/variant_bastet.c +++ b/games/tetris/variant_bastet.c @@ -1,17 +1,17 @@ -#include #include #include #include +#include #include "../../random/prng.h" #include "../../compat/pgmspace.h" #include "../../menu/menu.h" +#include "bearing.h" +#include "piece.h" +#include "highscore.h" +#include "bucket.h" +#include "input.h" #include "variants.h" #include "tetris_main.h" -#include "input.h" -#include "piece.h" -#include "bucket.h" -#include "bearing.h" -#include "input.h" #include "variant_bastet.h" diff --git a/games/tetris/variant_bastet.h b/games/tetris/variant_bastet.h index b06a841..d6fa202 100644 --- a/games/tetris/variant_bastet.h +++ b/games/tetris/variant_bastet.h @@ -1,12 +1,13 @@ -#ifndef BAST_H_ -#define BAST_H_ +#ifndef VARIANT_BASTET_H_ +#define VARIANT_BASTET_H_ #include -#include "variants.h" -#include "bucket.h" -#include "piece.h" #include "bearing.h" +#include "piece.h" +#include "highscore.h" +#include "bucket.h" #include "input.h" +#include "variants.h" /*************** * entry point * @@ -226,4 +227,4 @@ void tetris_bastet_setLastInput(void *pVariantData, */ tetris_bearing_t tetris_bastet_getBearing(void *pVariantData); -#endif /* BAST_H_ */ +#endif /*VARIANT_BASTET_H_*/ diff --git a/games/tetris/variant_fp.c b/games/tetris/variant_fp.c index 5168ca0..ae7e4f2 100644 --- a/games/tetris/variant_fp.c +++ b/games/tetris/variant_fp.c @@ -1,20 +1,18 @@ #include -#include #include #include - #include "../../random/prng.h" #include "../../compat/pgmspace.h" #include "../../menu/menu.h" -#include "variant_fp.h" -#include "variant_std.h" +#include "bearing.h" +#include "piece.h" +#include "highscore.h" +#include "bucket.h" +#include "input.h" #include "variants.h" #include "tetris_main.h" -#include "piece.h" -#include "bucket.h" -#include "highscore.h" -#include "bearing.h" -#include "input.h" +#include "variant_std.h" +#include "variant_fp.h" /*************** @@ -83,12 +81,6 @@ void tetris_fp_setLastInput(void *pVariantData, tetris_standard_variant_t *pStdVariant = (tetris_standard_variant_t *)pVariantData; - if (inCmd == TETRIS_INCMD_ROT_CW) - { - pStdVariant->nBearing = (pStdVariant->nBearing + 1) % 4; - } - else if (inCmd == TETRIS_INCMD_ROT_CCW) - { - pStdVariant->nBearing = (pStdVariant->nBearing + 3) % 4; - } + pStdVariant->nBearing = + (pStdVariant->nBearing + (TETRIS_INCMD_ROT_CW ? 1 : 3)) % 4; } diff --git a/games/tetris/variant_fp.h b/games/tetris/variant_fp.h index d3a5b80..390b9a4 100644 --- a/games/tetris/variant_fp.h +++ b/games/tetris/variant_fp.h @@ -2,11 +2,9 @@ #define VARIANT_FP_H_ #include -#include "variant_std.h" -#include "variants.h" -#include "highscore.h" -#include "piece.h" #include "bearing.h" +#include "highscore.h" +#include "variants.h" #include "input.h" diff --git a/games/tetris/variant_std.c b/games/tetris/variant_std.c index b4a6836..f641752 100644 --- a/games/tetris/variant_std.c +++ b/games/tetris/variant_std.c @@ -1,25 +1,19 @@ -/* Borgtris - * by: Christian Kroll - * date: Tuesday, 2007/09/16 - */ - #include #include #include #include - -#include "../../autoconf.h" +#include "../../config.h" #include "../../random/prng.h" #include "../../compat/pgmspace.h" #include "../../menu/menu.h" -#include "variant_std.h" +#include "bearing.h" +#include "piece.h" +#include "highscore.h" +#include "bucket.h" +#include "input.h" #include "variants.h" #include "tetris_main.h" -#include "piece.h" -#include "bucket.h" -#include "highscore.h" -#include "bearing.h" -#include "input.h" +#include "variant_std.h" /*************** diff --git a/games/tetris/variant_std.h b/games/tetris/variant_std.h index 2d11217..2d6b611 100644 --- a/games/tetris/variant_std.h +++ b/games/tetris/variant_std.h @@ -2,11 +2,11 @@ #define VARIANT_STD_H_ #include -#include "../../autoconf.h" -#include "variants.h" +#include "../../config.h" #include "piece.h" #include "bearing.h" #include "input.h" +#include "variants.h" /*************** diff --git a/games/tetris/variants.h b/games/tetris/variants.h index de27c11..1814e10 100644 --- a/games/tetris/variants.h +++ b/games/tetris/variants.h @@ -2,10 +2,10 @@ #define VARIANTS_H_ #include -#include "bucket.h" +#include "bearing.h" #include "piece.h" #include "highscore.h" -#include "bearing.h" +#include "bucket.h" #include "input.h" typedef struct tetris_variant_t @@ -132,6 +132,7 @@ typedef struct tetris_variant_t */ tetris_highscore_index_t (*getHighscoreIndex)(void *pVariantData); + /** * inform the variant about the player's last input * @param pVariantData the variant data object we want to modify @@ -148,4 +149,4 @@ typedef struct tetris_variant_t } tetris_variant_t; -#endif /* VARIANTS_H_ */ +#endif /*VARIANTS_H_*/ diff --git a/games/tetris/view.c b/games/tetris/view.c index b09ac94..2de3015 100644 --- a/games/tetris/view.c +++ b/games/tetris/view.c @@ -1,18 +1,17 @@ #include -#include #include +#include #include #include -#include "../../autoconf.h" +#include "../../config.h" #include "../../pixel.h" #include "../../util.h" #include "../../scrolltext/scrolltext.h" -#include "variants.h" -#include "piece.h" #include "bucket.h" +#include "piece.h" +#include "variants.h" #include "view.h" -#define WAIT(ms) wait(ms) /** * \defgroup TetrisViewDefinesPrivate View: Internal constants @@ -459,9 +458,9 @@ void tetris_view_blinkBorders(tetris_view_t *pV) for (uint8_t i = 0; i < TETRIS_VIEW_BORDER_BLINK_COUNT; ++i) { tetris_view_drawBorders(pV, TETRIS_VIEW_COLORPIECE); - WAIT(TETRIS_VIEW_BORDER_BLINK_DELAY); + wait(TETRIS_VIEW_BORDER_BLINK_DELAY); tetris_view_drawBorders(pV, TETRIS_VIEW_COLORBORDER); - WAIT(TETRIS_VIEW_BORDER_BLINK_DELAY); + wait(TETRIS_VIEW_BORDER_BLINK_DELAY); } } @@ -512,7 +511,7 @@ void tetris_view_blinkLines(tetris_view_t *pV) } } // wait a few ms to make the blink effect visible - WAIT(TETRIS_VIEW_LINE_BLINK_DELAY); + wait(TETRIS_VIEW_LINE_BLINK_DELAY); } } } diff --git a/games/tetris/view.h b/games/tetris/view.h index cee956a..1e21e37 100644 --- a/games/tetris/view.h +++ b/games/tetris/view.h @@ -2,9 +2,10 @@ #define TETRIS_VIEW_H_ #include -#include "variants.h" +#include "bearing.h" #include "piece.h" #include "bucket.h" +#include "variants.h" /**