Skip to content

Commit

Permalink
Improved slider keyboard animation
Browse files Browse the repository at this point in the history
  • Loading branch information
ammeir committed Dec 19, 2020
1 parent 2d93aee commit 498afc8
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/arch/psvita/view/vkeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,19 @@ using std::list;
// Globals (used for better performance).
int g_keyboardStatus = KEYBOARD_DOWN;

int animationArr[34] = {
0,8,16,24,32,40,48,56,
64,72,80,88,96,104,112,120,
128,136,144,152,160,168,176,184,
192,200,208,216,224,232,240,248,
256,264
//int animationArr[34] = {
// 0,8,16,24,32,40,48,56,
// 64,72,80,88,96,104,112,120,
// 128,136,144,152,160,168,176,184,
// 192,200,208,216,224,232,240,248,
// 256,264
//};

int animationArr[31] = {
0,9,18,27,36,45,54,63,
72,81,90,99,108,117,126,135,
144,153,162,171,180,189,198,207,
216,225,234,243,252,261,264
};

VirtualKeyboard::VirtualKeyboard()
Expand Down Expand Up @@ -234,14 +241,14 @@ void VirtualKeyboard::render()
868, // width of keyboard bitmap
animationArr[i]); // height of keyboard bitmap

if (i++ == 33){
if (i++ == 30){
// Add a little delay by drawing the last frame few times.
if (j++ > 7){
g_keyboardStatus = KEYBOARD_UP;
m_view->updateViewPos(); // Make a split screen.
i = j = 0;
}else
i = 33;
i = 30;
}

// Force redraw to keep the animation on. This eats performance a little.
Expand All @@ -265,7 +272,7 @@ void VirtualKeyboard::render()
868, // width of keyboard bitmap
264 - animationArr[i]); // height of keyboard bitmap

if (i++ == 33){
if (i++ == 30){
g_keyboardStatus = KEYBOARD_DOWN;
m_updated = false;
i = j = 0;
Expand Down

0 comments on commit 498afc8

Please sign in to comment.