ソースを参照

* Displays current completed lines count

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/cacatris/trunk@1126 92316355-f0b4-4df1-b90c-862c8a59935f
master
jylam 18年前
コミット
23aeab3d26
2個のファイルの変更12行の追加8行の削除
  1. +1
    -1
      src/cacatris.h
  2. +11
    -7
      src/main.c

+ 1
- 1
src/cacatris.h ファイルの表示

@@ -59,7 +59,7 @@ typedef struct piece_t_ {
} piece_t;


void infos_populate(cucul_canvas_t *, unsigned int score, unsigned char level);
void infos_populate(cucul_canvas_t *, unsigned int, unsigned char , unsigned char);
void playfield_draw(cucul_canvas_t *);
void put_piece(unsigned int, unsigned int, unsigned int, unsigned int);
void remove_piece(unsigned int id, unsigned int x, unsigned int y, unsigned int rot);


+ 11
- 7
src/main.c ファイルの表示

@@ -130,7 +130,7 @@ int main(int argc, char *argv[])


/* Populate info canvas */
infos_populate(infos, score, level);
infos_populate(infos, score, level, total_lines);
/* Draw everything on playfield */
put_piece(current_piece, x ,y, rotation);
playfield_draw(field);
@@ -165,7 +165,7 @@ int main(int argc, char *argv[])
{
level++;
total_lines = 0;
speed+=2;
speed+=4;
memset(playfield, 0, FIELD_WIDTH*FIELD_HEIGHT);
}
}
@@ -184,14 +184,17 @@ int main(int argc, char *argv[])
}


void infos_populate(cucul_canvas_t *inf, unsigned int score, unsigned char level)
void infos_populate(cucul_canvas_t *inf, unsigned int score,
unsigned char level, unsigned char total)
{
unsigned int i;
char scoreline[1024];
char levelline[1024];
char scoreline[256];
char levelline[256];
char totalline[256];

sprintf(scoreline, " Score : %05d ", score);
sprintf(levelline, " Level : %02d ", level);
sprintf(totalline, " Lines : %02d ", total);

cucul_set_color(inf, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
cucul_putstr(inf, 0, 0, " =Cacatris= ");
@@ -201,9 +204,10 @@ void infos_populate(cucul_canvas_t *inf, unsigned int score, unsigned char level
cucul_putstr(inf, 0, 4, " ");
cucul_putstr(inf, 0, 5, levelline);
cucul_putstr(inf, 0, 6, scoreline);
cucul_putstr(inf, 0, 7, " Time : XX:XX ");
cucul_putstr(inf, 0, 7, totalline);
cucul_putstr(inf, 0, 8, " Time : XX:XX ");

for(i = 7; i < cucul_get_canvas_height(inf); i++)
for(i = 8; i < cucul_get_canvas_height(inf); i++)
{
cucul_putstr(inf, 0, i," ");
}


読み込み中…
キャンセル
保存