-
Notifications
You must be signed in to change notification settings - Fork 108
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
Remove old pre-task-system code #359
Conversation
3dbf7bd
to
811c7c0
Compare
The extra stage code in master is very outdated and not worth keeping around. The 'yumemi' branch has diverged significantly (and needs a rebase, but that's a future me problem).
Currently, the only deprecation warnings I get while compiling have to do with
Some other random things:
Nothing specific to the task system, though. Looking good. |
@@ -520,16 +520,15 @@ static void credits_finish(void *arg) { | |||
} | |||
|
|||
static void credits_process(void) { |
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.
probably this could be a task too?
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.
Probably, but that can be refactored later. Credits code isn't great in general. I took the path of least resistance here for now.
@@ -364,7 +309,7 @@ float enemy_get_hurt_radius(Enemy *enemy) { | |||
|
|||
static bool should_auto_kill(Enemy *enemy) { | |||
return | |||
(enemy->hp <= 0 && enemy->hp != _internal_ENEMY_IMMUNE) || |
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.
why is this no longer needed?
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.
It's not used anymore. The same effect can be achieved by adding EFLAG_NO_AUTOKILL
to enemy->flags
. EFLAGS_GHOST
is a set of flags that generally matches the old behavior of ENEMY_IMMUNE
.
} | ||
|
||
void laserline_set_ab(Laser *l, cmplx a, cmplx b) { | ||
l->pos = a; | ||
l->args[0] = (b - a) * 0.005; |
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.
wait what was going on here?
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.
See create_laserline_ab
:
Laser *create_laserline_ab(cmplx a, cmplx b, float width, float charge, float dur, const Color *clr) {
float lt = 200;
cmplx m = (b - a) / lt;
Laser *l = create_laser(a, 200, dur, clr, las_linear, m, 0, 0, 0);
INVOKE_TASK(laser_charge,
.laser = ENT_BOX(l),
.charge_delay = charge,
.target_width = width,
);
return l;
}
200 was chosen somewhat arbitrarily (by you) for the lifetime parameter here a long time ago, and 0.005 is the reciprocal of it. I made the laserline_set_ab
function a little more general by taking the actual lifetime into account rather than hardcoding it.
Also, now that you brought it to my attention, I noticed that I forgot to replace one instance of 200 with lt in create_laserline_ab
.
Now that all stages have been finally ported, we have quite a bit of dead code to get rid of.