Skip to content

Commit

Permalink
parent 4d9d843
Browse files Browse the repository at this point in the history
author katerinamant <[email protected]> 1672327176 +0200
committer Alex Papadopoulos <[email protected]> 1673260252 +0200

Modify .gitignore

Add sidebar buttons and their user interactions

Add info page and logout feature

Add home screen slideshow and banner with gradient

Add functionality for slideshow prev and next buttons

Add github and linkedin links on Info screen

Add movie class, movie widget, place movie widgets on home screen

Add functionality for slideshow prev and next buttons

Add github and linkedin links on Info screen

Add movie class, movie widget, place movie widgets on home screen

Add movie screen for when clicking on a movie widget

Design and implement functionality of movie screen popup

Store imported movies and display them in home screen

Add to new releases

Add more movies (alexisthedev#3)

* Add to new releases

Co-authored-by: katerinamant <[email protected]>

Add movie database

Add slider widget

Show movies on browse screen

Add movies and change pictures
  • Loading branch information
katerinamant authored and alexisthedev committed Jan 9, 2023
1 parent 4d9d843 commit f37e94a
Show file tree
Hide file tree
Showing 81 changed files with 1,104 additions and 36 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@
*.out
*.app

# Visual Studio & Visual Studio Code
.vs/
.vscode/
*.sln
*.vcxproj
*.vcxproj.*
x64/

# Build files
bin/*
!bin/assets/
misc/
Binary file added bin/assets/alex.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 added bin/assets/back.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 bin/assets/background.png
Binary file not shown.
Binary file added bin/assets/bpwf.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 added bin/assets/browse.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 added bin/assets/everything.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 added bin/assets/github.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 added bin/assets/home.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 added bin/assets/homepage.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 added bin/assets/info.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 added bin/assets/kate.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 added bin/assets/left.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 added bin/assets/linkedin.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 added bin/assets/logout.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 added bin/assets/movies/bpwf.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 added bin/assets/movies/bpwf1.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 added bin/assets/movies/bpwf2.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 added bin/assets/movies/bpwfb.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 added bin/assets/movies/bpwfp.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 added bin/assets/movies/clue.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 added bin/assets/movies/clue1.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 added bin/assets/movies/clue2.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 added bin/assets/movies/clueb.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 added bin/assets/movies/cluep.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 added bin/assets/movies/elvis.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 added bin/assets/movies/elvis1.png
Binary file added bin/assets/movies/elvis2.png
Binary file added bin/assets/movies/elvisb.png
Binary file added bin/assets/movies/elvisp.png
Binary file added bin/assets/movies/encanto.png
Binary file added bin/assets/movies/encanto1.png
Binary file added bin/assets/movies/encanto2.png
Binary file added bin/assets/movies/encantob.png
Binary file added bin/assets/movies/encantob0.png
Binary file added bin/assets/movies/encantop.png
Binary file added bin/assets/movies/everything.png
Binary file added bin/assets/movies/everything1.png
Binary file added bin/assets/movies/everything2.png
Binary file added bin/assets/movies/everythingb.png
Binary file added bin/assets/movies/everythingp.png
Binary file added bin/assets/movies/home.png
Binary file added bin/assets/movies/home1.png
Binary file added bin/assets/movies/home2.png
Binary file added bin/assets/movies/homeb.png
Binary file added bin/assets/movies/homep.png
Binary file added bin/assets/movies/hp.png
Binary file added bin/assets/movies/hp1.png
Binary file added bin/assets/movies/hp2.png
Binary file added bin/assets/movies/hpb.png
Binary file added bin/assets/movies/hpp.png
Binary file added bin/assets/movies/nope.png
Binary file added bin/assets/movies/nope1.png
Binary file added bin/assets/movies/nope2.png
Binary file added bin/assets/movies/nopeb.png
Binary file added bin/assets/movies/nopep.png
Binary file added bin/assets/movies/sw.png
Binary file added bin/assets/movies/sw1.png
Binary file added bin/assets/movies/sw2.png
Binary file added bin/assets/movies/swb.png
Binary file added bin/assets/movies/swp.png
Binary file added bin/assets/movies/tdk.png
Binary file added bin/assets/movies/tdk1.png
Binary file added bin/assets/movies/tdk2.png
Binary file added bin/assets/movies/tdkb.png
Binary file added bin/assets/movies/tdkp.png
Binary file added bin/assets/nope.png
Binary file added bin/assets/right.png
Binary file added bin/assets/watchlist.png
36 changes: 35 additions & 1 deletion src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void App::draw() {
}

// draw background
SETCOLOR(br.fill_color, 0.18f, 0.23f, 0.29f);
SETCOLOR(br.fill_color, 0.03f, 0.04f, 0.12f);
br.fill_opacity = 1.0f;
graphics::drawRect(CANVAS_WIDTH/2, CANVAS_HEIGHT/2, CANVAS_WIDTH, CANVAS_HEIGHT, br);

Expand All @@ -36,15 +36,49 @@ void App::update() {
m_state = STATE_IDLE;
return;
}

for (auto w : m_widgets) {
w->update();
}
}

void App::init() {
// Initialize MovieDB object
MovieDB* mdb = MovieDB::getInstance();
mdb->init();

// Initialize components
Sidebar* s = new Sidebar();
m_widgets.push_front((Widget*) s);
s->setPosX(CANVAS_WIDTH/12.0f);
s->setPosY(CANVAS_HEIGHT/2.0f);
s->init();

HomeScreen* h = new HomeScreen();
m_widgets.push_front((Widget*) h);
h->setPosX(CANVAS_WIDTH * 7.0f/12.0f);
h->setPosY(CANVAS_HEIGHT/2.0f);
h->init();

BrowseScreen* b = new BrowseScreen();
m_widgets.push_front((Widget*) b);
b->setPosX(CANVAS_WIDTH * 7.0f/12.0f);
b->setPosY(CANVAS_HEIGHT/2.0f);
b->init();

InfoScreen* i = new InfoScreen();
m_widgets.push_front((Widget*) i);
i->setPosX(CANVAS_WIDTH * 7.0f/12.0f);
i->setPosY(CANVAS_HEIGHT/2.0f);

MovieScreen* m = new MovieScreen();
m_widgets.push_front((Widget*) m);
m->setPosX(CANVAS_WIDTH/2.0f);
m->setPosY(CANVAS_HEIGHT/2.0f);
m->init();

graphics::preloadBitmaps(ASSET_PATH);
graphics::preloadBitmaps(MOVIE_PATH);
}

App::~App() {
Expand Down
13 changes: 11 additions & 2 deletions src/app.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <list>
#include "widget.h"
#include "widgets.h"
#include "moviedb.h"

class App {
public:
Expand All @@ -10,15 +11,23 @@ class App {

std::list<Widget*> m_widgets;
app_state_t m_state = STATE_INIT;
std::string m_screen = "Home";
std::string m_prev_screen;
Movie* m_cur_movie = nullptr;

App() {}
public:
void draw();
void update();
void init();
void setScreen(std::string s) { m_prev_screen = m_screen; m_screen = s; }
std::string getScreen() { return m_screen; }
std::string getPrevScreen() { return m_prev_screen; }
void setMovie(Movie* m) { m_cur_movie = m; }
Movie* getMovie() { return m_cur_movie; }

~App();

static void releaseInstance() { if (m_instance) delete m_instance; m_instance = nullptr; }
static void releaseInstance() { if (m_instance) {delete m_instance;} m_instance = nullptr; DB()->releaseInstance();}
static App* getInstance();
};
3 changes: 3 additions & 0 deletions src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ inline void sleep(int ms) {
#define CANVAS_HEIGHT 16.0f

#define ASSET_PATH "assets/"
#define MOVIE_PATH "assets/movies/"

#define SETCOLOR(c, r, g, b) {c[0]=r; c[1]=g; c[2]=b;}
#define RAND0TO1() (rand()/(float)RAND_MAX)
#define APP() App::getInstance()
#define DB() MovieDB::getInstance()

inline float distance(float x1, float y1, float x2, float y2) {
float dx = x1 - x2;
Expand Down
Loading

0 comments on commit f37e94a

Please sign in to comment.