Skip to content

Commit

Permalink
Remove unused mask code from rotozoom
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak authored Aug 19, 2024
1 parent 9dc35ae commit 6e7795d
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions rotozoom/rotozoom.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

#include <string>
#include <cstring>
#include <memory>
#include <cstdlib>


#include "rotozoom.hpp"

using namespace blit;
Expand All @@ -28,11 +26,6 @@ uint8_t logo[16][16] = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};

uint8_t mask_buffer[320 * 240];
Surface hires_mask(mask_buffer, PixelFormat::M, Size(320, 240));
Surface lores_mask(mask_buffer, PixelFormat::M, Size(160, 120));
Surface mask = hires_mask;

/* setup */
void init() {
set_screen_mode(hires);
Expand Down Expand Up @@ -82,33 +75,14 @@ void rotozoom(uint32_t time_ms) {
int tick_count = 0;
void render(uint32_t time_ms) {
screen.alpha = 255;
screen.mask = nullptr;
screen.pen = Pen(0, 0, 0, 255);
screen.clear();

mask.pen = Pen(50);
mask.clear();
mask.pen = Pen(255);
Point centre = Point(160 + sinf(time_ms / 200.0f) * 40, 120 + cosf(time_ms / 200.0f) * 40);
mask.circle(centre, 100);

//screen.mask = &mask;

uint32_t ms_start = now();

rotozoom(time_ms);

uint32_t ms_end = now();
/*
for (auto y = 0; y < 10; y++) {
for (auto x = 0; x < 10; x++) {
float s = (sin(time_ms / 1000.0f) * 2.0f) + 3.0f;
screen.sprite(Point(x, y), Point(x * 8 * s + 160, y * 8 * s + 120), Point(40, 40), Vec2(s, s));
}
}*/

screen.mask = nullptr;


// draw FPS meter
screen.pen = Pen(0, 0, 0, 200);
Expand All @@ -131,11 +105,9 @@ void update(uint32_t time) {
if (buttons != last_buttons) {
if ((buttons & DPAD_UP)) {
set_screen_mode(lores);
mask = lores_mask;
}
else {
set_screen_mode(hires);
mask = hires_mask;
}
}

Expand Down

0 comments on commit 6e7795d

Please sign in to comment.