Skip to content

Commit

Permalink
BloodSpots Update;
Browse files Browse the repository at this point in the history
HD Roadsign;
SAMP fixes.
  • Loading branch information
DK22Pac committed May 21, 2017
1 parent 3950203 commit 265d9a6
Show file tree
Hide file tree
Showing 17 changed files with 530 additions and 18 deletions.
2 changes: 2 additions & 0 deletions project_files/imfx.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ClCompile Include="..\source\Lensflare.cpp" />
<ClCompile Include="..\source\Moonphases.cpp" />
<ClCompile Include="..\source\ProportionalCoronas.cpp" />
<ClCompile Include="..\source\Roadsign.cpp" />
<ClCompile Include="..\source\Settings.cpp" />
<ClCompile Include="..\source\Version.cpp" />
<ClCompile Include="..\source\WaterDrops.cpp" />
Expand All @@ -38,6 +39,7 @@
<ClInclude Include="..\source\Lensflare.h" />
<ClInclude Include="..\source\Moonphases.h" />
<ClInclude Include="..\source\ProportionalCoronas.h" />
<ClInclude Include="..\source\Roadsign.h" />
<ClInclude Include="..\source\Settings.h" />
<ClInclude Include="..\source\Version.h" />
<ClInclude Include="..\source\WaterDrops.h" />
Expand Down
6 changes: 6 additions & 0 deletions project_files/imfx.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<ClCompile Include="..\source\Version.cpp">
<Filter>source</Filter>
</ClCompile>
<ClCompile Include="..\source\Roadsign.cpp">
<Filter>source</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\source\DebugConsole.h">
Expand Down Expand Up @@ -92,5 +95,8 @@
<ClInclude Include="..\source\Version.h">
<Filter>source</Filter>
</ClInclude>
<ClInclude Include="..\source\Roadsign.h">
<Filter>source</Filter>
</ClInclude>
</ItemGroup>
</Project>
Empty file removed resources/imfx/bloodspots.dat
Empty file.
1 change: 1 addition & 0 deletions resources/imfx/imfx.dat
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ENABLE_HEADSHOT YES
ENABLE_MOONPHASES YES
ENABLE_EXPLOSIONS YES
ENABLE_BLOODSPOTS YES
ENABLE_ROADSIGN YES
ENABLE_PROPORTIONAL_CORONAS YES
ENABLE_WATER_DROPS YES
ENABLE_DEBUG_CONSOLE NO
Binary file modified resources/imfx/moon.txd
Binary file not shown.
Binary file added resources/imfx/roadsignfont.txd
Binary file not shown.
43 changes: 42 additions & 1 deletion source/BloodSpots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ void BloodSpots::Setup() {
m_pBloodFootStep4[1] = RwTexDictionaryFindNamedTexture(m_pTxd, "bloodfootstep4_r");
}
// change blood color
patch::RedirectCall(0x630EA2, AddBloodShadow1);
patch::RedirectCall(0x630E63, AddBloodShadow2);
patch::RedirectCall(0x49EB86, MyConstructBloodFxInfo);
patch::SetUChar(0x49ED79, 255);
patch::SetUChar(0x49ED7B, 255);
patch::SetUInt(0x49ED7D, 255);
Expand Down Expand Up @@ -124,6 +127,10 @@ void BloodSpots::DoFootStepShadow(unsigned char type, RwTexture* texture, CVecto
case MODEL_HFYBE:
case MODEL_WFYCRK:
case MODEL_HMYCM:
case MODEL_DWFYLC1:
case MODEL_WMYBE:
case MODEL_CWFYHB:
case MODEL_CWMOHB1:
myTexture = m_pBloodFootStep1[texNum];
break;
case MODEL_BFYRI:
Expand All @@ -136,12 +143,33 @@ void BloodSpots::DoFootStepShadow(unsigned char type, RwTexture* texture, CVecto
case MODEL_WFYRI:
case MODEL_DNFYLC:
case MODEL_SOFYBU:
case MODEL_WFYBU: // 150
case MODEL_WFYBU:
case MODEL_SOFYRI:
case MODEL_WFYSEX:
case MODEL_VHFYPRO:
case MODEL_VWFYWAI:
case MODEL_SBFORI:
case MODEL_SWFYRI:
case MODEL_SBFYRI:
case MODEL_SOFORI:
case MODEL_SWFYST:
case MODEL_SHFYPRO:
case MODEL_SBFYPRO:
case MODEL_SFYPRO:
case MODEL_VBFYST2:
case MODEL_VBFYPRO:
case MODEL_VHFYST3:
case MODEL_SBFYSTR:
case MODEL_SWFYSTR:
case MODEL_VWFYWA2:
myTexture = m_pBloodFootStep3[texNum];
break;
case MODEL_BMYBE:
case MODEL_HMYBE:
case MODEL_WMYLG:
case MODEL_CWMYHB1:
case MODEL_WFYLG:
case MODEL_WMYVA2:
myTexture = m_pBloodFootStep4[texNum];
break;
case MODEL_WFYRO:
Expand All @@ -154,4 +182,17 @@ void BloodSpots::DoFootStepShadow(unsigned char type, RwTexture* texture, CVecto
}
if (myTexture)
CShadows::AddPermanentShadow(type, myTexture, posn, topX, topY, rightX, rightY, intensity, 49, 17, 16, drawDistance, time, upDistance);
}

void BloodSpots::AddBloodShadow1(unsigned char type, RwTexture* texture, CVector* posn, float topX, float topY, float rightX, float rightY, short intensity, unsigned char red, unsigned char greeb, unsigned char blue, float drawDistance, unsigned int time, float upDistance) {
CShadows::AddPermanentShadow(type, texture, posn, topX, topY, rightX, rightY, intensity, 255, 255, 255, drawDistance, time, upDistance);
}

void BloodSpots::AddBloodShadow2(unsigned int id, unsigned char type, RwTexture* texture, CVector* posn, float topX, float topY, float rightX, float rightY, short intensity, unsigned char red, unsigned char greeb, unsigned char blue, float zDistance, float scale, float drawDistance, bool temporaryShadow, float upDistance) {
CShadows::StoreStaticShadow(id, type, texture, posn, topX, topY, rightX, rightY, intensity, 255, 255, 255, zDistance, scale, drawDistance, temporaryShadow, upDistance);
}

FxPrtMult_c * __fastcall BloodSpots::MyConstructBloodFxInfo(FxPrtMult_c *_this, int, float red, float green, float blue, float alpha, float size, float arg5, float lastFactor) {
CallMethod<0x4AB290>(_this, 1.0f, 1.0f, 1.0f, 1.0f, size, arg5, lastFactor);
return _this;
}
4 changes: 4 additions & 0 deletions source/BloodSpots.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "game_sa\RenderWare.h"
#include "game_sa\CPed.h"
#include "game_sa\FxPrtMult_c.h"

class BloodSpots {
public:
Expand All @@ -20,4 +21,7 @@ class BloodSpots {
static void Shutdown();
static void __fastcall MyDoPedFootLanded(CPed *ped, int, bool bLeftFoot, unsigned char arg3);
static void DoFootStepShadow(unsigned char type, RwTexture* texture, CVector* posn, float topX, float topY, float rightX, float rightY, short intensity, unsigned char red, unsigned char greeb, unsigned char blue, float drawDistance, unsigned int time, float upDistance);
static void AddBloodShadow1(unsigned char type, RwTexture* texture, CVector* posn, float topX, float topY, float rightX, float rightY, short intensity, unsigned char red, unsigned char greeb, unsigned char blue, float drawDistance, unsigned int time, float upDistance);
static void AddBloodShadow2(unsigned int id, unsigned char type, RwTexture* texture, CVector* posn, float topX, float topY, float rightX, float rightY, short intensity, unsigned char red, unsigned char greeb, unsigned char blue, float zDistance, float scale, float drawDistance, bool temporaryShadow, float upDistance);
static FxPrtMult_c * __fastcall MyConstructBloodFxInfo(FxPrtMult_c *_this, int, float red, float green, float blue, float alpha, float size, float arg5, float lastFactor);
};
17 changes: 13 additions & 4 deletions source/DebugConsole.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DebugConsole.h"
#include "imfx.h"
#include "Settings.h"
#include <string>
#include "plugin.h"
Expand Down Expand Up @@ -28,18 +29,26 @@ void DebugConsole::RenderOneMessage(float x, float y, char *text) {
}

void DebugConsole::Render() {
CSprite2d::DrawRect(CRect(SCREEN_COORD(10.0f), SCREEN_COORD(185.0f), SCREEN_COORD(400.0f), SCREEN_COORD(795.0f)),
CRGBA(0, 0, 0, 150));
if (!IMFX::bSampGame)
CSprite2d::DrawRect(CRect(SCREEN_COORD(10.0f), SCREEN_COORD(185.0f), SCREEN_COORD(400.0f), SCREEN_COORD(795.0f)), CRGBA(0, 0, 0, 150));
else
CSprite2d::DrawRect(CRect(SCREEN_COORD_RIGHT(400.0f), SCREEN_COORD(185.0f), SCREEN_COORD_RIGHT(10.0f), SCREEN_COORD(795.0f)), CRGBA(0, 0, 0, 150));
float y = 190.0f;
for (unsigned int i = nLastMessage + 1; i < 20; ++i) {
if (messages[i][0]) {
RenderOneMessage(SCREEN_COORD(15.0f), SCREEN_COORD(y), messages[i]);
if(!IMFX::bSampGame)
RenderOneMessage(SCREEN_COORD(15.0f), SCREEN_COORD(y), messages[i]);
else
RenderOneMessage(SCREEN_COORD_RIGHT(395.0f), SCREEN_COORD(y), messages[i]);
y += 30.0f;
}
}
for (unsigned int i = 0; i <= nLastMessage; ++i) {
if (messages[i][0]) {
RenderOneMessage(SCREEN_COORD(15.0f), SCREEN_COORD(y), messages[i]);
if(!IMFX::bSampGame)
RenderOneMessage(SCREEN_COORD(15.0f), SCREEN_COORD(y), messages[i]);
else
RenderOneMessage(SCREEN_COORD_RIGHT(395.0f), SCREEN_COORD(y), messages[i]);
y += 30.0f;
}
}
Expand Down
14 changes: 9 additions & 5 deletions source/Gunflashes.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Gunflashes.h"
#include "imfx.h"
#include "plugin.h"
#include "game_sa\FxManager_c.h"
#include "game_sa\common.h"
Expand All @@ -21,11 +22,13 @@ void Gunflashes::Setup() {
patch::Nop(0x7330FF, 9); // Remove default gunflashes
patch::SetUShort(0x5DF425, 0xE990); // Remove default gunflashes
patch::SetUChar(0x741353, 0); // Add gunflash for cuntgun
patch::SetUShort(0x53C1F0, 0xC483); // add esp, 8
patch::SetUChar(0x53C1F2, 8);
patch::Nop(0x53C1F3, 2);
if (!IMFX::bSampGame) {
patch::SetUShort(0x53C1F0, 0xC483); // add esp, 8
patch::SetUChar(0x53C1F2, 8);
patch::Nop(0x53C1F3, 2);
patch::RedirectCall(0x742299, DoDriveByGunflash);
}
patch::RedirectJump(0x4A0DE0, MyTriggerGunflash);
patch::RedirectCall(0x742299, DoDriveByGunflash);
patch::SetPointer(0x86D744, MyProcessUseGunTask);
ReadSettings();
}
Expand Down Expand Up @@ -120,7 +123,8 @@ void __fastcall Gunflashes::MyTriggerGunflash(Fx_c *fx, int, CEntity *entity, CV
if (rotate) {
RwMatrixRotate(&gunflashFx->m_localMatrix, &axis_y, CGeneral::GetRandomNumberInRange(0.0f, 360.0f), rwCOMBINEPRECONCAT);
}
gunflashFx->SetLocalParticles(true);
if(!IMFX::bSampGame)
gunflashFx->SetLocalParticles(true);
gunflashFx->PlayAndKill();
}
if (smoke) {
Expand Down
5 changes: 5 additions & 0 deletions source/Lensflare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ DynamicTxd Lensflare::m_txd;

void Lensflare::Setup() {
patch::RedirectJump(0x6FB2EE, DrawExecutor); // CCoronas::Render
// remove fire coronas
patch::Nop(0x53B7E0, 5);
patch::Nop(0x53B893, 5);
patch::Nop(0x53B99C, 5);
patch::Nop(0x53BAA5, 5);
ReadSettings();
m_txd.Init(PLUGIN_PATH("imfx\\lensflare.txd"));
}
Expand Down
Loading

0 comments on commit 265d9a6

Please sign in to comment.