Change to unembedded data

Change to unembedded data
This commit is contained in:
xhp-creations 2017-01-04 13:52:38 -05:00
parent e220d86a70
commit af8b1d58ee
7 changed files with 12 additions and 31 deletions

View File

@ -1 +0,0 @@
s

View File

@ -10,7 +10,7 @@ count=0
if [[ $OSTYPE == darwin* ]]; if [[ $OSTYPE == darwin* ]];
then then
for i in $(gfind ./data/images/ ./data/sounds/ ./data/fonts/ -maxdepth 1 -type f \( ! -printf "%f\n" \) | sort -f) for i in $(gfind ./channel/content -maxdepth 1 -type f \( ! -printf "%f\n" \) | sort -f)
do do
files[count]=$i files[count]=$i
count=$((count+1)) count=$((count+1))
@ -18,7 +18,7 @@ done
else else
for i in $(find ./data/images/ ./data/sounds/ ./data/fonts/ -maxdepth 1 -type f \( ! -printf "%f\n" \) | sort -f) for i in $(find ./channel/content -maxdepth 1 -type f \( ! -printf "%f\n" \) | sort -f)
do do
files[count]=$i files[count]=$i
count=$((count+1)) count=$((count+1))
@ -53,15 +53,6 @@ typedef struct _RecourceFile
EOF EOF
for i in ${files[@]}
do
filename=${i%.*}
extension=${i##*.}
echo 'extern const unsigned char '$filename'_'$extension'[];' >> $outFile
echo 'extern const unsigned int '$filename'_'$extension'_size;' >> $outFile
echo '' >> $outFile
done
echo 'static RecourceFile RecourceList[] =' >> $outFile echo 'static RecourceFile RecourceList[] =' >> $outFile
echo '{' >> $outFile echo '{' >> $outFile
@ -69,7 +60,7 @@ for i in ${files[@]}
do do
filename=${i%.*} filename=${i%.*}
extension=${i##*.} extension=${i##*.}
echo -e '\t{"'$i'", '$filename'_'$extension', '$filename'_'$extension'_size, NULL, 0},' >> $outFile echo -e '\t{"'$i'", NULL, 0, NULL, 0},' >> $outFile
done done
echo -e '\t{NULL, NULL, 0, NULL, 0}' >> $outFile echo -e '\t{NULL, NULL, 0, NULL, 0}' >> $outFile

View File

@ -5,7 +5,7 @@
#include "utils/logger.h" #include "utils/logger.h"
#include "utils/utils.h" #include "utils/utils.h"
#include "common/common.h" #include "common/common.h"
#include "resources/Resources.h"
#include "main.h" #include "main.h"
/* Entry point */ /* Entry point */

View File

@ -12,26 +12,17 @@
typedef struct _RecourceFile typedef struct _RecourceFile
{ {
const char *filename; const char *filename;
const u8 *DefaultFile; const unsigned char *DefaultFile;
const u32 &DefaultFileSize; const unsigned int &DefaultFileSize;
u8 *CustomFile; unsigned char *CustomFile;
u32 CustomFileSize; unsigned int CustomFileSize;
} RecourceFile; } RecourceFile;
extern const u8 bgMusic_ogg[];
extern const u32 bgMusic_ogg_size;
extern const u8 button_click_mp3[];
extern const u32 button_click_mp3_size;
extern const u8 font_ttf[];
extern const u32 font_ttf_size;
static RecourceFile RecourceList[] = static RecourceFile RecourceList[] =
{ {
{"bgMusic.ogg", bgMusic_ogg, bgMusic_ogg_size, NULL, 0}, {"bgMusic.ogg", NULL, 0, NULL, 0},
{"button_click.mp3", button_click_mp3, button_click_mp3_size, NULL, 0}, {"button_click.mp3", NULL, 0, NULL, 0},
{"font.ttf", font_ttf, font_ttf_size, NULL, 0}, {"font.ttf", NULL, 0, NULL, 0},
{NULL, NULL, 0, NULL, 0} {NULL, NULL, 0, NULL, 0}
}; };