From 6d25e5574025360425b385f09a0ff475ec98fc60 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Mon, 7 Sep 2009 00:34:04 +0000 Subject: [PATCH] Get bin2cpp to work on Linux. (Linux compilation is still broken.) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1766 96395faa-99c1-11dd-bbfe-3dabce05a288 --- Tools/bin2cpp/bin2cpp | Bin 0 -> 11932 bytes Tools/bin2cpp/bin2cpp.cpp | 22 ++++++++++++++++++---- pcsx2/gui/Resources/bin2app.sh | 12 ++++++++++++ pcsx2/gui/Resources/rebuild.sh | 11 +++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100755 Tools/bin2cpp/bin2cpp create mode 100755 pcsx2/gui/Resources/bin2app.sh create mode 100755 pcsx2/gui/Resources/rebuild.sh diff --git a/Tools/bin2cpp/bin2cpp b/Tools/bin2cpp/bin2cpp new file mode 100755 index 0000000000000000000000000000000000000000..d86c610766afa2f58a60104798fe223527f7443a GIT binary patch literal 11932 zcmeHNe{fXSb-ue=l0}h?z&}%yaD|1D2Y5&VyI9CrNLpmYGOUGgz?eK%yH9!x`>VTe zK}t*jFLJ;eB}(E<>pwEJlX1(KG^TOtq_HQX6pv*$=?vq>f7F?2X^W>zAsv!YJtW0! zzwh3C($ivh(oX->)f}Ds-Fxmi_niCVy}j=q4)tyE`Fz4neo-TcCcYF1t_Oc@xvp6+ zq^K25;?v>|@i7#!Zv7F+fI85Cv;buRPz}fdc8&&uq?>?AtV6LPFd@*EbaIIhB(@jz zx_KM{?^QK|SDg$<^PFdT;;gV2i}|VB*Lv0qeTPENId)YZLLowTal8L_C!rF>-06 zRhPpx)xKxz4%M7~(&j?YV$f|MH!+@!^DQ8@WB=jOjQkDAGkpSdE9gcL^?g)g-vRe2!iU|LhwbPkArGGW$YglZLm+&quMu#24ePMw0Hk2fAP@2P9i%e{lh+0@4t!VDu2DPzx z%FO4in8-QVXl7Ilr88DaWb#f<3|Z+R7AH{Pr1KeA5JRYmilmjKES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I%Z#97lpFCBxLH19smo1g8}K331>mk6ImgybiIoD^)r9yI3M7a=aBgwVd-Yvfg)1GN zhORz{U6;5Yu~6T-)BBFbS^@VLjkN{tBO24Xe%H{Lt4!|;8tVn%z9ZDAolUQEU9Z%r z^{g?y5Q6JgV|7fd)~CjwAQN1N8goVKdx9G48)sZs8e`EQas6n_TVr~iXslNy*Mr6! z6+Q1Y<{OX@oZlMj9h>u5W4+SccbOV>>rBr}UC$e5`dv$7y~A*xX{=AL)wKu|)QC^A zcqY||KbV;ZEDVTWm+2wrGqKNqn|fYwoe~TG5_Koii+fP)_Rr_PMeVJweTmca-Kggs z502ataf8?o&ixBa;Vd(i#AtB;a+5^n85e*Pp9C@9oEg0L^%A%{9!qco@UMW~M160% z0G#+e&}sCimDqoSxa7ghfqxC$?$OTx#c;mQ^}zn$1nl}(5C5cR;!}TX74ELWJF4(L z;DO3`E%x6o4p!BFsR}Rb ztyDMv)IW3Xbwu;AmKJ>D;wP?L{PR}$p(y(8aYA1~^eWRg6}=_uF5_%L%k1UE*}`V3 z&81BnA3qbg#E3hO-b!9^%#3Kdo^{J#N~M3g81 literal 0 HcmV?d00001 diff --git a/Tools/bin2cpp/bin2cpp.cpp b/Tools/bin2cpp/bin2cpp.cpp index 44208b876f..3fdf4ff0fc 100644 --- a/Tools/bin2cpp/bin2cpp.cpp +++ b/Tools/bin2cpp/bin2cpp.cpp @@ -35,6 +35,19 @@ #include +#if defined (__linux__) && !defined(__LINUX__) // some distributions are lower case +#define __LINUX__ +#endif + +#ifdef __LINUX__ +#define _stat stat +#define _fcloseall fcloseall +#include +#endif + +typedef unsigned char u8; +typedef char s8; + using namespace std; static const unsigned int BUF_LEN = 1; @@ -50,10 +63,6 @@ long getfilesize( const char* filename ) return result.st_size; } - -typedef unsigned char u8; -typedef char s8; - enum { ARG_SRCFILE = 1, @@ -121,7 +130,12 @@ int main(int argc, char* argv[]) char wxImgTypeLower[24]; strcpy( wxImgTypeUpper, &srcfile[srcfn_len-3] ); //strcpy( wxImgTypeLower, argv[ARG_IMGEXT] ); +#ifdef __LINUX__ + for (int i = 0; i < 24; i++) + wxImgTypeUpper[i] = toupper(wxImgTypeUpper[i]); +#else strupr( wxImgTypeUpper ); +#endif //strupr( wxImgTypeLower ); if( strcmp( wxImgTypeUpper, "JPG" ) == 0 ) diff --git a/pcsx2/gui/Resources/bin2app.sh b/pcsx2/gui/Resources/bin2app.sh new file mode 100755 index 0000000000..3829442b18 --- /dev/null +++ b/pcsx2/gui/Resources/bin2app.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Probably self-explanatory: This batch file compiles a single souce image into a +# CPP header file for use by pcsx2. +# +# bin2cpp.sh SrcImage +# +# Parameters +# SrcImage - Complete filename with extension. +# + +../../../Tools/bin2cpp/bin2cpp %1 \ No newline at end of file diff --git a/pcsx2/gui/Resources/rebuild.sh b/pcsx2/gui/Resources/rebuild.sh new file mode 100755 index 0000000000..d3172803a3 --- /dev/null +++ b/pcsx2/gui/Resources/rebuild.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +../../../Tools/bin2cpp/bin2cpp BackgroundLogo.png BackgroundLogo png_BackgroundLogo +../../../Tools/bin2cpp/bin2cpp AppIcon.png AppIcon png_AppIcon + +../../../Tools/bin2cpp/bin2cpp ConfigIcon_Cpu.png ConfigIcon_Cpu png_ConfigIcon_Cpu +../../../Tools/bin2cpp/bin2cpp ConfigIcon_Paths.png ConfigIcon_Paths png_ConfigIcon_Paths +../../../Tools/bin2cpp/bin2cpp ConfigIcon_Plugins.png ConfigIcon_Plugins png_ConfigIcon_Plugins +../../../Tools/bin2cpp/bin2cpp ConfigIcon_Speedhacks.png ConfigIcon_Speedhacks png_ConfigIcon_Speedhacks +../../../Tools/bin2cpp/bin2cpp ConfigIcon_Gamefixes.png ConfigIcon_Gamefixes png_ConfigIcon_Gamefixes +../../../Tools/bin2cpp/bin2cpp ConfigIcon_Video.png ConfigIcon_Video png_ConfigIcon_Video \ No newline at end of file