diff --git a/blocks3.h b/blocks3.h index 97d75a1..4c7b5e6 100644 --- a/blocks3.h +++ b/blocks3.h @@ -520,6 +520,7 @@ extern volatile int close_button_pressed; void Start_XYZ(int b_x, int b_y, int b_z, int b_dx, int b_dy, int b_dir); void Track_Laser(void); void Laser(void); +void Draw_Lasers(); // levels.c void Change_Levels(void); @@ -588,6 +589,7 @@ enum { }; // mon.c +void Draw_Monsters(); void Monster(void); void Monster_Draw(int m_no); void Monster_Mon0(int m_no); diff --git a/laser.c b/laser.c index e54088f..16f794d 100644 --- a/laser.c +++ b/laser.c @@ -10,48 +10,60 @@ int x, y, z, dx, dy; void Laser(void) { - int i, j, k; - int map_laser_back[20][15][2]; - - for (i = 0; i < 20; i++) - for (j = 0; j < 15; j++) - { - map_laser_back[i][j][0] = map_laser[i][j][0]; - map_laser_back[i][j][1] = map_laser[i][j][1]; - - map_laser[i][j][0] = 0; - map_laser[i][j][1] = 0; - } - - for (i = 0; i < box_count; i++) - { - if (box[i].type & LASER) - { - if (box[i].type == LASER_4WAY) - { - Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 1); - Track_Laser(); - Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 2); - Track_Laser(); - Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 4); - Track_Laser(); - Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 8); - Track_Laser(); - } - else - { - Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, box[i].dir); - Track_Laser(); - } - } - } - - - for (i = 0; i < 20; i++) - for (j = 0; j < 15; j++) - for (k = 0; k < 2; k++) - if (map_laser[i][j][k] != map_laser_back[i][j][k]) DirtyList(i*_block_width, j*_block_height, k*_block_depth, _block_width, _block_height_depth, blank); + int i, j, k; + int map_laser_back[20][15][2]; + + for (i = 0; i < 20; i++) + { + for (j = 0; j < 15; j++) + { + map_laser_back[i][j][0] = map_laser[i][j][0]; + map_laser_back[i][j][1] = map_laser[i][j][1]; + + map_laser[i][j][0] = 0; + map_laser[i][j][1] = 0; + } + } + + for (i = 0; i < box_count; i++) + { + if (box[i].type & LASER) + { + if (box[i].type == LASER_4WAY) + { + Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 1); + Track_Laser(); + Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 2); + Track_Laser(); + Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 4); + Track_Laser(); + Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, 8); + Track_Laser(); + } + else + { + Start_XYZ(box[i].x, box[i].y, box[i].z, box[i].dx, box[i].dy, box[i].dir); + Track_Laser(); + } + } + } + + for (i = 0; i < 20; i++) + { + for (j = 0; j < 15; j++) + { + for (k = 0; k < 2; k++) + { + if (map_laser[i][j][k] != map_laser_back[i][j][k]) + DirtyList(i*_block_width, j*_block_height, k*_block_depth, _block_width, _block_height_depth, blank); + } + } + } +} +void Draw_Lasers() +{ + // TODO: sort out properly } void Start_XYZ(int b_x, int b_y, int b_z, int b_dx, int b_dy, int b_dir) diff --git a/main.c b/main.c index c8cdbed..c778d93 100644 --- a/main.c +++ b/main.c @@ -179,10 +179,10 @@ int Run_Level(void) if (no_ply == 2) Player_Pickup_Check(1); - Player_Draw(0); +/* Player_Draw(0); if (no_ply == 2) - Player_Draw(1); + Player_Draw(1);*/ Check_Fall(0); @@ -211,6 +211,17 @@ int Run_Level(void) #endif } + Player_Draw(0); + + if (no_ply == 2) + Player_Draw(1); + + Draw_Monsters(); + //Draw_Lasers(); + // still todo: Doors + + // + Draw_Explode(); Draw_Screen(); diff --git a/mon.c b/mon.c index 4b7c62d..eb9f025 100644 --- a/mon.c +++ b/mon.c @@ -25,7 +25,7 @@ void Monster(void) if (mon[i].type == MON2) Monster_Mon1(i); } - Monster_Draw(i); +// Monster_Draw(i); } for (k = 0; k < 2; k++) @@ -42,6 +42,14 @@ void Monster(void) } } +void Draw_Monsters() +{ + int i; + + for (i = 0; i < mon_count; i++) + Monster_Draw(i); +} + void Monster_Draw(int m_no) { if ((mon[m_no].dx) || (mon[m_no].dy)) mon[m_no].frame++;