Commit 68bd5c32 authored by Jack's avatar Jack
Browse files

bumped version

parent 14355a48
...@@ -68,7 +68,7 @@ void Stegano::load(const PngData& data, Machine& m) ...@@ -68,7 +68,7 @@ void Stegano::load(const PngData& data, Machine& m)
/* skip 2 null*/ /* skip 2 null*/
o += 2; o += 2;
compressedLength = std::min(32769ULL - RAW_DATA_LENGTH, compressedLength); compressedLength = std::min(size_t(32769ULL - RAW_DATA_LENGTH), compressedLength);
const std::string lookup = "\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"; const std::string lookup = "\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_";
std::string code; std::string code;
...@@ -95,7 +95,7 @@ void Stegano::load(const PngData& data, Machine& m) ...@@ -95,7 +95,7 @@ void Stegano::load(const PngData& data, Machine& m)
else else
{ {
uint8_t vn = assembleByte(d[o + i + 1]); uint8_t vn = assembleByte(d[o + i + 1]);
auto offset = ((v - 0x3c) << 4) + (vn & 0xf); auto offset = ((v - 0x3c) << 4) + (vn & 0xf);
auto length = (vn >> 4) + 2; auto length = (vn >> 4) + 2;
...@@ -124,7 +124,7 @@ void Stegano::load(const std::string& path, Machine& m) ...@@ -124,7 +124,7 @@ void Stegano::load(const std::string& path, Machine& m)
#if DEBUGGER #if DEBUGGER
fileName = path.substr(0, path.length() - 4) + ".p8"; fileName = path.substr(0, path.length() - 4) + ".p8";
#endif #endif
SDL_Surface* surface = IMG_Load(path.c_str()); SDL_Surface* surface = IMG_Load(path.c_str());
if (!surface) if (!surface)
...@@ -138,4 +138,4 @@ void Stegano::load(const std::string& path, Machine& m) ...@@ -138,4 +138,4 @@ void Stegano::load(const std::string& path, Machine& m)
assert(surface->format->BytesPerPixel == 4); assert(surface->format->BytesPerPixel == 4);
load(pngData, m); load(pngData, m);
SDL_FreeSurface(surface); SDL_FreeSurface(surface);
} }
\ No newline at end of file
...@@ -34,18 +34,18 @@ std::vector<MenuEntry>::const_iterator selected; ...@@ -34,18 +34,18 @@ std::vector<MenuEntry>::const_iterator selected;
enum { RESUME = 0, HELP, OPTIONS, RESET, EXIT, SHOW_FPS = 0, SCALER, SOUND, MUSIC, BACK }; enum { RESUME = 0, HELP, OPTIONS, RESET, EXIT, SHOW_FPS = 0, SCALER, SOUND, MUSIC, BACK };
MenuView::MenuView(ViewManager* gvm) : _gvm(gvm) MenuView::MenuView(ViewManager* gvm) : _gvm(gvm)
{ {
static_assert(SCALER == 1, "must be 1"); static_assert(SCALER == 1, "must be 1");
mainMenu[RESUME].lambda = [this]() { mainMenu[RESUME].lambda = [this]() {
_gvm->backToGame(); _gvm->backToGame();
}; };
mainMenu[OPTIONS].lambda = [this]() { mainMenu[OPTIONS].lambda = [this]() {
menu = &optionsMenu; menu = &optionsMenu;
selected = menu->begin(); selected = menu->begin();
}; };
mainMenu[EXIT].lambda = [this]() { mainMenu[EXIT].lambda = [this]() {
_gvm->exit(); _gvm->exit();
}; };
...@@ -63,7 +63,7 @@ MenuView::MenuView(ViewManager* gvm) : _gvm(gvm) ...@@ -63,7 +63,7 @@ MenuView::MenuView(ViewManager* gvm) : _gvm(gvm)
_gvm->gameView()->setScaler(Scaler::FIRST); _gvm->gameView()->setScaler(Scaler::FIRST);
updateLabels(); updateLabels();
}; };
optionsMenu[SOUND].lambda = [this]() { optionsMenu[SOUND].lambda = [this]() {
bool v = !machine.sound().isSoundEnabled(); bool v = !machine.sound().isSoundEnabled();
machine.sound().toggleSound(v); machine.sound().toggleSound(v);
...@@ -152,7 +152,7 @@ void MenuView::render() ...@@ -152,7 +152,7 @@ void MenuView::render()
constexpr int32_t H = 240; constexpr int32_t H = 240;
auto renderer = _gvm->renderer(); auto renderer = _gvm->renderer();
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
...@@ -162,18 +162,18 @@ void MenuView::render() ...@@ -162,18 +162,18 @@ void MenuView::render()
_gvm->text("retro8", W / 2 + 2, 20 + 2, { 0, 22, 120 }, TextAlign::CENTER, 4.0f); _gvm->text("retro8", W / 2 + 2, 20 + 2, { 0, 22, 120 }, TextAlign::CENTER, 4.0f);
_gvm->text("retro8", W / 2, 20, { 0, 47, 255 }, TextAlign::CENTER, 4.0f); _gvm->text("retro8", W / 2, 20, { 0, 47, 255 }, TextAlign::CENTER, 4.0f);
_gvm->text("v0.1", W / 2 + _gvm->textWidth("retro8", 4.0)/2 + 3, 34, { 0, 47, 255 }, TextAlign::LEFT, 2.0f); _gvm->text("v0.1b", W / 2 + _gvm->textWidth("retro8", 4.0)/2 + 3, 34, { 0, 47, 255 }, TextAlign::LEFT, 2.0f);
retro8::point_t menuBase = { W / 2, 90 }; retro8::point_t menuBase = { W / 2, 90 };
for (auto it = menu->begin(); it != menu->end(); ++it) for (auto it = menu->begin(); it != menu->end(); ++it)
{ {
SDL_Color color = it == selected ? SDL_Color{ 255, 255, 0 } : SDL_Color{ 255,255,255 }; SDL_Color color = it == selected ? SDL_Color{ 255, 255, 0 } : SDL_Color{ 255,255,255 };
if (it != selected && !it->lambda) if (it != selected && !it->lambda)
color = { 160, 160, 160 }; color = { 160, 160, 160 };
_gvm->text(it->caption, menuBase.x, menuBase.y, color, TextAlign::CENTER, 2.0f); _gvm->text(it->caption, menuBase.x, menuBase.y, color, TextAlign::CENTER, 2.0f);
menuBase.y += 16; menuBase.y += 16;
} }
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment