forked from Mirrors/openclonk
Add a config option for the highres landscape renderer
parent
8c21cfbb41
commit
a511828003
|
@ -113,6 +113,7 @@ class C4ConfigGraphics
|
||||||
int32_t ShowStartupMessages;
|
int32_t ShowStartupMessages;
|
||||||
int32_t VerboseObjectLoading;
|
int32_t VerboseObjectLoading;
|
||||||
int32_t ColorAnimation;
|
int32_t ColorAnimation;
|
||||||
|
int32_t HighResLandscape;
|
||||||
int32_t SmokeLevel;
|
int32_t SmokeLevel;
|
||||||
int32_t VideoModule;
|
int32_t VideoModule;
|
||||||
int32_t MenuTransparency;
|
int32_t MenuTransparency;
|
||||||
|
|
|
@ -135,7 +135,8 @@ void C4ConfigGraphics::CompileFunc(StdCompiler *pComp)
|
||||||
pComp->Value(mkNamingAdapt(ShowCommands, "ShowCommands", 1 ,false, true));
|
pComp->Value(mkNamingAdapt(ShowCommands, "ShowCommands", 1 ,false, true));
|
||||||
pComp->Value(mkNamingAdapt(ShowCommandKeys, "ShowCommandKeys", 1 ,false, true));
|
pComp->Value(mkNamingAdapt(ShowCommandKeys, "ShowCommandKeys", 1 ,false, true));
|
||||||
pComp->Value(mkNamingAdapt(ShowStartupMessages, "ShowStartupMessages", 1 ,false, true));
|
pComp->Value(mkNamingAdapt(ShowStartupMessages, "ShowStartupMessages", 1 ,false, true));
|
||||||
pComp->Value(mkNamingAdapt(ColorAnimation, "ColorAnimation", 0 ,false,true));
|
pComp->Value(mkNamingAdapt(ColorAnimation, "ColorAnimation", 0 ,false, true));
|
||||||
|
pComp->Value(mkNamingAdapt(HighResLandscape, "HighResLandscape", 0 ,false, true));
|
||||||
pComp->Value(mkNamingAdapt(SmokeLevel, "SmokeLevel", 200 ,false, true));
|
pComp->Value(mkNamingAdapt(SmokeLevel, "SmokeLevel", 200 ,false, true));
|
||||||
pComp->Value(mkNamingAdapt(VerboseObjectLoading, "VerboseObjectLoading", 0 ));
|
pComp->Value(mkNamingAdapt(VerboseObjectLoading, "VerboseObjectLoading", 0 ));
|
||||||
pComp->Value(mkNamingAdapt(VideoModule, "VideoModule", 0 ,false, true));
|
pComp->Value(mkNamingAdapt(VideoModule, "VideoModule", 0 ,false, true));
|
||||||
|
|
|
@ -296,9 +296,12 @@ void C4Landscape::Draw(C4TargetFacet &cgo, int32_t iPlayer)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const CSurface * Surfaces[C4M_MaxTexIndex];
|
const CSurface * Surfaces[C4M_MaxTexIndex];
|
||||||
for (int i = 0; i < C4M_MaxTexIndex; ++i)
|
if (Config.Graphics.HighResLandscape)
|
||||||
Surfaces[i] = Game.TextureMap.GetEntry(i)->getPattern().getSurface();
|
for (int i = 0; i < C4M_MaxTexIndex; ++i)
|
||||||
Application.DDraw->BlitLandscape(Surface32, cgo.TargetX, cgo.TargetY, cgo.Surface, cgo.X,cgo.Y,cgo.Wdt,cgo.Hgt, DDrawCfg.Shader ? Surfaces : 0);
|
Surfaces[i] = Game.TextureMap.GetEntry(i)->getPattern().getSurface();
|
||||||
|
Application.DDraw->BlitLandscape(Surface32, cgo.TargetX, cgo.TargetY, cgo.Surface,
|
||||||
|
cgo.X, cgo.Y, cgo.Wdt, cgo.Hgt,
|
||||||
|
Config.Graphics.HighResLandscape ? Surfaces : 0);
|
||||||
}
|
}
|
||||||
if (Modulation) Application.DDraw->DeactivateBlitModulation();
|
if (Modulation) Application.DDraw->DeactivateBlitModulation();
|
||||||
}
|
}
|
||||||
|
@ -2477,6 +2480,14 @@ bool C4Landscape::ApplyLighting(C4Rect To)
|
||||||
if (To.Wdt<=0 || To.Hgt<=0) return true;
|
if (To.Wdt<=0 || To.Hgt<=0) return true;
|
||||||
if (!Surface32->Lock()) return false;
|
if (!Surface32->Lock()) return false;
|
||||||
Surface32->ClearBoxDw(To.x, To.y, To.Wdt, To.Hgt);
|
Surface32->ClearBoxDw(To.x, To.y, To.Wdt, To.Hgt);
|
||||||
|
|
||||||
|
if(lpDDraw->IsShaderific() && Config.Graphics.HighResLandscape)
|
||||||
|
{
|
||||||
|
for (int32_t iX=To.x; iX<To.x+To.Wdt; ++iX)
|
||||||
|
for (int32_t iY=To.y; iY<To.y+To.Hgt; ++iY)
|
||||||
|
Surface32->SetPixDw(iX, iY, _GetPix(iX, iY));
|
||||||
|
}
|
||||||
|
else
|
||||||
// do lightning
|
// do lightning
|
||||||
for (int32_t iX=To.x; iX<To.x+To.Wdt; ++iX)
|
for (int32_t iX=To.x; iX<To.x+To.Wdt; ++iX)
|
||||||
{
|
{
|
||||||
|
@ -2493,11 +2504,6 @@ bool C4Landscape::ApplyLighting(C4Rect To)
|
||||||
BelowDensity -= GetPlacement(iX, iY);
|
BelowDensity -= GetPlacement(iX, iY);
|
||||||
BelowDensity += GetPlacement(iX, iY + 8);
|
BelowDensity += GetPlacement(iX, iY + 8);
|
||||||
BYTE pix = _GetPix(iX, iY);
|
BYTE pix = _GetPix(iX, iY);
|
||||||
|
|
||||||
if(DDrawCfg.Shader) {
|
|
||||||
Surface32->SetPixDw(iX, iY, pix);
|
|
||||||
continue;
|
|
||||||
};
|
|
||||||
// Sky
|
// Sky
|
||||||
if(!pix)
|
if(!pix)
|
||||||
{
|
{
|
||||||
|
|
|
@ -902,7 +902,7 @@ C4StartupOptionsDlg::C4StartupOptionsDlg() : C4StartupDlg(LoadResStrNoAmp("IDS_D
|
||||||
pGroupEffects->SetColors(C4StartupEditBorderColor, C4StartupFontClr);
|
pGroupEffects->SetColors(C4StartupEditBorderColor, C4StartupFontClr);
|
||||||
pSheetGraphics->AddElement(pGroupEffects);
|
pSheetGraphics->AddElement(pGroupEffects);
|
||||||
C4GUI::ComponentAligner caGroupEffects(pGroupEffects->GetClientRect(), iIndentX1, iIndentY2, true);
|
C4GUI::ComponentAligner caGroupEffects(pGroupEffects->GetClientRect(), iIndentX1, iIndentY2, true);
|
||||||
iNumGfxOptions = 2; iOpt=0;
|
iNumGfxOptions = 3; iOpt=0;
|
||||||
// effects level slider
|
// effects level slider
|
||||||
C4GUI::ComponentAligner caEffectsLevel(caGroupEffects.GetGridCell(0,1,iOpt++,iNumGfxOptions), 1,0,false);
|
C4GUI::ComponentAligner caEffectsLevel(caGroupEffects.GetGridCell(0,1,iOpt++,iNumGfxOptions), 1,0,false);
|
||||||
StdStrBuf sEffectsTxt; sEffectsTxt.Copy(LoadResStr("IDS_CTL_SMOKELOW"));
|
StdStrBuf sEffectsTxt; sEffectsTxt.Copy(LoadResStr("IDS_CTL_SMOKELOW"));
|
||||||
|
@ -921,6 +921,11 @@ C4StartupOptionsDlg::C4StartupOptionsDlg() : C4StartupDlg(LoadResStrNoAmp("IDS_D
|
||||||
pCheck->SetToolTip(LoadResStr("IDS_MSG_FIREPARTICLES_DESC"));
|
pCheck->SetToolTip(LoadResStr("IDS_MSG_FIREPARTICLES_DESC"));
|
||||||
pCheck->SetFont(pUseFont, C4StartupFontClr, C4StartupFontClrDisabled);
|
pCheck->SetFont(pUseFont, C4StartupFontClr, C4StartupFontClrDisabled);
|
||||||
pGroupEffects->AddElement(pCheck);
|
pGroupEffects->AddElement(pCheck);
|
||||||
|
// high resolution landscape
|
||||||
|
pCheck = new BoolConfig(caGroupEffects.GetGridCell(0,1,iOpt++,iNumGfxOptions,-1,iCheckHgt,true), LoadResStr("[!]High resolution landscape"), NULL, &Config.Graphics.HighResLandscape);
|
||||||
|
pCheck->SetToolTip(LoadResStr("[!]An expensive effect."));
|
||||||
|
pCheck->SetFont(pUseFont, C4StartupFontClr, C4StartupFontClrDisabled);
|
||||||
|
pGroupEffects->AddElement(pCheck);
|
||||||
|
|
||||||
// --- page sound
|
// --- page sound
|
||||||
C4GUI::ComponentAligner caSheetSound(pSheetSound->GetClientRect(), iIndentX1, iIndentY1, true);
|
C4GUI::ComponentAligner caSheetSound(pSheetSound->GetClientRect(), iIndentX1, iIndentY1, true);
|
||||||
|
|
Loading…
Reference in New Issue