mirror of
https://github.com/joel16/VitaShell.git
synced 2024-11-23 11:49:40 +00:00
Merge remote-tracking branch 'refs/remotes/TheOfficialFloW/master'
This commit is contained in:
commit
09ddb32d90
9
Makefile
9
Makefile
@ -4,9 +4,10 @@ OBJS = main.o init.o io_process.o package_installer.o archive.o photo.o file
|
||||
uncommon_dialog.o message_dialog.o ime_dialog.o config.o theme.o language.o utils.o sha1.o \
|
||||
audioplayer.o minizip/unzip.o minizip/ioapi.o
|
||||
|
||||
RESOURCES_PNG = resources/folder_icon.png resources/file_icon.png resources/archive_icon.png resources/image_icon.png resources/ftp.png resources/dialog.png resources/context.png resources/battery.png resources/battery_bar_green.png resources/battery_bar_red.png \
|
||||
resources/headphone.png resources/audio_previous.png resources/audio_pause.png resources/audio_play.png \
|
||||
resources/audio_next.png
|
||||
RESOURCES_PNG = resources/folder_icon.png resources/file_icon.png resources/archive_icon.png resources/image_icon.png resources/ftp.png \
|
||||
resources/battery.png resources/battery_bar_green.png resources/battery_bar_red.png resources/battery_bar_charge.png \
|
||||
resources/headphone.png resources/audio_previous.png resources/audio_pause.png resources/audio_play.png \
|
||||
resources/audio_next.png
|
||||
RESOURCES_TXT = resources/theme.txt resources/colors.txt resources/english_us.txt
|
||||
OBJS += $(RESOURCES_PNG:.png=.o) $(RESOURCES_TXT:.txt=.o)
|
||||
|
||||
@ -36,7 +37,7 @@ ASFLAGS = $(CFLAGS)
|
||||
all: $(TARGET).vpk
|
||||
|
||||
%.vpk: eboot.bin
|
||||
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=00.86 -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo
|
||||
vita-mksfoex -d PARENTAL_LEVEL=1 -s APP_VER=00.90 -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo
|
||||
vita-pack-vpk -s param.sfo -b eboot.bin \
|
||||
--add pkg/sce_sys/icon0.png=sce_sys/icon0.png \
|
||||
--add pkg/sce_sys/livearea/contents/bg.png=sce_sys/livearea/contents/bg.png \
|
||||
|
31
README.md
31
README.md
@ -10,20 +10,29 @@ https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y7CVA9VSJA2
|
||||
### Customization ###
|
||||
You can customize those files:
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/colors.txt'**: All colors adjustable
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/bg_browser.txt'**: Background for file browser
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/bg_hexeditor.txt'**: Background for hex editor
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/bg_texteditor.txt'**: Background for text editor
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/bg_photoviewer.txt'**: Background for photo viewer
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/wallpaper.png'**: Wallpaper #1
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/wallpaperX.png'**: Wallpaper #X (X is a value from 2-10)
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/ftp.png'**: Ftp icon
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/dialog.png'**: Dialog menu image (Can be any size. This image file will be stretched by VitaShell to fit the dialog box. Suggestion: Don't use motives, as it will not look good with wrong proportion).
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/context.png'**: Context menu image (Can be any size. Suggestion: It will look great if you add alpha channel to your image).
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/battery.png'**: Battery border icon
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/battery_bar_green.png'**: Green battery bar
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/battery_bar_red.png'**: Red battery bar
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/battery_bar_charge.png'**: Charging battery bar
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/ftp.png'**: Ftp icon
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/archive_icon.png'**: Archive icon
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/file_icon.png'**: File icon
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/folder_icon.png'**: Folder icon
|
||||
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/image_icon.png'**: Image icon
|
||||
|
||||
**Theme setting:** VitaShell will load the theme that is set in **'ux0:VitaShell/theme/theme.txt'** (THEME_NAME = "YOUR_THEME_NAME")
|
||||
|
||||
**General info:** You don't need to have all these files in your custom theme, if one of them is missing, the default image file will be loaded instead.
|
||||
|
||||
**Wallpapers info:** You can have **ten wallpapers** which VitaShell will display at random interval. If no wallpaper is available, **BACKGROUND_COLOR** from **'colors.txt'** will be used.
|
||||
|
||||
**Theme setting:** VitaShell will load the theme that is set in **'ux0:VitaShell/theme/theme.txt'** (THEME_NAME = "YOUR_THEME_NAME")
|
||||
**Wallpapers info:** Wallpapers overlay background images. You can have **ten wallpapers** which VitaShell will display at random interval. If no wallpaper is available, **BACKGROUND_COLOR** from **'colors.txt'** will be used.
|
||||
|
||||
**Dialog and context image:** If these files are not available, the colors **DIALOG_BG_COLOR** and **CONTEXT_MENU_COLOR** from **'colors.txt'** will be used instead.
|
||||
|
||||
@ -50,7 +59,7 @@ Put your language file at **'ux0:VitaShell/language/x.txt'**, **where the file m
|
||||
- norwegian
|
||||
- polish
|
||||
- portuguese_br
|
||||
- english_gb
|
||||
- turksish
|
||||
|
||||
VitaShell does automatically load the language that matches to the current system language.
|
||||
If your system language is for example french, it will load from 'ux0:VitaShell/language/french.txt'.
|
||||
@ -64,6 +73,18 @@ https://github.com/xy2iii/vitashell-themes
|
||||
|
||||
Be sure you pull request your customized design or language file there.
|
||||
|
||||
### Changelog 0.9 ###
|
||||
- Added possibility to use specific background for file browser, hex editor, text editor, photo viewer.
|
||||
- Added files and folder icons by littlebalup.
|
||||
- Added charging battery icon by ribbid987.
|
||||
- Added sfo reader by theorywrong.
|
||||
- Added translation support for turkish (english_gb uses the same id as turkish, fix it Sony!).
|
||||
- Updated to latest libftpvita which fixed file size string > 2GB and added APPE command.
|
||||
- Fixed bug where copied files and folders of archives didn't stay on clipboard.
|
||||
- Allow auto screen-off.
|
||||
- System information trigger combo changed to START instead of L+R+START.
|
||||
System information can now also be translated, thanks to littlebalup.
|
||||
|
||||
### Changelog 0.86 ###
|
||||
- Added dialog box animation and aligned dialog box y to make it look better.
|
||||
- Fixed wrong time string for files and folders. Thanks to persona5.
|
||||
|
@ -428,7 +428,7 @@ int audioPlayer(char *file, FileList *list, FileListEntry *entry, int *base_pos,
|
||||
}
|
||||
|
||||
// Start drawing
|
||||
startDrawing();
|
||||
startDrawing(NULL);
|
||||
int nameLength = strlen(entry->name);
|
||||
vita2d_pgf_draw_text(font, SCREEN_WIDTH / 2 - nameLength * 5.5, SCREEN_HEIGHT - 190, GENERAL_COLOR, 1.0f, entry->name);
|
||||
|
||||
|
2
hex.c
2
hex.c
@ -292,7 +292,7 @@ int hexViewer(char *file) {
|
||||
}
|
||||
|
||||
// Start drawing
|
||||
startDrawing();
|
||||
startDrawing(bg_hex_image);
|
||||
|
||||
// Draw shell info
|
||||
drawShellInfo(file);
|
||||
|
11
init.c
11
init.c
@ -31,17 +31,15 @@ extern unsigned char _binary_resources_image_icon_png_start;
|
||||
extern unsigned char _binary_resources_image_icon_png_size;
|
||||
extern unsigned char _binary_resources_ftp_png_start;
|
||||
extern unsigned char _binary_resources_ftp_png_size;
|
||||
extern unsigned char _binary_resources_dialog_png_start;
|
||||
extern unsigned char _binary_resources_dialog_png_size;
|
||||
extern unsigned char _binary_resources_context_png_start;
|
||||
extern unsigned char _binary_resources_context_png_size;
|
||||
extern unsigned char _binary_resources_battery_png_start;
|
||||
extern unsigned char _binary_resources_battery_png_size;
|
||||
extern unsigned char _binary_resources_battery_bar_red_png_start;
|
||||
extern unsigned char _binary_resources_battery_bar_red_png_size;
|
||||
extern unsigned char _binary_resources_battery_bar_green_png_start;
|
||||
extern unsigned char _binary_resources_battery_bar_green_png_size;
|
||||
|
||||
extern unsigned char _binary_resources_battery_bar_charge_png_start;
|
||||
extern unsigned char _binary_resources_battery_bar_charge_png_size;
|
||||
|
||||
extern unsigned char _binary_resources_theme_txt_start;
|
||||
extern unsigned char _binary_resources_theme_txt_size;
|
||||
|
||||
@ -66,11 +64,10 @@ static DefaultFile default_files[] = {
|
||||
{ "ux0:VitaShell/theme/Default/archive_icon.png", (void *)&_binary_resources_archive_icon_png_start, (int)&_binary_resources_archive_icon_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/image_icon.png", (void *)&_binary_resources_image_icon_png_start, (int)&_binary_resources_image_icon_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/ftp.png", (void *)&_binary_resources_ftp_png_start, (int)&_binary_resources_ftp_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/dialog.png", (void *)&_binary_resources_dialog_png_start, (int)&_binary_resources_dialog_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/context.png", (void *)&_binary_resources_context_png_start, (int)&_binary_resources_context_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/battery.png", (void *)&_binary_resources_battery_png_start, (int)&_binary_resources_battery_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/battery_bar_red.png", (void *)&_binary_resources_battery_bar_red_png_start, (int)&_binary_resources_battery_bar_red_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/battery_bar_green.png", (void *)&_binary_resources_battery_bar_green_png_start, (int)&_binary_resources_battery_bar_green_png_size },
|
||||
{ "ux0:VitaShell/theme/Default/battery_bar_charge.png", (void *)&_binary_resources_battery_bar_charge_png_start, (int)&_binary_resources_battery_bar_charge_png_size },
|
||||
};
|
||||
|
||||
vita2d_pgf *font = NULL;
|
||||
|
@ -42,7 +42,7 @@ static char *lang[] ={
|
||||
"norwegian",
|
||||
"polish",
|
||||
"portuguese_br",
|
||||
"english_gb"
|
||||
"turkish"
|
||||
};
|
||||
|
||||
char *language_container[LANGUAGE_CONTRAINER_SIZE];
|
||||
|
35
main.c
35
main.c
@ -222,10 +222,10 @@ void refreshCopyList() {
|
||||
char path[MAX_PATH_LENGTH];
|
||||
snprintf(path, MAX_PATH_LENGTH, "%s%s", copy_list.path, entry->name);
|
||||
|
||||
// TODO: fix for archives
|
||||
// Check if the entry still exits. If not, remove it from list
|
||||
SceIoStat stat;
|
||||
if (sceIoGetstat(path, &stat) < 0)
|
||||
int res = sceIoGetstat(path, &stat);
|
||||
if (res < 0 && res != 0x80010014)
|
||||
fileListRemoveEntry(©_list, entry);
|
||||
|
||||
// Next
|
||||
@ -319,8 +319,11 @@ void drawShellInfo(char *path) {
|
||||
|
||||
vita2d_texture *battery_bar_image = battery_bar_green_image;
|
||||
|
||||
if (scePowerIsLowBattery())
|
||||
if (scePowerIsBatteryCharging()) {
|
||||
battery_bar_image = battery_bar_charge_image;
|
||||
} else if (scePowerIsLowBattery()) {
|
||||
battery_bar_image = battery_bar_red_image;
|
||||
}
|
||||
|
||||
float percent = scePowerGetBatteryLifePercent() / 100.0f;
|
||||
|
||||
@ -921,8 +924,8 @@ int dialogSteps() {
|
||||
}
|
||||
|
||||
void fileBrowserMenuCtrl() {
|
||||
// Hidden trigger
|
||||
if (current_buttons & SCE_CTRL_LTRIGGER && current_buttons & SCE_CTRL_RTRIGGER && current_buttons & SCE_CTRL_START) {
|
||||
// System information
|
||||
if (current_buttons & SCE_CTRL_START) {
|
||||
SceSystemSwVersionParam sw_ver_param;
|
||||
sw_ver_param.size = sizeof(SceSystemSwVersionParam);
|
||||
sceKernelGetSystemSwVersion(&sw_ver_param);
|
||||
@ -1114,7 +1117,7 @@ int shellMain() {
|
||||
}
|
||||
|
||||
// Start drawing
|
||||
startDrawing();
|
||||
startDrawing(bg_browser_image);
|
||||
|
||||
// Draw shell info
|
||||
drawShellInfo(file_list.path);
|
||||
@ -1134,20 +1137,16 @@ int shellMain() {
|
||||
if (file_entry->is_folder) {
|
||||
color = FOLDER_COLOR;
|
||||
vita2d_draw_texture(folder_icon, SHELL_MARGIN_X, y + 3.0f);
|
||||
}
|
||||
// Images
|
||||
else if (file_entry->type == FILE_TYPE_BMP || file_entry->type == FILE_TYPE_PNG || file_entry->type == FILE_TYPE_JPEG || file_entry->type == FILE_TYPE_MP3) {
|
||||
color = IMAGE_COLOR;
|
||||
vita2d_draw_texture(image_icon, SHELL_MARGIN_X, y + 3.0f);
|
||||
}
|
||||
// Archives
|
||||
else if (!isInArchive()) {
|
||||
if (file_entry->type == FILE_TYPE_VPK || file_entry->type == FILE_TYPE_ZIP) {
|
||||
} else {
|
||||
if (file_entry->type == FILE_TYPE_BMP || file_entry->type == FILE_TYPE_PNG || file_entry->type == FILE_TYPE_JPEG || file_entry->type == FILE_TYPE_MP3) { // Images
|
||||
color = IMAGE_COLOR;
|
||||
vita2d_draw_texture(image_icon, SHELL_MARGIN_X, y + 3.0f);
|
||||
} else if (file_entry->type == FILE_TYPE_VPK || file_entry->type == FILE_TYPE_ZIP) { // Archive
|
||||
color = ARCHIVE_COLOR;
|
||||
vita2d_draw_texture(archive_icon, SHELL_MARGIN_X, y + 3.0f);
|
||||
} else { // Other files
|
||||
vita2d_draw_texture(file_icon, SHELL_MARGIN_X, y + 3.0f);
|
||||
}
|
||||
// Other file
|
||||
else vita2d_draw_texture(file_icon, SHELL_MARGIN_X, y + 3.0f);
|
||||
}
|
||||
|
||||
// Current position
|
||||
@ -1182,7 +1181,7 @@ int shellMain() {
|
||||
}
|
||||
|
||||
// Draw shortened file name
|
||||
pgf_draw_text(SHELL_MARGIN_X + 25.0f, y, color, FONT_SIZE, file_entry->name);
|
||||
pgf_draw_text(SHELL_MARGIN_X + 26.0f, y, color, FONT_SIZE, file_entry->name);
|
||||
|
||||
if (j != length)
|
||||
file_entry->name[j] = ch;
|
||||
|
4
main.h
4
main.h
@ -64,7 +64,7 @@
|
||||
|
||||
// VitaShell version major.minor
|
||||
#define VITASHELL_VERSION_MAJOR 0
|
||||
#define VITASHELL_VERSION_MINOR 86
|
||||
#define VITASHELL_VERSION_MINOR 9
|
||||
|
||||
#define ALIGN(x, align) (((x) + ((align) - 1)) & ~((align) - 1))
|
||||
|
||||
@ -120,7 +120,7 @@
|
||||
// File browser
|
||||
#define MARK_WIDTH (SCREEN_WIDTH - 2.0f * SHELL_MARGIN_X)
|
||||
#define INFORMATION_X 680.0f
|
||||
#define MAX_NAME_WIDTH 530.0f
|
||||
#define MAX_NAME_WIDTH 500.0f
|
||||
|
||||
// Uncommon dialog
|
||||
#define UNCOMMON_DIALOG_PROGRESS_BAR_BOX_WIDTH 420.0f
|
||||
|
2
photo.c
2
photo.c
@ -345,7 +345,7 @@ int photoViewer(char *file, int type, FileList *list, FileListEntry *entry, int
|
||||
}
|
||||
|
||||
// Start drawing
|
||||
startDrawing();
|
||||
startDrawing(bg_photo_image);
|
||||
|
||||
// Photo
|
||||
vita2d_draw_texture_scale_rotate_hotspot(tex, SCREEN_HALF_WIDTH, SCREEN_HALF_HEIGHT, zoom, zoom, rad, x, y);
|
||||
|
@ -28,7 +28,7 @@
|
||||
<frame id="frame4">
|
||||
<liveitem>
|
||||
<text align="left" text-align="left" word-wrap="off" ellipsis="on">
|
||||
<str size="18" color="#ffffff" shadow="on">v0.86</str>
|
||||
<str size="18" color="#ffffff" shadow="on">v0.9</str>
|
||||
</text>
|
||||
</liveitem>
|
||||
</frame>
|
||||
|
BIN
resources/battery_bar_charge.png
Normal file
BIN
resources/battery_bar_charge.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 765 B |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 10 KiB |
6
sfo.c
6
sfo.c
@ -79,7 +79,7 @@ int SFOReader(char *file) {
|
||||
}
|
||||
|
||||
// Start drawing
|
||||
startDrawing();
|
||||
startDrawing(bg_text_image);
|
||||
|
||||
// Draw shell info
|
||||
drawShellInfo(file);
|
||||
@ -104,11 +104,11 @@ int SFOReader(char *file) {
|
||||
break;
|
||||
|
||||
case PSF_TYPE_STR:
|
||||
snprintf(string, sizeof(string), "%s", data);
|
||||
snprintf(string, sizeof(string), "%s", (char *)data);
|
||||
break;
|
||||
|
||||
case PSF_TYPE_VAL:
|
||||
snprintf(string, sizeof(string), "%X", *(uint32_t *)data);
|
||||
snprintf(string, sizeof(string), "%X", *(unsigned int *)data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
2
text.c
2
text.c
@ -247,7 +247,7 @@ int textViewer(char *file) {
|
||||
}
|
||||
|
||||
// Start drawing
|
||||
startDrawing();
|
||||
startDrawing(bg_text_image);
|
||||
|
||||
// Draw shell info
|
||||
drawShellInfo(file);
|
||||
|
60
theme.c
60
theme.c
@ -20,17 +20,17 @@
|
||||
#include "file.h"
|
||||
#include "config.h"
|
||||
#include "theme.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern unsigned char _binary_resources_folder_icon_png_start;
|
||||
extern unsigned char _binary_resources_file_icon_png_start;
|
||||
extern unsigned char _binary_resources_archive_icon_png_start;
|
||||
extern unsigned char _binary_resources_image_icon_png_start;
|
||||
extern unsigned char _binary_resources_ftp_png_start;
|
||||
extern unsigned char _binary_resources_dialog_png_start;
|
||||
extern unsigned char _binary_resources_context_png_start;
|
||||
extern unsigned char _binary_resources_battery_png_start;
|
||||
extern unsigned char _binary_resources_battery_bar_red_png_start;
|
||||
extern unsigned char _binary_resources_battery_bar_green_png_start;
|
||||
extern unsigned char _binary_resources_battery_bar_charge_png_start;
|
||||
|
||||
extern unsigned char _binary_resources_colors_txt_start;
|
||||
extern unsigned char _binary_resources_colors_txt_size;
|
||||
@ -55,7 +55,9 @@ int PROGRESS_BAR_BG_COLOR;
|
||||
int HEX_OFFSET_COLOR;
|
||||
int HEX_NIBBLE_COLOR;
|
||||
|
||||
vita2d_texture *folder_icon = NULL, *file_icon = NULL, *archive_icon = NULL, *image_icon = NULL, *ftp_image = NULL, *dialog_image = NULL, *context_image = NULL, *battery_image = NULL, *battery_bar_red_image = NULL, *battery_bar_green_image = NULL;
|
||||
vita2d_texture *folder_icon = NULL, *file_icon = NULL, *archive_icon = NULL, *image_icon = NULL, *ftp_image = NULL, *dialog_image = NULL, *context_image = NULL,
|
||||
*battery_image = NULL, *battery_bar_red_image = NULL, *battery_bar_green_image = NULL, *battery_bar_charge_image = NULL,
|
||||
*bg_browser_image = NULL, *bg_hex_image = NULL, *bg_text_image = NULL, *bg_photo_image = NULL;
|
||||
|
||||
vita2d_texture *wallpaper_image[MAX_WALLPAPERS];
|
||||
|
||||
@ -138,6 +140,21 @@ void loadTheme() {
|
||||
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/battery_bar_green.png", theme_name);
|
||||
battery_bar_green_image = vita2d_load_PNG_file(path);
|
||||
|
||||
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/battery_bar_charge.png", theme_name);
|
||||
battery_bar_charge_image = vita2d_load_PNG_file(path);
|
||||
|
||||
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/bg_browser.png", theme_name);
|
||||
bg_browser_image = vita2d_load_PNG_file(path);
|
||||
|
||||
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/bg_hexeditor.png", theme_name);
|
||||
bg_hex_image = vita2d_load_PNG_file(path);
|
||||
|
||||
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/bg_texteditor.png", theme_name);
|
||||
bg_text_image = vita2d_load_PNG_file(path);
|
||||
|
||||
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/bg_photoviewer.png", theme_name);
|
||||
bg_photo_image = vita2d_load_PNG_file(path);
|
||||
|
||||
// Wallpapers
|
||||
snprintf(path, MAX_PATH_LENGTH, "ux0:VitaShell/theme/%s/wallpaper.png", theme_name);
|
||||
vita2d_texture *image = vita2d_load_PNG_file(path);
|
||||
@ -153,8 +170,10 @@ void loadTheme() {
|
||||
}
|
||||
|
||||
// Set random wallpaper
|
||||
int random_num = randomNumber(0, wallpaper_count - 1);
|
||||
current_wallpaper_image = wallpaper_image[random_num];
|
||||
if (wallpaper_count > 0) {
|
||||
int random_num = randomNumber(0, wallpaper_count - 1);
|
||||
current_wallpaper_image = wallpaper_image[random_num];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,11 +193,31 @@ void loadTheme() {
|
||||
if (!ftp_image)
|
||||
ftp_image = vita2d_load_PNG_buffer(&_binary_resources_ftp_png_start);
|
||||
|
||||
if (!dialog_image)
|
||||
dialog_image = vita2d_load_PNG_buffer(&_binary_resources_dialog_png_start);
|
||||
if (!dialog_image) {
|
||||
dialog_image = vita2d_create_empty_texture(SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
void *data = vita2d_texture_get_datap(dialog_image);
|
||||
|
||||
if (!context_image)
|
||||
context_image = vita2d_load_PNG_buffer(&_binary_resources_context_png_start);
|
||||
int y;
|
||||
for (y = 0; y < SCREEN_HEIGHT; y++) {
|
||||
int x;
|
||||
for (x = 0; x < SCREEN_WIDTH; x++) {
|
||||
((uint32_t *)data)[x + SCREEN_WIDTH * y] = DIALOG_BG_COLOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!context_image) {
|
||||
context_image = vita2d_create_empty_texture(SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
void *data = vita2d_texture_get_datap(context_image);
|
||||
|
||||
int y;
|
||||
for (y = 0; y < SCREEN_HEIGHT; y++) {
|
||||
int x;
|
||||
for (x = 0; x < SCREEN_WIDTH; x++) {
|
||||
((uint32_t *)data)[x + SCREEN_WIDTH * y] = CONTEXT_MENU_COLOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!battery_image)
|
||||
battery_image = vita2d_load_PNG_buffer(&_binary_resources_battery_png_start);
|
||||
@ -188,4 +227,7 @@ void loadTheme() {
|
||||
|
||||
if (!battery_bar_green_image)
|
||||
battery_bar_green_image = vita2d_load_PNG_buffer(&_binary_resources_battery_bar_green_png_start);
|
||||
|
||||
if (!battery_bar_charge_image)
|
||||
battery_bar_charge_image = vita2d_load_PNG_buffer(&_binary_resources_battery_bar_charge_png_start);
|
||||
}
|
4
theme.h
4
theme.h
@ -41,7 +41,9 @@ extern int PROGRESS_BAR_BG_COLOR;
|
||||
extern int HEX_OFFSET_COLOR;
|
||||
extern int HEX_NIBBLE_COLOR;
|
||||
|
||||
extern vita2d_texture *folder_icon, *file_icon, *archive_icon, *image_icon, *ftp_image, *dialog_image, *context_image, *battery_image, *battery_bar_red_image, *battery_bar_green_image;
|
||||
extern vita2d_texture *folder_icon, *file_icon, *archive_icon, *image_icon, *ftp_image, *dialog_image, *context_image,
|
||||
*battery_image, *battery_bar_red_image, *battery_bar_green_image, *battery_bar_charge_image,
|
||||
*bg_browser_image, *bg_hex_image, *bg_text_image, *bg_photo_image;
|
||||
|
||||
extern vita2d_texture *wallpaper_image[MAX_WALLPAPERS];
|
||||
extern vita2d_texture *previous_wallpaper_image, *current_wallpaper_image;
|
||||
|
38
utils.c
38
utils.c
@ -37,30 +37,35 @@ static uint64_t wallpaper_time_start = 0;
|
||||
static int wallpaper_random_delay = 0;
|
||||
static float wallpaper_alpha = 255.0f;
|
||||
|
||||
void startDrawing() {
|
||||
void startDrawing(vita2d_texture *bg) {
|
||||
vita2d_start_drawing();
|
||||
vita2d_set_clear_color(BACKGROUND_COLOR);
|
||||
vita2d_clear_screen();
|
||||
|
||||
if (wallpaper_time_start == 0) {
|
||||
wallpaper_time_start = sceKernelGetProcessTimeWide();
|
||||
wallpaper_random_delay = randomNumber(15, 30);
|
||||
}
|
||||
// Background image
|
||||
if (bg)
|
||||
vita2d_draw_texture(bg, 0.0f, 0.0f);
|
||||
|
||||
if ((sceKernelGetProcessTimeWide() - wallpaper_time_start) >= (wallpaper_random_delay * 1000 * 1000)) {
|
||||
int random_num = randomNumber(0, wallpaper_count - 1);
|
||||
|
||||
vita2d_texture *random_wallpaper_image = wallpaper_image[random_num];
|
||||
if (random_wallpaper_image != current_wallpaper_image) {
|
||||
previous_wallpaper_image = current_wallpaper_image;
|
||||
current_wallpaper_image = random_wallpaper_image;
|
||||
wallpaper_alpha = 0.0f;
|
||||
// Wallpaper
|
||||
if (current_wallpaper_image) {
|
||||
if (wallpaper_time_start == 0) {
|
||||
wallpaper_time_start = sceKernelGetProcessTimeWide();
|
||||
wallpaper_random_delay = randomNumber(15, 30);
|
||||
}
|
||||
|
||||
wallpaper_time_start = 0;
|
||||
}
|
||||
if ((sceKernelGetProcessTimeWide() - wallpaper_time_start) >= (wallpaper_random_delay * 1000 * 1000)) {
|
||||
int random_num = randomNumber(0, wallpaper_count - 1);
|
||||
|
||||
vita2d_texture *random_wallpaper_image = wallpaper_image[random_num];
|
||||
if (random_wallpaper_image != current_wallpaper_image) {
|
||||
previous_wallpaper_image = current_wallpaper_image;
|
||||
current_wallpaper_image = random_wallpaper_image;
|
||||
wallpaper_alpha = 0.0f;
|
||||
}
|
||||
|
||||
wallpaper_time_start = 0;
|
||||
}
|
||||
|
||||
if (current_wallpaper_image) {
|
||||
if (previous_wallpaper_image) {
|
||||
vita2d_draw_texture(previous_wallpaper_image, 0.0f, 0.0f);
|
||||
}
|
||||
@ -106,7 +111,6 @@ int power_tick_thread(SceSize args, void *argp) {
|
||||
while (1) {
|
||||
if (lock_power) {
|
||||
sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND);
|
||||
sceKernelPowerTick(SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF);
|
||||
}
|
||||
|
||||
sceKernelDelayThread(10 * 1000 * 1000);
|
||||
|
Loading…
Reference in New Issue
Block a user