faster sample format conversion
don't render in all formats when converting
This commit is contained in:
parent
80fdc706d1
commit
0ddbc56b94
|
@ -52,9 +52,9 @@ class DivWorkPool;
|
|||
#define EXTERN_BUSY_BEGIN_SOFT e->softLocked=true; e->isBusy.lock();
|
||||
#define EXTERN_BUSY_END e->isBusy.unlock(); e->softLocked=false;
|
||||
|
||||
//#define DIV_UNSTABLE
|
||||
#define DIV_UNSTABLE
|
||||
|
||||
#define DIV_VERSION "0.6.2"
|
||||
#define DIV_VERSION "dev197"
|
||||
#define DIV_ENGINE_VERSION 197
|
||||
// for imports
|
||||
#define DIV_VERSION_MOD 0xff01
|
||||
|
|
|
@ -807,8 +807,8 @@ bool DivSample::insert(unsigned int pos, unsigned int length) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void DivSample::convert(DivSampleDepth newDepth) {
|
||||
render();
|
||||
void DivSample::convert(DivSampleDepth newDepth, unsigned int formatMask) {
|
||||
render(formatMask|(1U<<newDepth));
|
||||
depth=newDepth;
|
||||
switch (depth) {
|
||||
case DIV_SAMPLE_DEPTH_1BIT:
|
||||
|
@ -845,7 +845,7 @@ void DivSample::convert(DivSampleDepth newDepth) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
render();
|
||||
render(formatMask|(1U<<newDepth));
|
||||
}
|
||||
|
||||
#define RESAMPLE_BEGIN \
|
||||
|
@ -1309,6 +1309,7 @@ void DivSample::render(unsigned int formatMask) {
|
|||
if (!initInternal(DIV_SAMPLE_DEPTH_1BIT_DPCM,samples)) return;
|
||||
int accum=63;
|
||||
int next=63;
|
||||
|
||||
for (unsigned int i=0; (i<samples && (i>>3)<lengthDPCM); i++) {
|
||||
next=((unsigned short)(data16[i]^0x8000))>>9;
|
||||
if (next>accum) {
|
||||
|
|
|
@ -288,7 +288,7 @@ struct DivSample {
|
|||
* @warning do not attempt to do this outside of a synchronized block!
|
||||
* @param newDepth the new depth.
|
||||
*/
|
||||
void convert(DivSampleDepth newDepth);
|
||||
void convert(DivSampleDepth newDepth, unsigned int formatMask=0xffffffff);
|
||||
|
||||
/**
|
||||
* initialize the rest of sample formats for this sample.
|
||||
|
|
|
@ -498,7 +498,7 @@ void FurnaceGUI::drawSampleEdit() {
|
|||
if (ImGui::Selectable(sampleDepths[i])) {
|
||||
sample->prepareUndo(true);
|
||||
e->lockEngine([this,sample,i]() {
|
||||
sample->convert((DivSampleDepth)i);
|
||||
sample->convert((DivSampleDepth)i,e->getSampleFormatMask());
|
||||
e->renderSamples(curSample);
|
||||
});
|
||||
updateSampleTex=true;
|
||||
|
|
Loading…
Reference in a new issue