Skip to content

Commit

Permalink
fixed mobile VC postfx
Browse files Browse the repository at this point in the history
  • Loading branch information
aap committed Aug 11, 2020
1 parent 9700158 commit 7a65330
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,8 @@ patch(void)
#endif
#ifdef DEBUG
if(gtaversion == VC_10){
//extern void hackshit(void);
//hackshit();
// remove "%s has not been pre-instanced", we don't really care
Nop(0x40C32B, 5);
//MemoryVP::InjectHook(0x650ACB, RwTextureRead_VC);
Expand All @@ -1051,6 +1053,9 @@ patch(void)
Patch(0x58054D + 2, 0x94B210+4);
Patch(0x58057D + 2, 0x94B210+8);

// disable Vsynch
Patch<uint8>(0x6021EF + 1, 0);

// disable level load screens
Nop(0x40E00E, 5);
Nop(0x40E01C, 5);
Expand Down
1 change: 1 addition & 0 deletions src/matfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ else
RwD3D8SetTexture(texture, 0);
else
RwD3D8SetTexture(nil, 0);
RwD3D8SetPixelShader(0);
RwD3D8SetVertexShader(inst->vertexShader);
RwD3D8SetStreamSource(0, inst->vertexBuffer, inst->stride);
RwD3D8SetIndices(inst->indexBuffer, inst->baseIndex);
Expand Down
12 changes: 6 additions & 6 deletions src/postfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,12 @@ CMBlur::MotionBlurRender_mobile(RwCamera *cam, uint8 red, uint8 green, uint8 blu
add[1] = green/1536.f;
add[2] = blue/1536.f;
}else{
mult[0] = (red-64)/256.0f + 1.14f;
mult[1] = (green-64)/256.0f + 1.14f;
mult[2] = (blue-64)/256.0f + 1.14f;
add[0] = red/1536.f + 0.05f;
add[1] = green/1536.f + 0.05f;
add[2] = blue/1536.f + 0.05f;
mult[0] = (red-64)/256.0f + 1.4f;
mult[1] = (green-64)/256.0f + 1.4f;
mult[2] = (blue-64)/256.0f + 1.4f;
add[0] = red/1536.f - 0.05f;
add[1] = green/1536.f - 0.05f;
add[2] = blue/1536.f - 0.05f;
}
RwD3D9SetPixelShaderConstant(3, &mult, 1);
RwD3D9SetPixelShaderConstant(4, &add, 1);
Expand Down
2 changes: 2 additions & 0 deletions src/skygfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <stdint.h>
#include <assert.h>

//#define DEBUG

// want to use RwEngineInst instead of RwEngineInstance
#undef RWSRCGLOBAL
#define RWSRCGLOBAL(variable) \
Expand Down

0 comments on commit 7a65330

Please sign in to comment.