fix KickC issue #736
This commit is contained in:
parent
d2dfbd89b0
commit
767c836695
|
@ -40,12 +40,12 @@ void ck_init() {
|
|||
void ck_drawpiece(sprite *pl) {
|
||||
tile_offset *data = get_piece_offsets(pl->piece, pl->angle);
|
||||
for(byte t=0; t<4; t++) {
|
||||
int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
/*
|
||||
int x = pl->x + d->offset_x;
|
||||
int y = pl->y + d->offset_y;
|
||||
*/
|
||||
// int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
// int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
|
||||
int x = pl->x + (int) data->offset_x;
|
||||
int y = pl->y + (int) data->offset_y;
|
||||
|
||||
WRITE_BOARD(y,x,pl->piece);
|
||||
data++;
|
||||
}
|
||||
|
@ -55,12 +55,14 @@ void ck_drawpiece(sprite *pl) {
|
|||
void ck_erasepiece(sprite *pl) {
|
||||
tile_offset *data = get_piece_offsets(pl->piece, pl->angle);
|
||||
for(byte t=0; t<4; t++) {
|
||||
int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
/*
|
||||
int x = pl->x + (int) data->offset_x;
|
||||
int y = pl->y + (int) data->offset_y;
|
||||
*/
|
||||
#ifdef BUG736
|
||||
int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
#else
|
||||
int x = pl->x + (int) data->offset_x;
|
||||
int y = pl->y + (int) data->offset_y;
|
||||
#endif
|
||||
|
||||
WRITE_BOARD(y,x,EMPTY);
|
||||
data++;
|
||||
}
|
||||
|
@ -70,12 +72,14 @@ void ck_erasepiece(sprite *pl) {
|
|||
void ck_markpiece(sprite *pl) {
|
||||
tile_offset *data = get_piece_offsets(pl->piece, pl->angle);
|
||||
for(byte t=0; t<4; t++) {
|
||||
int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
/*
|
||||
int x = pl->x + (int) data->offset_x;
|
||||
int y = pl->y + (int) data->offset_y;
|
||||
*/
|
||||
#ifdef BUG736
|
||||
int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
#else
|
||||
int x = pl->x + (int) data->offset_x;
|
||||
int y = pl->y + (int) data->offset_y;
|
||||
#endif
|
||||
|
||||
WRITE_BOARD(y,x,MARKED);
|
||||
data++;
|
||||
}
|
||||
|
@ -85,11 +89,13 @@ void ck_markpiece(sprite *pl) {
|
|||
int collides(sprite *pl) {
|
||||
tile_offset *data = get_piece_offsets(pl->piece, pl->angle);
|
||||
for(byte t=0; t<4; t++) {
|
||||
int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
|
||||
//int x = pl->x + (int) data->offset_x;
|
||||
//int y = pl->y + (int) data->offset_y;
|
||||
#ifdef BUG736
|
||||
int x = pl->x; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = pl->y; byte y1 = data->offset_y; y+= (int) y1;
|
||||
#else
|
||||
int x = pl->x + (int) data->offset_x;
|
||||
int y = pl->y + (int) data->offset_y;
|
||||
#endif
|
||||
if(x<0) return 1; // does it collide with left border?
|
||||
if(x>=BCOLS) return 1; // does it collide with right border?
|
||||
if(y>=BROWS) return 1; // does it collide with bottom?
|
||||
|
|
|
@ -188,8 +188,8 @@ void gr_erasepiece(sprite *p) {
|
|||
}
|
||||
|
||||
for(byte t=0; t<4; t++) {
|
||||
int x = px + data->offset_x;
|
||||
int y = py + data->offset_y;
|
||||
int x = px + (int) data->offset_x;
|
||||
int y = py + (int) data->offset_y;
|
||||
data++;
|
||||
draw_tile((byte)x,(byte)y,EMPTY_GR_CHAR,EMPTY_GR_COLOR);
|
||||
}
|
||||
|
@ -208,11 +208,19 @@ void gr_erasepiece_unmarked(sprite *p) {
|
|||
py += STARTBOARD_Y;
|
||||
|
||||
for(byte t=0; t<4; t++) {
|
||||
int x = px; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = py; byte y1 = data->offset_y; y+= (int) y1;
|
||||
#ifdef BUG736
|
||||
int x = px; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = py; byte y1 = data->offset_y; y+= (int) y1;
|
||||
|
||||
int cx = p->x; cx += (int) x1;
|
||||
int cy = p->y; cy += (int) y1;
|
||||
int cx = p->x; cx += (int) x1;
|
||||
int cy = p->y; cy += (int) y1;
|
||||
#else
|
||||
int x = px + (int) data->offset_x;
|
||||
int y = py + (int) data->offset_y;
|
||||
|
||||
int cx = p->x + (int) data->offset_x;
|
||||
int cy = p->y + (int) data->offset_y;
|
||||
#endif
|
||||
|
||||
data++;
|
||||
|
||||
|
@ -240,15 +248,17 @@ void gr_drawpiece(sprite *p) {
|
|||
|
||||
byte piece = p->piece;
|
||||
for(byte t=0; t<4; t++) {
|
||||
int x = px; byte x1 = data->offset_x; x+= (int) x1;
|
||||
int y = py; byte y1 = data->offset_y; y+= (int) y1;
|
||||
#ifdef BUG736
|
||||
int x = px + (int) data->offset_x;
|
||||
int y = py + (int) data->offset_y;
|
||||
else
|
||||
int x = px + (int) data->offset_x;
|
||||
int y = py + (int) data->offset_y;
|
||||
#endif
|
||||
data++;
|
||||
/*
|
||||
int x = px + data[t].offset_x;
|
||||
int y = py + data[t].offset_y;
|
||||
*/
|
||||
byte ch = piece_chars[piece]; //piece_chars[p->piece];
|
||||
byte col = piece_colors[piece]; //piece_colors[p->piece];
|
||||
|
||||
byte ch = piece_chars[piece];
|
||||
byte col = piece_colors[piece];
|
||||
draw_tile((byte)x,(byte)y,ch,col);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
// previous implementations for the Laser 310 and Laser 500
|
||||
//
|
||||
|
||||
// KickC bug waiting to be fixed
|
||||
#define BUG736 1
|
||||
|
||||
// standard libraries
|
||||
#include <string.h> // memset, memcopy (memcopy no longer necessary)
|
||||
#include <stdlib.h> // for sprintf, rand
|
||||
|
@ -321,7 +324,6 @@ void initGame() {
|
|||
generate_new_piece();
|
||||
}
|
||||
|
||||
|
||||
void main() {
|
||||
|
||||
// install the start-of-frame interrupt detection
|
||||
|
|
Loading…
Reference in New Issue