Skip to content

Commit

Permalink
Update 0.85
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Aug 28, 2016
1 parent 220fc94 commit 1b35846
Show file tree
Hide file tree
Showing 15 changed files with 221 additions and 69 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,23 @@ Any amount of donation is a big support for VitaShell development and therefore
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y7CVA9VSJA2VW

### Customization ###
Put your colors file at **'ux0:VitaShell/theme/colors.txt'** and if wanted a PNG wallpaper file at **'ux0:VitaShell/theme/wallpaper.png'**.
If no wallpaper is available, **BACKGROUND_COLOR** from **'colors.txt'** will be used.
The standard VitaShell colors file is provided in the **'release'** section
You can customize those files:
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/colors.txt'**: All colors adjustable
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/wallpaper.png'**: Wallpaper #1
- **'ux0:VitaShell/theme/YOUR_THEME_NAME/wallpaperX.png'**: Wallpaper #X
- **'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

**General info:** You don't need to have all these files in your custom theme, if one of them is missing, the default one 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")
**Dialog and context image:** If these files are not available, the colors **DIALOG_BG_COLOR** and **CONTEXT_MENU_COLOR** from from **'colors.txt'** will be used instead.

The standard VitaShell theme is provided in 'VitaShellCustomization.rar' and available the **'release'** section.

### Multi-language ###
Put your language file at **'ux0:VitaShell/language/x.txt'**, **where the file must be UTF-8 encoded and 'x' is one of the language listed below:**
Expand All @@ -37,7 +51,7 @@ Put your language file at **'ux0:VitaShell/language/x.txt'**, **where the file m

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'.
The english language file is provided in the **'release'** section
The english language file is provided in 'VitaShellCustomization.rar' and available in the **'release'** section.

### VitaShell themes and translations collection ###
This is an unofficial VitaShell themes and translations collection:
Expand All @@ -46,6 +60,11 @@ https://github.com/xy2iii/vitashell-themes

Be sure you pull request your customized design or language file there.

### Changelog 0.85 ###
- Added customization possibility for ftp icon, battery, dialog and context menu.
- Added random wallpaper feature.
- Changed location of themes to 'ux0:VitaShell/theme/YOUR_THEME_NAME'.

### Changelog 0.8 ###
- Added support for >2GB zip archives (dropped support for 7zip and rar though).
- Added cache system for zipfs (faster file reading when browsing in zip archives).
Expand Down
4 changes: 2 additions & 2 deletions audioplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ int audioPlayer(char *file, FileList *list, FileListEntry *entry, int *base_pos,
}

// Start drawing
START_DRAWING();
startDrawing();
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);

Expand All @@ -442,7 +442,7 @@ int audioPlayer(char *file, FileList *list, FileListEntry *entry, int *base_pos,
}

// End drawing
END_DRAWING();
endDrawing();

sceKernelDelayThread(1000);
}
Expand Down
4 changes: 2 additions & 2 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int readEntry(char *line, ConfigEntry *entries, int n_entries) {
return -1;

// Name of entry
char name[MAX_NAME_LENGTH];
char name[MAX_CONFIG_NAME_LENGTH];
strncpy(name, line, p - line);
name[p - line] = '\0';

Expand Down Expand Up @@ -181,7 +181,7 @@ int readEntry(char *line, ConfigEntry *entries, int n_entries) {

int readConfigBuffer(void *buffer, int size, ConfigEntry *entries, int n_entries) {
int res = 0;
char line[MAX_LINE_LENGTH];
char line[MAX_CONFIG_LINE_LENGTH];
char *p = buffer;

// Skip UTF-8 bom
Expand Down
6 changes: 3 additions & 3 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#ifndef __CONFIG_H__
#define __CONFIG_H__

#define MAX_NAME_LENGTH 128
#define MAX_STRING_LENGTH 512
#define MAX_LINE_LENGTH 1024
#define MAX_CONFIG_NAME_LENGTH 128
#define MAX_CONFIG_STRING_LENGTH 512
#define MAX_CONFIG_LINE_LENGTH 1024

enum ConfigTypes {
CONFIG_TYPE_DECIMAL,
Expand Down
4 changes: 2 additions & 2 deletions hex.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ int hexViewer(char *file) {
}

// Start drawing
START_DRAWING();
startDrawing();

// Draw shell info
drawShellInfo(file);
Expand Down Expand Up @@ -361,7 +361,7 @@ int hexViewer(char *file) {
}

// End drawing
END_DRAWING();
endDrawing();
}

hexListEmpty(&list);
Expand Down
18 changes: 1 addition & 17 deletions init.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#include "file.h"
#include "utils.h"

extern unsigned char _binary_resources_ftp_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_headphone_png_start;
extern unsigned char _binary_resources_audio_previous_png_start;
extern unsigned char _binary_resources_audio_pause_png_start;
Expand All @@ -34,8 +30,7 @@ extern unsigned char _binary_resources_audio_next_png_start;
vita2d_pgf *font = NULL;
char font_size_cache[256];

vita2d_texture *ftp_image = NULL, *battery_image = NULL, *battery_bar_red_image = NULL, *battery_bar_green_image = NULL, *headphone_image = NULL;
vita2d_texture *audio_previous_image = NULL, *audio_pause_image = NULL, *audio_play_image = NULL, *audio_next_image = NULL;
vita2d_texture *headphone_image = NULL, *audio_previous_image = NULL, *audio_pause_image = NULL, *audio_play_image = NULL, *audio_next_image = NULL;

// System params
int language = 0, enter_button = 0, date_format = 0, time_format = 0;
Expand Down Expand Up @@ -94,10 +89,6 @@ void initVita2dLib() {
font_size_cache[i] = vita2d_pgf_text_width(font, FONT_SIZE, character);
}

ftp_image = vita2d_load_PNG_buffer(&_binary_resources_ftp_png_start);
battery_image = vita2d_load_PNG_buffer(&_binary_resources_battery_png_start);
battery_bar_red_image = vita2d_load_PNG_buffer(&_binary_resources_battery_bar_red_png_start);
battery_bar_green_image = vita2d_load_PNG_buffer(&_binary_resources_battery_bar_green_png_start);
headphone_image = vita2d_load_PNG_buffer(&_binary_resources_headphone_png_start);
audio_previous_image = vita2d_load_PNG_buffer(&_binary_resources_audio_previous_png_start);
audio_pause_image = vita2d_load_PNG_buffer(&_binary_resources_audio_pause_png_start);
Expand All @@ -106,10 +97,6 @@ void initVita2dLib() {
}

void finishVita2dLib() {
vita2d_free_texture(battery_bar_green_image);
vita2d_free_texture(battery_bar_red_image);
vita2d_free_texture(battery_image);
vita2d_free_texture(ftp_image);
vita2d_free_texture(headphone_image);
vita2d_free_texture(audio_previous_image);
vita2d_free_texture(audio_pause_image);
Expand All @@ -118,9 +105,6 @@ void finishVita2dLib() {
vita2d_free_pgf(font);
vita2d_fini();

battery_bar_green_image = NULL;
battery_bar_red_image = NULL;
battery_image = NULL;
font = NULL;
headphone_image = NULL;
audio_previous_image = NULL;
Expand Down
11 changes: 7 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "utils.h"
#include "audioplayer.h"

int _newlib_heap_size_user = 32 * 1024 * 1024;
int _newlib_heap_size_user = 64 * 1024 * 1024;

#define MAX_DIR_LEVELS 1024

Expand Down Expand Up @@ -512,7 +512,7 @@ void drawContextMenu() {

// Draw context menu
if (ctx_menu_mode != CONTEXT_MENU_CLOSED) {
vita2d_draw_rectangle(SCREEN_WIDTH - ctx_menu_width, 0.0f, ctx_menu_width, SCREEN_HEIGHT, CONTEXT_MENU_COLOR);
vita2d_draw_texture_part(context_image, SCREEN_WIDTH - ctx_menu_width, 0.0f, 0.0f, 0.0f, ctx_menu_width, SCREEN_HEIGHT);

int i;
for (i = 0; i < N_MENU_ENTRIES; i++) {
Expand Down Expand Up @@ -1110,7 +1110,7 @@ int shellMain() {
}

// Start drawing
START_DRAWING();
startDrawing();

// Draw shell info
drawShellInfo(file_list.path);
Expand Down Expand Up @@ -1211,7 +1211,7 @@ int shellMain() {
drawContextMenu();

// End drawing
END_DRAWING();
endDrawing();
}

// Empty lists
Expand Down Expand Up @@ -1279,6 +1279,9 @@ int main(int argc, const char *argv[]) {
if (current_buttons & SCE_CTRL_LTRIGGER)
use_custom_config = 0;

// Init random number generator
srand(time(NULL));

// Make VitaShell folders
sceIoMkdir("ux0:VitaShell", 0777);
sceIoMkdir("ux0:VitaShell/language", 0777);
Expand Down
25 changes: 2 additions & 23 deletions main.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,18 @@

#include "functions.h"

#include "uncommon_dialog.h"

#define ENABLE_DEBUGNET_LOGGING 1
#define ENABLE_FILE_LOGGING 1

// VitaShell version major.minor
#define VITASHELL_VERSION_MAJOR 0
#define VITASHELL_VERSION_MINOR 8
#define VITASHELL_VERSION_MINOR 85

#define ALIGN(x, align) (((x) + ((align) - 1)) & ~((align) - 1))

#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))

#define START_DRAWING() \
{ \
vita2d_start_drawing(); \
vita2d_set_clear_color(BACKGROUND_COLOR); \
vita2d_clear_screen(); \
if (bg_tex) \
vita2d_draw_texture(bg_tex, 0.0f, 0.0f); \
}

#define END_DRAWING() \
{ \
drawUncommonDialog(); \
vita2d_end_drawing(); \
vita2d_common_dialog_update(); \
vita2d_swap_buffers(); \
sceDisplayWaitVblankStart(); \
}

#define NOALPHA 0xFF

#define COLOR_ALPHA(color, alpha) (color & 0x00FFFFFF) | ((alpha & 0xFF) << 24)
Expand Down Expand Up @@ -195,8 +175,7 @@ enum DialogSteps {
extern vita2d_pgf *font;
extern char font_size_cache[256];

extern vita2d_texture *ftp_image, *battery_image, *battery_bar_red_image, *battery_bar_green_image, *headphone_image;
extern vita2d_texture *audio_previous_image, *audio_pause_image, *audio_play_image, *audio_next_image;
extern vita2d_texture *headphone_image, *audio_previous_image, *audio_pause_image, *audio_play_image, *audio_next_image;

extern int SCE_CTRL_ENTER, SCE_CTRL_CANCEL;

Expand Down
4 changes: 2 additions & 2 deletions photo.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ int photoViewer(char *file, int type, FileList *list, FileListEntry *entry, int
}

// Start drawing
START_DRAWING();
startDrawing();

// Photo
vita2d_draw_texture_scale_rotate_hotspot(tex, SCREEN_HALF_WIDTH, SCREEN_HALF_HEIGHT, zoom, zoom, rad, x, y);
Expand All @@ -355,7 +355,7 @@ int photoViewer(char *file, int type, FileList *list, FileListEntry *entry, int
pgf_draw_textf(SHELL_MARGIN_X, SCREEN_HEIGHT - 3.0f * SHELL_MARGIN_Y, GENERAL_COLOR, FONT_SIZE, "%.0f%%", zoom * 100.0f);

// End drawing
END_DRAWING();
endDrawing();
}

vita2d_free_texture(tex);
Expand Down
4 changes: 2 additions & 2 deletions text.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ int textViewer(char *file) {
}

// Start drawing
START_DRAWING();
startDrawing();

// Draw shell info
drawShellInfo(file);
Expand Down Expand Up @@ -283,7 +283,7 @@ int textViewer(char *file) {
}

// End drawing
END_DRAWING();
endDrawing();
}

running = 0;
Expand Down
Loading

0 comments on commit 1b35846

Please sign in to comment.