Skip to content

Commit

Permalink
#149 fix waveform height, optimize font files, move oscilloscope heig…
Browse files Browse the repository at this point in the history
…ht definition to font files
  • Loading branch information
laamaa committed May 26, 2024
1 parent 9b8c76e commit 708a49d
Show file tree
Hide file tree
Showing 7 changed files with 397 additions and 23 deletions.
46 changes: 41 additions & 5 deletions src/font1.h

Large diffs are not rendered by default.

70 changes: 68 additions & 2 deletions src/font2.h

Large diffs are not rendered by default.

76 changes: 74 additions & 2 deletions src/font3.h

Large diffs are not rendered by default.

91 changes: 89 additions & 2 deletions src/font4.h

Large diffs are not rendered by default.

124 changes: 122 additions & 2 deletions src/font5.h

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/inline_font.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct inline_font {
const int screen_offset_x;
const int screen_offset_y;
const int text_offset_y;
const int waveform_max_height;
const long image_size;
const unsigned char image_data[];
};
Expand Down
12 changes: 2 additions & 10 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static int font_mode = -1;
static int m8_hardware_model = 0;
static int screen_offset_y = 0;
static int text_offset_y = 0;
static int waveform_max_height = 20;
static int waveform_max_height = 24;

static int texture_width = 320;
static int texture_height = 240;
Expand Down Expand Up @@ -143,15 +143,7 @@ void set_font_mode(unsigned int mode) {
font_mode = mode;
screen_offset_y = fonts[mode]->screen_offset_y;
text_offset_y = fonts[mode]->text_offset_y;

if (m8_hardware_model == 0) {
waveform_max_height = 20;
} else {
waveform_max_height = 38;
if(font_mode == 4) {
waveform_max_height = 20;
}
}
waveform_max_height = fonts[mode]->waveform_max_height;

change_font(fonts[mode]);
SDL_LogDebug(SDL_LOG_CATEGORY_RENDER,"Font mode %i, Screen offset %i", mode, screen_offset_y);
Expand Down

0 comments on commit 708a49d

Please sign in to comment.