Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/screenshots/item-ground-after-bias.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/item-ground-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/item-ground-before-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/item-ground-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 19 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,15 @@ static void update_hurt_flash(void) {
palette_effect = 1;
}
hurt_flash--;
} else if (bonus_flash) {
return;
}

if (palette_effect == 1) {
restore_hurt_palettes();
palette_effect = 0;
}

if (bonus_flash) {
if (palette_effect != 3) {
set_bonus_palettes();
palette_effect = 3;
Expand Down Expand Up @@ -6211,9 +6219,8 @@ static int world_sprite_origin_y(u16 thing_type, int h) {

if (thing_is_corpse(thing_type)) return origin_y + 2;
if (thing_is_pickup(thing_type)) {
int lift = h < 48 ? 14 : (h < 96 ? 18 : 22);
if (origin_y > GAME_H - 18) origin_y = GAME_H - 18;
return origin_y - lift;
if (origin_y > GAME_H - 10) origin_y = GAME_H - 10;
return origin_y + 1;
}
if (thing_is_barrel(thing_type)) return origin_y + 1;

Expand All @@ -6231,6 +6238,13 @@ static int projected_floor_screen_offset(short world_x_q8, short world_y_q8, int
return offset;
}

static int pickup_floor_distance_bias(int dist_q8) {
if (dist_q8 > WORLD_Q8(2304)) return 10;
if (dist_q8 > WORLD_Q8(1536)) return 7;
if (dist_q8 > WORLD_Q8(1024)) return 4;
return 0;
}

static int thing_min_screen_height(u16 thing_type) {
#if DOOM_SIMPLE_MAP
switch (thing_type) {
Expand Down Expand Up @@ -6363,6 +6377,7 @@ static u8 render_type_slot(u16 slot, int thing_index, u16 thing_type, short worl
top = world_sprite_origin_y(thing_type, h)
- projected_floor_screen_offset(world_x_q8, world_y_q8, h, view_px, view_py)
- meta->origin_y + ENEMY_GROUND_LIFT;
if (is_pickup) top += pickup_floor_distance_bias(dist_q8);
}
if (top < 0) top = 0;
for (u16 j = 0; j < ENEMY_STRIPS; j++) {
Expand Down
12 changes: 6 additions & 6 deletions tools/check_powerup_screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ def main() -> int:
print(error, file=sys.stderr)
return 1

armor = score_region(image, (300, 310, 440, 420))
ammo = score_region(image, (400, 315, 500, 395))
weapon = score_region(image, (470, 300, 620, 395))
shells = score_region(image, (610, 315, 700, 400))
playfield = score_region(image, (240, 250, 720, 460))
armor = score_region(image, (280, 330, 460, 470))
ammo = score_region(image, (390, 335, 500, 430))
weapon = score_region(image, (450, 300, 650, 430))
shells = score_region(image, (600, 320, 715, 430))
playfield = score_region(image, (240, 270, 720, 490))
hud = score_region(image, (0, 560, 960, 672))

require_min(errors, path, "green armor pickup", armor, "green", 1500)
require_min(errors, path, "green armor pickup", armor, "green", 900)
require_min(errors, path, "green armor pickup", armor, "colored", 3000)
require_min(errors, path, "ammo box pickup", ammo, "green", 400)
require_min(errors, path, "ammo box pickup", ammo, "gray", 500)
Expand Down
Loading