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

Commits on Aug 6, 2024

  1. Configuration menu
    Copy the full SHA
    9a41709 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c0feba8 View commit details
    Browse the repository at this point in the history
  3. Use extrastyle_id in estyle_hash

    Using a more specific type is more correct.
    lmoureaux committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    6e77596 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e2eefe6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9f1a857 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    72eb60f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7f20455 View commit details
    Browse the repository at this point in the history
  8. Move water drawing (CARDINAL/RIVER extras) to layer_water

    layer_water is the first layer that loads its sprites on its own.
    lmoureaux committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    e1cf358 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2cea04d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2b0048b View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2024

  1. Add a draw_sprite constructor taking QPoint offsets

    This is much easier to work with when drawing many sprites with offsets.
    lmoureaux committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    9183b45 View commit details
    Browse the repository at this point in the history
  2. Move layer_units drawing and initialization to the class

    I also moved LAYER_WORKERTASK to a very similar class. Some
    deduplication will be needed.
    lmoureaux committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    250442f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7c5dcc3 View commit details
    Browse the repository at this point in the history
  4. Move LAYER_FOG to a class

    lmoureaux committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    942725d View commit details
    Browse the repository at this point in the history
  5. Standardize layer::load_sprites()

    Since many layers now load their sprites on their own, this lets us do
    it for all layers at once.
    lmoureaux committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    578d9c7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8c2ecd5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    bfa4c16 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f2e2460 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c8a6cf0 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    91ab41f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a09846b View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Add a common base for layers using activity sprites

    Multiple layers need to load sprites to represent unit activities.
    Reduce code duplication by loading them in an abstract base class.
    lmoureaux committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    c9ceebe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d37e1e8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f77c1d0 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Port LAYER_ROADS to class layer_roads

    So far only create the class. Tile loading and drawing will come next.
    lmoureaux committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    b9052c5 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2024

  1. Configuration menu
    Copy the full SHA
    ac8eb0c View commit details
    Browse the repository at this point in the history
  2. Expose valid tileset directions

    This is necessary to port the roads layer drawing to layer_roads.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    16cdaba View commit details
    Browse the repository at this point in the history
  3. Move road drawing to layer_roads

    This is a very deep refactor of the algorithms. The main change is the
    use of std::bitset to replace bool[], which provides a few helpful
    algorithms out of the box. Better code organization also helped reduce
    its complexity significantly.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    f21b5f0 View commit details
    Browse the repository at this point in the history
  4. Remove fill_sprite_array() from tilespec.cpp

    This function used to drive the drawing of mapview layers, but has now
    been fully replaced by layer classes.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    445fffd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    335e672 View commit details
    Browse the repository at this point in the history
  6. Update POTFILES

    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    e4cba69 View commit details
    Browse the repository at this point in the history
  7. Use QPoint in drawn_sprite and related APIs

    One variable is easier to work with than two.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    ce57556 View commit details
    Browse the repository at this point in the history
  8. Remove ADD_SPRITE_FULL

    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    3363dc7 View commit details
    Browse the repository at this point in the history
  9. Fix make_tag_terrain_list when the terrain has no graphic_alt

    Instead of trying to match something (with __ or _-_), skip the entry
    for the alt graphic.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    030cee0 View commit details
    Browse the repository at this point in the history
  10. Fix initializing tileset extra data after terrains

    Roads rely on having terrain information available, but the server sends
    terrains after rulesets. This moves extra initialization to the very
    end, in handle_rulesets_ready(). All tileset loading code shoud probably
    be done there.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    f431bef View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    004aaaa View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0b23b0a View commit details
    Browse the repository at this point in the history
  13. Add a function in the layer class to load a sprite

    This wraps load_sprite and specifies the tileset automatically, which is
    a nice syntactic sugar in layer classes.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    a47eb4c View commit details
    Browse the repository at this point in the history
  14. Don't use tiles_lookup_sprite_tag_alt in helpdlg

    It's a low-level function whose usage should ideally be limited to
    tilespec.cpp.
    lmoureaux committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    5b42d04 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    d648de8 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. clang-format

    lmoureaux committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    3a2b056 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. Add missing <array> includes

    Fixes compilation with libc++.
    lmoureaux committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    0ad45cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    49328e8 View commit details
    Browse the repository at this point in the history
  3. Tidy up layer_fog a little

    I thought I could remove a warning about an optional sprite not being
    found but it doesn't seem to be the case.
    lmoureaux committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    51ff22c View commit details
    Browse the repository at this point in the history
  4. Add a silent mode when loading optional sprites

    When loading many optional sprites, it's better to log a single line
    summarizing everything than one line per sprite.
    lmoureaux committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    5e4e707 View commit details
    Browse the repository at this point in the history
  5. Direct all tileset-related messages to a logging category

    This will allow silencing them.
    lmoureaux committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    f3245dd View commit details
    Browse the repository at this point in the history
  6. Switch "already have a sprite for" to a qCWarning

    Also remove "warning" from the message itself.
    lmoureaux committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    63d7383 View commit details
    Browse the repository at this point in the history
  7. Disable tileset INFO messages by default

    Gate displaying these messages behind the --debug-tileset option. This
    reduces the client verbosity.
    lmoureaux committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    204a0de View commit details
    Browse the repository at this point in the history
  8. Don't show the "city is occupied" sprite in city_icon_widget

    Looks bad with amplio2.
    lmoureaux committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    6ff7183 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f7febe4 View commit details
    Browse the repository at this point in the history