Freeciv-tao-client

Can you help improve your favourite game? Hardcore C mages, talented artists, and players with any level of experience are welcome!
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: Freeciv-tao-client

Post by Lachu »

I have one question. Where was image displayed on start screen of gtk3 client? Which file should I include and which macrodefinition/string use?
louis94
Hardened
Posts: 270
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Freeciv-tao-client

Post by louis94 »

Lachu wrote:I have one question. Where was image displayed on start screen of gtk3 client? Which file should I include and which macrodefinition/string use?
I assume you're speaking about something like this:
Spectacle.M14405.png
Which image to use is actually defined by the tileset, you can get the file name from tileset_main_intro_filename (tilespec.h:395). The tileset needs to be initialized for this to work. The client startup procedure is as follows:
  1. (UI side) main() is called
  2. (UI) main() calls client_main (client_main.h:51)
  3. (common side) client_main() calls gui_init
  4. (co) client_main() loads some things
  5. (co) client_main() calls ui_main
  6. (co) client_main() finishes loading
  7. (UI) ui_main creates the GUI. The application exits when it returns
The tileset is only available in ui_main.

After initialization is done, it's up to the UI to call the common code when needed, including map rendering functions (the only exception to this is the metaserver, which lives in its own thread). The common code will call add_idle_callback (gui_main_g.h:41) when a function needs to be called "at some moment in the future". The real_timer_callback (client_main.h:111) needs to be called by the UI code at specified time intervals.

Louis
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: Freeciv-tao-client

Post by Lachu »

Yes, I spoke about image you attached. I copy files *.c and *.h from client/gui-stub into clien/gui-tao, change Makefile.am, ran ./autogen.sh --gui-client=tao and try to compile, but compiler complains about missing symbols.
cazfi
Elite
Posts: 3095
Joined: Tue Jan 29, 2013 6:54 pm

Re: Freeciv-tao-client

Post by cazfi »

Submit you current work to a patch ticket ( https://gna.org/patch/?func=additem&group=freeciv ), patch as attachment, and I can have a look of what it needs.
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: Freeciv-tao-client

Post by Lachu »

It now compile. I copy source from stub, but didn't add some sources into list of sources to compile for tao client in client/Makefile.am. I have in mind gui_interface.c and gui_cb_setter.c
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: Freeciv-tao-client

Post by Lachu »

I cannot find a callback for start window/screen. Where it should be created?
louis94
Hardened
Posts: 270
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Freeciv-tao-client

Post by louis94 »

Lachu wrote:I cannot find a callback for start window/screen. Where it should be created?
Everything can be created in ui_main(). real_set_client_page() is called on page switching (see pages_g.h, notably enum client_pages at line 19).

Louis
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: Freeciv-tao-client

Post by Lachu »

So I would create windows in real_set_client_page. I have another questions. Why in options.h are options separately for each client? How to select one kind of options, like theme string?
louis94
Hardened
Posts: 270
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Freeciv-tao-client

Post by louis94 »

Lachu wrote:Why in options.h are options separately for each client?
Because not all clients support the same options.
Lachu wrote:How to select one kind of options, like theme string?

Code: Select all

char *value;
options_iterate(client_optset, poption) {
  if (option_type(poption) == OT_STRING
      && strcmp(option_name(poption), "gui_tao_an_option")) {
    value = option_str_get(poption);
    /* Do something */
  }
} options_iterate_end;
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: Freeciv-tao-client

Post by Lachu »

I updated data/gui-tao/Freeciv/gui-gtk-3.0/Makefile.am and ran ./autogen --enable-client=tao, but Makefile/Makefile.in wasn't update. I decided to remove dirty files and ran ./autogen --enable-client=tao, but missing files wasn't recreated.
Post Reply