In scroll only activate actors that should be onscreen
@@ -79,18 +79,20 @@ void ScrollUpdateRowWithDelay(INT16 x, INT16 y) {
pending_w_i = SCREEN_TILE_REFRES_W;
pending_w_map = image_ptr + image_tile_width * y + x;
+ // Activate Actors in Row
for (i = 1; i != actors_len; i++) {
- //
if (actors[i].pos.y >> 3 == y) {
+ INT16 tx = actors[i].pos.x >> 3;
+ if (U_LESS_THAN(x, tx) && U_LESS_THAN(tx, x + SCREEN_TILE_REFRES_W)) {
ActivateActor(i);
}
}
+ }
#ifdef CGB
pending_w_cmap = image_attr_ptr + image_tile_width * y + x;
#endif
- // ActivateActor(2);
}
void ScrollUpdateRow(INT16 x, INT16 y) {
@@ -126,7 +128,7 @@ void ScrollUpdateRow(INT16 x, INT16 y) {
for (i = 1; i != actors_len; i++) {
if (actors[i].pos.y >> 3 == y) {
INT16 tx = actors[i].pos.x >> 3;
- if (tx >= x && tx <= x + 23) {
+ if (U_LESS_THAN(x, tx) && U_LESS_THAN(tx, x + 24)) {
ActivateActor(i);
}
}
@@ -184,11 +186,15 @@ void ScrollUpdateColumnWithDelay(INT16 x, INT16 y) {
ScrollUpdateColumnR();
}
+ // Activate Actors in Column
for (i = 1; i != actors_len; i++) {
if (actors[i].pos.x >> 3 == x) {
+ INT16 ty = actors[i].pos.y >> 3;
+ if (U_LESS_THAN(y, ty) && U_LESS_THAN(ty, y + SCREEN_TILE_REFRES_H)) {
ActivateActor(i);
}
}
+ }
pending_h_x = x;
pending_h_y = y;
@@ -231,7 +237,6 @@ void RenderScreen() {
POP_BANK;
game_time = 0;
- UpdateActors();
DISPLAY_ON;
}
