Skip to content

Commit

Permalink
Merge pull request #536 from lenardg/feature/credits-update
Browse files Browse the repository at this point in the history
Feature/credits update
  • Loading branch information
Gadgetoid committed Jan 8, 2021
2 parents 5d62777 + f0e5e4e commit 48c960c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions launcher/credits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@

using namespace blit;

#include "assets.hpp"
#include "credits.hpp"
#include "contrib.hpp"
#include "theme.hpp"

// Speed of scrolling, ms per pixel
#define SPEED 40

#define ROW_HEIGHT 12

// External variables

namespace credits {
static const Font launcher_font(font8x8);

enum class CreditRenderMode {
Credits,
Expand All @@ -35,7 +41,7 @@ namespace credits {

static const char* credits[] = {
"*32Blit",
"A pimoroni production",
"A Pimoroni production",
"",
"*Pimoroni Overlords",
"Jon",
Expand Down Expand Up @@ -63,7 +69,7 @@ namespace credits {
"No parrots were harmed in",
"the making of this product.",
"",
"*(c) MMXX",
"*(c) MMXXI",
nullptr // credits ends with a nullptr
};

Expand Down Expand Up @@ -125,7 +131,7 @@ namespace credits {
// render
if (y >= 0 && y < screen.bounds.h) { // clip to screen
if (mode == CreditRenderMode::Contributors && contributors[contrib_index]) {
screen.text(contributors[contrib_index], minimal_font, Point(screen_width / 2, y), true, TextAlign::center_h);
screen.text(contributors[contrib_index], launcher_font, Point(screen_width / 2, y), true, TextAlign::center_h);
}
else if (mode == CreditRenderMode::SpecialThanks && specialthanks[special_index]) {
screen.pen = rainbow_colours[colour_index];
Expand All @@ -136,7 +142,7 @@ namespace credits {
screen.text(specialthanks[special_index], outline_font, Point(screen_width / 2, y), true, TextAlign::center_h);
}
else { // render regular text
screen.text(text_to_render, minimal_font, Point(screen_width / 2, y), true, TextAlign::center_h);
screen.text(text_to_render, launcher_font, Point(screen_width / 2, y), true, TextAlign::center_h);
}
}

Expand All @@ -156,7 +162,7 @@ namespace credits {
if (mode == CreditRenderMode::Credits) {
next_index++;
}
y += 10;
y += ROW_HEIGHT;
}

screen.pen = bar_colour;
Expand Down
1 change: 1 addition & 0 deletions launcher/launcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ class AutoRepeat {
uint32_t pressed_time = 0;
uint32_t last_time = 0;
};

0 comments on commit 48c960c

Please sign in to comment.