mirror of https://github.com/aap/librw.git
restructured some files
This commit is contained in:
parent
c99e045e8d
commit
fca3327ae2
5
Makefile
5
Makefile
|
@ -11,6 +11,7 @@ SRC := $(patsubst %.cpp,$(SRCDIR)/%.cpp, rwbase.cpp clump.cpp\
|
|||
image.cpp gtaplg.cpp)
|
||||
OBJ := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRC))
|
||||
DEP := $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.d,$(SRC))
|
||||
INC := -I/usr/local/include
|
||||
CFLAGS=-Wall -Wextra -g $(BUILDDEF) -Wno-parentheses #-Wconversion
|
||||
LIB=librw-$(BUILD).a
|
||||
|
||||
|
@ -19,11 +20,11 @@ $(LIB): $(OBJ)
|
|||
|
||||
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) $(CFLAGS) -c $< -o $@
|
||||
$(CXX) $(CFLAGS) $(INC) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/%.d: $(SRCDIR)/%.cpp
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $< > $@
|
||||
$(CXX) -MM -MT '$(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$<)' $(CFLAGS) $(INC) $< > $@
|
||||
|
||||
clean:
|
||||
rm -f $(BUILDDIR)/*.[od]
|
||||
|
|
1
TODO
1
TODO
|
@ -25,7 +25,6 @@ Clump & related:
|
|||
Geometry
|
||||
((Morph)) 0x105
|
||||
R* 2dfx 0x253F2F8
|
||||
R* mystery xbox plugin 0x253F2F2
|
||||
Material
|
||||
UV Anim 0x135
|
||||
Texture
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librw_2013", "librw_2013.vcxproj", "{44700D30-55D1-4D17-917C-5BF474F322C4}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dffwrite", "..\..\various\dffwrite\dffwrite_2013.vcxproj", "{FD03F2BD-125B-4D3C-809D-420D8DABEB5B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{44700D30-55D1-4D17-917C-5BF474F322C4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{44700D30-55D1-4D17-917C-5BF474F322C4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{44700D30-55D1-4D17-917C-5BF474F322C4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{44700D30-55D1-4D17-917C-5BF474F322C4}.Release|Win32.Build.0 = Release|Win32
|
||||
{FD03F2BD-125B-4D3C-809D-420D8DABEB5B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FD03F2BD-125B-4D3C-809D-420D8DABEB5B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FD03F2BD-125B-4D3C-809D-420D8DABEB5B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FD03F2BD-125B-4D3C-809D-420D8DABEB5B}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,101 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{44700D30-55D1-4D17-917C-5BF474F322C4}</ProjectGuid>
|
||||
<RootNamespace>win32_2013</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>librw_d_2013</TargetName>
|
||||
<OutDir>$(ProjectDir)..\..\lib\</OutDir>
|
||||
<IntDir>$(ProjectDir)..\..\obj\win32_$(Configuration)_2013\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>librw_2013</TargetName>
|
||||
<OutDir>$(ProjectDir)..\..\lib\</OutDir>
|
||||
<IntDir>$(ProjectDir)..\..\obj\win32_$(Configuration)_2013\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\clump.cpp" />
|
||||
<ClCompile Include="..\..\src\geometry.cpp" />
|
||||
<ClCompile Include="..\..\src\gtaplg.cpp" />
|
||||
<ClCompile Include="..\..\src\image.cpp" />
|
||||
<ClCompile Include="..\..\src\ogl.cpp" />
|
||||
<ClCompile Include="..\..\src\plugins.cpp" />
|
||||
<ClCompile Include="..\..\src\ps2.cpp" />
|
||||
<ClCompile Include="..\..\src\rwbase.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\rw.h" />
|
||||
<ClInclude Include="..\..\src\gtaplg.h" />
|
||||
<ClInclude Include="..\..\src\rwbase.h" />
|
||||
<ClInclude Include="..\..\src\rwobjects.h" />
|
||||
<ClInclude Include="..\..\src\rwogl.h" />
|
||||
<ClInclude Include="..\..\src\rwplugin.h" />
|
||||
<ClInclude Include="..\..\src\rwps2.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -4,8 +4,8 @@
|
|||
#include <cassert>
|
||||
#include <new>
|
||||
|
||||
#include "rw.h"
|
||||
#include "src/gtaplg.h"
|
||||
#include "../rw.h"
|
||||
#include "../src/gtaplg.h"
|
||||
|
||||
using namespace std;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
#include <cassert>
|
||||
#include <new>
|
||||
|
||||
#include "rw.h"
|
||||
#include "../rw.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace rw;
|
|
@ -4,7 +4,8 @@ OBJ = $(patsubst %.cpp, $(BUILDDIR)/%.o, $(SRC))
|
|||
DEP = $(patsubst %.cpp, $(BUILDDIR)/%.d, $(SRC))
|
||||
RWDIR=$(HOME)/src/librw
|
||||
|
||||
LDLIBS=-pthread -lX11 -lXrandr -lXi -lXxf86vm -lGL -lGLEW -lm
|
||||
INC := -I/usr/local/include
|
||||
LDLIBS=-L/usr/local/lib -pthread -lX11 -lXrandr -lXi -lXxf86vm -lGL -lGLEW -lm
|
||||
STATICLIBS= $(RWDIR)/librw-opengl.a /usr/local/lib/libglfw3.a
|
||||
|
||||
#LDLIBS=-pthread -lGL -lGLEW -lglfw
|
||||
|
@ -17,11 +18,11 @@ rwtest: $(OBJ) $(STATICLIBS)
|
|||
|
||||
$(BUILDDIR)/%.o: %.cpp
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) $(CFLAGS) -c $< -o $@
|
||||
$(CXX) $(CFLAGS) $(INC) -c $< -o $@
|
||||
|
||||
$(BUILDDIR)/%.d: %.cpp
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) -MM -MT '$(patsubst %.cpp,$(BUILDDIR)%.o,$<)' $(CFLAGS) $< > $@
|
||||
$(CXX) -MM -MT '$(patsubst %.cpp,$(BUILDDIR)%.o,$<)' $(CFLAGS) $(INC) $< > $@
|
||||
|
||||
clean:
|
||||
rm $(BUILDDIR)/* rwtest
|
|
@ -127,8 +127,15 @@ init(void)
|
|||
"void main()"
|
||||
"{"
|
||||
" gl_Position = projMat * viewMat * worldMat * vec4(in_vertex, 1.0);"
|
||||
|
||||
" vec3 N = normalize(mat3(viewMat * worldMat) * in_normal);"
|
||||
" vec3 P = vec3(viewMat * worldMat * vec4(in_vertex, 1.0));"
|
||||
" vec3 V = normalize(-P);"
|
||||
" float rim = 1.0 - max(dot(V, N), 0.0);"
|
||||
|
||||
" vec3 n = mat3(worldMat) * in_normal;"
|
||||
" float l = max(0.0, dot(n, -lightdir));"
|
||||
// " l = l*0.4 + rim;"
|
||||
" v_color = (in_color+vec4(l,l,l,0)+amblight)*matColor;"
|
||||
" v_texCoord = in_texCoord;"
|
||||
"}\n"
|
||||
|
@ -179,7 +186,8 @@ init(void)
|
|||
camera->setAspectRatio(1.0f*screenWidth/screenHeight);
|
||||
camera->setNearFar(0.1f, 450.0f);
|
||||
camera->setTarget(Vec3(0.0f, 0.0f, 0.0f));
|
||||
camera->setPosition(Vec3(0.0f, 5.0f, 0.0f));
|
||||
// camera->setPosition(Vec3(0.0f, 5.0f, 0.0f));
|
||||
camera->setPosition(Vec3(0.0f, -1.0f, 3.0f));
|
||||
|
||||
rw::currentTexDictionary = new rw::TexDictionary;
|
||||
// rw::Image::setSearchPath("/home/aap/gamedata/ps2/gtasa/models/gta3_archive/txd_extracted/");
|
|
@ -4,8 +4,8 @@
|
|||
#include <cassert>
|
||||
#include <new>
|
||||
|
||||
#include "rw.h"
|
||||
#include "src/gtaplg.h"
|
||||
#include "../rw.h"
|
||||
#include "../src/gtaplg.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace rw;
|
|
@ -8,7 +8,7 @@ To compile you need the ps2toolchain and ee-dvp-as from the Sony SDK
|
|||
(dvp-as from the ps2toolchain segfaults when encountering MPG,
|
||||
this should be fixed).
|
||||
|
||||
So far the program can render PS2 native geometry (no generic geometry atm)
|
||||
So far the program can render PS2 native geometry
|
||||
in the default or skin format (no PDS pipes as used in San Andreas supported yet).
|
||||
The files are read from host: (see main.cpp)
|
||||
so you can use e.g. ps2link on a real PS2 or pcsx2 with the host device enabled.
|
|
@ -1,96 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FD03F2BD-125B-4D3C-809D-420D8DABEB5B}</ProjectGuid>
|
||||
<RootNamespace>dffwrite</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(ProjectDir)..\..\bin\</OutDir>
|
||||
<IntDir>$(ProjectDir)..\..\obj\dffwrite\win32_$(Configuration)_2013\</IntDir>
|
||||
<TargetName>dffwrite_d</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(ProjectDir)..\..\bin\</OutDir>
|
||||
<IntDir>$(ProjectDir)..\..\obj\dffwrite\win32_$(Configuration)_2013\</IntDir>
|
||||
<TargetName>dffwrite</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName)_2013.pdb</ProgramDatabaseFile>
|
||||
<ManifestFile>$(IntDir)$(TargetName)_2013$(TargetExt).intermediate.manifest</ManifestFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>librw_d_2013.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName)_2013.pdb</ProgramDatabaseFile>
|
||||
<ManifestFile>$(IntDir)$(TargetName)_2013$(TargetExt).intermediate.manifest</ManifestFile>
|
||||
<AdditionalLibraryDirectories>..\..\lib\</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>librw_2013.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\dffwrite.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\rw.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
Loading…
Reference in New Issue