[Commits] [wesnoth/wesnoth] b46a64: Dropped CVideo parameter from loading screen and p...

GitHub noreply at github.com
Mon Nov 20 15:31:18 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: b46a64b8ad7a89d1450b043d6c3976a72fbf9c01
      https://github.com/wesnoth/wesnoth/commit/b46a64b8ad7a89d1450b043d6c3976a72fbf9c01
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-11-21 (Tue, 21 Nov 2017)

  Changed paths:
    M src/chat_command_handler.cpp
    M src/editor/controller/editor_controller.cpp
    M src/game_config_manager.cpp
    M src/game_initialization/multiplayer.cpp
    M src/game_launcher.cpp
    M src/gui/dialogs/loading_screen.cpp
    M src/gui/dialogs/loading_screen.hpp
    M src/gui/dialogs/preferences_dialog.cpp
    M src/gui/dialogs/preferences_dialog.hpp
    M src/menu_events.cpp
    M src/play_controller.cpp
    M src/wesnoth.cpp
    M src/wesnothd_connection.cpp

  Log Message:
  -----------
  Dropped CVideo parameter from loading screen and prefs display functions (missed in f2b31ba)

I had left the former alone in the above commit since I thought it might be worth keeping for the
faked() call, but that's not really a great reason.

As for the latter, I didn't realize the CVideo argument wasn't really even needed. I didn't even
need to replace it with a get_singleton() call since the resolution list is updated by set_resolution_list
before it's used.


  Commit: 9dd497db4a0c4d694bf5b85e49514470298a19fb
      https://github.com/wesnoth/wesnoth/commit/9dd497db4a0c4d694bf5b85e49514470298a19fb
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2017-11-21 (Tue, 21 Nov 2017)

  Changed paths:
    M src/display.cpp
    M src/display.hpp
    M src/editor/controller/editor_controller.cpp
    M src/editor/controller/editor_controller.hpp
    M src/editor/editor_display.cpp
    M src/editor/editor_display.hpp
    M src/editor/editor_main.cpp
    M src/editor/editor_main.hpp
    M src/game_display.cpp
    M src/game_display.hpp
    M src/game_initialization/multiplayer.cpp
    M src/game_initialization/multiplayer.hpp
    M src/game_initialization/playcampaign.cpp
    M src/game_initialization/playcampaign.hpp
    M src/game_launcher.cpp
    M src/play_controller.cpp
    M src/play_controller.hpp
    M src/playmp_controller.cpp
    M src/playmp_controller.hpp
    M src/playsingle_controller.cpp
    M src/playsingle_controller.hpp
    M src/tooltips.cpp
    M src/tooltips.hpp

  Log Message:
  -----------
  Cleaned up the mess of CVideo references passed around the game initialization process

Essentially, we had CVideo arguments being passed down this chain:
- game_launcher
- free-standing MP initialization functions
- campaign_controller
- playsingle_controller/playmp_controller
- play_controller
- game_display
- display

And likewise down through
- game_launcher
- editor_controller
- editor_display
- display

With only a minimal number of actual calls along the way. :| There were maybe... two remaining?

This removes the CVideo arguments and class members from both chains (except of course, game_launcher.
That's where the "real" CVideo object lives).

The display class now initializes its CVideo reference from the singleton, which is also used in the
very few other places it's needed. I also replaced a check for a null video ptr in show_tooltip()
with a faked() check (see src/tooltips.cpp). That seems to make more sense, since CVideo is never
null now.


Compare: https://github.com/wesnoth/wesnoth/compare/464cf07a8b79...9dd497db4a0c


More information about the Commits mailing list