Skip to content

Commit

Permalink
Fix -bitmap-size?
Browse files Browse the repository at this point in the history
  • Loading branch information
benbaker76 committed May 22, 2024
1 parent 09c006a commit 4a82c50
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/gfx2next.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int _CRT_glob = 0;
#define CUTE_ASEPRITE_IMPLEMENTATION
#include "cute_aseprite.h"

#define VERSION "1.1.13"
#define VERSION "1.1.14"

#define DIR_SEPERATOR_CHAR '\\'

Expand Down Expand Up @@ -961,6 +961,8 @@ static bool parse_args(int argc, char *argv[], arguments_t *args)
{
m_bitmap_width = atoi(strtok(&argv[i][13], "x"));
m_bitmap_height = atoi(strtok(NULL, "x"));
m_args.bank_size = BANKSIZE_CUSTOM;
m_bank_size = m_bitmap_width * m_bitmap_height;

printf("Bitmap Size = %d x %d\n", m_bitmap_width, m_bitmap_height);
}
Expand Down Expand Up @@ -2298,12 +2300,12 @@ static uint8_t *get_bitmap_width_height(uint8_t *p_data, int bank_index, int bit

bank_count++;
}

if (bank_count > 0)
{
*bank_size = bank_count;
}

return bank;
}

Expand Down Expand Up @@ -2686,7 +2688,7 @@ static void write_next_bitmap()
while (size > 0)
{
int bank_size = (size < m_bank_size ? size : m_bank_size);

create_series_filename(m_bitmap_filename, m_args.out_filename, EXT_NXI, m_args.compress & COMPRESS_BITMAP, m_bank_count);

if (m_args.asm_mode > ASMMODE_NONE)
Expand All @@ -2704,7 +2706,7 @@ static void write_next_bitmap()
}

uint8_t *p_image = NULL;

if (m_bitmap_width != 0 && m_bitmap_height != 0)
p_image = get_bitmap_width_height(m_next_image, m_bank_count, m_bitmap_width, m_bitmap_height, &bank_size);
else
Expand Down

0 comments on commit 4a82c50

Please sign in to comment.