• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionc641b891b3d9ba3eaaff0f53b5e4de8edb30f157 (tree)
Time2019-01-08 22:48:04
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #38852 notice_stuff() と update_stuff() を update_creature() へ統一。 / Unify notice_stuff() and update_stuff() to update_creature().

Change Summary

Incremental Difference

--- a/src/xtra1.c
+++ b/src/xtra1.c
@@ -5670,149 +5670,6 @@ void calc_bonuses(void)
56705670 }
56715671
56725672
5673-
5674-/*!
5675- * @brief p_ptr->update のフラグに応じた更新をまとめて行う / Handle "p_ptr->update"
5676- * @return なし
5677- * @details 更新処理の対象はアイテムの自動破壊/アイテムの結合/アイテムの並び替え。
5678- */
5679-static void notice_stuff(void)
5680-{
5681- if(!p_ptr->update) return;
5682-
5683- /* Actually do auto-destroy */
5684- if(p_ptr->update & (PU_AUTODESTROY))
5685- {
5686- p_ptr->update &= ~(PU_AUTODESTROY);
5687- autopick_delayed_alter();
5688- }
5689-
5690- /* Combine the pack */
5691- if (p_ptr->update & (PU_COMBINE))
5692- {
5693- p_ptr->update &= ~(PU_COMBINE);
5694- combine_pack();
5695- }
5696-
5697- /* Reorder the pack */
5698- if (p_ptr->update & (PU_REORDER))
5699- {
5700- p_ptr->update &= ~(PU_REORDER);
5701- reorder_pack();
5702- }
5703-}
5704-
5705-
5706-/*!
5707- * @brief p_ptr->update のフラグに応じた更新をまとめて行う / Handle "p_ptr->update"
5708- * @return なし
5709- * @details 更新処理の対象はプレイヤーの能力修正/光源寿命/HP/MP/魔法の学習状態、他多数の外界の状態判定。
5710- */
5711-static void update_stuff(void)
5712-{
5713- if (!p_ptr->update) return;
5714-
5715- if (p_ptr->update & (PU_BONUS))
5716- {
5717- p_ptr->update &= ~(PU_BONUS);
5718- calc_bonuses();
5719- }
5720-
5721- if (p_ptr->update & (PU_TORCH))
5722- {
5723- p_ptr->update &= ~(PU_TORCH);
5724- calc_torch();
5725- }
5726-
5727- if (p_ptr->update & (PU_HP))
5728- {
5729- p_ptr->update &= ~(PU_HP);
5730- calc_hitpoints();
5731- }
5732-
5733- if (p_ptr->update & (PU_MANA))
5734- {
5735- p_ptr->update &= ~(PU_MANA);
5736- calc_mana();
5737- }
5738-
5739- if (p_ptr->update & (PU_SPELLS))
5740- {
5741- p_ptr->update &= ~(PU_SPELLS);
5742- calc_spells();
5743- }
5744-
5745- /* Character is not ready yet, no screen updates */
5746- if (!character_generated) return;
5747-
5748- /* Character is in "icky" mode, no screen updates */
5749- if (character_icky) return;
5750-
5751- if (p_ptr->update & (PU_UN_LITE))
5752- {
5753- p_ptr->update &= ~(PU_UN_LITE);
5754- forget_lite();
5755- }
5756-
5757- if (p_ptr->update & (PU_UN_VIEW))
5758- {
5759- p_ptr->update &= ~(PU_UN_VIEW);
5760- forget_view();
5761- }
5762-
5763- if (p_ptr->update & (PU_VIEW))
5764- {
5765- p_ptr->update &= ~(PU_VIEW);
5766- update_view();
5767- }
5768-
5769- if (p_ptr->update & (PU_LITE))
5770- {
5771- p_ptr->update &= ~(PU_LITE);
5772- update_lite();
5773- }
5774-
5775-
5776- if (p_ptr->update & (PU_FLOW))
5777- {
5778- p_ptr->update &= ~(PU_FLOW);
5779- update_flow();
5780- }
5781-
5782- if (p_ptr->update & (PU_DISTANCE))
5783- {
5784- p_ptr->update &= ~(PU_DISTANCE);
5785-
5786- /* Still need to call update_monsters(FALSE) after update_mon_lite() */
5787- /* p_ptr->update &= ~(PU_MONSTERS); */
5788-
5789- update_monsters(TRUE);
5790- }
5791-
5792- if (p_ptr->update & (PU_MON_LITE))
5793- {
5794- p_ptr->update &= ~(PU_MON_LITE);
5795- update_mon_lite();
5796- }
5797-
5798- /*
5799- * Mega-Hack -- Delayed visual update
5800- * Only used if update_view(), update_lite() or update_mon_lite() was called
5801- */
5802- if (p_ptr->update & (PU_DELAY_VIS))
5803- {
5804- p_ptr->update &= ~(PU_DELAY_VIS);
5805- delayed_visual_update();
5806- }
5807-
5808- if (p_ptr->update & (PU_MONSTERS))
5809- {
5810- p_ptr->update &= ~(PU_MONSTERS);
5811- update_monsters(FALSE);
5812- }
5813-}
5814-
5815-
58165673 /*!
58175674 * @brief p_ptr->redraw のフラグに応じた更新をまとめて行う / Handle "p_ptr->redraw"
58185675 * @return なし
@@ -6103,8 +5960,7 @@ static void window_stuff(void)
61035960 */
61045961 void handle_stuff(void)
61055962 {
6106- if (p_ptr->update) notice_stuff();
6107- if (p_ptr->update) update_stuff();
5963+ if (p_ptr->update) update_creature();
61085964 if (p_ptr->redraw) redraw_stuff();
61095965 if (p_ptr->window) window_stuff();
61105966 }
@@ -6115,10 +5971,135 @@ void update_output(void)
61155971 if (p_ptr->window) window_stuff();
61165972 }
61175973
5974+/*!
5975+ * @brief p_ptr->update のフラグに応じた更新をまとめて行う / Handle "p_ptr->update"
5976+ * @return なし
5977+ * @details 更新処理の対象はプレイヤーの能力修正/光源寿命/HP/MP/魔法の学習状態、他多数の外界の状態判定。
5978+ */
61185979 void update_creature(void)
61195980 {
6120- if (p_ptr->update) notice_stuff();
6121- if (p_ptr->update) update_stuff();
5981+
5982+ if (!p_ptr->update) return;
5983+
5984+ /* Actually do auto-destroy */
5985+ if (p_ptr->update & (PU_AUTODESTROY))
5986+ {
5987+ p_ptr->update &= ~(PU_AUTODESTROY);
5988+ autopick_delayed_alter();
5989+ }
5990+
5991+ /* Combine the pack */
5992+ if (p_ptr->update & (PU_COMBINE))
5993+ {
5994+ p_ptr->update &= ~(PU_COMBINE);
5995+ combine_pack();
5996+ }
5997+
5998+ /* Reorder the pack */
5999+ if (p_ptr->update & (PU_REORDER))
6000+ {
6001+ p_ptr->update &= ~(PU_REORDER);
6002+ reorder_pack();
6003+ }
6004+
6005+ if (p_ptr->update & (PU_BONUS))
6006+ {
6007+ p_ptr->update &= ~(PU_BONUS);
6008+ calc_bonuses();
6009+ }
6010+
6011+ if (p_ptr->update & (PU_TORCH))
6012+ {
6013+ p_ptr->update &= ~(PU_TORCH);
6014+ calc_torch();
6015+ }
6016+
6017+ if (p_ptr->update & (PU_HP))
6018+ {
6019+ p_ptr->update &= ~(PU_HP);
6020+ calc_hitpoints();
6021+ }
6022+
6023+ if (p_ptr->update & (PU_MANA))
6024+ {
6025+ p_ptr->update &= ~(PU_MANA);
6026+ calc_mana();
6027+ }
6028+
6029+ if (p_ptr->update & (PU_SPELLS))
6030+ {
6031+ p_ptr->update &= ~(PU_SPELLS);
6032+ calc_spells();
6033+ }
6034+
6035+ /* Character is not ready yet, no screen updates */
6036+ if (!character_generated) return;
6037+
6038+ /* Character is in "icky" mode, no screen updates */
6039+ if (character_icky) return;
6040+
6041+ if (p_ptr->update & (PU_UN_LITE))
6042+ {
6043+ p_ptr->update &= ~(PU_UN_LITE);
6044+ forget_lite();
6045+ }
6046+
6047+ if (p_ptr->update & (PU_UN_VIEW))
6048+ {
6049+ p_ptr->update &= ~(PU_UN_VIEW);
6050+ forget_view();
6051+ }
6052+
6053+ if (p_ptr->update & (PU_VIEW))
6054+ {
6055+ p_ptr->update &= ~(PU_VIEW);
6056+ update_view();
6057+ }
6058+
6059+ if (p_ptr->update & (PU_LITE))
6060+ {
6061+ p_ptr->update &= ~(PU_LITE);
6062+ update_lite();
6063+ }
6064+
6065+
6066+ if (p_ptr->update & (PU_FLOW))
6067+ {
6068+ p_ptr->update &= ~(PU_FLOW);
6069+ update_flow();
6070+ }
6071+
6072+ if (p_ptr->update & (PU_DISTANCE))
6073+ {
6074+ p_ptr->update &= ~(PU_DISTANCE);
6075+
6076+ /* Still need to call update_monsters(FALSE) after update_mon_lite() */
6077+ /* p_ptr->update &= ~(PU_MONSTERS); */
6078+
6079+ update_monsters(TRUE);
6080+ }
6081+
6082+ if (p_ptr->update & (PU_MON_LITE))
6083+ {
6084+ p_ptr->update &= ~(PU_MON_LITE);
6085+ update_mon_lite();
6086+ }
6087+
6088+ /*
6089+ * Mega-Hack -- Delayed visual update
6090+ * Only used if update_view(), update_lite() or update_mon_lite() was called
6091+ */
6092+ if (p_ptr->update & (PU_DELAY_VIS))
6093+ {
6094+ p_ptr->update &= ~(PU_DELAY_VIS);
6095+ delayed_visual_update();
6096+ }
6097+
6098+ if (p_ptr->update & (PU_MONSTERS))
6099+ {
6100+ p_ptr->update &= ~(PU_MONSTERS);
6101+ update_monsters(FALSE);
6102+ }
61226103 }
61236104
61246105 /*!
Show on old repository browser