MCPcopy Create free account
hub / github.com/NBlood/NBlood / DoSectorObjectSetScale

Function DoSectorObjectSetScale

source/sw/src/morph.cpp:39–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37void ScaleSectorObject(SECTOR_OBJECTp);
38
39short
40DoSectorObjectSetScale(short match)
41{
42 SECTOR_OBJECTp sop;
43
44 for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
45 {
46 if (sop->xmid == MAXLONG)
47 continue;
48
49 if (sop->match_event == match)
50 {
51 SET(sop->flags, SOBJ_DYNAMIC);
52 sop->PreMoveAnimator = ScaleSectorObject;
53
54 switch (sop->scale_active_type)
55 {
56 case SO_SCALE_RANDOM_POINT:
57 if (sop->scale_type == SO_SCALE_HOLD || sop->scale_type == SO_SCALE_NONE)
58 {
59 // if holding start it up
60 sop->scale_type = sop->scale_active_type;
61 }
62 else
63 {
64 // if moving set to hold
65 sop->scale_type = SO_SCALE_HOLD;
66 }
67 break;
68
69 case SO_SCALE_DEST:
70
71 sop->scale_type = sop->scale_active_type;
72
73 if (sop->scale_dist == sop->scale_dist_max)
74 {
75 // make it negative
76 if (sop->scale_speed > 0)
77 sop->scale_speed = -sop->scale_speed;
78 }
79 else if (sop->scale_dist == sop->scale_dist_min)
80 {
81 // make it positive
82 if (sop->scale_speed < 0)
83 sop->scale_speed = -sop->scale_speed;
84 }
85 else
86 {
87 // make it positive
88 if (sop->scale_speed < 0)
89 sop->scale_speed = -sop->scale_speed;
90 }
91 break;
92
93 case SO_SCALE_RANDOM:
94 case SO_SCALE_CYCLE:
95 if (sop->scale_type == SO_SCALE_HOLD)
96 {

Callers 3

DoMatchEverythingFunction · 0.85
OperateSpriteFunction · 0.85
OperateTripTriggerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected