Skip to content

Commit 75c6cac

Browse files
authored
Merge pull request #262 from spacevx/pr/01-small-fixes
Array_DecodeZero, WorldSpaceCenter and fast detail sprite fixes
2 parents ee46008 + c42afa1 commit 75c6cac

5 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎Game.Client/C_Rope.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@ public partial class C_RopeKeyframe : C_BaseEntity
8181
public float Width;
8282
[NetworkVar("m_flScrollSpeed")]
8383
public float ScrollSpeed;
84+
85+
public override Vector3 WorldSpaceCenter() => GetAbsOrigin();
8486
}
8587

‎Game.Client/DetailObjectSystem.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ int BuildOutSortedSprites(FastDetailLeafSpriteList data, in Vector3 viewOrigin,
12841284
FastSpriteX4[] sprites = data.Sprites!;
12851285
SortInfo[] outSort = FastSortInfos!;
12861286
FastSpriteQuadBuildoutBufferX4[] quadBufferOut = BuildoutBuffer!;
1287-
int spriteIdx = 0;
1287+
int spriteIdx = data.StartSIMDSprite;
12881288
int outIdx = 0;
12891289
int quadIdx = 0;
12901290
int curidx = 0;

‎Game.Shared/BaseEntityShared.cs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,7 @@ public static void SetPredictionRandomSeed(in UserCmd cmd) {
635635
}
636636

637637
public BasePlayer? GetSimulatingPlayer() => PlayerSimulationOwner.Get();
638-
public virtual ref readonly Vector3 WorldSpaceCenter() {
639-
return ref GetAbsOrigin(); // todo
640-
}
638+
public virtual Vector3 WorldSpaceCenter() => CollisionProp().WorldSpaceCenter();
641639

642640
public void SetPlayerSimulated(BasePlayer owner) {
643641
b_IsPlayerSimulated = true;

‎Game.Shared/Beam.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public partial class
2929
#endif
3030
: BaseEntity
3131
{
32+
// todo: WorldSpaceCenter override ((GetAbsStartPos() + GetAbsEndPos()) * 0.5f), it needs GetAbsStartPos and GetAbsEndPos ported first
33+
3234
public const int ATTACHMENT_INDEX_BITS = 5;
3335
public const float MAX_BEAM_WIDTH = 102.3f;
3436
public const float MAX_BEAM_SCROLLSPEED = 100f;

‎Source.Engine/DtEncode.cs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,11 @@ public static void Array_FastCopy(SendProp sendProp, RecvProp recvProp, object s
638638
}
639639
}
640640

641-
public static void Array_DecodeZero(ref DecodeInfo info) => throw new NotImplementedException();
641+
public static void Array_DecodeZero(ref DecodeInfo info) {
642+
ArrayLengthRecvProxyFn? lengthProxy = info.RecvProxyData.RecvProp.GetArrayLengthProxy();
643+
if (lengthProxy != null)
644+
lengthProxy(info.Object, info.RecvProxyData.ObjectID, 0);
645+
}
642646
public static void Array_Encode(object instance, ref DVariant var, SendProp prop, bf_write writeOut, int objectID) {
643647
SendProp? arrayProp = prop.GetArrayProp();
644648
AssertMsg(arrayProp != null, $"Array_Decode: missing m_pArrayProp for SendProp '{prop.GetName()}'.");

0 commit comments

Comments
 (0)