Skip to content
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

EXTENSION: Add MVD_PEXT1_EXTRA_PFS. #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

# define MVD_PEXT1_INCLUDEINMVD (MVD_PEXT1_HIDDEN_MESSAGES)

# define MVD_PEXT1_EXTRA_PFS (1 << 8) // Send extra flags used in conjunction with FTE_PEXT_TRANS

#endif // PROTOCOL_VERSION_MVD1

//=========================================
Expand Down Expand Up @@ -291,8 +293,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// bits 11..13 are player move type bits (ZQuake extension)
#define PF_PMC_SHIFT 11
#define PF_PMC_MASK 7
#ifdef FTE_PEXT_TRANS
#define PF_ONGROUND (1<<22) // ZQuake extension, 14 offset to extra playerflags
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use indentation to indicate the parent definition.
These files are containing nothing but ifdefs and defines (more or less). Using indentation makes it easier to read.

#ifdef A
# define B
#else
# define C
# ifdef D
#  define E
# endif // D
#endif //A

Copy link
Author

@dsvensson dsvensson Jan 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tcsabina as you see here, FTE_PEXT_TRANS will be defined, and then the PF_ONGROUND and PF_SOLID would be offsetted, and the code in ezquake would have to deal with that as it should have from day one when it adopted FTE_PEXT_TRANS. So if this was merged, and ezquake got the new protocol.h file without updated cl_ents.c it would not be able to connect to any server. So this is an API change between <project ezquake> and <project protocol.h> unrelated to protocol changes.

Copy link
Author

@dsvensson dsvensson Jan 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thing is that this part of the alpha support is a trivial change in ezquake once merged in qwprot. Can be dealt with separately from the graphical updates. Could actually be merged before via ifdef's now that I think of it.

#define PF_SOLID (1<<23) // ZQuake extension, 15 offset to extra playerflags
#else
#define PF_ONGROUND (1<<14) // ZQuake extension
#define PF_SOLID (1<<15) // ZQuake extension
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add as comment the closing definition:
#endif // FTE_PEXT_TRANS


// encoded player move types
#define PMC_NORMAL 0 // normal ground movement
Expand Down Expand Up @@ -362,6 +369,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# endif // FTE_PEXT_SCALE
# ifdef FTE_PEXT_TRANS
# define U_FTE_TRANS (1<<1) //transparency value
# define PF_EXTRA_PFS (1<<15) //TRANS requires extra playerflags
# define PF_TRANS_Z (1<<17)
# endif // FTE_PEXT_TRANS
# ifdef FTE_PEXT_FATNESS
Expand Down