summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-02-08 11:21:53 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-02-08 11:21:53 +0100
commit0eb191371388e5b25fbc957ca928c457fc544b21 (patch)
treeb3203e68d3f74c005d2fe0689bce7cf3240dd713 /src
parentDon't show menu map and new languages if gamefiles isn't copied (diff)
parentreorganize shaders; use modulate flag; update librw (diff)
downloadre3-0eb191371388e5b25fbc957ca928c457fc544b21.tar
re3-0eb191371388e5b25fbc957ca928c457fc544b21.tar.gz
re3-0eb191371388e5b25fbc957ca928c457fc544b21.tar.bz2
re3-0eb191371388e5b25fbc957ca928c457fc544b21.tar.lz
re3-0eb191371388e5b25fbc957ca928c457fc544b21.tar.xz
re3-0eb191371388e5b25fbc957ca928c457fc544b21.tar.zst
re3-0eb191371388e5b25fbc957ca928c457fc544b21.zip
Diffstat (limited to '')
-rw-r--r--src/core/Cam.cpp2
-rw-r--r--src/core/Game.cpp9
-rw-r--r--src/core/common.h2
-rw-r--r--src/extras/custompipes_d3d9.cpp31
-rw-r--r--src/extras/custompipes_gl.cpp34
-rw-r--r--src/extras/postfx.cpp12
-rw-r--r--src/extras/screendroplets.cpp6
-rw-r--r--src/extras/shaders/Makefile79
-rw-r--r--src/extras/shaders/make_glsl.sh9
-rw-r--r--src/extras/shaders/make_hlsl.cmd (renamed from src/extras/shaders/make.cmd)4
-rw-r--r--src/extras/shaders/makeinc_glsl.sh6
-rw-r--r--src/extras/shaders/makeinc_hlsl.sh (renamed from src/extras/shaders/makeinc.sh)1
-rw-r--r--src/extras/shaders/obj/colourfilterIII_PS.cso (renamed from src/extras/shaders/colourfilterIII_PS.cso)bin452 -> 452 bytes
-rw-r--r--src/extras/shaders/obj/colourfilterIII_PS.inc (renamed from src/extras/shaders/colourfilterIII_PS.inc)0
-rw-r--r--src/extras/shaders/obj/colourfilterIII_frag.inc (renamed from src/extras/shaders/colourfilterIII_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/contrastPS.cso (renamed from src/extras/shaders/contrastPS.cso)bin344 -> 344 bytes
-rw-r--r--src/extras/shaders/obj/contrastPS.inc (renamed from src/extras/shaders/contrastPS.inc)0
-rw-r--r--src/extras/shaders/obj/contrast_frag.inc (renamed from src/extras/shaders/contrast_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/default_UV2_VS.cso (renamed from src/extras/shaders/default_UV2_VS.cso)bin628 -> 628 bytes
-rw-r--r--src/extras/shaders/obj/default_UV2_VS.inc (renamed from src/extras/shaders/default_UV2_VS.inc)0
-rw-r--r--src/extras/shaders/obj/default_UV2_vert.inc (renamed from src/extras/shaders/default_UV2_gl.inc)0
-rw-r--r--src/extras/shaders/obj/im2d_UV2_vert.inc (renamed from src/extras/shaders/im2d_UV2_gl.inc)0
-rw-r--r--src/extras/shaders/obj/im2d_vert.inc (renamed from src/extras/shaders/im2d_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_PS.cso (renamed from src/extras/shaders/neoGloss_PS.cso)bin444 -> 444 bytes
-rw-r--r--src/extras/shaders/obj/neoGloss_PS.inc (renamed from src/extras/shaders/neoGloss_PS.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_VS.cso (renamed from src/extras/shaders/neoGloss_VS.cso)bin764 -> 764 bytes
-rw-r--r--src/extras/shaders/obj/neoGloss_VS.inc (renamed from src/extras/shaders/neoGloss_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_frag.inc (renamed from src/extras/shaders/neoGloss_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoGloss_vert.inc (renamed from src/extras/shaders/neoGloss_vs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoRimSkin_VS.cso (renamed from src/extras/shaders/neoRimSkin_VS.cso)bin2404 -> 2404 bytes
-rw-r--r--src/extras/shaders/obj/neoRimSkin_VS.inc (renamed from src/extras/shaders/neoRimSkin_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoRimSkin_vert.inc (renamed from src/extras/shaders/neoRimSkin_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoRim_VS.cso (renamed from src/extras/shaders/neoRim_VS.cso)bin1384 -> 1384 bytes
-rw-r--r--src/extras/shaders/obj/neoRim_VS.inc (renamed from src/extras/shaders/neoRim_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoRim_vert.inc (renamed from src/extras/shaders/neoRim_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_PS.cso (renamed from src/extras/shaders/neoVehicle_PS.cso)bin476 -> 476 bytes
-rw-r--r--src/extras/shaders/obj/neoVehicle_PS.inc (renamed from src/extras/shaders/neoVehicle_PS.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_VS.cso (renamed from src/extras/shaders/neoVehicle_VS.cso)bin1896 -> 1896 bytes
-rw-r--r--src/extras/shaders/obj/neoVehicle_VS.inc (renamed from src/extras/shaders/neoVehicle_VS.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_frag.inc (renamed from src/extras/shaders/neoVehicle_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoVehicle_vert.inc (renamed from src/extras/shaders/neoVehicle_vs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/neoWorldIII_PS.cso (renamed from src/extras/shaders/neoWorldIII_PS.cso)bin528 -> 528 bytes
-rw-r--r--src/extras/shaders/obj/neoWorldIII_PS.inc (renamed from src/extras/shaders/neoWorldIII_PS.inc)0
-rw-r--r--src/extras/shaders/obj/neoWorldIII_frag.inc (renamed from src/extras/shaders/neoWorldIII_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/screenDroplet_PS.cso (renamed from src/extras/shaders/screenDroplet_PS.cso)bin324 -> 324 bytes
-rw-r--r--src/extras/shaders/obj/screenDroplet_PS.inc (renamed from src/extras/shaders/screenDroplet_PS.inc)0
-rw-r--r--src/extras/shaders/obj/screenDroplet_frag.inc (renamed from src/extras/shaders/screenDroplet_fs_gl.inc)0
-rw-r--r--src/extras/shaders/obj/simple_frag.inc (renamed from src/extras/shaders/simple_fs_gl.inc)0
-rw-r--r--src/peds/PedAI.cpp2
-rw-r--r--src/render/Font.cpp1
-rw-r--r--src/render/Hud.cpp8
51 files changed, 76 insertions, 130 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 2a32ed1f..e0497fe2 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -4631,7 +4631,7 @@ CCam::Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrient
*/
{
LookLeftRight = -CPad::GetPad(0)->LookAroundLeftRight();
- LookUpDown = -CPad::GetPad(0)->LookAroundUpDown();
+ LookUpDown = CPad::GetPad(0)->LookAroundUpDown();
}
float AlphaOffset, BetaOffset;
if(UseMouse){
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 4fd30b53..2a6afa97 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -414,6 +414,11 @@ bool CGame::Initialise(const char* datFile)
CTxdStore::Create(gameTxdSlot);
CTxdStore::AddRef(gameTxdSlot);
+#ifdef EXTENDED_PIPELINES
+ // for generic fallback
+ CustomPipes::SetTxdFindCallback();
+#endif
+
LoadingScreen("Loading the Game", "Loading particles", nil);
int particleTxdSlot = CTxdStore::AddTxdSlot("particle");
CTxdStore::LoadTxd(particleTxdSlot, "MODELS/PARTICLE.TXD");
@@ -498,10 +503,6 @@ bool CGame::Initialise(const char* datFile)
CFileLoader::LoadLevel("GTA3.DAT");
#endif
-#ifdef EXTENDED_PIPELINES
- // for generic fallback
- CustomPipes::SetTxdFindCallback();
-#endif
CWorld::AddParticles();
CVehicleModelInfo::LoadVehicleColours();
CVehicleModelInfo::LoadEnvironmentMaps();
diff --git a/src/core/common.h b/src/core/common.h
index 33d8910d..a8f19158 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -354,7 +354,7 @@ __inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function
#ifndef MASTER
#define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) )
#else
-#define assert(_Expression)
+#define assert(_Expression) (_Expression)
#endif
#define ASSERT assert
diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp
index 4242c630..dad42b33 100644
--- a/src/extras/custompipes_d3d9.cpp
+++ b/src/extras/custompipes_d3d9.cpp
@@ -89,6 +89,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
}
int vsBits;
+ rw::uint32 flags = atomic->geometry->flags;
setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride);
setIndices(header->indexBuffer);
setVertexDeclaration(header->vertexDeclaration);
@@ -120,7 +121,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
reflProps[3] = m->surfaceProps.specular == 0.0f ? 0.0f : VehicleSpecularity;
d3ddevice->SetVertexShaderConstantF(VSLOC_reflProps, reflProps, 1);
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
if(m->texture)
d3d::setTexture(0, m->texture);
@@ -149,11 +150,11 @@ CreateVehiclePipe(void)
fp = ReadTweakValueTable(fp, SpecColor);
}
-#include "shaders/neoVehicle_VS.inc"
+#include "shaders/obj/neoVehicle_VS.inc"
neoVehicle_VS = rw::d3d::createVertexShader(neoVehicle_VS_cso);
assert(neoVehicle_VS);
-#include "shaders/neoVehicle_PS.inc"
+#include "shaders/obj/neoVehicle_PS.inc"
neoVehicle_PS = rw::d3d::createPixelShader(neoVehicle_PS_cso);
assert(neoVehicle_PS);
@@ -259,11 +260,11 @@ CreateWorldPipe(void)
else
ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
-#include "shaders/default_UV2_VS.inc"
+#include "shaders/obj/default_UV2_VS.inc"
neoWorld_VS = rw::d3d::createVertexShader(default_UV2_VS_cso);
assert(neoWorld_VS);
-#include "shaders/neoWorldIII_PS.inc"
+#include "shaders/obj/neoWorldIII_PS.inc"
neoWorldIII_PS = rw::d3d::createPixelShader(neoWorldIII_PS_cso);
assert(neoWorldIII_PS);
@@ -346,11 +347,11 @@ glossRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
void
CreateGlossPipe(void)
{
-#include "shaders/neoGloss_VS.inc"
+#include "shaders/obj/neoGloss_VS.inc"
neoGloss_VS = rw::d3d::createVertexShader(neoGloss_VS_cso);
assert(neoGloss_VS);
-#include "shaders/neoGloss_PS.inc"
+#include "shaders/obj/neoGloss_PS.inc"
neoGloss_PS = rw::d3d::createPixelShader(neoGloss_PS_cso);
assert(neoGloss_PS);
@@ -420,6 +421,7 @@ rimRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
}
int vsBits;
+ rw::uint32 flags = atomic->geometry->flags;
setStreamSource(0, header->vertexStream[0].vertexBuffer, 0, header->vertexStream[0].stride);
setIndices(header->indexBuffer);
setVertexDeclaration(header->vertexDeclaration);
@@ -437,7 +439,7 @@ rimRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
if(m->texture){
d3d::setTexture(0, m->texture);
@@ -463,7 +465,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
}
int vsBits;
-
+ rw::uint32 flags = atomic->geometry->flags;
setStreamSource(0, (IDirect3DVertexBuffer9*)header->vertexStream[0].vertexBuffer,
0, header->vertexStream[0].stride);
setIndices((IDirect3DIndexBuffer9*)header->indexBuffer);
@@ -484,7 +486,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
if(inst->material->texture){
d3d::setTexture(0, m->texture);
@@ -512,11 +514,11 @@ CreateRimLightPipes(void)
}
-#include "shaders/neoRim_VS.inc"
+#include "shaders/obj/neoRim_VS.inc"
neoRim_VS = rw::d3d::createVertexShader(neoRim_VS_cso);
assert(neoRim_VS);
-#include "shaders/neoRimSkin_VS.inc"
+#include "shaders/obj/neoRimSkin_VS.inc"
neoRimSkin_VS = rw::d3d::createVertexShader(neoRimSkin_VS_cso);
assert(neoRimSkin_VS);
@@ -610,6 +612,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
assert(building->instHeader->platform == PLATFORM_D3D9);
building->fadeAlpha = 255;
building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT);
+ rw::uint32 flags = atomic->geometry->flags;
bool setupDone = false;
bool defer = false;
@@ -639,7 +642,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
setupDone = true;
}
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
if(m->texture){
d3d::setTexture(0, m->texture);
@@ -702,7 +705,7 @@ RenderBlendPass(int pass)
rw::RGBA color = m->color;
color.alpha = (color.alpha * building->fadeAlpha)/255;
- setMaterial(color, m->surfaceProps);
+ setMaterial(color, m->surfaceProps); // always modulate here
if(m->texture){
d3d::setTexture(0, m->texture);
diff --git a/src/extras/custompipes_gl.cpp b/src/extras/custompipes_gl.cpp
index caf9eb27..f1cbfc38 100644
--- a/src/extras/custompipes_gl.cpp
+++ b/src/extras/custompipes_gl.cpp
@@ -87,6 +87,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
Material *m;
+ rw::uint32 flags = atomic->geometry->flags;
setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic);
@@ -119,7 +120,7 @@ vehicleRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
while(n--){
m = inst->material;
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
setTexture(0, m->texture);
@@ -159,8 +160,8 @@ CreateVehiclePipe(void)
{
-#include "shaders/neoVehicle_fs_gl.inc"
-#include "shaders/neoVehicle_vs_gl.inc"
+#include "shaders/obj/neoVehicle_frag.inc"
+#include "shaders/obj/neoVehicle_vert.inc"
const char *vs[] = { shaderDecl, header_vert_src, neoVehicle_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, neoVehicle_frag_src, nil };
neoVehicleShader = Shader::create(vs, fs);
@@ -270,8 +271,8 @@ CreateWorldPipe(void)
ReadTweakValueTable((char*)work_buff, WorldLightmapBlend);
{
-#include "shaders/neoWorldIII_fs_gl.inc"
-#include "shaders/default_UV2_gl.inc"
+#include "shaders/obj/neoWorldIII_frag.inc"
+#include "shaders/obj/default_UV2_vert.inc"
const char *vs[] = { shaderDecl, header_vert_src, default_UV2_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, neoWorldIII_frag_src, nil };
neoWorldShader = Shader::create(vs, fs);
@@ -378,8 +379,8 @@ CreateGlossPipe(void)
using namespace rw::gl3;
{
-#include "shaders/neoGloss_fs_gl.inc"
-#include "shaders/neoGloss_vs_gl.inc"
+#include "shaders/obj/neoGloss_frag.inc"
+#include "shaders/obj/neoGloss_vert.inc"
const char *vs[] = { shaderDecl, header_vert_src, neoGloss_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, neoGloss_frag_src, nil };
neoGlossShader = Shader::create(vs, fs);
@@ -448,6 +449,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
Material *m;
+ rw::uint32 flags = atomic->geometry->flags;
setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic);
@@ -471,7 +473,7 @@ rimSkinRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
while(n--){
m = inst->material;
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
setTexture(0, m->texture);
@@ -498,6 +500,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
Material *m;
+ rw::uint32 flags = atomic->geometry->flags;
setWorldMatrix(atomic->getFrame()->getLTM());
lightingCB(atomic);
@@ -519,7 +522,7 @@ rimRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
while(n--){
m = inst->material;
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
setTexture(0, m->texture);
@@ -550,8 +553,8 @@ CreateRimLightPipes(void)
}
{
-#include "shaders/simple_fs_gl.inc"
-#include "shaders/neoRimSkin_gl.inc"
+#include "shaders/obj/simple_frag.inc"
+#include "shaders/obj/neoRimSkin_vert.inc"
const char *vs[] = { shaderDecl, header_vert_src, neoRimSkin_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
neoRimSkinShader = Shader::create(vs, fs);
@@ -559,8 +562,8 @@ CreateRimLightPipes(void)
}
{
-#include "shaders/simple_fs_gl.inc"
-#include "shaders/neoRim_gl.inc"
+#include "shaders/obj/simple_frag.inc"
+#include "shaders/obj/neoRim_vert.inc"
const char *vs[] = { shaderDecl, header_vert_src, neoRim_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, simple_frag_src, nil };
neoRimShader = Shader::create(vs, fs);
@@ -664,6 +667,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
assert(building->instHeader->platform == PLATFORM_GL3);
building->fadeAlpha = 255;
building->lighting = !!(atomic->geometry->flags & rw::Geometry::LIGHT);
+ rw::uint32 flags = atomic->geometry->flags;
WorldLights lights;
lights.numAmbients = 1;
@@ -703,7 +707,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
setupDone = true;
}
- setMaterial(m->color, m->surfaceProps);
+ setMaterial(flags, m->color, m->surfaceProps);
setTexture(0, m->texture);
@@ -772,7 +776,7 @@ RenderBlendPass(int pass)
rw::RGBA color = m->color;
color.alpha = (color.alpha * building->fadeAlpha)/255;
- setMaterial(color, m->surfaceProps);
+ setMaterial(color, m->surfaceProps); // always modulate here
setTexture(0, m->texture);
diff --git a/src/extras/postfx.cpp b/src/extras/postfx.cpp
index 51b91060..b94d245d 100644
--- a/src/extras/postfx.cpp
+++ b/src/extras/postfx.cpp
@@ -141,16 +141,16 @@ CPostFX::Open(RwCamera *cam)
#ifdef RW_D3D9
-#include "shaders/colourfilterIII_PS.inc"
+#include "shaders/obj/colourfilterIII_PS.inc"
colourfilterIII_PS = rw::d3d::createPixelShader(colourfilterIII_PS_cso);
-#include "shaders/contrastPS.inc"
+#include "shaders/obj/contrastPS.inc"
contrast_PS = rw::d3d::createPixelShader(contrastPS_cso);
#endif
#ifdef RW_OPENGL
using namespace rw::gl3;
{
-#include "shaders/im2d_gl.inc"
-#include "shaders/colourfilterIII_fs_gl.inc"
+#include "shaders/obj/im2d_vert.inc"
+#include "shaders/obj/colourfilterIII_frag.inc"
const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, colourfilterIII_frag_src, nil };
colourFilterIII = Shader::create(vs, fs);
@@ -158,8 +158,8 @@ CPostFX::Open(RwCamera *cam)
}
{
-#include "shaders/im2d_gl.inc"
-#include "shaders/contrast_fs_gl.inc"
+#include "shaders/obj/im2d_vert.inc"
+#include "shaders/obj/contrast_frag.inc"
const char *vs[] = { shaderDecl, header_vert_src, im2d_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, contrast_frag_src, nil };
contrast = Shader::create(vs, fs);
diff --git a/src/extras/screendroplets.cpp b/src/extras/screendroplets.cpp
index 74c44da0..1412141e 100644
--- a/src/extras/screendroplets.cpp
+++ b/src/extras/screendroplets.cpp
@@ -112,14 +112,14 @@ ScreenDroplets::InitDraw(void)
openim2d_uv2();
#ifdef RW_D3D9
-#include "shaders/screenDroplet_PS.inc"
+#include "shaders/obj/screenDroplet_PS.inc"
screenDroplet_PS = rw::d3d::createPixelShader(screenDroplet_PS_cso);
#endif
#ifdef RW_GL3
using namespace rw::gl3;
{
-#include "shaders/im2d_UV2_gl.inc"
-#include "shaders/screenDroplet_fs_gl.inc"
+#include "shaders/obj/im2d_UV2_vert.inc"
+#include "shaders/obj/screenDroplet_frag.inc"
const char *vs[] = { shaderDecl, header_vert_src, im2d_UV2_vert_src, nil };
const char *fs[] = { shaderDecl, header_frag_src, screenDroplet_frag_src, nil };
screenDroplet = Shader::create(vs, fs);
diff --git a/src/extras/shaders/Makefile b/src/extras/shaders/Makefile
deleted file mode 100644
index 51e009d6..00000000
--- a/src/extras/shaders/Makefile
+++ /dev/null
@@ -1,79 +0,0 @@
-all: im2d_gl.inc simple_fs_gl.inc default_UV2_gl.inc \
- colourfilterIII_fs_gl.inc contrast_fs_gl.inc \
- neoRim_gl.inc neoRimSkin_gl.inc \
- neoWorldIII_fs_gl.inc neoGloss_vs_gl.inc neoGloss_fs_gl.inc \
- neoVehicle_vs_gl.inc neoVehicle_fs_gl.inc \
- im2d_UV2_gl.inc screenDroplet_fs_gl.inc
-
-im2d_gl.inc: im2d.vert
- (echo 'const char *im2d_vert_src =';\
- sed 's/..*/"&\\n"/' im2d.vert;\
- echo ';') >im2d_gl.inc
-
-simple_fs_gl.inc: simple.frag
- (echo 'const char *simple_frag_src =';\
- sed 's/..*/"&\\n"/' simple.frag;\
- echo ';') >simple_fs_gl.inc
-
-default_UV2_gl.inc: default_UV2.vert
- (echo 'const char *default_UV2_vert_src =';\
- sed 's/..*/"&\\n"/' default_UV2.vert;\
- echo ';') >default_UV2_gl.inc
-
-
-
-colourfilterIII_fs_gl.inc: colourfilterIII.frag
- (echo 'const char *colourfilterIII_frag_src =';\
- sed 's/..*/"&\\n"/' colourfilterIII.frag;\
- echo ';') >colourfilterIII_fs_gl.inc
-
-contrast_fs_gl.inc: contrast.frag
- (echo 'const char *contrast_frag_src =';\
- sed 's/..*/"&\\n"/' contrast.frag;\
- echo ';') >contrast_fs_gl.inc
-
-
-neoRim_gl.inc: neoRim.vert
- (echo 'const char *neoRim_vert_src =';\
- sed 's/..*/"&\\n"/' neoRim.vert;\
- echo ';') >neoRim_gl.inc
-
-neoRimSkin_gl.inc: neoRimSkin.vert
- (echo 'const char *neoRimSkin_vert_src =';\
- sed 's/..*/"&\\n"/' neoRimSkin.vert;\
- echo ';') >neoRimSkin_gl.inc
-
-neoWorldIII_fs_gl.inc: neoWorldIII.frag
- (echo 'const char *neoWorldIII_frag_src =';\
- sed 's/..*/"&\\n"/' neoWorldIII.frag;\
- echo ';') >neoWorldIII_fs_gl.inc
-
-neoGloss_fs_gl.inc: neoGloss.frag
- (echo 'const char *neoGloss_frag_src =';\
- sed 's/..*/"&\\n"/' neoGloss.frag;\
- echo ';') >neoGloss_fs_gl.inc
-
-neoGloss_vs_gl.inc: neoGloss.vert
- (echo 'const char *neoGloss_vert_src =';\
- sed 's/..*/"&\\n"/' neoGloss.vert;\
- echo ';') >neoGloss_vs_gl.inc
-
-neoVehicle_vs_gl.inc: neoVehicle.vert
- (echo 'const char *neoVehicle_vert_src =';\
- sed 's/..*/"&\\n"/' neoVehicle.vert;\
- echo ';') >neoVehicle_vs_gl.inc
-
-neoVehicle_fs_gl.inc: neoVehicle.frag
- (echo 'const char *neoVehicle_frag_src =';\
- sed 's/..*/"&\\n"/' neoVehicle.frag;\
- echo ';') >neoVehicle_fs_gl.inc
-
-im2d_UV2_gl.inc: im2d_UV2.vert
- (echo 'const char *im2d_UV2_vert_src =';\
- sed 's/..*/"&\\n"/' im2d_UV2.vert;\
- echo ';') >im2d_UV2_gl.inc
-
-screenDroplet_fs_gl.inc: screenDroplet.frag
- (echo 'const char *screenDroplet_frag_src =';\
- sed 's/..*/"&\\n"/' screenDroplet.frag;\
- echo ';') >screenDroplet_fs_gl.inc
diff --git a/src/extras/shaders/make_glsl.sh b/src/extras/shaders/make_glsl.sh
new file mode 100644
index 00000000..0af98961
--- /dev/null
+++ b/src/extras/shaders/make_glsl.sh
@@ -0,0 +1,9 @@
+#!sh
+for i in *.vert; do
+ echo $i
+ ./makeinc_glsl.sh $i
+done
+for i in *.frag; do
+ echo $i
+ ./makeinc_glsl.sh $i
+done
diff --git a/src/extras/shaders/make.cmd b/src/extras/shaders/make_hlsl.cmd
index 8404ac6c..dee95283 100644
--- a/src/extras/shaders/make.cmd
+++ b/src/extras/shaders/make_hlsl.cmd
@@ -1,3 +1,3 @@
@echo off
-for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo %%~nf.cso %%f
-for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo %%~nf.cso %%f
+for %%f in (*PS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T ps_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f
+for %%f in (*VS.hlsl) do "%DXSDK_DIR%\Utilities\bin\x86\fxc.exe" /T vs_2_0 /nologo /E main /Fo obj\%%~nf.cso %%f
diff --git a/src/extras/shaders/makeinc_glsl.sh b/src/extras/shaders/makeinc_glsl.sh
new file mode 100644
index 00000000..2bc6a387
--- /dev/null
+++ b/src/extras/shaders/makeinc_glsl.sh
@@ -0,0 +1,6 @@
+#!sh
+ext=${1##*.}
+name=${1%.*}
+(echo "const char *${name}_${ext}_src =";\
+sed 's/..*/"&\\n"/' $1;\
+echo ';') > obj/${name}_${ext}.inc
diff --git a/src/extras/shaders/makeinc.sh b/src/extras/shaders/makeinc_hlsl.sh
index a649af33..a5b12867 100644
--- a/src/extras/shaders/makeinc.sh
+++ b/src/extras/shaders/makeinc_hlsl.sh
@@ -1,4 +1,5 @@
#!sh
+cd obj
for i in *cso; do
(echo -n 'static '
xxd -i $i | grep -v '_len = ') > ${i%cso}inc
diff --git a/src/extras/shaders/colourfilterIII_PS.cso b/src/extras/shaders/obj/colourfilterIII_PS.cso
index cc41bcec..cc41bcec 100644
--- a/src/extras/shaders/colourfilterIII_PS.cso
+++ b/src/extras/shaders/obj/colourfilterIII_PS.cso
Binary files differ
diff --git a/src/extras/shaders/colourfilterIII_PS.inc b/src/extras/shaders/obj/colourfilterIII_PS.inc
index db49de6c..db49de6c 100644
--- a/src/extras/shaders/colourfilterIII_PS.inc
+++ b/src/extras/shaders/obj/colourfilterIII_PS.inc
diff --git a/src/extras/shaders/colourfilterIII_fs_gl.inc b/src/extras/shaders/obj/colourfilterIII_frag.inc
index 6fd1935b..6fd1935b 100644
--- a/src/extras/shaders/colourfilterIII_fs_gl.inc
+++ b/src/extras/shaders/obj/colourfilterIII_frag.inc
diff --git a/src/extras/shaders/contrastPS.cso b/src/extras/shaders/obj/contrastPS.cso
index a87c48d7..a87c48d7 100644
--- a/src/extras/shaders/contrastPS.cso
+++ b/src/extras/shaders/obj/contrastPS.cso
Binary files differ
diff --git a/src/extras/shaders/contrastPS.inc b/src/extras/shaders/obj/contrastPS.inc
index 5386792f..5386792f 100644
--- a/src/extras/shaders/contrastPS.inc
+++ b/src/extras/shaders/obj/contrastPS.inc
diff --git a/src/extras/shaders/contrast_fs_gl.inc b/src/extras/shaders/obj/contrast_frag.inc
index 97f78194..97f78194 100644
--- a/src/extras/shaders/contrast_fs_gl.inc
+++ b/src/extras/shaders/obj/contrast_frag.inc
diff --git a/src/extras/shaders/default_UV2_VS.cso b/src/extras/shaders/obj/default_UV2_VS.cso
index 5a48c663..5a48c663 100644
--- a/src/extras/shaders/default_UV2_VS.cso
+++ b/src/extras/shaders/obj/default_UV2_VS.cso
Binary files differ
diff --git a/src/extras/shaders/default_UV2_VS.inc b/src/extras/shaders/obj/default_UV2_VS.inc
index de832107..de832107 100644
--- a/src/extras/shaders/default_UV2_VS.inc
+++ b/src/extras/shaders/obj/default_UV2_VS.inc
diff --git a/src/extras/shaders/default_UV2_gl.inc b/src/extras/shaders/obj/default_UV2_vert.inc
index 450f3d9a..450f3d9a 100644
--- a/src/extras/shaders/default_UV2_gl.inc
+++ b/src/extras/shaders/obj/default_UV2_vert.inc
diff --git a/src/extras/shaders/im2d_UV2_gl.inc b/src/extras/shaders/obj/im2d_UV2_vert.inc
index 3feb2bc1..3feb2bc1 100644
--- a/src/extras/shaders/im2d_UV2_gl.inc
+++ b/src/extras/shaders/obj/im2d_UV2_vert.inc
diff --git a/src/extras/shaders/im2d_gl.inc b/src/extras/shaders/obj/im2d_vert.inc
index d11f5d33..d11f5d33 100644
--- a/src/extras/shaders/im2d_gl.inc
+++ b/src/extras/shaders/obj/im2d_vert.inc
diff --git a/src/extras/shaders/neoGloss_PS.cso b/src/extras/shaders/obj/neoGloss_PS.cso
index aa88e450..aa88e450 100644
--- a/src/extras/shaders/neoGloss_PS.cso
+++ b/src/extras/shaders/obj/neoGloss_PS.cso
Binary files differ
diff --git a/src/extras/shaders/neoGloss_PS.inc b/src/extras/shaders/obj/neoGloss_PS.inc
index 97e5641d..97e5641d 100644
--- a/src/extras/shaders/neoGloss_PS.inc
+++ b/src/extras/shaders/obj/neoGloss_PS.inc
diff --git a/src/extras/shaders/neoGloss_VS.cso b/src/extras/shaders/obj/neoGloss_VS.cso
index 9635b8b7..9635b8b7 100644
--- a/src/extras/shaders/neoGloss_VS.cso
+++ b/src/extras/shaders/obj/neoGloss_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoGloss_VS.inc b/src/extras/shaders/obj/neoGloss_VS.inc
index 1ec03761..1ec03761 100644
--- a/src/extras/shaders/neoGloss_VS.inc
+++ b/src/extras/shaders/obj/neoGloss_VS.inc
diff --git a/src/extras/shaders/neoGloss_fs_gl.inc b/src/extras/shaders/obj/neoGloss_frag.inc
index 67e9724e..67e9724e 100644
--- a/src/extras/shaders/neoGloss_fs_gl.inc
+++ b/src/extras/shaders/obj/neoGloss_frag.inc
diff --git a/src/extras/shaders/neoGloss_vs_gl.inc b/src/extras/shaders/obj/neoGloss_vert.inc
index dffb423f..dffb423f 100644
--- a/src/extras/shaders/neoGloss_vs_gl.inc
+++ b/src/extras/shaders/obj/neoGloss_vert.inc
diff --git a/src/extras/shaders/neoRimSkin_VS.cso b/src/extras/shaders/obj/neoRimSkin_VS.cso
index 8410504e..8410504e 100644
--- a/src/extras/shaders/neoRimSkin_VS.cso
+++ b/src/extras/shaders/obj/neoRimSkin_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoRimSkin_VS.inc b/src/extras/shaders/obj/neoRimSkin_VS.inc
index ac182956..ac182956 100644
--- a/src/extras/shaders/neoRimSkin_VS.inc
+++ b/src/extras/shaders/obj/neoRimSkin_VS.inc
diff --git a/src/extras/shaders/neoRimSkin_gl.inc b/src/extras/shaders/obj/neoRimSkin_vert.inc
index 01b739b2..01b739b2 100644
--- a/src/extras/shaders/neoRimSkin_gl.inc
+++ b/src/extras/shaders/obj/neoRimSkin_vert.inc
diff --git a/src/extras/shaders/neoRim_VS.cso b/src/extras/shaders/obj/neoRim_VS.cso
index 4af538b1..4af538b1 100644
--- a/src/extras/shaders/neoRim_VS.cso
+++ b/src/extras/shaders/obj/neoRim_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoRim_VS.inc b/src/extras/shaders/obj/neoRim_VS.inc
index 03b044a6..03b044a6 100644
--- a/src/extras/shaders/neoRim_VS.inc
+++ b/src/extras/shaders/obj/neoRim_VS.inc
diff --git a/src/extras/shaders/neoRim_gl.inc b/src/extras/shaders/obj/neoRim_vert.inc
index 7cd199d0..7cd199d0 100644
--- a/src/extras/shaders/neoRim_gl.inc
+++ b/src/extras/shaders/obj/neoRim_vert.inc
diff --git a/src/extras/shaders/neoVehicle_PS.cso b/src/extras/shaders/obj/neoVehicle_PS.cso
index ded01bfb..ded01bfb 100644
--- a/src/extras/shaders/neoVehicle_PS.cso
+++ b/src/extras/shaders/obj/neoVehicle_PS.cso
Binary files differ
diff --git a/src/extras/shaders/neoVehicle_PS.inc b/src/extras/shaders/obj/neoVehicle_PS.inc
index 8b77cec2..8b77cec2 100644
--- a/src/extras/shaders/neoVehicle_PS.inc
+++ b/src/extras/shaders/obj/neoVehicle_PS.inc
diff --git a/src/extras/shaders/neoVehicle_VS.cso b/src/extras/shaders/obj/neoVehicle_VS.cso
index 6ea47987..6ea47987 100644
--- a/src/extras/shaders/neoVehicle_VS.cso
+++ b/src/extras/shaders/obj/neoVehicle_VS.cso
Binary files differ
diff --git a/src/extras/shaders/neoVehicle_VS.inc b/src/extras/shaders/obj/neoVehicle_VS.inc
index 37c5858d..37c5858d 100644
--- a/src/extras/shaders/neoVehicle_VS.inc
+++ b/src/extras/shaders/obj/neoVehicle_VS.inc
diff --git a/src/extras/shaders/neoVehicle_fs_gl.inc b/src/extras/shaders/obj/neoVehicle_frag.inc
index 20537440..20537440 100644
--- a/src/extras/shaders/neoVehicle_fs_gl.inc
+++ b/src/extras/shaders/obj/neoVehicle_frag.inc
diff --git a/src/extras/shaders/neoVehicle_vs_gl.inc b/src/extras/shaders/obj/neoVehicle_vert.inc
index b7b42622..b7b42622 100644
--- a/src/extras/shaders/neoVehicle_vs_gl.inc
+++ b/src/extras/shaders/obj/neoVehicle_vert.inc
diff --git a/src/extras/shaders/neoWorldIII_PS.cso b/src/extras/shaders/obj/neoWorldIII_PS.cso
index 817888ef..817888ef 100644
--- a/src/extras/shaders/neoWorldIII_PS.cso
+++ b/src/extras/shaders/obj/neoWorldIII_PS.cso
Binary files differ
diff --git a/src/extras/shaders/neoWorldIII_PS.inc b/src/extras/shaders/obj/neoWorldIII_PS.inc
index a4631efb..a4631efb 100644
--- a/src/extras/shaders/neoWorldIII_PS.inc
+++ b/src/extras/shaders/obj/neoWorldIII_PS.inc
diff --git a/src/extras/shaders/neoWorldIII_fs_gl.inc b/src/extras/shaders/obj/neoWorldIII_frag.inc
index afd75f57..afd75f57 100644
--- a/src/extras/shaders/neoWorldIII_fs_gl.inc
+++ b/src/extras/shaders/obj/neoWorldIII_frag.inc
diff --git a/src/extras/shaders/screenDroplet_PS.cso b/src/extras/shaders/obj/screenDroplet_PS.cso
index 5508096b..5508096b 100644
--- a/src/extras/shaders/screenDroplet_PS.cso
+++ b/src/extras/shaders/obj/screenDroplet_PS.cso
Binary files differ
diff --git a/src/extras/shaders/screenDroplet_PS.inc b/src/extras/shaders/obj/screenDroplet_PS.inc
index c2055188..c2055188 100644
--- a/src/extras/shaders/screenDroplet_PS.inc
+++ b/src/extras/shaders/obj/screenDroplet_PS.inc
diff --git a/src/extras/shaders/screenDroplet_fs_gl.inc b/src/extras/shaders/obj/screenDroplet_frag.inc
index dd393b02..dd393b02 100644
--- a/src/extras/shaders/screenDroplet_fs_gl.inc
+++ b/src/extras/shaders/obj/screenDroplet_frag.inc
diff --git a/src/extras/shaders/simple_fs_gl.inc b/src/extras/shaders/obj/simple_frag.inc
index 614d79a0..614d79a0 100644
--- a/src/extras/shaders/simple_fs_gl.inc
+++ b/src/extras/shaders/obj/simple_frag.inc
diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp
index 56c9429a..7f7120af 100644
--- a/src/peds/PedAI.cpp
+++ b/src/peds/PedAI.cpp
@@ -3454,7 +3454,7 @@ CPed::BeingDraggedFromCar(void)
#ifdef VC_PED_PORTS
if (m_objective == OBJECTIVE_LEAVE_CAR_AND_DIE) {
if (m_pMyVehicle) {
- m_pMyVehicle->ProcessOpenDoor(m_vehDoor, NUM_ANIMS, m_pVehicleAnim->currentTime * 5.0f);
+ m_pMyVehicle->ProcessOpenDoor(m_vehDoor, ANIM_STD_NUM, m_pVehicleAnim->currentTime * 5.0f);
}
}
#endif
diff --git a/src/render/Font.cpp b/src/render/Font.cpp
index 7dba8094..6a9944e1 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -451,6 +451,7 @@ CFont::Shutdown(void)
for (int i = 0; i < MAX_BUTTON_ICONS; i++)
ButtonSprite[i].Delete();
CTxdStore::RemoveTxdSlot(ButtonsSlot);
+ ButtonsSlot = -1;
}
#endif
Sprite[0].Delete();
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 2f7b9001..4991e024 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -1150,18 +1150,18 @@ void CHud::Draw()
if (IntroRect.m_nTextureId >= 0) {
CRect rect (
IntroRect.m_sRect.left,
- IntroRect.m_sRect.top,
+ IntroRect.m_sRect.bottom,
IntroRect.m_sRect.right,
- IntroRect.m_sRect.bottom );
+ IntroRect.m_sRect.top );
CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor);
}
else {
CRect rect (
IntroRect.m_sRect.left,
- IntroRect.m_sRect.top,
+ IntroRect.m_sRect.bottom,
IntroRect.m_sRect.right,
- IntroRect.m_sRect.bottom );
+ IntroRect.m_sRect.top );
CSprite2d::DrawRect(rect, IntroRect.m_sColor);
}