123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624 |
- //---------------------------------------------------------------------------
- //
- // Appear.h -- File contains the Basic Game Appearance Declaration
- //
- //---------------------------------------------------------------------------//
- // Copyright (C) Microsoft Corporation. All rights reserved. //
- //===========================================================================//
- #ifndef APPEAR_H
- #define APPEAR_H
- //---------------------------------------------------------------------------
- // Include Files
- #ifndef DAPPEAR_H
- #include "dappear.h"
- #endif
- #ifndef DAPRTYPE_H
- #include "daprtype.h"
- #endif
- #ifndef FLOATHELP_H
- #include "floathelp.h"
- #endif
- #include <stuff\stuff.hpp>
- //---------------------------------------------------------------------------
- // Macro definitions
- #ifndef MAX_ULONG
- #define MAX_ULONG 0x70000000 //Must be able to square this and still get big number!!
- #endif
- #ifndef NO_ERR
- #define NO_ERR 0
- #endif
- #define HUD_DEPTH 0.0001f //HUD Objects draw over everything else.
- #define WIDTH 19 // really half the width...
- #define HEIGHT 4
- #define BARTEST 0.001f
- extern FloatHelpPtr globalFloatHelp;
- extern unsigned long currentFloatHelp;
- // would have loved to make object flags, but it looks like we're out...
- #define DRAW_NORMAL 0x00
- #define DRAW_BARS 0x01
- #define DRAW_TEXT 0x02
- #define DRAW_BRACKETS 0x04
- #define DRAW_COLORED 0x08
- struct _ScenarioMapCellInfo;
- struct _GameObjectFootPrint;
- //---------------------------------------------------------------------------
- // Class definitions
- class Appearance
- {
- //Data Members
- //-------------
- protected:
- Stuff::Vector4D screenPos; //Where am I on Screen? INCLUDES correct Z now!
- bool visible; //Current FOW status to help draw
- bool seen; //Current FOW status to help draw
-
- public:
- bool inView; //Can I be Seen?
- Stuff::Vector4D upperLeft; //used to draw select boxes. Can be 3D Now!
- Stuff::Vector4D lowerRight; //used to draw select boxes.
-
- float barStatus; //Status Bar Length.
- DWORD barColor; //Status Bar Color.
-
- //Member Functions
- //-----------------
- public:
- void * operator new (size_t mySize);
- void operator delete (void * us);
-
- Appearance (void)
- {
- inView = FALSE;
- screenPos.x = screenPos.y = screenPos.z = screenPos.w = -999.0f;
- upperLeft.x = upperLeft.y = upperLeft.z = upperLeft.w = -999.0f;
- lowerRight.x = lowerRight.y = lowerRight.z = lowerRight.w = -999.0f;
- barStatus = 1.0;
- barColor = 0x0;
- visible = seen = false;
- }
-
- virtual void init (AppearanceTypePtr tree = NULL, GameObjectPtr obj = NULL)
- {
- inView = FALSE;
- screenPos.x = screenPos.y = screenPos.z = screenPos.w = -999.0f;
- upperLeft.x = upperLeft.y = upperLeft.z = upperLeft.w = -999.0f;
- lowerRight.x = lowerRight.y = lowerRight.z = lowerRight.w = -999.0f;
- barStatus = 1.0;
- barColor = 0x0;
- visible = seen = false;
- }
-
- virtual void initFX (void)
- {
- }
- virtual void destroy (void)
- {
- init();
- }
-
- virtual ~Appearance (void)
- {
- destroy();
- }
-
- virtual long update (bool animate = true)
- {
- //Perform any frame by frame tasks. Animations, etc.
- return NO_ERR;
- }
-
- virtual long render (long depthFixup = 0)
- {
- //Decide whether or not I can be seen and add me to render list.
- return NO_ERR;
- }
- virtual long renderShadows (void)
- {
- return NO_ERR;
- }
- virtual AppearanceTypePtr getAppearanceType (void)
- {
- return NULL;
- }
- bool canBeSeen (void)
- {
- return(inView);
- }
-
- void setInView (bool viewStatus)
- {
- inView = viewStatus;
- }
-
- Stuff::Vector4D getScreenPos (void)
- {
- return screenPos;
- }
- virtual bool isMouseOver (float px, float py)
- {
- return FALSE; //Never over a base appearance
- }
-
- virtual void drawSelectBox (DWORD color);
- virtual void drawSelectBrackets (DWORD color);
- virtual void drawBars (void);
- void drawTextHelp (char *text);
- void drawTextHelp (char *text, unsigned long color);
- void drawPilotName(char *text, unsigned long color ); // next line below drawTextHelp
-
- virtual bool recalcBounds (void)
- {
- //-------------------------------------------------------
- // returns TRUE is this appearance is Visible this frame
- inView = FALSE;
- return inView;
- }
- virtual void setGesture (unsigned long gestureId)
- {
- }
- virtual long setGestureGoal (long gestureId)
- {
- return 0;
- }
-
- virtual void setVelocityPercentage (float percent)
- {
- }
-
- virtual long getFrameNumber (void)
- {
- return 0;
- }
- virtual unsigned long getAppearanceClass (void)
- {
- return BASE_APPEARANCE;
- }
-
- virtual void setBarStatus (float stat)
- {
- barStatus = stat;
- if (barStatus > 1.0f)
- barStatus = 1.0f;
- }
- virtual void setBarColor (DWORD clr)
- {
- barColor = clr;
- }
- virtual bool getInTransition (void)
- {
- return false;
- }
- virtual long getNumFramesInGesture (long gestureId)
- {
- return 0;
- }
- virtual long getOldGestureGoal (void)
- {
- return -1;
- }
-
- virtual long getCurrentGestureGoal (void)
- {
- return -1;
- }
- virtual long getCurrentGestureId (void)
- {
- return 0;
- }
- virtual bool isInJump (void)
- {
- return false;
- }
- virtual bool isJumpSetup (void)
- {
- return false;
- }
- virtual bool isJumpAirborne (void)
- {
- return false;
- }
- virtual bool haveFallen (void)
- {
- return false;
- }
- virtual void setObjectNameId (long objId)
- {
- }
- virtual bool setJumpParameters (Stuff::Vector3D &jumpGoal)
- {
- return false;
- }
- virtual void setWeaponNodeUsed (long nodeId)
- {
- }
- virtual long getLowestWeaponNode (void)
- {
- return 0;
- }
-
- virtual long getWeaponNode (long weapontype)
- {
- return 0;
- }
-
- virtual float getWeaponNodeRecycle (long node)
- {
- return 0.0f;
- }
- virtual void resetWeaponNodes (void)
- {
- }
- virtual void setWeaponNodeRecycle(long nodeId, float time)
- {
- }
-
- virtual Stuff::Vector3D getSmokeNodePosition (long nodeId)
- {
- Stuff::Vector3D position;
- position.x = position.y = position.z = 0.0f;
- return position;
- }
-
- virtual Stuff::Vector3D getDustNodePosition (long nodeId)
- {
- Stuff::Vector3D position;
- position.x = position.y = position.z = 0.0f;
- return position;
- }
-
- virtual Stuff::Vector3D getWeaponNodePosition (long node)
- {
- Stuff::Vector3D position;
- position.x = position.y = position.z = 0.0f;
- return position;
- }
- virtual Stuff::Vector3D getNodePosition (long nodeId)
- {
- Stuff::Vector3D position;
- position.x = position.y = position.z = 0.0f;
- return position;
- }
-
- virtual Stuff::Vector3D getNodeNamePosition (char *nodeName)
- {
- Stuff::Vector3D position;
- position.x = position.y = position.z = 0.0f;
- return position;
- }
-
- virtual Stuff::Vector3D getNodeIdPosition (long nodeId)
- {
- Stuff::Vector3D position;
- position.x = position.y = position.z = 0.0f;
- return position;
- }
- virtual void setCombatMode (bool combatMode)
- {
- }
- virtual float getVelocityMagnitude (void)
- {
- return 0.0f;
- }
- virtual float getVelocityOfGesture (long gestureId)
- {
- return 0.0f;
- }
- virtual void setBrake (bool brake)
- {
- }
- virtual void setObjectParameters (Stuff::Vector3D &pos, float rot, long selected, long team, long homeRelations)
- {
- }
- virtual void setMoverParameters (float turretRot, float lArmRot = 0.0f, float rArmRot = 0.0f, bool isAirborne = false)
- {
- }
- virtual void updateFootprints (void)
- {
- }
- virtual void setPaintScheme (void)
- {
- }
- virtual void setPaintScheme (DWORD red, DWORD green, DWORD blue)
- {
- }
- virtual void getPaintScheme (DWORD &red, DWORD &green, DWORD &blue)
- {
- }
- virtual void resetPaintScheme (DWORD red, DWORD green, DWORD blue)
- {
- }
-
- virtual void setDebugMoveMode (void)
- {
- }
- virtual void setSingleStepMode (void)
- {
- }
-
- virtual void setPrevFrame (void)
- {
- }
-
- virtual void setNextFrame (void)
- {
- }
- virtual void setVisibility (bool vis, bool sen)
- {
- visible = vis;
- seen = sen;
- }
- virtual void setSensorLevel (long lvl)
- {
- }
-
- virtual void hitFront (void)
- {
- }
-
- virtual void hitBack (void)
- {
- }
-
- virtual void hitLeft (void)
- {
- }
- virtual void hitRight (void)
- {
- }
-
- virtual void setObjStatus (long oStatus)
- {
- }
-
- virtual long calcCellsCovered (Stuff::Vector3D& pos, short* cellList) {
- return(0);
- }
- virtual void markTerrain (_ScenarioMapCellInfo* pInfo, int type, int counter)
- {
- }
-
- virtual long markMoveMap (bool passable, long* lineOfSightRect, bool useheight = false, short* cellList = NULL)
- {
- return(0);
- }
- virtual void markLOS (bool clearIt = false)
- {
-
- }
-
- virtual void scale (float scaleFactor)
- {
- }
-
- virtual bool playDestruction (void)
- {
- return false;
- }
-
- virtual float getRadius (void)
- {
- return 0.0f;
- }
-
- virtual void flashBuilding (float duration, float flashDuration, DWORD color)
- {
- }
-
- virtual void setHighlightColor( long argb )
- {
- }
-
- virtual float getTopZ (void)
- {
- return 0.0f;
- }
-
- virtual void blowLeftArm (void)
- {
- }
-
- virtual void blowRightArm (void)
- {
- }
- virtual void setFilterState (bool state)
- {
- }
-
- virtual Stuff::Vector3D getVelocity (void)
- {
- Stuff::Vector3D result;
- result.Zero();
- return result;
- }
- virtual bool isSelectable()
- {
- return true;
- }
-
- virtual void setIsHudElement (void)
- {
- }
- virtual long getObjectNameId ()
- {
- return -1;
- }
- virtual bool getIsLit (void)
- {
- return false;
- }
-
- virtual void setLightsOut (bool lightFlag)
- {
-
- }
- virtual bool PerPolySelect (long mouseX, long mouseY)
- {
- return true;
- }
- virtual bool isForestClump (void)
- {
- return false;
- }
-
- virtual Stuff::Point3D getRootNodeCenter (void)
- {
- Stuff::Point3D result;
- result.Zero();
- return result;
- }
-
- virtual void setAlphaValue (BYTE aVal)
- {
- }
- void drawIcon( unsigned long bmpHandle, unsigned long bmpWidth,
- unsigned long bmpHeight, unsigned long color,
- unsigned long where = 0 );
-
- virtual void setSkyNumber (long skyNum)
- {
- }
- virtual void setMechName( const char* pName ){}
-
- virtual void startSmoking (long smokeLvl)
- {
- }
-
- virtual void startWaterWake (void)
- {
- }
-
- virtual void stopWaterWake (void)
- {
- }
-
- virtual void playEjection (void)
- {
- }
-
- virtual void startActivity (long effectId, bool loop)
- {
- }
-
- virtual void stopActivity (void)
- {
- }
- virtual Stuff::Vector3D getHitNode (void)
- {
- Stuff::Point3D result;
- result.Zero();
- return result;
- }
- virtual Stuff::Vector3D getHitNodeLeft (void)
- {
- Stuff::Point3D result;
- result.Zero();
- return result;
- }
- virtual Stuff::Vector3D getHitNodeRight (void)
- {
- Stuff::Point3D result;
- result.Zero();
- return result;
- }
- virtual bool getRightArmOff (void)
- {
- return false;
- }
- virtual bool getLeftArmOff (void)
- {
- return false;
- }
- virtual bool hasAnimationData (long gestureId)
- {
- return false;
- }
- };
- //---------------------------------------------------------------------------
- #endif
|