Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#149 fix waveform height, optimize font files, move oscilloscope height definition to font files #150

Merged
merged 1 commit into from
May 26, 2024
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
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
Loading