cleaned up include directives

This commit is contained in:
Christian Kroll 2010-08-28 15:13:35 +00:00
parent adfccca351
commit e23f079ae9
15 changed files with 55 additions and 68 deletions

View File

@ -2,7 +2,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>
#include "../../autoconf.h" #include "../../config.h"
#include "bucket.h" #include "bucket.h"
#include "piece.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, void tetris_bucket_insertPiece(tetris_bucket_t *pBucket,
tetris_piece_t *pPiece, tetris_piece_t *pPiece,
tetris_piece_t** ppOldPiece) tetris_piece_t **ppOldPiece)
{ {
assert((pBucket != NULL) && (pPiece != NULL) && (ppOldPiece != NULL)); 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); uint16_t nPiece = tetris_piece_getBitmap(pBucket->pPiece);
// Is the bucket filled up? // 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; pBucket->status = TETRIS_BUS_GAMEOVER;
} }

View File

@ -2,7 +2,7 @@
#define BUCKET_H_ #define BUCKET_H_
#include <stdint.h> #include <stdint.h>
#include "../../autoconf.h" #include "../../config.h"
#include "piece.h" #include "piece.h"

View File

@ -1,11 +1,11 @@
#include <string.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <stdint.h> #include <stdint.h>
#include "highscore.h"
#include "../../config.h" #include "../../config.h"
#include "../../scrolltext/scrolltext.h" #include "../../scrolltext/scrolltext.h"
#include "../../joystick/joystick.h" #include "../../joystick/joystick.h"
#include "../../compat/eeprom.h" #include "../../compat/eeprom.h"
#include "highscore.h"
// global array for the high score // global array for the high score
uint16_t tetris_highscore[TETRIS_HISCORE_END] EEMEM; uint16_t tetris_highscore[TETRIS_HISCORE_END] EEMEM;

View File

@ -1,6 +1,8 @@
#ifndef TETRIS_HIGHSCORE_H_ #ifndef TETRIS_HIGHSCORE_H_
#define TETRIS_HIGHSCORE_H_ #define TETRIS_HIGHSCORE_H_
#include <stdint.h>
/** /**
* indexes for different tetris variants * indexes for different tetris variants
*/ */

View File

@ -1,7 +1,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>
#include "../../compat/pgmspace.h" #include "../../compat/pgmspace.h"
#include "piece.h" #include "piece.h"

View File

@ -1,5 +1,4 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>

View File

@ -1,17 +1,17 @@
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <stdint.h>
#include "../../random/prng.h" #include "../../random/prng.h"
#include "../../compat/pgmspace.h" #include "../../compat/pgmspace.h"
#include "../../menu/menu.h" #include "../../menu/menu.h"
#include "bearing.h"
#include "piece.h"
#include "highscore.h"
#include "bucket.h"
#include "input.h"
#include "variants.h" #include "variants.h"
#include "tetris_main.h" #include "tetris_main.h"
#include "input.h"
#include "piece.h"
#include "bucket.h"
#include "bearing.h"
#include "input.h"
#include "variant_bastet.h" #include "variant_bastet.h"

View File

@ -1,12 +1,13 @@
#ifndef BAST_H_ #ifndef VARIANT_BASTET_H_
#define BAST_H_ #define VARIANT_BASTET_H_
#include <stdint.h> #include <stdint.h>
#include "variants.h"
#include "bucket.h"
#include "piece.h"
#include "bearing.h" #include "bearing.h"
#include "piece.h"
#include "highscore.h"
#include "bucket.h"
#include "input.h" #include "input.h"
#include "variants.h"
/*************** /***************
* entry point * * entry point *
@ -226,4 +227,4 @@ void tetris_bastet_setLastInput(void *pVariantData,
*/ */
tetris_bearing_t tetris_bastet_getBearing(void *pVariantData); tetris_bearing_t tetris_bastet_getBearing(void *pVariantData);
#endif /* BAST_H_ */ #endif /*VARIANT_BASTET_H_*/

View File

@ -1,20 +1,18 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>
#include "../../random/prng.h" #include "../../random/prng.h"
#include "../../compat/pgmspace.h" #include "../../compat/pgmspace.h"
#include "../../menu/menu.h" #include "../../menu/menu.h"
#include "variant_fp.h" #include "bearing.h"
#include "variant_std.h" #include "piece.h"
#include "highscore.h"
#include "bucket.h"
#include "input.h"
#include "variants.h" #include "variants.h"
#include "tetris_main.h" #include "tetris_main.h"
#include "piece.h" #include "variant_std.h"
#include "bucket.h" #include "variant_fp.h"
#include "highscore.h"
#include "bearing.h"
#include "input.h"
/*************** /***************
@ -83,12 +81,6 @@ void tetris_fp_setLastInput(void *pVariantData,
tetris_standard_variant_t *pStdVariant = tetris_standard_variant_t *pStdVariant =
(tetris_standard_variant_t *)pVariantData; (tetris_standard_variant_t *)pVariantData;
if (inCmd == TETRIS_INCMD_ROT_CW) pStdVariant->nBearing =
{ (pStdVariant->nBearing + (TETRIS_INCMD_ROT_CW ? 1 : 3)) % 4;
pStdVariant->nBearing = (pStdVariant->nBearing + 1) % 4;
}
else if (inCmd == TETRIS_INCMD_ROT_CCW)
{
pStdVariant->nBearing = (pStdVariant->nBearing + 3) % 4;
}
} }

View File

@ -2,11 +2,9 @@
#define VARIANT_FP_H_ #define VARIANT_FP_H_
#include <stdint.h> #include <stdint.h>
#include "variant_std.h"
#include "variants.h"
#include "highscore.h"
#include "piece.h"
#include "bearing.h" #include "bearing.h"
#include "highscore.h"
#include "variants.h"
#include "input.h" #include "input.h"

View File

@ -1,25 +1,19 @@
/* Borgtris
* by: Christian Kroll
* date: Tuesday, 2007/09/16
*/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>
#include "../../config.h"
#include "../../autoconf.h"
#include "../../random/prng.h" #include "../../random/prng.h"
#include "../../compat/pgmspace.h" #include "../../compat/pgmspace.h"
#include "../../menu/menu.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 "variants.h"
#include "tetris_main.h" #include "tetris_main.h"
#include "piece.h" #include "variant_std.h"
#include "bucket.h"
#include "highscore.h"
#include "bearing.h"
#include "input.h"
/*************** /***************

View File

@ -2,11 +2,11 @@
#define VARIANT_STD_H_ #define VARIANT_STD_H_
#include <stdint.h> #include <stdint.h>
#include "../../autoconf.h" #include "../../config.h"
#include "variants.h"
#include "piece.h" #include "piece.h"
#include "bearing.h" #include "bearing.h"
#include "input.h" #include "input.h"
#include "variants.h"
/*************** /***************

View File

@ -2,10 +2,10 @@
#define VARIANTS_H_ #define VARIANTS_H_
#include <stdint.h> #include <stdint.h>
#include "bucket.h" #include "bearing.h"
#include "piece.h" #include "piece.h"
#include "highscore.h" #include "highscore.h"
#include "bearing.h" #include "bucket.h"
#include "input.h" #include "input.h"
typedef struct tetris_variant_t typedef struct tetris_variant_t
@ -132,6 +132,7 @@ typedef struct tetris_variant_t
*/ */
tetris_highscore_index_t (*getHighscoreIndex)(void *pVariantData); tetris_highscore_index_t (*getHighscoreIndex)(void *pVariantData);
/** /**
* inform the variant about the player's last input * inform the variant about the player's last input
* @param pVariantData the variant data object we want to modify * @param pVariantData the variant data object we want to modify
@ -148,4 +149,4 @@ typedef struct tetris_variant_t
} }
tetris_variant_t; tetris_variant_t;
#endif /* VARIANTS_H_ */ #endif /*VARIANTS_H_*/

View File

@ -1,18 +1,17 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <assert.h> #include <assert.h>
#include <stdint.h> #include <stdint.h>
#include "../../autoconf.h" #include "../../config.h"
#include "../../pixel.h" #include "../../pixel.h"
#include "../../util.h" #include "../../util.h"
#include "../../scrolltext/scrolltext.h" #include "../../scrolltext/scrolltext.h"
#include "variants.h"
#include "piece.h"
#include "bucket.h" #include "bucket.h"
#include "piece.h"
#include "variants.h"
#include "view.h" #include "view.h"
#define WAIT(ms) wait(ms)
/** /**
* \defgroup TetrisViewDefinesPrivate View: Internal constants * \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) for (uint8_t i = 0; i < TETRIS_VIEW_BORDER_BLINK_COUNT; ++i)
{ {
tetris_view_drawBorders(pV, TETRIS_VIEW_COLORPIECE); 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); 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 a few ms to make the blink effect visible
WAIT(TETRIS_VIEW_LINE_BLINK_DELAY); wait(TETRIS_VIEW_LINE_BLINK_DELAY);
} }
} }
} }

View File

@ -2,9 +2,10 @@
#define TETRIS_VIEW_H_ #define TETRIS_VIEW_H_
#include <stdint.h> #include <stdint.h>
#include "variants.h" #include "bearing.h"
#include "piece.h" #include "piece.h"
#include "bucket.h" #include "bucket.h"
#include "variants.h"
/** /**