- Fixed TfrmLogin to create the profile path if it doesn't exist
- Removed old code from TfrmMain.Render - Bumped version to 0.4.5 - Moved TVirtualTile to UWorldItem - Added TVirtualTile handling to CompareWorldItems - Added priorities to the virtual tiles
This commit is contained in:
@@ -37,9 +37,6 @@ uses
|
||||
ImagingClasses, dateutils, UPlatformTypes, UVector, UMap, contnrs;
|
||||
|
||||
type
|
||||
|
||||
TVirtualTile = class(TWorldItem);
|
||||
|
||||
TAccessChangedListener = procedure(AAccessLevel: TAccessLevel) of object;
|
||||
TScreenBufferState = (sbsValid, sbsIndexed, sbsFiltered);
|
||||
TScreenBufferStates = set of TScreenBufferState;
|
||||
@@ -1937,170 +1934,6 @@ begin
|
||||
|
||||
if highlight then
|
||||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
|
||||
{GetDrawOffset(item.X - FX, item.Y - FY, drawX, drawY);
|
||||
|
||||
{if editing and acDraw.Checked and (singleTarget or multiTarget) then
|
||||
begin
|
||||
ghostTile := FGhostTile;
|
||||
if (ghostTile is TMapCell) and (not frmDrawSettings.cbForceAltitude.Checked) then
|
||||
ghostTile.Z := FLandscape.MapCell[item.X, item.Y].Z;
|
||||
end else
|
||||
ghostTile := nil;} //TODO : re add Ghost Tile
|
||||
|
||||
{if frmVirtualLayer.cbShowLayer.Checked then
|
||||
begin
|
||||
virtualTile := FVirtualLayer[k, j - k];
|
||||
virtualTile.X := FX + offsetX;
|
||||
virtualTile.Y := FY + offsetY;
|
||||
virtualTile.Z := frmVirtualLayer.seZ.Value;
|
||||
end else
|
||||
virtualTile := nil;}
|
||||
|
||||
if not editing then
|
||||
highlight := False
|
||||
{else if item = virtualTile then
|
||||
highlight := False} //todo virtual tile
|
||||
else if acDelete.Checked and multiTarget and (item is TStaticItem) then
|
||||
highlight := True
|
||||
else if ((acElevate.Checked) or (acMove.Checked)) and multiTarget then
|
||||
highlight := True
|
||||
else if (acHue.Checked and multiTarget and (item is TMapCell)) then
|
||||
highlight := True
|
||||
else
|
||||
highlight := (not acSelect.Checked) and
|
||||
(not acHue.Checked) and
|
||||
(item = CurrentTile) or
|
||||
((item is TMapCell) and (item = ghostTile));
|
||||
|
||||
if highlight then
|
||||
begin
|
||||
glEnable(GL_COLOR_LOGIC_OP);
|
||||
glLogicOp(GL_COPY_INVERTED);
|
||||
end;
|
||||
|
||||
if acFlat.Checked then
|
||||
z := 0
|
||||
else
|
||||
z := item.Z;
|
||||
|
||||
glColor4f(intensity, intensity, intensity, 1.0);
|
||||
|
||||
{if TObject(draw[i]) = virtualTile then
|
||||
begin
|
||||
glBindTexture(GL_TEXTURE_2D, FVLayerMaterial.Texture);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0); glVertex2d(drawX - 22, drawY - z * 4);
|
||||
glTexCoord2f(1, 0); glVertex2d(drawX - 22 + FVLayerMaterial.Width, drawY - z * 4);
|
||||
glTexCoord2f(1, 1); glVertex2d(drawX - 22 + FVLayerMaterial.Width, drawY + FVLayerMaterial.Height - z * 4);
|
||||
glTexCoord2f(0, 1); glVertex2d(drawX - 22, drawY + FVLayerMaterial.Height - z * 4);
|
||||
glEnd;
|
||||
|
||||
FScreenBuffer.Store(Bounds(Trunc(drawX - 22), Trunc(drawY - z * 4), 44, 44), virtualTile, FVLayerMaterial);
|
||||
end else} if item is TMapCell then //TODO : virtual tile!
|
||||
begin
|
||||
cell := TMapCell(item);
|
||||
|
||||
{if ResMan.Tiledata.LandTiles[cell.TileID].HasFlag(tdfTranslucent) then
|
||||
glColor4f(intensity, intensity, intensity, 0.5);} //Possible, but probably not like the OSI client
|
||||
|
||||
mat := nil;
|
||||
|
||||
if not acFlat.Checked then
|
||||
begin
|
||||
west := FLandscape.GetLandAlt(item.X, item.Y + 1, z);
|
||||
south := FLandscape.GetLandAlt(item.X + 1, item.Y + 1, z);
|
||||
east := FLandscape.GetLandAlt(item.X + 1, item.Y, z);
|
||||
|
||||
if (west <> z) or (south <> z) or (east <> z) then
|
||||
begin
|
||||
mat := FTextureManager.GetTexMaterial(cell.TileID);
|
||||
end;
|
||||
end;
|
||||
|
||||
if mat = nil then
|
||||
begin
|
||||
mat := FTextureManager.GetArtMaterial(cell.TileID);
|
||||
if (not (ghostTile is TMapCell)) or
|
||||
(item = ghostTile) then //when we have a ghosttile, only draw that, but still store the real one
|
||||
begin
|
||||
glBindTexture(GL_TEXTURE_2D, mat.Texture);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0); glVertex2d(drawX - 22, drawY - z * 4);
|
||||
glTexCoord2f(1, 0); glVertex2d(drawX - 22 + mat.Width, drawY - z * 4);
|
||||
glTexCoord2f(1, 1); glVertex2d(drawX - 22 + mat.Width, drawY + mat.Height - z * 4);
|
||||
glTexCoord2f(0, 1); glVertex2d(drawX - 22, drawY + mat.Height - z * 4);
|
||||
glEnd;
|
||||
end;
|
||||
|
||||
if item <> ghostTile then
|
||||
FScreenBuffer.Store(Bounds(Trunc(drawX - 22), Trunc(drawY - z * 4), 44, 44), cell, mat);
|
||||
end else // Texture found
|
||||
begin
|
||||
if (not (ghostTile is TMapCell)) or
|
||||
(item = ghostTile) then //when we have a ghosttile, only draw that, but still store the real one
|
||||
begin
|
||||
glBindTexture(GL_TEXTURE_2D, mat.Texture);
|
||||
//if (not cell.Selected) and (intensity = 1.0) then
|
||||
if not cell.Selected then
|
||||
glEnable(GL_LIGHTING);
|
||||
normals := FLandscape.Normals[item.X, item.Y];
|
||||
glBegin(GL_TRIANGLES);
|
||||
glNormal3f(normals[3].X, normals[3].Y, normals[3].Z);
|
||||
glTexCoord2f(0, 1); glVertex2d(drawX - 22, drawY + 22 - west * 4);
|
||||
glNormal3f(normals[0].X, normals[0].Y, normals[0].Z);
|
||||
glTexCoord2f(0, 0); glVertex2d(drawX, drawY - z * 4);
|
||||
glNormal3f(normals[1].X, normals[1].Y, normals[1].Z);
|
||||
glTexCoord2f(1, 0); glVertex2d(drawX + 22, drawY + 22 - east * 4);
|
||||
glNormal3f(normals[1].X, normals[1].Y, normals[1].Z);
|
||||
glTexCoord2f(1, 0); glVertex2d(drawX + 22, drawY + 22 - east * 4);
|
||||
glNormal3f(normals[2].X, normals[2].Y, normals[2].Z);
|
||||
glTexCoord2f(1, 1); glVertex2d(drawX, drawY + 44 - south * 4);
|
||||
glNormal3f(normals[3].X, normals[3].Y, normals[3].Z);
|
||||
glTexCoord2f(0, 1); glVertex2d(drawX - 22, drawY + 22 - west * 4);
|
||||
glEnd;
|
||||
//if (not cell.Selected) and (intensity = 1.0) then
|
||||
if not cell.Selected then
|
||||
glDisable(GL_LIGHTING);
|
||||
end;
|
||||
|
||||
if item <> ghostTile then
|
||||
FScreenBuffer.Store(Rect(Trunc(drawX - 22), Trunc(drawY - z * 4), Trunc(drawX + 22), Trunc(drawY + 44 - south * 4)), cell, mat);
|
||||
end;
|
||||
end else if item is TStaticItem then
|
||||
begin
|
||||
staticItem := TStaticItem(item);
|
||||
|
||||
staticTileData := ResMan.Tiledata.StaticTiles[staticItem.TileID];
|
||||
if tbSetHue.Down and ((singleTarget and (item = CurrentTile)) or multiTarget) then
|
||||
begin
|
||||
if frmHueSettings.lbHue.ItemIndex > 0 then
|
||||
hue := ResMan.Hue.Hues[frmHueSettings.lbHue.ItemIndex - 1]
|
||||
else
|
||||
hue := nil;
|
||||
end else if staticItem.Hue > 0 then
|
||||
hue := ResMan.Hue.Hues[staticItem.Hue - 1]
|
||||
else
|
||||
hue := nil;
|
||||
|
||||
if staticTileData.HasFlag(tdfTranslucent) then
|
||||
glColor4f(intensity, intensity, intensity, 0.5);
|
||||
|
||||
mat := FTextureManager.GetArtMaterial($4000 + staticItem.TileID, hue, (staticTileData.Flags and tdfPartialHue) = tdfPartialHue);
|
||||
south := mat.RealHeight;
|
||||
east := mat.RealWidth div 2;
|
||||
glBindTexture(GL_TEXTURE_2D, mat.Texture);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0); glVertex2d(drawX - east, drawY + 44 - south - z * 4);
|
||||
glTexCoord2f(1, 0); glVertex2d(drawX - east + mat.Width, drawY + 44 - south - z * 4);
|
||||
glTexCoord2f(1, 1); glVertex2d(drawX - east + mat.Width, drawY + 44 - south + mat.Height - z * 4);
|
||||
glTexCoord2f(0, 1); glVertex2d(drawX - east, drawY + 44 - south + mat.Height - z * 4);
|
||||
glEnd;
|
||||
|
||||
if TObject(draw[i]) <> ghostTile then
|
||||
FScreenBuffer.Store(Bounds(Trunc(drawX - east), Trunc(drawY + 44 - south - z * 4), mat.RealWidth, Trunc(south)), staticItem, mat);
|
||||
end;}
|
||||
|
||||
end;
|
||||
|
||||
FOverlayUI.Draw(oglGameWindow);
|
||||
@@ -2362,6 +2195,8 @@ begin
|
||||
virtualTile.X := tileX;
|
||||
virtualTile.Y := tileY;
|
||||
virtualTile.Z := frmVirtualLayer.seZ.Value;
|
||||
virtualTile.Priority := virtualTile.Z;
|
||||
virtualTile.PriorityBonus := MaxInt;
|
||||
|
||||
Inc(i);
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user