-
Notifications
You must be signed in to change notification settings - Fork 27
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
Dbl bfr #58
Conversation
uwBoundWidth, uwBoundHeight, | ||
pVPort->ubBPP, ubBitmapFlags | ||
); | ||
if(!pFront) { |
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.
pFront
?
@@ -81,7 +186,8 @@ tSimpleBufferManager *simpleBufferCreate( | |||
logWrite("Copperlist offset: %u\n", pManager->uwCopperOffset); | |||
} | |||
|
|||
simpleBufferSetBitmap(pManager, pBuffer); | |||
simpleBufferSetFront(pManager, pFront); | |||
simpleBufferSetBack(pManager, pBack == 0 ? pFront : pBack); |
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.
Explicit == 0
is not needed.
pBack ? pBack : pFront
(6+2*pManager->sCommon.pVPort->ubBPP)*sizeof(tCopCmd) | ||
); | ||
if(pManager->pCameraManager && isCameraCreated) { | ||
cameraDestroy(pManager->pCameraManager); |
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.
Accessing pManager
that was freed in line 206?
I need to say NO for breaking change with removing Actually games explicitly use Let's keep the old pointer to keep sanity, and |
Okay, hold on. This braking change is minor and I've mentioned it only so that you can effortlessly update code in your prods. Keep in mind that we're not versioning ACE yet, so unless we're in semver 1.0 expect stuff to change a lot. I expect that ACE will have little to no backwards compatibility between versions for sake of speed, because there are lots of stuff in code which were written in a very poor way. Best approaches are not yet known, so I'm not going to support wrong ones. This change is for the better, since for single-buffered screens Also, recent OS disabling and GCC pull requests probably broke your code anyway, so idk why you're getting mad at such trivial change. If you really don't want to change code in your games, just include ACE as submodule with HEAD set to last known commit which worked. Regarding simplebuffer-only pattern, expect double buffering support in tile/scroll buffers too. |
@@ -187,7 +187,7 @@ tSimpleBufferManager *simpleBufferCreate( | |||
} | |||
|
|||
simpleBufferSetFront(pManager, pFront); | |||
simpleBufferSetBack(pManager, pBack == 0 ? pFront : pBack); | |||
simpleBufferSetBack(pManager, pBack ? pFront : pBack); |
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.
Ommiting == 0
actually flips the logic.
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.
fixed in 6301206
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.
I expressed myself not correctly, sorry.
I'm not against breaking changes. What I mean is to keep engine API consistent.
Breaking out simplebuffer manager from pBuffer
which is used by EVERY other buffer manager is breaking the consistence. It's API job to ease end-users with working with engine. Double buffering is an optional feature which forces the-most-simple-case (single buffered mode) to have a penalty in decision about buffer manager change.
Good API should have most common cases as defaults. That's why I want to keep pBuffer
in singlebuffer manager. Optional feature is not worthy of removing that handy consistent name regardless of the manager you use.
@@ -202,12 +202,12 @@ tSimpleBufferManager *simpleBufferCreate( | |||
if(pFront) { | |||
bitmapDestroy(pFront); | |||
} | |||
if(pManager && pManager->pCameraManager && isCameraCreated) { |
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 can be nested inside pManager
check. Why check twice, when you can check once?
We may wait with merge until rest of vport managers get double buffering support then - it will be consistent across whole engine. From my current point of view, writing games using single buffering shouldn't be a default approach since it works in very few cases, where you're sure you will always be with your drawing before display beam. Double buffering allows you to not waste computing time on bob sorting which gets costly if you also consider z-sort. Without sorting in mind, your only concern is if you finish all blits in time of single frame, or in two frames if you target 25fps instead of 50. |
5eb3d25
to
88dd170
Compare
f2f47c5
to
ec41b96
Compare
2e2d12a
to
e3d9ad3
Compare
a6e9d25
to
db49889
Compare
cc64a3d
to
1229792
Compare
0c5fdb8
to
a7d9142
Compare
d55fe9d
to
57733d4
Compare
scrollBuffer now disables second copBlock if not needed
previous version allowed drawing on outermost margins, which resulted in drawing stuff when it shouldn't be drawn
i don't want to wait for it any longer, seems stable enough |
fixes #57
fixes #34
fixes #59
Imposes a breaking change: pointer to simplebuffer's bitmap is changed from
pManager->pBuffer
topManager->pFront
andpManager->pBack
.