Skip to content

Commit

Permalink
images
Browse files Browse the repository at this point in the history
  • Loading branch information
sheep_wizard committed Aug 17, 2024
1 parent 08fc0b9 commit 7780c79
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
Binary file modified assets/cell_flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/cursor.png
Binary file not shown.
1 change: 0 additions & 1 deletion make_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@ grit $ASSETS/smiley_win.png -gb -gB16
grit $ASSETS/title_screen.png -gb -gB16
grit $ASSETS/title_screen2.png -gb -gB16
grit $ASSETS/menu_screen.png -gb -gB16
grit $ASSETS/cursor.png -gb -gB16
grit $ASSETS/game_background.png -gb -gB16
grit $ASSETS/highscore_screen.png -gb -gB16
12 changes: 2 additions & 10 deletions source/views/menuView/menuView.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ static void update_menu_selector(const int previousPosition)
}

yOffset = (SELECTOR_GAP * selectorPosition) + SELECTOR_Y_OFFSET;
int x, y;
for (y = 0; y < SELECTOR_SIZE; y++)
for (i = 0; i < SELECTOR_SIZE; i++)
{
for (x = 0; x < SELECTOR_SIZE; x++)
{
if (cursorBitmap[y * (SELECTOR_SIZE / 2) + (x / 2)] == 0x00000000)
{
continue;
}
memcpy(&vid_mem[(y + yOffset) * M3_WIDTH + (SELECTOR_X_OFFSET + x)], &cursorBitmap[y * (SELECTOR_SIZE / 2) + (x / 2)], 2);
}
memcpy(&vid_mem[(i + yOffset) * M3_WIDTH + SELECTOR_X_OFFSET], &smiley_playBitmap[i * (SELECTOR_SIZE / 2)], SELECTOR_SIZE * 2);
}
}

Expand Down
6 changes: 3 additions & 3 deletions source/views/menuView/menuView.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#pragma once
#include "tonc.h"
#include "../../assets/menu_screen.h"
#include "../../assets/cursor.h"
#include "../../assets/smiley_play.h"
#include "../../view.h"
#include "../gameView/gameView.h"
#include <string.h>

static const int SELECTOR_SIZE = 16;
static const int SELECTOR_GAP = 25;
static const int SELECTOR_X_OFFSET = 12;
static const int SELECTOR_Y_OFFSET = 45;
static const int SELECTOR_X_OFFSET = 16;
static const int SELECTOR_Y_OFFSET = 50;
static const int MAX_SELECTOR_POSITION = 3;

void init_menu_view();
Expand Down

0 comments on commit 7780c79

Please sign in to comment.