forked from Mirrors/openclonk
Only one texture per material
committer: Günther Brammer <gbrammer@gmx.de>
parent
6f18e7250c
commit
6db4f8e5b3
|
@ -147,7 +147,6 @@ class C4Material: public C4MaterialCore
|
|||
int32_t AboveTempConvertTo; // MatTex
|
||||
#ifdef C4ENGINE
|
||||
int32_t DefaultMatTex; // texture used for single pixel values
|
||||
CPattern MatPattern;
|
||||
C4Facet PXSFace; // loose pixel facet
|
||||
|
||||
void UpdateScriptPointers(); // set all material script pointers
|
||||
|
|
|
@ -2560,8 +2560,6 @@ DWORD C4Landscape::GetClrByTex(int32_t iX, int32_t iY)
|
|||
{
|
||||
// pattern color
|
||||
pTex->getPattern().PatternClr(iX, iY, pix, dwPix, Application.DDraw->Pal);
|
||||
if(pTex->GetMaterial())
|
||||
pTex->GetMaterial()->MatPattern.PatternClr(iX, iY, pix, dwPix, Application.DDraw->Pal);
|
||||
}
|
||||
return dwPix;
|
||||
}
|
||||
|
|
|
@ -406,14 +406,6 @@ void C4MaterialMap::CrossMapMaterials() // Called after load
|
|||
// search/create entry in texmap
|
||||
Map[cnt].DefaultMatTex = Game.TextureMap.GetIndex(Map[cnt].Name, szTextureOverlay, TRUE,
|
||||
FormatString("DefaultMatTex of mat %s", Map[cnt].Name).getData());
|
||||
const C4TexMapEntry *pTex = Game.TextureMap.GetEntry(Map[cnt].DefaultMatTex);
|
||||
if (pTex)
|
||||
{
|
||||
// take pattern
|
||||
Map[cnt].MatPattern = pTex->getPattern();
|
||||
// special zooming for overlay
|
||||
Map[cnt].MatPattern.SetZoom((Map[cnt].OverlayType & C4MatOv_Exact) ? 1 : 2);
|
||||
}
|
||||
// init PXS facet
|
||||
SURFACE sfcTexture;
|
||||
C4Texture * Texture;
|
||||
|
|
|
@ -655,13 +655,12 @@ void C4ToolsDlg::UpdatePreview()
|
|||
Application.DDraw->DrawBox(sfcPreview,0,0,iPrvWdt-1,iPrvHgt-1,CGray4);
|
||||
#endif
|
||||
BYTE bCol = 0;
|
||||
CPattern Pattern1;
|
||||
CPattern Pattern2;
|
||||
CPattern Pattern;
|
||||
// Sky material: sky as pattern only
|
||||
if (SEqual(Material,C4TLS_MatSky))
|
||||
{
|
||||
Pattern1.SetColors(0, 0);
|
||||
Pattern1.Set(Game.Landscape.Sky.Surface, 0, false);
|
||||
Pattern.SetColors(0, 0);
|
||||
Pattern.Set(Game.Landscape.Sky.Surface, 0, false);
|
||||
}
|
||||
// Material-Texture
|
||||
else
|
||||
|
@ -677,13 +676,7 @@ void C4ToolsDlg::UpdatePreview()
|
|||
if(pTex)
|
||||
{
|
||||
// Set drawing pattern
|
||||
Pattern2 = pTex->getPattern();
|
||||
// get and set extended texture of material
|
||||
C4Material *pMat = pTex->GetMaterial();
|
||||
if (pMat && !(pMat->OverlayType & C4MatOv_None))
|
||||
{
|
||||
Pattern1 = pMat->MatPattern;
|
||||
}
|
||||
Pattern = pTex->getPattern();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -697,7 +690,7 @@ void C4ToolsDlg::UpdatePreview()
|
|||
Application.DDraw->DrawPatternedCircle( sfcPreview,
|
||||
iPrvWdt/2,iPrvHgt/2,
|
||||
Grade,
|
||||
bCol, Pattern1, Pattern2, *Game.Landscape.GetPal());
|
||||
bCol, Pattern, *Game.Landscape.GetPal());
|
||||
|
||||
Application.DDraw->AttachPrimaryPalette(sfcPreview);
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ class CStdDDraw
|
|||
void DrawBox(SURFACE sfcDest, int iX1, int iY1, int iX2, int iY2, BYTE byCol); // calls DrawBoxDw
|
||||
void DrawBoxDw(SURFACE sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr); // calls DrawBoxFade
|
||||
void DrawBoxFade(SURFACE sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, int iBoxOffX, int iBoxOffY); // calls DrawQuadDw
|
||||
void DrawPatternedCircle(SURFACE sfcDest, int x, int y, int r, BYTE col, CPattern & Pattern1, CPattern & Pattern2, CStdPalette &rPal);
|
||||
void DrawPatternedCircle(SURFACE sfcDest, int x, int y, int r, BYTE col, CPattern & Pattern, CStdPalette &rPal);
|
||||
void DrawHorizontalLine(SURFACE sfcDest, int x1, int x2, int y, BYTE col);
|
||||
void DrawVerticalLine(SURFACE sfcDest, int x, int y1, int y2, BYTE col);
|
||||
void DrawFrame(SURFACE sfcDest, int x1, int y1, int x2, int y2, BYTE col);
|
||||
|
|
|
@ -1544,7 +1544,7 @@ bool DLineSPixDw(int32_t x, int32_t y, int32_t dwClr)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdDDraw::DrawPatternedCircle(SURFACE sfcDest, int x, int y, int r, BYTE col, CPattern & Pattern1, CPattern & Pattern2, CStdPalette &rPal)
|
||||
void CStdDDraw::DrawPatternedCircle(SURFACE sfcDest, int x, int y, int r, BYTE col, CPattern & Pattern, CStdPalette &rPal)
|
||||
{
|
||||
if (!sfcDest->Lock()) return;
|
||||
for (int ycnt = -r; ycnt < r; ycnt++)
|
||||
|
@ -1555,8 +1555,7 @@ void CStdDDraw::DrawPatternedCircle(SURFACE sfcDest, int x, int y, int r, BYTE c
|
|||
{
|
||||
// apply both patterns
|
||||
DWORD dwClr=rPal.GetClr(col);
|
||||
Pattern1.PatternClr(xcnt, y + ycnt, col, dwClr, rPal);
|
||||
Pattern2.PatternClr(xcnt, y + ycnt, col, dwClr, rPal);
|
||||
Pattern.PatternClr(xcnt, y + ycnt, col, dwClr, rPal);
|
||||
sfcDest->SetPixDw(xcnt, y + ycnt, dwClr);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue