Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish migrating tileset layers to classes #2346

Merged
merged 50 commits into from
Sep 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9a41709
Make is_extra_drawing_enabled const-correct
lmoureaux Aug 6, 2024
c0feba8
Allow class-based layers to use info about extras
lmoureaux Aug 6, 2024
6e77596
Use extrastyle_id in estyle_hash
lmoureaux Aug 6, 2024
e2eefe6
Tilespec: expose make_tag_terrain_list
lmoureaux Aug 6, 2024
9f1a857
Tilespec: expose dir_get_tileset_name
lmoureaux Aug 6, 2024
72eb60f
Tilespec: Create a load_sprite() overload taking a list of possible tags
lmoureaux Aug 6, 2024
7f20455
Tilespec: move extra-related definitions to layer.h
lmoureaux Aug 6, 2024
e1cf358
Move water drawing (CARDINAL/RIVER extras) to layer_water
lmoureaux Aug 6, 2024
2cea04d
Make layer_darkness load its own sprites
lmoureaux Aug 6, 2024
2b0048b
Migrate loading special sprites to layer_special
lmoureaux Aug 6, 2024
9183b45
Add a draw_sprite constructor taking QPoint offsets
lmoureaux Aug 7, 2024
250442f
Move layer_units drawing and initialization to the class
lmoureaux Aug 7, 2024
7c5dcc3
Use QPoint-based offsets more consistently
lmoureaux Aug 7, 2024
942725d
Move LAYER_FOG to a class
lmoureaux Aug 7, 2024
578d9c7
Standardize layer::load_sprites()
lmoureaux Aug 7, 2024
8c2ecd5
Move LAYER_GRID1 and 2 to class layer_grid
lmoureaux Aug 7, 2024
bfa4c16
Move LAYER_EDITOR to class layer_editor
lmoureaux Aug 7, 2024
f2e2460
Move LAYER_GOTO to class layer_goto
lmoureaux Aug 7, 2024
c8a6cf0
Migrate LAYER_CITY2 to class layer_city_size
lmoureaux Aug 7, 2024
91ab41f
Migrate LAYER_CITY1 to class layer_city
lmoureaux Aug 7, 2024
a09846b
Migrate LAYER_OVERLAYS to class layer_overlays
lmoureaux Aug 7, 2024
c9ceebe
Add a common base for layers using activity sprites
lmoureaux Aug 8, 2024
d37e1e8
Fix trying to fetch goto state on unknown tiles
lmoureaux Aug 8, 2024
f77c1d0
Port LAYER_INFRAWORK to class layer_infrawork
lmoureaux Aug 8, 2024
b9052c5
Port LAYER_ROADS to class layer_roads
lmoureaux Aug 9, 2024
ac8eb0c
Fix some offsets in city layers
lmoureaux Aug 10, 2024
16cdaba
Expose valid tileset directions
lmoureaux Aug 10, 2024
f21b5f0
Move road drawing to layer_roads
lmoureaux Aug 10, 2024
445fffd
Remove fill_sprite_array() from tilespec.cpp
lmoureaux Aug 10, 2024
335e672
Remove unused includes from tilespec.cpp
lmoureaux Aug 10, 2024
e4cba69
Update POTFILES
lmoureaux Aug 10, 2024
ce57556
Use QPoint in drawn_sprite and related APIs
lmoureaux Aug 10, 2024
3363dc7
Remove ADD_SPRITE_FULL
lmoureaux Aug 10, 2024
030cee0
Fix make_tag_terrain_list when the terrain has no graphic_alt
lmoureaux Aug 10, 2024
f431bef
Fix initializing tileset extra data after terrains
lmoureaux Aug 10, 2024
004aaaa
Use std::vector::insert more now that drawn_sprite is assignable
lmoureaux Aug 10, 2024
0b23b0a
Replace sprite_vector with vector<QPixmap *>
lmoureaux Aug 10, 2024
a47eb4c
Add a function in the layer class to load a sprite
lmoureaux Aug 10, 2024
5b42d04
Don't use tiles_lookup_sprite_tag_alt in helpdlg
lmoureaux Aug 10, 2024
d648de8
Use QSize for sprite sizes in tilespec.cpp
lmoureaux Aug 10, 2024
3a2b056
clang-format
lmoureaux Aug 12, 2024
0ad45cb
Add missing <array> includes
lmoureaux Aug 14, 2024
49328e8
Check that at least one unit.hp_ sprite is present
lmoureaux Aug 14, 2024
51ff22c
Tidy up layer_fog a little
lmoureaux Aug 14, 2024
5e4e707
Add a silent mode when loading optional sprites
lmoureaux Aug 14, 2024
f3245dd
Direct all tileset-related messages to a logging category
lmoureaux Aug 14, 2024
63d7383
Switch "already have a sprite for" to a qCWarning
lmoureaux Aug 14, 2024
204a0de
Disable tileset INFO messages by default
lmoureaux Aug 14, 2024
6ff7183
Don't show the "city is occupied" sprite in city_icon_widget
lmoureaux Aug 14, 2024
f7febe4
city_size_offset is relative to full_tile_offset
lmoureaux Aug 14, 2024
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
4 changes: 2 additions & 2 deletions client/tileset/tilespec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,8 +1488,8 @@ static void tileset_add_layer(struct tileset *t, mapview_layer layer)
t, t->city_offset, t->city_flag_offset, t->occupied_offset));
} break;
case LAYER_CITY2: {
t->layers.emplace_back(
std::make_unique<freeciv::layer_city_size>(t, t->city_size_offset));
t->layers.emplace_back(std::make_unique<freeciv::layer_city_size>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std library, need an include in header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only needed in the header if used there (which is the case). But vector is somehow magically included everywhere already, I'm not sure which header does that. If you want we can run iwyu in another PR...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i'll do a fresh compile on clang as a test as well

t, tileset_full_tile_offset(t) + t->city_size_offset));
} break;
case LAYER_DARKNESS: {
t->layers.emplace_back(
Expand Down
Loading