pouët.net

Bundle data into EXE

category: general [glöplog]
for what it's worth, i made a visual studio compile rule (C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults\*.rules) so if i pull any file into the project, i just set the build rule to "Raw Data Compiler" and it automagically gets .obj-ified.

here's the .rules file itself:
Code: <?xml version="1.0" encoding="utf-8"?> <VisualStudioToolFile Name="Raw data" Version="8,00" > <Rules> <CustomBuildRule Name="Raw Data" DisplayName="Raw Data Compiler" CommandLine="nasmw.exe -f win32 &quot;%NASMDIR%\bin2obj.asm&quot; -o &quot;$(OutDir)\$(InputName).obj&quot; -dOBJNAME=_$(InputName) -dBINNAME=\&quot;$(InputPath)\&quot;" Outputs="$(OutDir)\$(InputName).obj" FileExtensions="*.raw" ExecutionDescription="Compiling raw data..." > <Properties> </Properties> </CustomBuildRule> </Rules> </VisualStudioToolFile>
added on the 2010-05-24 16:07:18 by Gargaj Gargaj
oh and the bin2obj.asm i use is
Code: %macro include_binary 2 global %1 %1 incbin %2 %1_end: global %1_size %1_size dd %1_end - %1 %endmacro section .data include_binary OBJNAME, BINNAME

(a bit of an overkill using a macro but i used to use one asm file to include a lot of stuff and it kindof got deprecated)
added on the 2010-05-24 16:47:41 by Gargaj Gargaj
thanks gargaj -- those are going into the "if ever needed" folder :)
added on the 2010-05-24 17:37:21 by superplek superplek
and i´m doin it the hard way all the time !
number_of_textures=x;
size_of_textures=y;
of1fset_textures=x*y;
[...]
data_size=offset_textures+offset_models+blahblah+blah+blah...

am i doin it wrong ?!!

login