This commit is contained in:
louis 2016-07-30 17:31:34 +02:00
parent 6acc22e5c2
commit 88982c3230
3 changed files with 16 additions and 13 deletions

View File

@ -290,13 +290,13 @@ cShifter::cShifter(cShiftable *shiftable) {
shifttime = 0; shifttime = 0;
x = 0.0f; x = 0.0f;
y = 0.0f; y = 0.0f;
stepXLinear = 0; stepXLinear = 0.0f;
stepYLinear = 0; stepYLinear = 0.0f;
stepsFast = 0; stepsFast = 0;
stepXFast = 0; stepXFast = 0.0f;
stepXSlow = 0; stepXSlow = 0.0f;
stepYFast = 0; stepYFast = 0.0f;
stepYSlow = 0; stepYSlow = 0.0f;
Init(); Init();
} }
@ -317,14 +317,14 @@ void cShifter::Init(void) {
stepYFast = (float)(end.Y() - start.Y()) * distanceFast / 100.0f / (float)stepsFast; stepYFast = (float)(end.Y() - start.Y()) * distanceFast / 100.0f / (float)stepsFast;
stepYSlow = (float)(end.Y() - start.Y()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast); stepYSlow = (float)(end.Y() - start.Y()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
} else if (start.Y() == end.Y()) { } else if (start.Y() == end.Y()) {
stepXLinear = (end.X() - start.X()) / steps; stepXLinear = (float)(end.X() - start.X()) / (float)steps;
stepXFast = (float)(end.X() - start.X()) * distanceFast / 100.0f / (float)stepsFast; stepXFast = (float)(end.X() - start.X()) * distanceFast / 100.0f / (float)stepsFast;
stepXSlow = (float)(end.X() - start.X()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast); stepXSlow = (float)(end.X() - start.X()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
} else { } else {
stepXLinear = (end.X() - start.X()) / steps; stepXLinear = (float)(end.X() - start.X()) / (float)steps;
stepXFast = (float)(end.X() - start.X()) * distanceFast / 100.0f / (float)stepsFast; stepXFast = (float)(end.X() - start.X()) * distanceFast / 100.0f / (float)stepsFast;
stepXSlow = (float)(end.X() - start.X()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast); stepXSlow = (float)(end.X() - start.X()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
stepYLinear = (end.Y() - start.Y()) / steps; stepYLinear = (float)(end.Y() - start.Y()) / (float)steps;
stepYFast = (float)(end.Y() - start.Y()) * distanceFast / 100.0f / (float)stepsFast; stepYFast = (float)(end.Y() - start.Y()) * distanceFast / 100.0f / (float)stepsFast;
stepYSlow = (float)(end.Y() - start.Y()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast); stepYSlow = (float)(end.Y() - start.Y()) * (100.0f - distanceFast) / 100.0f / (float)(steps-stepsFast);
} }

View File

@ -258,9 +258,8 @@ void cView::Show(int ve) {
void cView::SetViewelementsAnimOut(void) { void cView::SetViewelementsAnimOut(void) {
for (int i=0; i< numViewElements; i++) for (int i=0; i< numViewElements; i++)
if (viewElements[i]) { if (viewElements[i])
viewElements[i]->SetAnimOut(); viewElements[i]->SetAnimOut();
}
} }
void cView::Close(void) { void cView::Close(void) {
@ -298,7 +297,9 @@ int cView::ShiftTime(void) {
} }
int cView::ShiftMode(void) { int cView::ShiftMode(void) {
return attribs->ShiftMode(); int mode = attribs->ShiftMode();
if (mode < 0) mode = 0;
return mode;
} }
void cView::ShiftPositions(cPoint *start, cPoint *end) { void cView::ShiftPositions(cPoint *start, cPoint *end) {

View File

@ -437,7 +437,9 @@ int cViewElement::ShiftTime(void) {
} }
int cViewElement::ShiftMode(void) { int cViewElement::ShiftMode(void) {
return attribs->ShiftMode(); int mode = attribs->ShiftMode();
if (mode < 0) mode = 0;
return mode;
} }
void cViewElement::ShiftPositions(cPoint *start, cPoint *end) { void cViewElement::ShiftPositions(cPoint *start, cPoint *end) {