Angband development tasks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9647

    #16
    Originally posted by AnonymousHero
    Soooooo tempted to try to "port" my Qt frontend from T2 to Angband... My main obstactle (in T2) was macros/keymaps. (Well, that and the rather large amount of assumed-to-be-blocking calls to/from "struct term" functions.) Is the UI code independent from keymaps in 4.x? Does the engine code still do "blocking" calls to the UI and/or vice versa?
    Keymaps and the term code are now considered part of the UI, so you could do as you please with them.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • AnonymousHero
      Veteran
      • Jun 2007
      • 1393

      #17
      Originally posted by Nick
      Keymaps and the term code are now considered part of the UI, so you could do as you please with them.
      That's good news... but what about the blocking calls? Is it possible for the game engine to block indefintely and/or call back into the UI code?

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9647

        #18
        Originally posted by AnonymousHero
        That's good news... but what about the blocking calls? Is it possible for the game engine to block indefintely and/or call back into the UI code?
        Stuff has moved around a lot. The UI now runs the game, as follows:
        Code:
        /**
         * Play Angband
         */
        void play_game(bool new_game)
        {
        	/* Load a savefile or birth a character, or both */
        	start_game(new_game);
        
        	/* Get commands from the user, then process the game world until the
        	 * command queue is empty and a new player command is needed */
        	while (!player->is_dead && player->upkeep->playing) {
        		cmd_get_hook(CMD_GAME);
        		run_game_loop();
        	}
        
        	/* Close game on death or quitting */
        	close_game();
        }
        So run_game_loop() just does all the game stuff until the player gets to command again. I'm not sure if that helps - it's probably best to just start reading code
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • AnonymousHero
          Veteran
          • Jun 2007
          • 1393

          #19
          Originally posted by Nick
          Stuff has moved around a lot. The UI now runs the game, as follows:
          Code:
          /**
           * Play Angband
           */
          void play_game(bool new_game)
          {
          	/* Load a savefile or birth a character, or both */
          	start_game(new_game);
          
          	/* Get commands from the user, then process the game world until the
          	 * command queue is empty and a new player command is needed */
          	while (!player->is_dead && player->upkeep->playing) {
          		cmd_get_hook(CMD_GAME);
          		run_game_loop();
          	}
          
          	/* Close game on death or quitting */
          	close_game();
          }
          So run_game_loop() just does all the game stuff until the player gets to command again. I'm not sure if that helps - it's probably best to just start reading code
          That gives me... dangerous ideas. I think I'll have a proper look at the code tomorrow. (No promises, &c. )

          EDIT: Thanks, btw.

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎