-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1f7ec3
commit cc62f30
Showing
8 changed files
with
1,023 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
DIST_DIR := OctoLair | ||
BIN_DIR := bin | ||
|
||
UNAME_S := $(shell uname -s) | ||
|
||
CFLAGS := "" | ||
LDFLAGS := "" | ||
CC := "" | ||
|
||
|
||
ifeq ($(UNAME_S), Linux) | ||
SYSROOT := /usr/local/aarch64-linux-gnu-7.5.0-linaro/sysroot | ||
CFLAGS = -I${SYSROOT}/usr/include -I${SYSROOT}/usr/include/SDL2 -I/usr/include/aarch64-linux-gnu/curl -I ./include -D_REENTRANT | ||
LDFLAGS = -L${SYSROOT}/lib -L${SYSROOT}/usr/lib -L/usr/lib/aarch64-linux-gnu/ -lSDL2_image -lSDL2_ttf -lSDL2 -ldl -lpthread -lm -lstdc++ -lxml2 | ||
CC = aarch64-linux-gnu-gcc --sysroot=${SYSROOT} | ||
endif | ||
|
||
SRC := src/main.cpp src/utils.cpp src/theme.cpp | ||
OBJ := $(SRC:.cpp=.o) | ||
TARGET := octolair | ||
|
||
.PHONY: run build | ||
.DEFAULT: build | ||
|
||
build: | ||
@mkdir -p ${BIN_DIR} | ||
@${CC} ${CFLAGS} ${SRC} -o ${BIN_DIR}/${TARGET} ${LDFLAGS} | ||
|
||
clean: | ||
@rm -rf ${BIN_DIR}/* ${DIST_DIR}/* | ||
|
||
run: | ||
@${BIN_DIR}/${TARGET} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef CONFIG_H | ||
#define CONFIG_H | ||
|
||
#define SCREEN_WIDTH 1280 | ||
#define SCREEN_HEIGHT 720 | ||
|
||
|
||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef THEME_H | ||
#define THEME_H | ||
|
||
#include <SDL.h> | ||
|
||
struct Theme { | ||
SDL_Color backgroundColor; | ||
SDL_Color textColor; | ||
SDL_Color highlightColor; | ||
SDL_Color borderColor; | ||
SDL_Color progressBarColor; | ||
}; | ||
|
||
extern Theme currentTheme; | ||
|
||
void applyTheme(const Theme& theme); | ||
|
||
#endif // THEME_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef TYPES_H | ||
#define TYPES_H | ||
|
||
#include <string> | ||
#include <unordered_map> | ||
|
||
struct Game { | ||
std::string title; | ||
std::string region; | ||
std::string version; | ||
std::string languages; | ||
std::string rating; | ||
std::string url; | ||
}; | ||
|
||
struct Console { | ||
std::string name; | ||
std::string url; | ||
}; | ||
|
||
class Filter { | ||
public: | ||
std::string value; | ||
Filter(const std::string& val) : value(val) {} | ||
}; | ||
|
||
|
||
|
||
#endif // TYPES_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef UTILS_H | ||
#define UTILS_H | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <iostream> | ||
#include <dlfcn.h> | ||
#include <libxml/HTMLparser.h> | ||
#include <libxml/xpath.h> | ||
#include <regex> | ||
#include <fstream> | ||
|
||
#include "types.h" | ||
|
||
size_t header_callback(void* ptr, size_t size, size_t nmemb, std::string* filename); | ||
std::string getHtml(const std::string& url); | ||
std::vector<Console> parseHTML(const std::string& html); | ||
std::vector<Game> parseGamesHTML(const std::string &htmlContent); | ||
int downloadGame(std::string console, const std::string &htmlContent); | ||
|
||
#endif | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.