/* Allow us to pre-load the DIB once for future draws */ #ifdef MESS BOOL LoadScreenShotEx(int nGame, LPCSTR lpSoftwareName, int nType) #else /* !MESS */ BOOL LoadScreenShot(int nGame, int nType) #endif /* MESS */ { BOOL loaded = FALSE; /* No need to reload the same one again */ #ifndef MESS if (nGame == current_image_game && nType == current_image_type) return TRUE; #endif /* Delete the last ones */ FreeScreenShot(); /* Load the DIB */ #ifdef MESS if (lpSoftwareName) { int nParentIndex = -1; loaded = LoadSoftwareScreenShot(drivers[nGame], lpSoftwareName, nType); if (!loaded && DriverIsClone(nGame) == TRUE) { nParentIndex = GetParentIndex(drivers[nGame]); loaded = LoadSoftwareScreenShot(drivers[nParentIndex], lpSoftwareName, nType); } } if (!loaded) #endif /* MESS */ { loaded = LoadDIB(drivers[nGame]->name, &m_hDIB, &m_hPal, nType); } /* If not loaded, see if there is a clone and try that */ if (!loaded) { int nParentIndex = GetParentIndex(drivers[nGame]); if( nParentIndex >= 0) { loaded = LoadDIB(drivers[nParentIndex]->name, &m_hDIB, &m_hPal, nType); nParentIndex = GetParentIndex(drivers[nParentIndex]); if (!loaded && nParentIndex >= 0) loaded = LoadDIB(drivers[nParentIndex]->name, &m_hDIB, &m_hPal, nType); } } if (loaded) { HDC hdc = GetDC(GetMainWindow()); m_hDDB = DIBToDDB(hdc, m_hDIB, NULL); ReleaseDC(GetMainWindow(),hdc); current_image_game = nGame; current_image_type = nType; } return (loaded) ? TRUE : FALSE; }
/* Allow us to pre-load the DIB once for future draws */ #ifdef MESS BOOL LoadScreenShotEx(int nGame, LPCSTR lpSoftwareName, int nType) #else /* !MESS */ BOOL LoadScreenShot(int nGame, int nType) #endif /* MESS */ { BOOL loaded = FALSE; /* No need to reload the same one again */ #ifndef MESS if (nGame == current_image_game && nType == current_image_type) return TRUE; #endif /* Delete the last ones */ FreeScreenShot(); /* Load the DIB */ #ifdef MESS if (lpSoftwareName) { loaded = LoadSoftwareScreenShot(drivers[nGame], lpSoftwareName, nType); if (!loaded && (drivers[nGame]->clone_of && !(drivers[nGame]->clone_of->flags & NOT_A_DRIVER))) loaded = LoadSoftwareScreenShot(drivers[nGame]->clone_of, lpSoftwareName, nType); } if (!loaded) #endif /* MESS */ { loaded = LoadDIB(drivers[nGame]->name, &m_hDIB, &m_hPal, nType); } /* If not loaded, see if there is a clone and try that */ if (!loaded && (drivers[nGame]->clone_of != NULL) && !(drivers[nGame]->clone_of->flags & NOT_A_DRIVER)) { loaded = LoadDIB(drivers[nGame]->clone_of->name, &m_hDIB, &m_hPal, nType); if (!loaded && drivers[nGame]->clone_of->clone_of) loaded = LoadDIB(drivers[nGame]->clone_of->clone_of->name, &m_hDIB, &m_hPal, nType); } if (loaded) { HDC hdc = GetDC(GetMainWindow()); m_hDDB = DIBToDDB(hdc, m_hDIB, NULL); ReleaseDC(GetMainWindow(),hdc); current_image_game = nGame; current_image_type = nType; } return (loaded) ? TRUE : FALSE; }
/* Allow us to pre-load the DIB once for future draws */ BOOL LoadScreenShotEx(int nGame, LPCSTR lpSoftwareName, int nType) { BOOL loaded = FALSE; /* Delete the last ones */ FreeScreenShot(); /* Load the DIB */ if (lpSoftwareName) { int nParentIndex = -1; loaded = LoadSoftwareScreenShot(&driver_list::driver(nGame), lpSoftwareName, nType); if (!loaded && DriverIsClone(nGame) == TRUE) { nParentIndex = GetParentIndex(&driver_list::driver(nGame)); loaded = LoadSoftwareScreenShot(&driver_list::driver(nParentIndex), lpSoftwareName, nType); } } if (!loaded) loaded = LoadDIB(driver_list::driver(nGame).name, &m_hDIB, &m_hPal, nType); /* If not loaded, see if there is a clone and try that */ if (!loaded) { int nParentIndex = GetParentIndex(&driver_list::driver(nGame)); if( nParentIndex >= 0) { loaded = LoadDIB(driver_list::driver(nParentIndex).name, &m_hDIB, &m_hPal, nType); nParentIndex = GetParentIndex(&driver_list::driver(nParentIndex)); if (!loaded && nParentIndex >= 0) loaded = LoadDIB(driver_list::driver(nParentIndex).name, &m_hDIB, &m_hPal, nType); } } if (loaded) { HDC hdc = GetDC(GetMainWindow()); m_hDDB = DIBToDDB(hdc, m_hDIB, NULL); ReleaseDC(GetMainWindow(),hdc); } return (loaded) ? TRUE : FALSE; }
/* Allow us to pre-load the DIB once for future draws */ #ifdef MESS BOOL LoadScreenShotEx(int nGame, LPCSTR lpSoftwareName, int nType) #else /* !MESS */ BOOL LoadScreenShot(int nGame, int nType) #endif /* MESS */ { BOOL loaded = FALSE; /* No need to reload the same one again */ #ifndef MESS if (nGame == current_image_game && nType == current_image_type) return TRUE; #endif /* Delete the last ones */ FreeScreenShot(); /* Load the DIB */ #ifdef MESS if (lpSoftwareName) { int nParentIndex = -1; loaded = LoadSoftwareScreenShot(&driver_list::driver(nGame), lpSoftwareName, nType); if (!loaded && DriverIsClone(nGame) == TRUE) { nParentIndex = GetParentIndex(&driver_list::driver(nGame)); loaded = LoadSoftwareScreenShot(&driver_list::driver(nParentIndex), lpSoftwareName, nType); } } if (!loaded) #endif /* MESS */ { loaded = LoadDIB(driver_list::driver(nGame).name, &m_hDIB, &m_hPal, nType); } /* If not loaded, see if there is a clone and try that */ if (!loaded) { int nParentIndex = GetParentIndex(&driver_list::driver(nGame)); if( nParentIndex >= 0) { loaded = LoadDIB(driver_list::driver(nParentIndex).name, &m_hDIB, &m_hPal, nType); nParentIndex = GetParentIndex(&driver_list::driver(nParentIndex)); if (!loaded && nParentIndex >= 0) loaded = LoadDIB(driver_list::driver(nParentIndex).name, &m_hDIB, &m_hPal, nType); } } #ifndef MESS /* MSH 20071029 - If driver is broken and no images exists, look for nonworking.png */ if (!loaded && DriverIsBroken(nGame)) { loaded = LoadDIB("nonworking", &m_hDIB, &m_hPal, nType); } #endif if (loaded) { HDC hdc = GetDC(GetMainWindow()); m_hDDB = DIBToDDB(hdc, m_hDIB, NULL); ReleaseDC(GetMainWindow(),hdc); current_image_game = nGame; current_image_type = nType; } return (loaded) ? TRUE : FALSE; }
/* Allow us to pre-load the DIB once for future draws */ #ifdef MESS BOOL LoadScreenShotEx(int nGame, LPCSTR lpSoftwareName, int nType) #else /* !MESS */ #ifdef USE_IPS BOOL LoadScreenShot(int nGame, LPCWSTR lpIPSName, int nType) #else /* USE_IPS */ BOOL LoadScreenShot(int nGame, int nType) #endif /* USE_IPS */ #endif /* MESS */ { BOOL loaded = FALSE; int nIndex = nGame; /* No need to reload the same one again */ #ifndef MESS if (nGame == current_image_game && nType == current_image_type) return TRUE; #endif /* Delete the last ones */ FreeScreenShot(); /* Load the DIB */ #ifdef MESS if (lpSoftwareName) { int nParentIndex = -1; loaded = LoadSoftwareScreenShot(&driver_list::driver(nGame), lpSoftwareName, nType); if (!loaded && DriverIsClone(nGame) == TRUE) { nParentIndex = GetParentIndex(drivers[nGame]); loaded = LoadSoftwareScreenShot(&driver_list::driver(nParentIndex), lpSoftwareName, nType); } } if (!loaded) #endif /* MESS */ { #ifdef USE_IPS if (lpIPSName) { WCHAR *wdrv = driversw[nIndex]->name; WCHAR buf[MAX_PATH]; wsprintf(buf, TEXT("%s/%s"), wdrv, lpIPSName); dwprintf(TEXT("found ipsname: %s"), buf); while (!loaded && nIndex >= 0) { wdrv = driversw[nIndex]->name; wsprintf(buf, TEXT("%s/%s"), wdrv, lpIPSName); loaded = LoadDIB(buf, &m_hDIB, &m_hPal, nType); nIndex = GetParentIndex(&driver_list::driver(nIndex)); } } else #endif /* USE_IPS */ { dwprintf(TEXT("not found ipsname: %s"), driversw[nIndex]->name); while (!loaded && nIndex >= 0) { loaded = LoadDIB(driversw[nIndex]->name, &m_hDIB, &m_hPal, nType); nIndex = GetParentIndex(&driver_list::driver(nIndex)); } } } if (loaded) { HDC hdc = GetDC(GetMainWindow()); m_hDDB = DIBToDDB(hdc, m_hDIB, NULL); ReleaseDC(GetMainWindow(),hdc); current_image_game = nGame; current_image_type = nType; } return (loaded) ? TRUE : FALSE; }