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
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions Art/DayNight/Spring/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
0100/
0200/
0300/
0400/
0500/
0600/
0700/
0800/
0900/
1000/
1100/
1200/
1300/
1400/
1500/
1600/
1700/
1800/
1900/
2000/
2100/
2200/
2300/
2400/
1 change: 1 addition & 0 deletions Art/DayNight/Spring/Annotations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*_lights.pcx
24 changes: 24 additions & 0 deletions Art/DayNight/Summer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
0100/
0200/
0300/
0400/
0500/
0600/
0700/
0800/
0900/
1000/
1100/
1200/
1300/
1400/
1500/
1600/
1700/
1800/
1900/
2000/
2100/
2200/
2300/
2400/
24 changes: 24 additions & 0 deletions Art/DayNight/Winter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
0100/
0200/
0300/
0400/
0500/
0600/
0700/
0800/
0900/
1000/
1100/
1200/
1300/
1400/
1500/
1600/
1700/
1800/
1900/
2000/
2100/
2200/
2300/
2400/
1 change: 1 addition & 0 deletions Art/DayNight/Winter/Annotations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*_lights.pcx
24 changes: 24 additions & 0 deletions Art/Districts/Fall/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
0100/
0200/
0300/
0400/
0500/
0600/
0700/
0800/
0900/
1000/
1100/
1200/
1300/
1400/
1500/
1600/
1700/
1800/
1900/
2000/
2100/
2200/
2300/
2400/
1 change: 1 addition & 0 deletions Art/Districts/Fall/Annotations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*_lights.pcx
24 changes: 24 additions & 0 deletions Art/Districts/Spring/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
0100/
0200/
0300/
0400/
0500/
0600/
0700/
0800/
0900/
1000/
1100/
1200/
1300/
1400/
1500/
1600/
1700/
1800/
1900/
2000/
2100/
2200/
2300/
2400/
1 change: 1 addition & 0 deletions Art/Districts/Spring/Annotations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*_lights.pcx
1 change: 0 additions & 1 deletion Art/.gitignore → Art/Districts/Summer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Seasons/
0100/
0200/
0300/
Expand Down
1 change: 1 addition & 0 deletions Art/Districts/Summer/1200/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*_lights.pcx
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions Art/Districts/Winter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
0100/
0200/
0300/
0400/
0500/
0600/
0700/
0800/
0900/
1000/
1100/
1200/
1300/
1400/
1500/
1600/
1700/
1800/
1900/
2000/
2100/
2200/
2300/
2400/
1 change: 1 addition & 0 deletions Art/Districts/Winter/Annotations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*_lights.pcx
33 changes: 31 additions & 2 deletions C3X.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,25 @@ enum day_night_cycle_mode {
DNCM_SPECIFIED
};

enum seasonal_cycle_mode {
SCM_OFF = 0,
SCM_TIMER,
SCM_USER_SEASON,
SCM_EVERY_TURN,
SCM_ON_DAY_NIGHT_HOUR,
SCM_SPECIFIED
};

enum cycle_season {
CS_SUMMER = 0,
CS_FALL,
CS_WINTER,
CS_SPRING,
COUNT_CYCLE_SEASONS
};

char const * const cycle_season_names[COUNT_CYCLE_SEASONS] = {"Summer", "Fall", "Winter", "Spring"};

enum distribution_hub_yield_division_mode {
DHYDM_FLAT = 0,
DHYDM_SCALE_BY_CITY_COUNT
Expand Down Expand Up @@ -418,6 +437,12 @@ struct c3x_config {
int elapsed_minutes_per_day_night_hour_transition;
int fixed_hours_per_turn_for_day_night_cycle;
int pinned_hour_for_day_night_cycle;
int seasonal_cycle_mode;
int enabled_seasons_mask;
int pinned_season_for_seasonal_cycle;
int elapsed_minutes_per_season_transition;
int fixed_turns_per_season;
int transition_season_on_day_night_hour;

bool enable_natural_wonders;
bool add_natural_wonders_to_scenarios_if_none;
Expand Down Expand Up @@ -1978,10 +2003,14 @@ struct injected_state {
// Day-Night cycle data
int current_day_night_cycle;
bool day_night_cycle_unstarted; // If current_day_night_cycle has not been set, f.e. because it's the first turn of a new game.
int current_seasonal_cycle;
bool seasonal_cycle_unstarted;
int turns_in_current_season;
bool day_night_cycle_img_proxies_indexed;
LARGE_INTEGER last_day_night_cycle_update_time;
LARGE_INTEGER last_seasonal_cycle_update_time;

struct table day_night_sprite_proxy_by_hour[24];
struct table * day_night_sprite_proxy_by_season_and_hour;

struct wonder_district_image_set {
Sprite img;
Expand Down Expand Up @@ -2074,7 +2103,7 @@ struct injected_state {
Sprite Abandoned_Maritime_District_Image;
struct wonder_district_image_set Wonder_District_Images[MAX_WONDER_DISTRICT_TYPES];
struct natural_wonder_district_image_set Natural_Wonder_Images[MAX_NATURAL_WONDER_DISTRICT_TYPES];
} day_night_cycle_imgs[24];
} * cycle_imgs;

// Districts
enum init_state dc_img_state;
Expand Down
9 changes: 8 additions & 1 deletion DayNight/civ3_postprocess_pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ def walk_and_fix(data_dir: str, noon_folder: str,
annotations_abs = os.path.normpath(os.path.join(data_dir, "Annotations"))
targets = []

def is_hour_folder_name(name: str) -> bool:
return len(name) == 4 and name.isdigit()

if only_hour is not None:
hour_name = f"{only_hour:04d}"
hour_abs = os.path.normpath(os.path.join(data_dir, hour_name))
Expand All @@ -241,11 +244,15 @@ def walk_and_fix(data_dir: str, noon_folder: str,
if not os.path.isdir(sub): continue
if os.path.normcase(sub) == os.path.normcase(noon_abs): continue
if os.path.normcase(sub) == os.path.normcase(annotations_abs): continue
if not is_hour_folder_name(name): continue
targets.append(sub)

total_changed = 0
for root in targets:
for dirpath, _, filenames in os.walk(root):
for dirpath, dirnames, filenames in os.walk(root):
dirnames[:] = [d for d in dirnames if d.lower() != "annotations"]
if os.path.basename(dirpath).lower() == "annotations":
continue
for fname in filenames:
if not fname.lower().endswith(".pcx"):
continue
Expand Down
Loading