Revision | 611335c2988f5f32c7ee69cab54f26e0e7620e6d (tree) |
---|---|
Time | 2019-07-30 07:36:09 |
Author | Starg <starg@user...> |
Commiter | Starg |
Fix message scrolling
@@ -4250,26 +4250,22 @@ void MPanelUpdate(void) | ||
4250 | 4250 | SetTextAlign(MPanel.hmdc, TA_LEFT | TA_TOP | TA_NOUPDATECP); |
4251 | 4251 | TCHAR *t = char_to_tchar(MPanelMessageData.buff); |
4252 | 4252 | switch ( MPanelMessageData.curmode ) { |
4253 | - case 0: | |
4254 | - ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, | |
4255 | - ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), | |
4256 | - t,_tcslen(t),NULL); | |
4257 | 4253 | case 1: |
4258 | - ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, | |
4254 | + ExtTextOut(MPanel.hmdc, MPanel.rcMessage.left - (MPanelMessageData.pointer - MPanelMessageData.len) * (MPanel.rcMessage.bottom - MPanel.rcMessage.top + 1) / 2, MPanel.rcMessage.top, | |
4259 | 4255 | ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), |
4260 | 4256 | t,_tcslen(t),NULL); |
4261 | -// ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left-(MPanel.rcMessage.bottom-MPanel.rcMessage.top)*2, | |
4262 | -// MPanel.rcMessage.top, ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), | |
4263 | -// t,_tcslen(t),NULL); | |
4257 | + break; | |
4258 | + case 3: | |
4259 | + case 4: | |
4260 | + // FIXME: implement this | |
4261 | + | |
4264 | 4262 | case 2: |
4265 | - ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, | |
4266 | - ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), | |
4267 | - t,_tcslen(t),NULL); | |
4268 | 4263 | case -1: |
4269 | 4264 | default: |
4270 | 4265 | ExtTextOut(MPanel.hmdc,MPanel.rcMessage.left,MPanel.rcMessage.top, |
4271 | 4266 | ETO_CLIPPED | ETO_OPAQUE,&(MPanel.rcMessage), |
4272 | 4267 | t,_tcslen(t),NULL); |
4268 | + break; | |
4273 | 4269 | } |
4274 | 4270 | safe_free(t); |
4275 | 4271 | if((HGDIOBJ)hgdiobj!=(HGDIOBJ)NULL && (HGDIOBJ)hgdiobj!=(HGDIOBJ)GDI_ERROR) |
@@ -4547,6 +4543,7 @@ void MPanelMessageUpdate(void) | ||
4547 | 4543 | break; |
4548 | 4544 | case 1: |
4549 | 4545 | if ( MPanelMessageData.prevtime == -1 ){ |
4546 | + strcpy(MPanelMessageData.buff, MPanelMessageData.curbuff); | |
4550 | 4547 | MPanelMessageData.prevtime = curtime; |
4551 | 4548 | MPanelMessageData.msec = MPanelMessageData.curmsec; |
4552 | 4549 | MPanel.UpdateFlag |= MP_UPDATE_MESSAGE; |
@@ -4564,18 +4561,7 @@ void MPanelMessageUpdate(void) | ||
4564 | 4561 | pointer = MPanelMessageData.len - 8 + ( MPanelMessageData.curmsec - MPanelMessageData.msec ) / 1000 * 2; |
4565 | 4562 | pointer = (int)( pointer / 2 ) * 2; |
4566 | 4563 | if ( MPanelMessageData.pointer != pointer ) { |
4567 | - int p = MPanelMessageData.len - pointer; | |
4568 | - MPanelMessageData.buff[0] = '\0'; | |
4569 | 4564 | MPanelMessageData.pointer = pointer; |
4570 | - if ( p >= 0 ) { | |
4571 | - memset( MPanelMessageData.buff, 0x20, p ); | |
4572 | - MPanelMessageData.buff[p] = '\0'; | |
4573 | - strcat( MPanelMessageData.buff, MPanelMessageData.curbuff); | |
4574 | - } else if ( MPanelMessageData.curbuffsize + p > 0 ) { | |
4575 | - strcpy( MPanelMessageData.buff, MPanelMessageData.curbuff - p); | |
4576 | - } else { | |
4577 | - MPanelMessageData.buff[0] = '\0'; | |
4578 | - } | |
4579 | 4565 | MPanel.UpdateFlag |= MP_UPDATE_MESSAGE; |
4580 | 4566 | } |
4581 | 4567 | break; |
@@ -4602,6 +4588,7 @@ void MPanelMessageUpdate(void) | ||
4602 | 4588 | break; |
4603 | 4589 | case 3: |
4604 | 4590 | if ( MPanelMessageData.prevtime == -1 ){ |
4591 | + strcpy(MPanelMessageData.buff, MPanelMessageData.curbuff); | |
4605 | 4592 | MPanelMessageData.prevtime = curtime; |
4606 | 4593 | MPanelMessageData.msec = MPanelMessageData.curmsec; |
4607 | 4594 | MPanel.UpdateFlag |= MP_UPDATE_MESSAGE; |
@@ -4618,23 +4605,13 @@ void MPanelMessageUpdate(void) | ||
4618 | 4605 | pointer = MPanelMessageData.len * 3 / 4 + ( MPanelMessageData.len / 4 + MPanelMessageData.curbuffsize ) * ( MPanelMessageData.curmsec - MPanelMessageData.msec ) / MPanelMessageData.curmsec; |
4619 | 4606 | pointer = ((int)(pointer / 2)) * 2; |
4620 | 4607 | if ( MPanelMessageData.pointer != pointer ) { |
4621 | - int p = MPanelMessageData.len - pointer; | |
4622 | - MPanelMessageData.buff[0] = '\0'; | |
4623 | 4608 | MPanelMessageData.pointer = pointer; |
4624 | - if ( p >= 0 ) { | |
4625 | - memset( MPanelMessageData.buff, 0x20, p ); | |
4626 | - MPanelMessageData.buff[p] = '\0'; | |
4627 | - strcat( MPanelMessageData.buff, MPanelMessageData.curbuff); | |
4628 | - } else if ( MPanelMessageData.curbuffsize + p > 0 ) { | |
4629 | - strcpy( MPanelMessageData.buff, MPanelMessageData.curbuff - p); | |
4630 | - } else { | |
4631 | - MPanelMessageData.buff[0] = '\0'; | |
4632 | - } | |
4633 | 4609 | MPanel.UpdateFlag |= MP_UPDATE_MESSAGE; |
4634 | 4610 | } |
4635 | 4611 | break; |
4636 | 4612 | case 4: |
4637 | 4613 | if ( MPanelMessageData.prevtime == -1 ){ |
4614 | + strcpy(MPanelMessageData.buff, MPanelMessageData.curbuff); | |
4638 | 4615 | MPanelMessageData.prevtime = curtime; |
4639 | 4616 | #define MPANELMESSAGE_MODE2_SLEEPMSEC 1000 |
4640 | 4617 | if ( MPanelMessageData.curmsec < MPANELMESSAGE_MODE2_SLEEPMSEC * 2 ) { |
@@ -4659,13 +4636,7 @@ void MPanelMessageUpdate(void) | ||
4659 | 4636 | } |
4660 | 4637 | pointer = ((int)(pointer / 2)) * 2; |
4661 | 4638 | if ( MPanelMessageData.pointer != pointer ) { |
4662 | - MPanelMessageData.buff[0] = '\0'; | |
4663 | 4639 | MPanelMessageData.pointer = pointer; |
4664 | - if ( pointer < MPanelMessageData.curbuffsize ) { | |
4665 | - strcpy( MPanelMessageData.buff, MPanelMessageData.curbuff + pointer ); | |
4666 | - } else { | |
4667 | - MPanelMessageData.buff[0] = '\0'; | |
4668 | - } | |
4669 | 4640 | MPanel.UpdateFlag |= MP_UPDATE_MESSAGE; |
4670 | 4641 | } |
4671 | 4642 | break; |