From bb0541404d79e91cde0ffe2dac8506df134e18b7 Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 6 May 2020 09:24:12 +0200 Subject: [PATCH] updated librw --- librw | 2 +- premake5.lua | 92 ++++++++++++++++++++++++++++++++++++++++++++ src/fakerw/fake.cpp | 3 +- src/fakerw/rwcore.h | 10 ++--- src/render/Lines.cpp | 2 + src/skel/win/win.cpp | 2 - 6 files changed, 101 insertions(+), 10 deletions(-) diff --git a/librw b/librw index b3ad490d..40eae78e 160000 --- a/librw +++ b/librw @@ -1 +1 @@ -Subproject commit b3ad490d1be3c1f41b416d3ceeaff3453bd2d28d +Subproject commit 40eae78e793f234e332aff08265c41683faeb7f7 diff --git a/premake5.lua b/premake5.lua index 1c313a10..cfba8e01 100644 --- a/premake5.lua +++ b/premake5.lua @@ -192,3 +192,95 @@ project "re3" libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") } libdirs { path.join(_OPTIONS["glfwdir"], "lib-" .. string.gsub(_ACTION, "vs", "vc")) } links { "opengl32", "glew32s", "glfw3" } + + +project "reVC" + kind "WindowedApp" + targetname "reVC" + targetdir "bin/%{cfg.platform}/%{cfg.buildcfg}" + targetextension ".exe" + characterset ("MBCS") + linkoptions "/SAFESEH:NO" + + defines { "MIAMI" } + + files { "src/*.*" } + files { "src/animation/*.*" } + files { "src/audio/*.*" } + files { "src/control/*.*" } + files { "src/core/*.*" } + files { "src/entities/*.*" } + files { "src/math/*.*" } + files { "src/modelinfo/*.*" } + files { "src/objects/*.*" } + files { "src/peds/*.*" } + files { "src/render/*.*" } + files { "src/rw/*.*" } + files { "src/save/*.*" } + files { "src/skel/*.*" } + files { "src/skel/win/*.*" } + files { "src/skel/glfw/*.*" } + files { "src/text/*.*" } + files { "src/vehicles/*.*" } + files { "src/weapons/*.*" } + files { "src/extras/*.*" } + files { "eax/*.*" } + + includedirs { "src" } + includedirs { "src/animation" } + includedirs { "src/audio" } + includedirs { "src/control" } + includedirs { "src/core" } + includedirs { "src/entities" } + includedirs { "src/math" } + includedirs { "src/modelinfo" } + includedirs { "src/objects" } + includedirs { "src/peds" } + includedirs { "src/render" } + includedirs { "src/rw" } + includedirs { "src/save/" } + includedirs { "src/skel/" } + includedirs { "src/skel/win" } + includedirs { "src/skel/glfw" } + includedirs { "src/text" } + includedirs { "src/vehicles" } + includedirs { "src/weapons" } + includedirs { "src/extras" } + includedirs { "eax" } + + includedirs { "milessdk/include" } + includedirs { "eax" } + + libdirs { "milessdk/lib" } + + setpaths("$(GTA_VC_RE_DIR)/", "$(TargetFileName)", "") + + filter "platforms:*RW33*" + staticruntime "on" + includedirs { "rwsdk/include/d3d8" } + libdirs { "rwsdk/lib/d3d8/release" } + links { "rwcore", "rpworld", "rpmatfx", "rpskin", "rphanim", "rtbmp", "rtquat", "rtcharse" } + defines { "RWLIBS" } + linkoptions "/SECTION:_rwcseg,ER!W /MERGE:_rwcseg=.text" + + filter "platforms:*librw*" + defines { "LIBRW" } + files { "src/fakerw/*.*" } + includedirs { "src/fakerw" } + includedirs { Librw } + if(_OPTIONS["with-librw"]) then + libdirs { "lib/%{cfg.platform}/%{cfg.buildcfg}" } + end + links { "rw" } + + filter "platforms:*d3d*" + includedirs { "dxsdk/include" } + libdirs { "dxsdk/lib" } + + filter "platforms:*d3d9*" + links { "d3d9" } + + filter "platforms:*gl3_glfw*" + libdirs { path.join(_OPTIONS["glewdir"], "lib/Release/Win32") } + libdirs { path.join(_OPTIONS["glfwdir"], "lib-" .. string.gsub(_ACTION, "vs", "vc")) } + links { "opengl32", "glew32s", "glfw3" } diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 76d7865c..e569dea9 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -429,8 +429,7 @@ void RwIm3DVertexSetU(RwIm3DVertex *vert, RwReal u) { vert->setU(u); } void RwIm3DVertexSetV(RwIm3DVertex *vert, RwReal v) { vert->setV(v); } void RwIm3DVertexSetRGBA(RwIm3DVertex *vert, RwUInt8 r, RwUInt8 g, RwUInt8 b, RwUInt8 a) { vert->setColor(r, g, b, a); } -// WARNING: ignoring flags -void *RwIm3DTransform(RwIm3DVertex *pVerts, RwUInt32 numVerts, RwMatrix *ltm, RwUInt32 flags) { im3d::Transform(pVerts, numVerts, ltm); return pVerts; } +void *RwIm3DTransform(RwIm3DVertex *pVerts, RwUInt32 numVerts, RwMatrix *ltm, RwUInt32 flags) { im3d::Transform(pVerts, numVerts, ltm, flags); return pVerts; } RwBool RwIm3DEnd(void) { im3d::End(); return true; } RwBool RwIm3DRenderLine(RwInt32 vert1, RwInt32 vert2) { RwImVertexIndex indices[2]; diff --git a/src/fakerw/rwcore.h b/src/fakerw/rwcore.h index 22e29737..31bc5541 100644 --- a/src/fakerw/rwcore.h +++ b/src/fakerw/rwcore.h @@ -20,11 +20,11 @@ typedef RwUInt16 RwImVertexIndex; enum RwIm3DTransformFlags { - rwIM3D_VERTEXUV = 1, - rwIM3D_ALLOPAQUE = 2, - rwIM3D_NOCLIP = 4, - rwIM3D_VERTEXXYZ = 8, - rwIM3D_VERTEXRGBA = 16, + rwIM3D_VERTEXUV = rw::im3d::VERTEXUV, + rwIM3D_ALLOPAQUE = rw::im3d::ALLOPAQUE, + rwIM3D_NOCLIP = rw::im3d::NOCLIP, + rwIM3D_VERTEXXYZ = rw::im3d::VERTEXXYZ, + rwIM3D_VERTEXRGBA = rw::im3d::VERTEXRGBA, }; void RwIm2DVertexSetCameraX(RwIm2DVertex *vert, RwReal camx); diff --git a/src/render/Lines.cpp b/src/render/Lines.cpp index b5c85149..84d3683b 100644 --- a/src/render/Lines.cpp +++ b/src/render/Lines.cpp @@ -60,6 +60,8 @@ CLines::RenderLineWithClipping(float x1, float y1, float z1, float x2, float y2, col2.green = c2>>16; col2.blue = c2>>8; col2.alpha = c2; +// HACK HACK until i got im3d fixed +RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil); RwIm3DVertexSetRGBA(&v[0], col1.red, col1.green, col1.blue, col1.alpha); RwIm3DVertexSetRGBA(&v[1], col2.red, col2.green, col2.blue, col2.alpha); diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index d20cc0bf..ec72bf7e 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -1884,13 +1884,11 @@ WinMain(HINSTANCE instance, StaticPatcher::Apply(); SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE); -/* // TODO: make this an option somewhere AllocConsole(); freopen("CONIN$", "r", stdin); freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); -*/ /* * Initialize the platform independent data.