Linux: Using Code::Blocks Custom Compile option to generate embedded resources now. :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1774 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-09-07 13:40:16 +00:00
parent 2b26e4f300
commit aa3d448c97
10 changed files with 129 additions and 34 deletions

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="pcsx2_suite_2008 workspace">
<Project filename="pcsx2.cbp">
<Project filename="pcsx2.cbp" active="1">
<Depends filename="../../common/build/x86emitter/x86emitter.cbp" />
<Depends filename="../../common/build/Utilities/Utilities.cbp" />
<Depends filename="../../3rdparty/zlib/zlib.cbp" />
<Depends filename="../../tools/bin2cpp/bin2cpp.cbp" />
</Project>
<Project filename="../../common/build/x86emitter/x86emitter.cbp" />
<Project filename="../../common/build/Utilities/Utilities.cbp" />
@ -17,6 +18,7 @@
<Project filename="../../plugins/CDVDnull/Linux/CDVDnull.cbp" />
<Project filename="../../plugins/GSnull/Linux/GSnull.cbp" />
<Project filename="../../plugins/SPU2null/Linux/SPU2null.cbp" />
<Project filename="../../plugins/PadNull/Linux/PadNull.cbp" active="1" />
<Project filename="../../plugins/PadNull/Linux/PadNull.cbp" />
<Project filename="../../tools/bin2cpp/bin2cpp.cbp" />
</Workspace>
</CodeBlocks_workspace_file>

View File

@ -12,6 +12,7 @@
<Option output="$(SvnRootDir)/bin/pcsx2-dbg" prefix_auto="1" extension_auto="1" />
<Option working_dir="$(SvnRootDir)/bin/" />
<Option object_output="./.objs/debug" />
<Option external_deps="../../tools/bin/bin2cpp;" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
@ -299,13 +300,58 @@
<Unit filename="../gui/Panels/VideoPanel.cpp" />
<Unit filename="../gui/Plugins.cpp" />
<Unit filename="../gui/Resources/AppIcon.h" />
<Unit filename="../gui/Resources/AppIcon.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/BackgroundLogo.h" />
<Unit filename="../gui/Resources/BackgroundLogo.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/ConfigIcon_Cpu.h" />
<Unit filename="../gui/Resources/ConfigIcon_Cpu.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/ConfigIcon_Gamefixes.h" />
<Unit filename="../gui/Resources/ConfigIcon_Gamefixes.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/ConfigIcon_Paths.h" />
<Unit filename="../gui/Resources/ConfigIcon_Paths.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/ConfigIcon_Plugins.h" />
<Unit filename="../gui/Resources/ConfigIcon_Plugins.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/ConfigIcon_Speedhacks.h" />
<Unit filename="../gui/Resources/ConfigIcon_Speedhacks.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/ConfigIcon_Video.h" />
<Unit filename="../gui/Resources/ConfigIcon_Video.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/Dualshock.png">
<Option compile="1" />
<Option weight="0" />
<Option compiler="gcc" use="1" buildCommand="$(SvnRootDir)/tools/bin2app.sh $(SvnRootDir) $file" />
</Unit>
<Unit filename="../gui/Resources/EmbeddedImage.h" />
<Unit filename="../gui/Resources/ps2_silver.h" />
<Unit filename="../gui/Saveslots.cpp" />
@ -314,7 +360,6 @@
<Unit filename="../gui/main.cpp" />
<Unit filename="../gui/wxHelpers.cpp" />
<Unit filename="../gui/wxHelpers.h" />
<Unit filename="../pcsxAbout.bmp" />
<Unit filename="../ps2/BiosTools.cpp" />
<Unit filename="../ps2/BiosTools.h" />
<Unit filename="../ps2/CoreEmuThread.cpp" />

View File

@ -1,9 +1,9 @@
..\..\..\tools\bin\bin2cpp BackgroundLogo.png BackgroundLogo png_BackgroundLogo
..\..\..\tools\bin\bin2cpp AppIcon.png AppIcon png_AppIcon
..\..\..\tools\bin\bin2cpp BackgroundLogo.png
..\..\..\tools\bin\bin2cpp AppIcon.png
..\..\..\tools\bin\bin2cpp ConfigIcon_Cpu.png ConfigIcon_Cpu png_ConfigIcon_Cpu
..\..\..\tools\bin\bin2cpp ConfigIcon_Paths.png ConfigIcon_Paths png_ConfigIcon_Paths
..\..\..\tools\bin\bin2cpp ConfigIcon_Plugins.png ConfigIcon_Plugins png_ConfigIcon_Plugins
..\..\..\tools\bin\bin2cpp ConfigIcon_Speedhacks.png ConfigIcon_Speedhacks png_ConfigIcon_Speedhacks
..\..\..\tools\bin\bin2cpp ConfigIcon_Gamefixes.png ConfigIcon_Gamefixes png_ConfigIcon_Gamefixes
..\..\..\tools\bin\bin2cpp ConfigIcon_Video.png ConfigIcon_Video png_ConfigIcon_Video
..\..\..\tools\bin\bin2cpp ConfigIcon_Cpu.png
..\..\..\tools\bin\bin2cpp ConfigIcon_Paths.png
..\..\..\tools\bin\bin2cpp ConfigIcon_Plugins.png
..\..\..\tools\bin\bin2cpp ConfigIcon_Speedhacks.png
..\..\..\tools\bin\bin2cpp ConfigIcon_Gamefixes.png
..\..\..\tools\bin\bin2cpp ConfigIcon_Video.png

View File

@ -1,12 +1,12 @@
#!/bin/sh
../../../Tools/bin2cpp/bin2cpp BackgroundLogo.png BackgroundLogo res_BackgroundLogo
../../../Tools/bin2cpp/bin2cpp AppIcon.png AppIcon res_AppIcon
../../../tools/bin/bin2cpp BackgroundLogo.png
../../../tools/bin/bin2cpp AppIcon.png
../../../Tools/bin2cpp/bin2cpp ConfigIcon_Cpu.png ConfigIcon_Cpu res_ConfigIcon_Cpu
../../../Tools/bin2cpp/bin2cpp ConfigIcon_Paths.png ConfigIcon_Paths res_ConfigIcon_Paths
../../../Tools/bin2cpp/bin2cpp ConfigIcon_Plugins.png ConfigIcon_Plugins res_ConfigIcon_Plugins
../../../Tools/bin2cpp/bin2cpp ConfigIcon_Speedhacks.png ConfigIcon_Speedhacks res_ConfigIcon_Speedhacks
../../../Tools/bin2cpp/bin2cpp ConfigIcon_Gamefixes.png ConfigIcon_Gamefixes res_ConfigIcon_Gamefixes
../../../Tools/bin2cpp/bin2cpp ConfigIcon_Video.png ConfigIcon_Video res_ConfigIcon_Video
../../../Tools/bin2cpp/bin2cpp Dualshock.png Dualshock res_Dualshock
../../../tools/bin/bin2cpp ConfigIcon_Cpu.png
../../../tools/bin/bin2cpp ConfigIcon_Paths.png
../../../tools/bin/bin2cpp ConfigIcon_Plugins.png
../../../tools/bin/bin2cpp ConfigIcon_Speedhacks.png
../../../tools/bin/bin2cpp ConfigIcon_Gamefixes.png
../../../tools/bin/bin2cpp ConfigIcon_Video.png
../../../tools/bin/bin2cpp Dualshock.png

View File

@ -8,6 +8,6 @@
<Cursor position="2455" topLine="86" />
</File>
<File name="../GifTransfer.h" open="1" top="0" tabpos="3">
<Cursor position="3401" topLine="126" />
<Cursor position="3401" topLine="112" />
</File>
</CodeBlocks_layout_file>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
<File name="Config.cpp" open="1" top="1" tabpos="1">
<File name="Config.cpp" open="1" top="0" tabpos="1">
<Cursor position="808" topLine="4" />
</File>
</CodeBlocks_layout_file>

View File

@ -9,4 +9,4 @@
# SrcImage - Complete filename with extension.
#
../../../Tools/bin2cpp/bin2cpp %1
$1/tools/bin/bin2cpp $2

Binary file not shown.

34
tools/bin2cpp/bin2cpp.cbp Normal file
View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="bin2cpp" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Release">
<Option output="../bin/bin2cpp" prefix_auto="1" extension_auto="1" />
<Option object_output="./.objs/release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="bin2cpp.cpp" />
<Extensions>
<envvars />
<code_completion />
<lib_finder disable_auto="1" />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@ -57,7 +57,7 @@ static const unsigned int LINE = 16;
long getfilesize( const char* filename )
{
struct stat result;
stat( filename, &result );
return result.st_size;
}
@ -76,7 +76,6 @@ int main(int argc, char* argv[])
s8 Dummy[260];
s8 srcfile[260];
s8 classname[260];
int c;
if ( (argc <= ARG_SRCFILE) )
{
@ -122,7 +121,7 @@ int main(int argc, char* argv[])
printf( "ERROR : I can't find source file %s\n", srcfile );
return 20;
}
const int filesize( getfilesize( srcfile ) );
char wxImgTypeUpper[24];
@ -143,7 +142,7 @@ int main(int argc, char* argv[])
// ----------------------------------------------------------------------------
// Determine Target Name, and Open Target File for Writing
// ----------------------------------------------------------------------------
strcpy( Dummy, argv[(argc <= ARG_DESTFILE) ? ARG_SRCFILE : ARG_DESTFILE] );
strcat( Dummy,".h" );
@ -154,18 +153,33 @@ int main(int argc, char* argv[])
(void)fcloseall();
return 0L;
}
// ----------------------------------------------------------------------------
printf( "Bin2CPP Output > %s\n", Dummy );
const char* fnameonly = NULL;
if( argc <= ARG_CLASSNAME )
{
fnameonly = argv[(argc <= ARG_DESTFILE) ? ARG_SRCFILE : ARG_DESTFILE];
strcpy( classname, "res_" );
strcat( classname, argv[(argc <= ARG_DESTFILE) ? ARG_SRCFILE : ARG_DESTFILE] );
}
else
strcpy( classname, argv[ARG_CLASSNAME] );
{
fnameonly = argv[ARG_CLASSNAME];
classname[0] = 0;
}
{
int len = strlen(fnameonly);
const char* fnlast = &fnameonly[len];
while( --fnlast, --len, (len >= 0 && (*fnlast != '/')) );
fnameonly = fnlast+1;
}
strcpy( classname, "res_" );
strcat( classname, fnameonly );
/* It writes the header information */
@ -193,10 +207,10 @@ int main(int argc, char* argv[])
do
{
fprintf(dest,"\t");
for ( c=0; c <= LINE; ++c )
for ( unsigned int c=0; c <= LINE; ++c )
{
if( fread( buffer, 1, 1, source ) == 0 ) break;
if( c != 0 )
fprintf( dest, "," );
fprintf( dest,"0x%02x", *buffer );