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* ]];
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
files[count]=$i
count=$((count+1))
@ -18,7 +18,7 @@ done
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
files[count]=$i
count=$((count+1))
@ -53,15 +53,6 @@ typedef struct _RecourceFile
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 '{' >> $outFile
@ -69,7 +60,7 @@ for i in ${files[@]}
do
filename=${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
echo -e '\t{NULL, NULL, 0, NULL, 0}' >> $outFile

View File

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

View File

@ -11,27 +11,18 @@
typedef struct _RecourceFile
{
const char *filename;
const u8 *DefaultFile;
const u32 &DefaultFileSize;
u8 *CustomFile;
u32 CustomFileSize;
const char *filename;
const unsigned char *DefaultFile;
const unsigned int &DefaultFileSize;
unsigned char *CustomFile;
unsigned int CustomFileSize;
} 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[] =
{
{"bgMusic.ogg", bgMusic_ogg, bgMusic_ogg_size, NULL, 0},
{"button_click.mp3", button_click_mp3, button_click_mp3_size, NULL, 0},
{"font.ttf", font_ttf, font_ttf_size, NULL, 0},
{"bgMusic.ogg", NULL, 0, NULL, 0},
{"button_click.mp3", NULL, 0, NULL, 0},
{"font.ttf", NULL, 0, NULL, 0},
{NULL, NULL, 0, NULL, 0}
};