Skip to content
Open
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
2 changes: 1 addition & 1 deletion C7/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class GotoInfo {
private Vector2 OldPosition;

Stopwatch loadTimer = new Stopwatch();
GlobalSingleton Global;
public GlobalSingleton Global { get; private set; }

[Export]
private PopupOverlay popupOverlay;
Expand Down
21 changes: 21 additions & 0 deletions C7/Lua/texture_configs/civ3/resources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ function resources.large:map_object_to_sprite(resource)
}
end

resources.shadows = {
extra_data = {
path = "Art/resources_shadows.pcx",
},
}

function resources.shadows:map_object_to_sprite(resource)
if resource:GetType().Name ~= "Resource" then
error "Expected a Resource object"
end

local icon = resource.Icon
local row = math.floor(icon / 6)
local col = icon % 6

return {
path = self.extra_data.path,
crop_region = { col * RESOURCE_SIZE, row * RESOURCE_SIZE, RESOURCE_SIZE, RESOURCE_SIZE },
}
end

resources.small = {
extra_data = {
path = "Art/city screen/luxuryicons_small.pcx",
Expand Down
6 changes: 5 additions & 1 deletion C7/Map/ResourceLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ public override void drawObject(LooseView looseView, GameData gameData, Tile til
return;
}

var texture = TextureLoader.Load("resources.large", resource, useCache: true);
if (!looseView.mapView.game.Global.ModernGraphicsActive) {
ImageTexture shadows = TextureLoader.Load("resources.shadows", resource, useCache: true);
looseView.DrawTexture(shadows, tileCenter - 0.5f * shadows.GetSize());
}

ImageTexture texture = TextureLoader.Load("resources.large", resource, useCache: true);
looseView.DrawTexture(texture, tileCenter - 0.5f * texture.GetSize());
}

Expand Down
4 changes: 3 additions & 1 deletion C7/Textures/PCXToGodot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ private static int[] loadPalette(byte[,] palette, ColorOptions colorOptions) {

if (colorOptions.shadows) {
for (int i = 240; i < 256; i++) {
ColorData[i] = ((MAX_COLOR - i) * 16) << ALPHA_BITSHIFT;
if (!colorOptions.transparentColorIndexes.Contains(i)) {
ColorData[i] = ((MAX_COLOR - i) * 16) << ALPHA_BITSHIFT;
}
}
}

Expand Down