mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Started on resources.
This commit is contained in:
Binary file not shown.
+30
-6
@@ -9,6 +9,29 @@ void load(std::string file);
|
||||
void write(std::string file, int size, char *data);
|
||||
|
||||
|
||||
const char * love_header = ""
|
||||
"/**\n"
|
||||
"* Copyright (c) 2006-2009 LOVE Development Team\n"
|
||||
"* \n"
|
||||
"* This software is provided 'as-is', without any express or implied\n"
|
||||
"* warranty. In no event will the authors be held liable for any damages\n"
|
||||
"* arising from the use of this software.\n"
|
||||
"* \n"
|
||||
"* Permission is granted to anyone to use this software for any purpose,\n"
|
||||
"* including commercial applications, and to alter it and redistribute it\n"
|
||||
"* freely, subject to the following restrictions:\n"
|
||||
"* \n"
|
||||
"* 1. The origin of this software must not be misrepresented; you must not\n"
|
||||
"* claim that you wrote the original software. If you use this software\n"
|
||||
"* in a product, an acknowledgment in the product documentation would be\n"
|
||||
"* appreciated but is not required.\n"
|
||||
"* 2. Altered source versions must be plainly marked as such, and must not be\n"
|
||||
"* misrepresented as being the original software.\n"
|
||||
"* 3. This notice may not be removed or altered from any source distribution.\n"
|
||||
"**/\n\n";
|
||||
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -17,14 +40,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
resources_h.open("resources.h");
|
||||
resources_h
|
||||
<< love_header
|
||||
<< "#ifndef LOVE_RESOURCES_H\n"
|
||||
<< "#define LOVE_RESOURCES_H\n\n"
|
||||
<< "#include <vector>\n"
|
||||
<< "#include <love/MemoryFile.h>\n\n"
|
||||
<< "namespace love\n"
|
||||
<< "{\n";
|
||||
resources_cpp.open("resources.cpp");
|
||||
resources_cpp
|
||||
<< love_header
|
||||
<< "#include \"resources.h\"\n\n"
|
||||
<< "namespace love\n"
|
||||
<< "{\n";
|
||||
@@ -37,7 +60,7 @@ int main(int argc, char *argv[])
|
||||
resources_cpp.close();
|
||||
resources_h
|
||||
<< "}\n\n"
|
||||
<< "#endif\n";
|
||||
<< "#endif // LOVE_RESOURCES_H \n";
|
||||
resources_h.close();
|
||||
}
|
||||
|
||||
@@ -95,7 +118,7 @@ void write(string file, int size, char *data)
|
||||
}
|
||||
//#endif
|
||||
|
||||
resources_cpp << "\tstatic char " << var << "_data[" << size << "] = {";
|
||||
resources_cpp << "\tconst char " << var << "_data[] = {";
|
||||
for (int i = 0; i < size - 1; i++)
|
||||
{
|
||||
sprintf(buffer, "%d,", data[i]);
|
||||
@@ -104,8 +127,9 @@ void write(string file, int size, char *data)
|
||||
resources_cpp << "\n\t";
|
||||
}
|
||||
sprintf(buffer, "%d};\n", data[size]);
|
||||
resources_cpp << buffer << "\tpFile " << var.c_str() << "(new MemoryFile(" << var << "_data, " << size << ", \"" << file.c_str() << "\"));\n\n";
|
||||
|
||||
resources_h << "\textern pFile " << var << ";\n";
|
||||
resources_h << "\t// " << var << "\n";
|
||||
resources_h << "\tconst int " << var << "_size = " << size << ";\n";
|
||||
resources_h << "\textern const char " << var << "_data[];\n\n";
|
||||
printf(" is haxed\n");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reshax", "reshax.vcproj", "{B47E7C85-A0CF-4A14-BBB0-EA64BDDA9981}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B47E7C85-A0CF-4A14-BBB0-EA64BDDA9981}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B47E7C85-A0CF-4A14-BBB0-EA64BDDA9981}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B47E7C85-A0CF-4A14-BBB0-EA64BDDA9981}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B47E7C85-A0CF-4A14-BBB0-EA64BDDA9981}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,193 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="reshax"
|
||||
ProjectGUID="{B47E7C85-A0CF-4A14-BBB0-EA64BDDA9981}"
|
||||
RootNamespace="reshax"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\reshax.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
#ifndef LOVE_RESOURCES_H
|
||||
#define LOVE_RESOURCES_H
|
||||
|
||||
#include <vector>
|
||||
#include <love/MemoryFile.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
extern pFile Vera_ttf;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user