Skip to content

Commit

Permalink
ATLAS: Create minimum 1x1 textures from ibar
Browse files Browse the repository at this point in the history
Atlas extracted the ammo icons from ibar
Matrix-QW created a 1x1 ibar.png
Atlas then attempted to create a 0x0 ammo texture

Fixes #571
  • Loading branch information
meag committed Aug 2, 2021
1 parent a861b4b commit 8a22b7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions r_atlas.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ void CachePics_LoadAmmoPics(mpic_t* ibar)
realwidth = (newsh - newsl) * texWidth;
realheight = (newth - newtl) * texHeight;

// Cope with 1x1 transparent png files...(#571)
realwidth = max(realwidth, 1);
realheight = max(realheight, 1);
x_src = min(x_src, texWidth - 1);
y_src = min(y_src, texHeight - 1);

snprintf(name, sizeof(name), "hud_ammo_%d", i - WADPIC_SB_IBAR_AMMO1);

for (y = 0; y < realheight; ++y) {
Expand Down
1 change: 1 addition & 0 deletions release-notes-latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Leaving these here as bugs between dev versions of 3.6 aren't in the release not
- Fixed incomplete rendering when gibbed or dead in shallow water (reported by Matrix, #568)
- Fixed tab key not switching tabs on serverinfo popup (reported by Hangtime, #555)
- Fixed `/demo_jump_mark` not working if `/demo_jump_rewind` not set
- Fixed coping with 1x1 ibar.png (reported by Matrix, #571)
- Added `/gl_smoothmodels` back in (modern renderer only), (requested by Repast via [quakeworld.nu](https://www.quakeworld.nu/forum/topic/7508/why-is-the-command-glsmoothmodels-r))
- Added `/demo_jump_skip_messages` to determine if messages should be printed to console during demo jump
- Added `/demo_jump_end` to jump to next intermission point or end of demo (requested by Hangtime, #564)
Expand Down

0 comments on commit 8a22b7b

Please sign in to comment.