fix visible clip brushes
add support for the two missing content flags from re-release
This commit is contained in:
parent
8c93a4b1ff
commit
f816b433d1
|
|
@ -864,6 +864,7 @@ struct gamedef_q2_t : public gamedef_t
|
|||
if (native & Q2_CONTENTS_AREAPORTAL) result |= EWT_INVISCONTENTS_AREAPORTAL;
|
||||
if (native & Q2_CONTENTS_PLAYERCLIP) result |= EWT_INVISCONTENTS_PLAYERCLIP;
|
||||
if (native & Q2_CONTENTS_MONSTERCLIP) result |= EWT_INVISCONTENTS_MONSTERCLIP;
|
||||
if (native & Q2_CONTENTS_PROJECTILECLIP) result |= EWT_INVISCONTENTS_PROJECTILECLIP;
|
||||
if (native & Q2_CONTENTS_ORIGIN) result |= EWT_INVISCONTENTS_ORIGIN;
|
||||
|
||||
// contents flags
|
||||
|
|
@ -888,8 +889,6 @@ struct gamedef_q2_t : public gamedef_t
|
|||
if (native & Q2_CONTENTS_UNUSED_10) result |= EWT_CFLAG_Q2_UNUSED_10;
|
||||
if (native & Q2_CONTENTS_UNUSED_11) result |= EWT_CFLAG_Q2_UNUSED_11;
|
||||
if (native & Q2_CONTENTS_UNUSED_12) result |= EWT_CFLAG_Q2_UNUSED_12;
|
||||
if (native & Q2_CONTENTS_UNUSED_13) result |= EWT_CFLAG_Q2_UNUSED_13;
|
||||
if (native & Q2_CONTENTS_UNUSED_14) result |= EWT_CFLAG_Q2_UNUSED_14;
|
||||
if (native & Q2_CONTENTS_UNUSED_30) result |= EWT_CFLAG_Q2_UNUSED_30;
|
||||
if (native & Q2_CONTENTS_UNUSED_31) result |= EWT_CFLAG_Q2_UNUSED_31;
|
||||
|
||||
|
|
@ -911,6 +910,7 @@ struct gamedef_q2_t : public gamedef_t
|
|||
if (contents.flags & EWT_INVISCONTENTS_ORIGIN) result |= Q2_CONTENTS_ORIGIN;
|
||||
if (contents.flags & EWT_INVISCONTENTS_PLAYERCLIP) result |= Q2_CONTENTS_PLAYERCLIP;
|
||||
if (contents.flags & EWT_INVISCONTENTS_MONSTERCLIP) result |= Q2_CONTENTS_MONSTERCLIP;
|
||||
if (contents.flags & EWT_INVISCONTENTS_PROJECTILECLIP) result |= Q2_CONTENTS_PROJECTILECLIP;
|
||||
if (contents.flags & EWT_INVISCONTENTS_AREAPORTAL) result |= Q2_CONTENTS_AREAPORTAL;
|
||||
if (contents.flags & EWT_INVISCONTENTS_ILLUSIONARY_VISBLOCKER) throw std::invalid_argument("illusionary visblocker not a contents in Q2");
|
||||
if (contents.flags & EWT_CFLAG_DETAIL) result |= Q2_CONTENTS_DETAIL;
|
||||
|
|
@ -932,8 +932,6 @@ struct gamedef_q2_t : public gamedef_t
|
|||
if (contents.flags & EWT_CFLAG_Q2_UNUSED_10) result |= Q2_CONTENTS_UNUSED_10;
|
||||
if (contents.flags & EWT_CFLAG_Q2_UNUSED_11) result |= Q2_CONTENTS_UNUSED_11;
|
||||
if (contents.flags & EWT_CFLAG_Q2_UNUSED_12) result |= Q2_CONTENTS_UNUSED_12;
|
||||
if (contents.flags & EWT_CFLAG_Q2_UNUSED_13) result |= Q2_CONTENTS_UNUSED_13;
|
||||
if (contents.flags & EWT_CFLAG_Q2_UNUSED_14) result |= Q2_CONTENTS_UNUSED_14;
|
||||
if (contents.flags & EWT_CFLAG_Q2_UNUSED_30) result |= Q2_CONTENTS_UNUSED_30;
|
||||
if (contents.flags & EWT_CFLAG_Q2_UNUSED_31) result |= Q2_CONTENTS_UNUSED_31;
|
||||
|
||||
|
|
|
|||
|
|
@ -566,6 +566,8 @@ static const char *DefaultTextureForContents(const mbsp_t *bsp, const contentfla
|
|||
return "e1u1/clip";
|
||||
} else if (native & Q2_CONTENTS_MONSTERCLIP) {
|
||||
return "e1u1/clip_mon";
|
||||
} else if (native & Q2_CONTENTS_PROJECTILECLIP) {
|
||||
return "e1u1/clip_proj";
|
||||
} else if (native & Q2_CONTENTS_AREAPORTAL) {
|
||||
return "e1u1/trigger";
|
||||
}
|
||||
|
|
@ -591,9 +593,13 @@ static void OverrideTextureForContents(
|
|||
if (bsp->loadversion->game->id == GAME_QUAKE_II) {
|
||||
int native = bsp->loadversion->game->contents_to_native(contents);
|
||||
|
||||
if (native & (Q2_CONTENTS_PLAYERCLIP | Q2_CONTENTS_MONSTERCLIP)) {
|
||||
if (!(native & Q2_CONTENTS_PLAYERCLIP)) {
|
||||
if (native & (Q2_CONTENTS_PLAYERCLIP | Q2_CONTENTS_MONSTERCLIP | Q2_CONTENTS_PROJECTILECLIP)) {
|
||||
if ((native & Q2_CONTENTS_PLAYERCLIP) == Q2_CONTENTS_PLAYERCLIP) {
|
||||
side.texture_name = "e1u1/clip_player";
|
||||
} else if ((native & Q2_CONTENTS_MONSTERCLIP) == Q2_CONTENTS_MONSTERCLIP) {
|
||||
side.texture_name = "e1u1/clip_mon";
|
||||
} else if ((native & Q2_CONTENTS_PROJECTILECLIP) == Q2_CONTENTS_PROJECTILECLIP) {
|
||||
side.texture_name = "e1u1/clip_proj";
|
||||
} else {
|
||||
side.texture_name = "e1u1/clip";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,37 +68,14 @@ enum contents_t : contents_int_t {
|
|||
EWT_LAST_VISIBLE_CONTENTS_INDEX = 8,
|
||||
EWT_LAST_VISIBLE_CONTENTS = EWT_VISCONTENTS_MIST,
|
||||
|
||||
EWT_ALL_LIQUIDS =
|
||||
EWT_VISCONTENTS_LAVA |
|
||||
EWT_VISCONTENTS_SLIME |
|
||||
EWT_VISCONTENTS_WATER,
|
||||
|
||||
EWT_ALL_VISIBLE_CONTENTS =
|
||||
EWT_VISCONTENTS_SOLID |
|
||||
EWT_VISCONTENTS_SKY |
|
||||
EWT_VISCONTENTS_DETAIL_WALL |
|
||||
EWT_VISCONTENTS_WINDOW |
|
||||
EWT_VISCONTENTS_AUX |
|
||||
EWT_VISCONTENTS_LAVA |
|
||||
EWT_VISCONTENTS_SLIME |
|
||||
EWT_VISCONTENTS_WATER |
|
||||
EWT_VISCONTENTS_MIST,
|
||||
|
||||
EWT_INVISCONTENTS_ORIGIN = nth_bit<uint64_t>(9), // removed before bsping an entity
|
||||
// Q1 clip
|
||||
EWT_INVISCONTENTS_PLAYERCLIP = nth_bit<uint64_t>(10),
|
||||
EWT_INVISCONTENTS_MONSTERCLIP = nth_bit<uint64_t>(11),
|
||||
EWT_INVISCONTENTS_AREAPORTAL = nth_bit<uint64_t>(12),
|
||||
EWT_INVISCONTENTS_ILLUSIONARY_VISBLOCKER = nth_bit<uint64_t>(13),
|
||||
EWT_INVISCONTENTS_NO_WATERJUMP = nth_bit<uint64_t>(13), // re-release
|
||||
EWT_INVISCONTENTS_PROJECTILECLIP = nth_bit<uint64_t>(14), // re-release
|
||||
|
||||
EWT_ALL_INVISCONTENTS =
|
||||
EWT_INVISCONTENTS_ORIGIN |
|
||||
EWT_INVISCONTENTS_PLAYERCLIP |
|
||||
EWT_INVISCONTENTS_MONSTERCLIP |
|
||||
EWT_INVISCONTENTS_AREAPORTAL |
|
||||
EWT_INVISCONTENTS_ILLUSIONARY_VISBLOCKER,
|
||||
|
||||
EWT_CFLAG_DETAIL = nth_bit<uint64_t>(14), // brushes to be added after vis leafs
|
||||
EWT_CFLAG_MIRROR_INSIDE = nth_bit<uint64_t>(15),
|
||||
EWT_CFLAG_MIRROR_INSIDE_SET = nth_bit<uint64_t>(16),
|
||||
EWT_CFLAG_SUPPRESS_CLIPPING_SAME_TYPE = nth_bit<uint64_t>(17),
|
||||
|
|
@ -114,17 +91,43 @@ enum contents_t : contents_int_t {
|
|||
EWT_CFLAG_MONSTER = nth_bit<uint64_t>(26), // disallowed in maps, only for gamecode use
|
||||
EWT_CFLAG_DEADMONSTER = nth_bit<uint64_t>(27), // disallowed in maps, only for gamecode use
|
||||
|
||||
EWT_INVISCONTENTS_ILLUSIONARY_VISBLOCKER = nth_bit<uint64_t>(28),
|
||||
EWT_CFLAG_DETAIL = nth_bit<uint64_t>(29), // brushes to be added after vis leafs
|
||||
|
||||
// unused Q2 contents bits - just present here so we can roundtrip all 32-bit Q2 contents
|
||||
EWT_CFLAG_Q2_UNUSED_7 = nth_bit<uint64_t>(28),
|
||||
EWT_CFLAG_Q2_UNUSED_8 = nth_bit<uint64_t>(29),
|
||||
EWT_CFLAG_Q2_UNUSED_9 = nth_bit<uint64_t>(30),
|
||||
EWT_CFLAG_Q2_UNUSED_10 = nth_bit<uint64_t>(31),
|
||||
EWT_CFLAG_Q2_UNUSED_11 = nth_bit<uint64_t>(32),
|
||||
EWT_CFLAG_Q2_UNUSED_12 = nth_bit<uint64_t>(33),
|
||||
EWT_CFLAG_Q2_UNUSED_13 = nth_bit<uint64_t>(34),
|
||||
EWT_CFLAG_Q2_UNUSED_14 = nth_bit<uint64_t>(35),
|
||||
EWT_CFLAG_Q2_UNUSED_7 = nth_bit<uint64_t>(30),
|
||||
EWT_CFLAG_Q2_UNUSED_8 = nth_bit<uint64_t>(31),
|
||||
EWT_CFLAG_Q2_UNUSED_9 = nth_bit<uint64_t>(32),
|
||||
EWT_CFLAG_Q2_UNUSED_10 = nth_bit<uint64_t>(33),
|
||||
EWT_CFLAG_Q2_UNUSED_11 = nth_bit<uint64_t>(34),
|
||||
EWT_CFLAG_Q2_UNUSED_12 = nth_bit<uint64_t>(35),
|
||||
EWT_CFLAG_Q2_UNUSED_30 = nth_bit<uint64_t>(36),
|
||||
EWT_CFLAG_Q2_UNUSED_31 = nth_bit<uint64_t>(37)
|
||||
EWT_CFLAG_Q2_UNUSED_31 = nth_bit<uint64_t>(37),
|
||||
|
||||
// masks
|
||||
EWT_ALL_LIQUIDS =
|
||||
EWT_VISCONTENTS_LAVA |
|
||||
EWT_VISCONTENTS_SLIME |
|
||||
EWT_VISCONTENTS_WATER,
|
||||
|
||||
EWT_ALL_VISIBLE_CONTENTS =
|
||||
EWT_VISCONTENTS_SOLID |
|
||||
EWT_VISCONTENTS_SKY |
|
||||
EWT_VISCONTENTS_DETAIL_WALL |
|
||||
EWT_VISCONTENTS_WINDOW |
|
||||
EWT_VISCONTENTS_AUX |
|
||||
EWT_VISCONTENTS_LAVA |
|
||||
EWT_VISCONTENTS_SLIME |
|
||||
EWT_VISCONTENTS_WATER |
|
||||
EWT_VISCONTENTS_MIST,
|
||||
|
||||
EWT_ALL_INVISCONTENTS =
|
||||
EWT_INVISCONTENTS_ORIGIN |
|
||||
EWT_INVISCONTENTS_PLAYERCLIP |
|
||||
EWT_INVISCONTENTS_MONSTERCLIP |
|
||||
EWT_INVISCONTENTS_AREAPORTAL |
|
||||
EWT_INVISCONTENTS_ILLUSIONARY_VISBLOCKER |
|
||||
EWT_INVISCONTENTS_PROJECTILECLIP,
|
||||
};
|
||||
|
||||
struct gamedef_t;
|
||||
|
|
@ -202,6 +205,15 @@ struct contentflags_t
|
|||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & EWT_INVISCONTENTS_PLAYERCLIP) {
|
||||
return 10;
|
||||
} else if (flags & EWT_INVISCONTENTS_MONSTERCLIP) {
|
||||
return 11;
|
||||
} else if (flags & EWT_INVISCONTENTS_PROJECTILECLIP) {
|
||||
return 14;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,8 +116,8 @@ enum q2_contents_t : int32_t
|
|||
Q2_CONTENTS_UNUSED_10 = nth_bit(10),
|
||||
Q2_CONTENTS_UNUSED_11 = nth_bit(11),
|
||||
Q2_CONTENTS_UNUSED_12 = nth_bit(12),
|
||||
Q2_CONTENTS_UNUSED_13 = nth_bit(13),
|
||||
Q2_CONTENTS_UNUSED_14 = nth_bit(14),
|
||||
Q2_CONTENTS_NO_WATERJUMP = nth_bit(13), // liquid-only; re-release
|
||||
Q2_CONTENTS_PROJECTILECLIP = nth_bit(14), // like playerclip/monsterclip, but only affects projectiles
|
||||
|
||||
Q2_LAST_VISIBLE_CONTENTS = Q2_CONTENTS_MIST,
|
||||
Q2_ALL_VISIBLE_CONTENTS = Q2_CONTENTS_SOLID | Q2_CONTENTS_WINDOW | Q2_CONTENTS_AUX | Q2_CONTENTS_LAVA |
|
||||
|
|
|
|||
Loading…
Reference in New Issue