mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
Fix input
Fix timming svn-id: r29990
This commit is contained in:
parent
b2ab69f455
commit
1b62e2758c
@ -1593,12 +1593,6 @@ int currentMouseX = 0;
|
||||
int currentMouseY = 0;
|
||||
int currentMouseButton = 0;
|
||||
|
||||
void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY) {
|
||||
*pMouseX = currentMouseX;
|
||||
*pMouseY = currentMouseY;
|
||||
*pMouseButton = currentMouseButton;
|
||||
}
|
||||
|
||||
bool bFastMode = false;
|
||||
|
||||
void manageEvents() {
|
||||
@ -1730,11 +1724,13 @@ void manageEvents() {
|
||||
* mouseRight = 0;
|
||||
* }
|
||||
*/
|
||||
g_system->updateScreen();
|
||||
}
|
||||
|
||||
if (!bFastMode) {
|
||||
g_system->delayMillis(40);
|
||||
}
|
||||
void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY) {
|
||||
manageEvents();
|
||||
*pMouseX = currentMouseX;
|
||||
*pMouseY = currentMouseY;
|
||||
*pMouseButton = currentMouseButton;
|
||||
}
|
||||
|
||||
void mainLoop(void) {
|
||||
@ -1849,8 +1845,15 @@ void mainLoop(void) {
|
||||
}
|
||||
|
||||
if (userWait) {
|
||||
int16 button = 0;
|
||||
while (!button) {
|
||||
int16 mouseX;
|
||||
int16 mouseY;
|
||||
int16 mouseButton;
|
||||
|
||||
do {
|
||||
getMouseStatus(&main10, &mouseX, &mouseButton, &mouseY);
|
||||
}while(mouseButton);
|
||||
|
||||
while (!mouseButton) {
|
||||
manageScripts(&relHead);
|
||||
manageScripts(&procHead);
|
||||
|
||||
@ -1865,7 +1868,9 @@ void mainLoop(void) {
|
||||
int16 mouseVar;
|
||||
int16 mouseX;
|
||||
int16 mouseY;
|
||||
getMouseStatus(&mouseVar, &mouseX, &button, &mouseY);
|
||||
getMouseStatus(&mouseVar, &mouseX, &mouseButton, &mouseY);
|
||||
|
||||
flip();
|
||||
}
|
||||
|
||||
changeScriptParamInList(-1, -1, &procHead, 9999, 0);
|
||||
|
@ -619,7 +619,7 @@ int16 Op_GetMouseButton(void) {
|
||||
|
||||
getMouseStatus(&dummy, &mouseX, &mouseButton, &mouseY);
|
||||
|
||||
if (mouseButton & 4)
|
||||
if (mouseButton)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -221,6 +221,10 @@ void gfxModuleData_flipScreen(void) {
|
||||
flip();
|
||||
}
|
||||
|
||||
extern bool bFastMode;
|
||||
|
||||
static uint32 lastTick;
|
||||
|
||||
void flip() {
|
||||
int i;
|
||||
byte paletteRGBA[256 * 4];
|
||||
@ -242,6 +246,16 @@ void flip() {
|
||||
g_system->copyRectToScreen(globalScreen, 320, 0, 0, 320, 200);
|
||||
g_system->updateScreen();
|
||||
|
||||
uint32 currentTick = g_system->getMillis();
|
||||
|
||||
if (!bFastMode) {
|
||||
uint32 speed = 50;
|
||||
if(lastTick + speed > currentTick) {
|
||||
g_system->delayMillis(lastTick + speed - currentTick);
|
||||
}
|
||||
}
|
||||
|
||||
lastTick = g_system->getMillis();
|
||||
}
|
||||
|
||||
} // End of namespace Cruise
|
||||
|
@ -1145,7 +1145,7 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y
|
||||
buildPolyModel(newX, newY, newScale, (char*)polygonMask, destBuffer, newFrame);
|
||||
}
|
||||
|
||||
void drawMessage(gfxEntryStruct *pGfxPtr, int globalX, int globalY, int idx, int newColor, uint8 *ouputPtr) {
|
||||
void drawMessage(gfxEntryStruct *pGfxPtr, int globalX, int globalY, int width, int newColor, uint8 *ouputPtr) {
|
||||
// this is used for font only
|
||||
|
||||
if (pGfxPtr) {
|
||||
@ -1157,11 +1157,15 @@ void drawMessage(gfxEntryStruct *pGfxPtr, int globalX, int globalY, int idx, int
|
||||
int y;
|
||||
uint8 *ptr = pGfxPtr->imagePtr;
|
||||
int height = pGfxPtr->height;
|
||||
int width = pGfxPtr->width;
|
||||
|
||||
if (globalY < 0) {
|
||||
if (width>310)
|
||||
width = 310;
|
||||
if(width+globalX>319)
|
||||
globalX = 319 - width;
|
||||
if(globalY < 0)
|
||||
globalY = 0;
|
||||
}
|
||||
if(globalX < 0)
|
||||
globalX = 0;
|
||||
|
||||
if (globalY + pGfxPtr->height >= 198) {
|
||||
globalY = 198 - pGfxPtr->height;
|
||||
@ -1175,12 +1179,11 @@ void drawMessage(gfxEntryStruct *pGfxPtr, int globalX, int globalY, int idx, int
|
||||
for (i = 0; i < height; i++) {
|
||||
output = initialOuput + 320 * i;
|
||||
|
||||
for (j = 0; j < width; j++) {
|
||||
for (j = 0; j < pGfxPtr->width; j++) {
|
||||
uint8 color = *(ptr++);
|
||||
|
||||
if (color) {
|
||||
if ((x >= 0) && (x < 320) && (y >= 0)
|
||||
&& (y < 200)) {
|
||||
if ((x >= 0) && (x < 320) && (y >= 0) && (y < 200)) {
|
||||
if (color == 1) {
|
||||
*output = (uint8) 0;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user