From 48ce6151f919d14731cfa79c1b814786b123a80b Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 12 Jan 2021 18:55:14 +0100 Subject: fix building with PED_SKIN --- src/rw/RwHelper.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 4ee3a0b3..dd356b96 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -2,6 +2,7 @@ #define WITHD3D #endif #include "common.h" +#include #include "RwHelper.h" #include "Timecycle.h" -- cgit v1.2.3 From 57201187de74da42437dfa984a6cd36fe663a5e4 Mon Sep 17 00:00:00 2001 From: erorcun Date: Wed, 13 Jan 2021 14:22:31 +0300 Subject: Fix build without FIX_BUGS, divide to 0 fixes --- src/rw/RwHelper.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index dd356b96..d004656c 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -291,7 +291,8 @@ SkinGetBonePositionsToTable(RpClump *clump, RwV3d *boneTable) parent = stack[sp--]; else parent = i; - assert(parent >= 0 && parent < numBones); + + //assert(parent >= 0 && parent < numBones); } } @@ -299,7 +300,7 @@ RpHAnimAnimation* HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier) { int i; -#ifdef FIX_BUGS +#if defined FIX_BUGS || defined LIBRW int numNodes = hier->numNodes*2; // you're supposed to have at least two KFs per node #else int numNodes = hier->numNodes; @@ -313,7 +314,7 @@ HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier) frame->q.real = 1.0f; frame->q.imag.x = frame->q.imag.y = frame->q.imag.z = 0.0f; frame->t.x = frame->t.y = frame->t.z = 0.0f; -#ifdef FIX_BUGS +#if defined FIX_BUGS || defined LIBRW // times are subtracted and divided giving NaNs // so they can't both be 0 frame->time = i/hier->numNodes; @@ -401,7 +402,7 @@ CameraSize(RwCamera * camera, RwRect * rect, RwRaster *zRaster; // BUG: game just changes camera raster's sizes, but this is a hack -#ifdef FIX_BUGS +#if defined FIX_BUGS || defined LIBRW /* * Destroy rasters... */ -- cgit v1.2.3 From 5a47379bf5f011a65c1d0f88a0cb5f2130feb9db Mon Sep 17 00:00:00 2001 From: erorcun Date: Sat, 16 Jan 2021 16:44:59 +0300 Subject: Includes overhaul, fix some compiler warnings --- src/rw/RwHelper.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index d004656c..65e342ed 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -1,6 +1,4 @@ -#if defined RW_D3D9 || defined RWLIBS #define WITHD3D -#endif #include "common.h" #include -- cgit v1.2.3 From 253021866c266d8cf8d18241d3c3f330bff9ed06 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 18 Feb 2021 13:08:22 +0100 Subject: d3d9 debug render groups --- src/rw/RwHelper.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 65e342ed..e98b58f6 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -113,6 +113,30 @@ SetCullMode(uint32 mode) RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); } +#ifndef FINAL +void +PushRendergroup(const char *name) +{ +#if defined(RW_OPENGL) + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name); +#elif defined(RW_D3D9) + static WCHAR tmp[256]; + MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, tmp, sizeof(tmp)); + D3DPERF_BeginEvent(0xFFFFFFFF, tmp); +#endif +} + +void +PopRendergroup(void) +{ +#if defined(RW_OPENGL) + glPopDebugGroup(); +#elif defined(RW_D3D9) + D3DPERF_EndEvent(); +#endif +} +#endif + RwFrame* GetFirstFrameCallback(RwFrame *child, void *data) { -- cgit v1.2.3 From 6245a17e168822300d7bb1f5a308305872dff2bc Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 18 Feb 2021 20:31:46 +0100 Subject: update librw; render groups only if extension supported --- src/rw/RwHelper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index e98b58f6..76749cb1 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -118,7 +118,8 @@ void PushRendergroup(const char *name) { #if defined(RW_OPENGL) - glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name); + if(GLAD_GL_KHR_debug) + glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name); #elif defined(RW_D3D9) static WCHAR tmp[256]; MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, tmp, sizeof(tmp)); @@ -130,7 +131,8 @@ void PopRendergroup(void) { #if defined(RW_OPENGL) - glPopDebugGroup(); + if(GLAD_GL_KHR_debug) + glPopDebugGroup(); #elif defined(RW_D3D9) D3DPERF_EndEvent(); #endif -- cgit v1.2.3 From 9a7fa478578beaba947ea867c15a25e411d641d8 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 19 Feb 2021 18:41:31 +0100 Subject: make debug render groups optional --- src/rw/RwHelper.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 76749cb1..ef2d1c0f 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -11,6 +11,7 @@ #endif #ifndef FINAL RtCharset *debugCharset; +bool bDebugRenderGroups; #endif #ifdef PS2_ALPHA_TEST @@ -117,6 +118,8 @@ SetCullMode(uint32 mode) void PushRendergroup(const char *name) { + if(!bDebugRenderGroups) + return; #if defined(RW_OPENGL) if(GLAD_GL_KHR_debug) glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name); @@ -130,6 +133,8 @@ PushRendergroup(const char *name) void PopRendergroup(void) { + if(!bDebugRenderGroups) + return; #if defined(RW_OPENGL) if(GLAD_GL_KHR_debug) glPopDebugGroup(); -- cgit v1.2.3 From df1ad8e122e43967710470e275844b62c4962e5d Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 28 Feb 2021 15:29:58 +0100 Subject: fix postfx --- src/rw/RwHelper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index ef2d1c0f..a633a139 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -6,6 +6,7 @@ #include "Timecycle.h" #include "skeleton.h" #include "Debug.h" +#include "MBlur.h" #if !defined(FINAL) || defined(DEBUGMENU) #include "rtcharse.h" #endif @@ -526,6 +527,13 @@ CameraSize(RwCamera * camera, RwRect * rect, RsGlobal.width = rect->w; RsGlobal.height = rect->h; + +#ifdef FIX_BUGS + if(CMBlur::BlurOn){ + CMBlur::MotionBlurClose(); + CMBlur::MotionBlurOpen(camera); + } +#endif } return; -- cgit v1.2.3 From 77ca9c593f7f04dcc1a1141bdaf197caa398afbf Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 28 Feb 2021 19:03:46 +0100 Subject: fix postfx fix --- src/rw/RwHelper.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/rw/RwHelper.cpp') diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index a633a139..35593722 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -498,6 +498,12 @@ CameraSize(RwCamera * camera, RwRect * rect, raster->width = zRaster->width = rect->w; raster->height = zRaster->height = rect->h; +#endif +#ifdef FIX_BUGS + if(CMBlur::BlurOn){ + CMBlur::MotionBlurClose(); + CMBlur::MotionBlurOpen(camera); + } #endif } @@ -527,13 +533,6 @@ CameraSize(RwCamera * camera, RwRect * rect, RsGlobal.width = rect->w; RsGlobal.height = rect->h; - -#ifdef FIX_BUGS - if(CMBlur::BlurOn){ - CMBlur::MotionBlurClose(); - CMBlur::MotionBlurOpen(camera); - } -#endif } return; -- cgit v1.2.3