-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Currently, blitCopy() etc require something like 10 args, passing which is a bad idea performance-wise.
It could be replace by passing an arg struct. Instead of
blitCopy(s_pBgSub, 0, 0, s_pBfr->pBack, 0, 0, 320, 128, MINTERM_COPY);
blitCopy(s_pBgSub, 0, 128, s_pBfr->pBack, 0, 128, 320, 128, MINTERM_COPY);
It would be something like
tBlitCopyArgs sArgs = {s_pBgSub, 0, 0, s_pBfr->pBack, 0, 0, 320, 128, MINTERM_COPY};
blitCopyPredefined(&sArgs);
sArgs.uwSrcY = 128;
sArgs.uwDstY = 128;
blitCopyPredefined(&sArgs);
Pros:
- less stdcall overhead
- ability to cache repetitive blits
Cons:
- a bit less readable syntax (completely optional if old functions stay as is)
- no compile-time checks if all struct fields have been set - especially dangerous if additional field will be added in future. Could be resolved by
steamknight
Metadata
Metadata
Assignees
Type
Projects
Status
To do