CommandXlat.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: CommandXlat.h ///////////////////////////////////////////////////////////
  24. // Author: Steven Johnson, Dec 2001
  25. #pragma once
  26. #ifndef _H_CommandXlat
  27. #define _H_CommandXlat
  28. #include "GameClient/InGameUI.h"
  29. enum GUICommandType;
  30. //-----------------------------------------------------------------------------
  31. class CommandTranslator : public GameMessageTranslator
  32. {
  33. public:
  34. CommandTranslator();
  35. ~CommandTranslator();
  36. enum CommandEvaluateType { DO_COMMAND, DO_HINT, EVALUATE_ONLY };
  37. GameMessage::Type evaluateForceAttack( Drawable *draw, const Coord3D *pos, CommandEvaluateType type );
  38. GameMessage::Type evaluateContextCommand( Drawable *draw, const Coord3D *pos, CommandEvaluateType type );
  39. private:
  40. Int m_objective;
  41. Bool m_teamExists; ///< is there a currently selected "team"?
  42. // these are for determining if a drag occurred or it wasjust a sloppy click
  43. ICoord2D m_mouseRightDragAnchor; // the location of a possible mouse drag start
  44. ICoord2D m_mouseRightDragLift; // the location of a possible mouse drag end
  45. UnsignedInt m_mouseRightDown; // when the mouse down happened
  46. UnsignedInt m_mouseRightUp; // when the mouse up happened
  47. GameMessage::Type createMoveToLocationMessage( Drawable *draw, const Coord3D *dest, CommandEvaluateType commandType );
  48. GameMessage::Type createAttackMessage( Drawable *draw, Drawable *other, CommandEvaluateType commandType );
  49. GameMessage::Type createEnterMessage( Drawable *enter, CommandEvaluateType commandType );
  50. GameMessage::Type issueMoveToLocationCommand( const Coord3D *pos, Drawable *drawableInWay, CommandEvaluateType commandType );
  51. GameMessage::Type issueAttackCommand( Drawable *target, CommandEvaluateType commandType, GUICommandType command = (GUICommandType)0 );
  52. GameMessage::Type issueSpecialPowerCommand( const CommandButton *command, CommandEvaluateType commandType, Drawable *target, const Coord3D *pos, Object* ignoreSelObj );
  53. GameMessage::Type issueFireWeaponCommand( const CommandButton *command, CommandEvaluateType commandType, Drawable *target, const Coord3D *pos );
  54. GameMessage::Type issueCombatDropCommand( const CommandButton *command, CommandEvaluateType commandType, Drawable *target, const Coord3D *pos );
  55. virtual GameMessageDisposition translateGameMessage(const GameMessage *msg);
  56. };
  57. enum FilterTypes
  58. {
  59. FT_NULL_FILTER=0,
  60. // The following are screen filter shaders, that modify the rendered viewport after it is drawn.
  61. FT_VIEW_BW_FILTER, //filter to apply a black & white filter to the screen.
  62. FT_VIEW_MOTION_BLUR_FILTER, //filter to apply motion blur filter to screen.
  63. FT_VIEW_CROSSFADE, ///<filter to apply a cross blend between previous/current views.
  64. FT_MAX
  65. };
  66. enum FilterModes
  67. {
  68. FM_NULL_MODE = 0,
  69. // These apply to FT_VIEW_BW_FILTER
  70. FM_VIEW_BW_BLACK_AND_WHITE, // BW Filter to black & white
  71. FM_VIEW_BW_RED_AND_WHITE, // BW Filter to red & white
  72. FM_VIEW_BW_GREEN_AND_WHITE, // BW Filter to green & white
  73. // These apply to FT_VIEW_CROSSFADE
  74. FM_VIEW_CROSSFADE_CIRCLE, // Fades from previous to current view using expanding circle.
  75. FM_VIEW_CROSSFADE_FB_MASK, // Fades from previous to current using mask stored in framebuffer alpha.
  76. // These apply to FT_VIEW_MOTION_BLUR_FILTER
  77. FM_VIEW_MB_IN_AND_OUT_ALPHA, // Motion blur filter in and out alpha blur
  78. FM_VIEW_MB_IN_AND_OUT_SATURATE, // Motion blur filter in and out saturated blur
  79. FM_VIEW_MB_IN_ALPHA, // Motion blur filter in alpha blur
  80. FM_VIEW_MB_OUT_ALPHA, // Motion blur filter out alpha blur
  81. FM_VIEW_MB_IN_SATURATE, // Motion blur filter in saturated blur
  82. FM_VIEW_MB_OUT_SATURATE, // Motion blur filter out saturated blur
  83. FM_VIEW_MB_END_PAN_ALPHA, // Moton blur on screen pan (for camera tracks object mode)
  84. // NOTE: This has to be the last entry in this enum.
  85. // Add new entries before this one. jba.
  86. FM_VIEW_MB_PAN_ALPHA, // Moton blur on screen pan (for camera tracks object mode)
  87. };
  88. class PickAndPlayInfo
  89. {
  90. public:
  91. PickAndPlayInfo::PickAndPlayInfo(); //INITIALIZE THE CONSTRUCTOR IN CPP
  92. Bool m_air; //Are we attacking an airborned target?
  93. Drawable *m_drawTarget; //Do we have an override draw target?
  94. WeaponSlotType *m_weaponSlot; //Are we forcing a specific weapon slot? NULL if unspecified.
  95. SpecialPowerType m_specialPowerType; //Which special power are use using? SPECIAL_INVALID if unspecified.
  96. };
  97. extern void pickAndPlayUnitVoiceResponse( const DrawableList *list, GameMessage::Type msgType, PickAndPlayInfo *info = NULL );
  98. #endif