-
Notifications
You must be signed in to change notification settings - Fork 135
chore: adjusted enums and fixed CPad functions #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,24 +15,28 @@ class CAnimBlendNode; | |
| class CAnimBlendHierarchy; | ||
| class CAnimBlendStaticAssociation; | ||
|
|
||
| enum eAnimationFlags | ||
| { | ||
| ANIMATION_STARTED = 0x1, | ||
| ANIMATION_LOOPED = 0x2, | ||
| ANIMATION_FREEZE_LAST_FRAME = 0x4, | ||
| ANIMATION_UNLOCK_LAST_FRAME = 0x8, // Animation will be stuck on last frame, if not set | ||
| ANIMATION_PARTIAL = 0x10, | ||
| ANIMATION_MOVEMENT = 0x20, | ||
| ANIMATION_TRANLSATE_X = 0x40, | ||
| ANIMATION_TRANLSATE_Y = 0x80, | ||
| ANIMATION_UNUSED_1 = 0x100, | ||
| ANIMATION_UNUSED_2 = 0x200, | ||
| ANIMATION_ADD_TO_BLEND = 0x400, | ||
| ANIMATION_UNUSED_3 = 0x800, | ||
| ANIMATION_UNUSED_4 = 0x1000, | ||
| ANIMATION_FREEZE_TRANSLATION = 0x2000, | ||
| ANIMATION_BLOCK_REFERENCED = 0x4000, | ||
| ANIMATION_INDESTRUCTIBLE = 0x8000 | ||
| enum eAnimationFlags { | ||
| ANIMATION_DEFAULT = 0, //0x0, | ||
| ANIMATION_IS_PLAYING = 1 << 0, //0x1, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why calculating flag then putting the value again in the comment? Just more visual noise. Plus comment message is fussed with
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found it clear to put shift operation and leave the old value as reference. What do you suggest? |
||
| ANIMATION_IS_LOOPED = 1 << 1, //0x2, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why adding |
||
| ANIMATION_IS_BLEND_AUTO_REMOVE = 1 << 2, //!< (0x4) Automatically `delete this` once faded out (`m_BlendAmount <= 0 && m_BlendDelta <= 0`) | ||
| ANIMATION_IS_FINISH_AUTO_REMOVE = 1 << 3, //0x8, // Animation will be stuck on last frame, if not set | ||
| ANIMATION_IS_PARTIAL = 1 << 4, //0x10, // TODO: Flag name is possibly incorrect? Following the usual logic (like `ANIMATION_MOVEMENT`), it should be `ANIMATION_GET_IN_CAR` (See `RemoveGetInAnims`) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So now we are adding "possibly incorrect" names into SDK? |
||
| ANIMATION_IS_SYNCRONISED = 1 << 5, //0x20, | ||
| ANIMATION_CAN_EXTRACT_VELOCITY = 1 << 6, //0x40, | ||
| ANIMATION_CAN_EXTRACT_X_VELOCITY = 1 << 7, //0x80, | ||
|
|
||
| // ** User defined flags ** | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does it mean? Does ANIMATION_WALK work in vanilla game? |
||
| ANIMATION_WALK = 1 << 8, //0x100, | ||
| ANIMATION_200 = 1 << 9, //0x200, | ||
| ANIMATION_DONT_ADD_TO_PARTIAL_BLEND = 1 << 10, //0x400, // Possibly should be renamed to ANIMATION_IDLE, see `CPed::PlayFootSteps()` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, adding TODO comments from reversing process into PSDK. |
||
| ANIMATION_IS_FRONT = 1 << 11, //0x800, | ||
| ANIMATION_SECONDARY_TASK_ANIM = 1 << 12, //0x1000, | ||
| // ** | ||
|
|
||
| ANIMATION_IGNORE_ROOT_TRANSLATION = 1 << 13, //0x2000, | ||
| ANIMATION_REFERENCE_BLOCK = 1 << 14, //0x4000, | ||
| ANIMATION_FACIAL = 1 << 15, //0x8000 // The animation is never destroyed if this flag is set, NO MATTER WHAT | ||
| }; | ||
|
|
||
| class PLUGIN_API CAnimBlendAssociation { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,20 @@ enum PLUGIN_API eFightingStyle | |
| STYLE_ELBOWS | ||
| }; | ||
|
|
||
| enum PLUGIN_API ePedPieceTypes | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not inside ePedPieceTypes.h?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The enum is related to the ped itself, didn't seem logical to have it separated in another .h file while other enums are living in CPed.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You already need it in CWeapon. |
||
| { | ||
| PED_COL_SPHERE_LEG = 0, | ||
| PED_COL_SPHERE_MID = 1, | ||
| PED_COL_SPHERE_HEAD = 2, | ||
| PED_PIECE_TORSO = 3, // AKA CHEST | ||
| PED_PIECE_ASS = 4, // AKA MIDSECTION | ||
| PED_PIECE_LEFT_ARM = 5, // AKA UPPERARM_L | ||
| PED_PIECE_RIGHT_ARM = 6, // AKA UPPERARM_R | ||
| PED_PIECE_LEFT_LEG = 7, // AKA LEG_L | ||
| PED_PIECE_RIGHT_LEG = 8, // AKA LEG_R | ||
| PED_PIECE_HEAD = 9 | ||
| }; | ||
|
|
||
| class CObject; | ||
| class CVehicle; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |
| #include "FxSystem_c.h" | ||
| #include "CVector2D.h" | ||
| #include "CColPoint.h" | ||
| #include "ePedPieceTypes.h" | ||
|
|
||
| enum eWeaponState : unsigned int | ||
| { | ||
|
|
@@ -23,6 +22,7 @@ enum eWeaponState : unsigned int | |
| }; | ||
|
|
||
| class CPed; | ||
| enum ePedPieceTypes : int; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing the include file and defining the enum base type here? This is spaghetti code.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needs to be forward declared due to circular dependency between CPed.h and CWeapon.h |
||
| class CVehicle; | ||
| class CColModel; | ||
|
|
||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it is improvement. Old flags are still cleaner and easier to understand.
We do not have to blindly follow whatever guys from reversed project do.
I still did not got explanation about their policy about naming things gta-reversed/gta-reversed#1133, but seems they stick to leaked names even when these are bluntly incorrect.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not agree to the old flags being easier to understand.
ANIMATION_FREEZE_LAST_FRAME -> ANIMATION_IS_BLEND_AUTO_REMOVE when it clearly is being removed when blendAmount reaches 0. How is the old name saying this from its name? From the old name I would expect the animation to freeze in the last frame, not be removed.