Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/audio/oal/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#endif

extern bool IsFXSupported();
#ifdef FIX_BUGS
// Defined in sampman_oal.cpp behind the same guard, so without one here the Vanilla
// configuration references a symbol that was never emitted and fails at link (LNK2001).
extern size_t gPlayerTalkDataSize;
#endif

ALuint alSources[NUM_CHANNELS];
ALuint alFilters[NUM_CHANNELS];
Expand All @@ -26,7 +30,11 @@ CChannel::InitChannels()
if (IsFXSupported())
alGenFilters(NUM_CHANNELS, alFilters);

#ifdef FIX_BUGS
tempStereoBuffer = new uint8[Max(PED_BLOCKSIZE, gPlayerTalkDataSize) * 2];
#else
tempStereoBuffer = new uint8[PED_BLOCKSIZE * 2];
#endif
bChannelsCreated = true;
}

Expand Down
12 changes: 12 additions & 0 deletions src/renderer/Coronas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,21 @@ CEntity::ProcessLightsForEntity(void)
effect->light.shadowSize, 0.0f,
0.0f, -effect->light.shadowSize,
128,
#ifdef FIX_BUGS
// StoreStaticShadow takes these as uint8 and nothing bounds them on
// the way in, so a value past 255 wraps instead of clipping and the
// decal comes out dark rather than merely too bright. Retail data
// stops at exactly 255 (sprBght tops out at 1.00 in timecyc.dat),
// but the parser stores sprBght*10 in an int8, so anything asking
// for more than 1.0 is already over.
Min(effect->col.r*CTimeCycle::GetSpriteBrightness()*effect->light.shadowIntensity/255.0f, 255.0f),
Min(effect->col.g*CTimeCycle::GetSpriteBrightness()*effect->light.shadowIntensity/255.0f, 255.0f),
Min(effect->col.b*CTimeCycle::GetSpriteBrightness()*effect->light.shadowIntensity/255.0f, 255.0f),
#else
effect->col.r*CTimeCycle::GetSpriteBrightness()*effect->light.shadowIntensity/255.0f,
effect->col.g*CTimeCycle::GetSpriteBrightness()*effect->light.shadowIntensity/255.0f,
effect->col.b*CTimeCycle::GetSpriteBrightness()*effect->light.shadowIntensity/255.0f,
#endif
15.0f, 1.0f, 40.0f, false, 0.0f);
}else if(lightFlickering){
CShadows::StoreStaticShadow((uintptr)this + i, SHADOWTYPE_ADDITIVE,
Expand Down
16 changes: 10 additions & 6 deletions src/rw/TexRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,16 @@ bool
CanVideoCardDoDXT(void)
{
#ifdef LIBRW
// TODO
#ifdef RW_OPENGL
return false;
#else
return true;
#endif
// Answering "no" unconditionally is not free: CStreaming::Init then builds
// MODELS\TXD.IMG, repacking every texture dictionary out of its D3D8 container, and
// TXD.DIR is scanned before GTA3.DIR - so that copy is what gets read from then on and
// the originals are shadowed. On the retail PC data that is 1360 dictionaries, ~180 MB
// of duplicate and a conversion pass on first run, for a card that can read the
// originals directly. GetGPUcaps already asks librw the same question, so ask it here:
// desktop GL has S3TC, and a GLES device without it still takes the conversion path.
GPUcaps caps;
GetGPUcaps(&caps);
return !!caps.dxtSupport;
#else
return _rwD3D8CheckValidTextureFormat(D3DFMT_DXT1) && _rwD3D8CheckValidTextureFormat(D3DFMT_DXT3);
#endif
Expand Down