Jump to content

gameboy

Community Members
  • Posts

    1.786
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by gameboy

  1. @wraitii But the whale still can't swim. Can you get it to swim? I'm looking forward to your restoration as soon as possible
  2. I tested the latest SVN22420 and found a problem: when I tested the maritime map, the whale was not swimming, it was stationary on the sea.
  3. @wraitii My friend, can this patch be released in SVN?
  4. Please let me know when it will be officially released.
  5. Why does elexis block them? These issues need to be patched.
  6. @wraitii Where are the fixes for these problems? I didn't see them in SVN, my friend, please take time to tell me, thank you!
  7. Really? I don't seem to feel that wraitii is paying attention to these problems. They really need him to solve them. If you are free now, please tell him.
  8. @Stan` I found some problems: 1. When farmers and riders hunt wild deer, they will not chase the prey when they reach half or run in another direction. It seems that they can't find the prey. When the prey is shot, the rider will not automatically get the food. He needs to give instructions again to get the food. 2. Wild animals can only stay where they are. They can't walk.
  9. @wraitii Today, I tested https://code.wildfiregames.com/D1987 and found some problems: 1. When farmers and riders hunt wild deer, they will not chase the prey when they reach half or run in another direction. It seems that they can't find the prey. When the prey is shot, the rider will not automatically get the food. He needs to give instructions again to get the food. 2. Wild animals can only stay where they are. They can't walk. commands.txt
  10. @Stan` This code is more practical, it is simpler, it can effectively solve practical problems. BTW: we should not delete those settings, should adjust it. // The hDC DC handle, if NULL, uses the entire screen // wR wG wB 0-255, default 128 BOOL SetBrightness(HDC hDC, int wR, int wG, int wB) { BOOL bRet = FALSE; HDC hGammDC = hDC ? hDC : ::GetDC(NULL); #pragma pack(push, 8) typedef struct _tagD3dGammaramp_t { WORDred[256]; WORDgreen[256]; WORDblue[256]; } _D3DGAMMARAMP, *LP_D3DGAMMARAMP; #pragma pack(pop) _D3DGAMMARAMP mGamRamp; memset(&mGamRamp, 0, sizeof(mGamRamp)); for (int iIndex = 0; iIndex < 256; iIndex++) { mGamRamp.red[iIndex] = min(65535, iIndex * (wR + 128)); mGamRamp.green[iIndex] = min(65535, iIndex * (wG + 128)); mGamRamp.blue[iIndex] = min(65535, iIndex * (wB + 128)); } LPVOID lpRamp = &mGamRamp; bRet = SetDeviceGammaRamp(hGammDC, lpRamp); if (hDC == NULL && hGammDC) { ::ReleaseDC(NULL, hGammDC); } return bRet; }
  11. @Stan` I wrote a piece of code that might be able to adjust and correct the gamma on the display. Class header file : (gammaramp.h) #ifndef GAMMARAMP_H_ #define GAMMARAMP_H_ /* CGammaRamp class Encapsulates the Gamma Ramp API and changes the brightness of the entire screen. */ class CGammaRamp { protected: HMODULE hGDI32; HDC hScreenDC; typedef BOOL(WINAPI *Type_SetDeviceGammaRamp)(HDC hDC, LPVOID lpRamp); Type_SetDeviceGammaRamp pGetDeviceGammaRamp; Type_SetDeviceGammaRamp pSetDeviceGammaRamp; public: CGammaRamp(); ~CGammaRamp(); BOOL LoadLibrary(); void FreeLibrary(); BOOL LoadLibraryIfNeeded(); BOOL SetDeviceGammaRamp(HDC hDC, LPVOID lpRamp); BOOL GetDeviceGammaRamp(HDC hDC, LPVOID lpRamp); BOOL SetBrightness(HDC hDC, WORD wBrightness); }; #endif Class C++ File : (gammaramp.cpp) #include <windows.h> #include "gammaramp.h" /* CGammaRamp class Encapsulates the Gamma Ramp API and changes the brightness of the entire screen. */ CGammaRamp::CGammaRamp() { //Initialize all variables. hGDI32 = NULL; hScreenDC = NULL; pGetDeviceGammaRamp = NULL; pSetDeviceGammaRamp = NULL; } CGammaRamp::~CGammaRamp() { FreeLibrary(); } BOOL CGammaRamp::LoadLibrary() { BOOL bReturn = FALSE; FreeLibrary(); //Load the GDI library. hGDI32 = ::LoadLibrary("gdi32.dll"); if (hGDI32 != NULL) { //Get the addresses of GetDeviceGammaRamp and SetDeviceGammaRamp API functions. pGetDeviceGammaRamp = (Type_SetDeviceGammaRamp)GetProcAddress(hGDI32, "GetDeviceGammaRamp"); pSetDeviceGammaRamp = (Type_SetDeviceGammaRamp)GetProcAddress(hGDI32, "SetDeviceGammaRamp"); //Return TRUE only if these functions exist. if (pGetDeviceGammaRamp == NULL || pSetDeviceGammaRamp == NULL) FreeLibrary(); else bReturn = TRUE; } return bReturn; } void CGammaRamp::FreeLibrary() { //Free the GDI library. if (hGDI32 != NULL) { ::FreeLibrary(hGDI32); hGDI32 = NULL; } } BOOL CGammaRamp::LoadLibraryIfNeeded() { BOOL bReturn = FALSE; if (hGDI32 == NULL) LoadLibrary(); if (pGetDeviceGammaRamp != NULL && pSetDeviceGammaRamp != NULL) bReturn = TRUE; return bReturn; } BOOL CGammaRamp::SetDeviceGammaRamp(HDC hDC, LPVOID lpRamp) { //Call to SetDeviceGammaRamp only if this function is successfully loaded. if (LoadLibraryIfNeeded()) { return pSetDeviceGammaRamp(hDC, lpRamp); } else return FALSE; } BOOL CGammaRamp::GetDeviceGammaRamp(HDC hDC, LPVOID lpRamp) { //Call to GetDeviceGammaRamp only if this function is successfully loaded. if (LoadLibraryIfNeeded()) { return pGetDeviceGammaRamp(hDC, lpRamp); } else return FALSE; } BOOL CGammaRamp::SetBrightness(HDC hDC, WORD wBrightness) { /* Changes the brightness of the entire screen. This function may not work properly in some video cards. The wBrightness value should be a number between 0 and 255. 128 = Regular brightness above 128 = brighter below 128 = darker If hDC is NULL, SetBrightness automatically load and release the display device context for you. */ BOOL bReturn = FALSE; HDC hGammaDC = hDC; //Load the display device context of the entire screen if hDC is NULL. if (hDC == NULL) hGammaDC = GetDC(NULL); if (hGammaDC != NULL) { //Generate the 256-colors array for the specified wBrightness value. WORD GammaArray[3][256]; for (int iIndex = 0; iIndex < 256; iIndex++) { int iArrayValue = iIndex * (wBrightness + 128); if (iArrayValue > 65535) iArrayValue = 65535; GammaArray[0][iIndex] = GammaArray[1][iIndex] = GammaArray[2][iIndex] = (WORD)iArrayValue; } //Set the GammaArray values into the display device context. bReturn = SetDeviceGammaRamp(hGammaDC, GammaArray); } if (hDC == NULL) ReleaseDC(NULL, hGammaDC); return bReturn; } Example for using the CGammaRamp class: #include <windows.h> #include "gammaramp.h" int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // command line int nCmdShow // show state ) { //Example for changing the brightness with CGammaRamp class: //Be aware that this exmaple may not work properly in all //Video cards. CGammaRamp GammaRamp; //Make the screen darker: GammaRamp.SetBrightness(NULL, 64); //Wait 3 seconds: Sleep(3000); //Return back to normal: GammaRamp.SetBrightness(NULL, 128); return 0; }
  12. @Stan` Will this patch be officially released?
  13. // Adjust brightness parameter 0 - 100 Setting Successfully Returns 0 Setting Failure Returns Negative Number Int SetGamma(int bright) { Void *lpGamma = NULL; Int iArray Value; WORD gMap[3][256] = {0}; LpGamma = &gMap; HDC HDC = GetDC(NULL); If(NULL = hdc) Return - 1; For(int I = 0; I < 256; i +) { IArrayValue = i * (bright + 128); If(iArray Value > 65535) IArrayValue = 65535; GMap[0][i] = GMap[1][i] = GMap[2][i] = (WORD)iArray Value; } If(FALSE = SetDeviceGamma Ramp(hdc, lpGamma)) Return - 2; Return 0; }
  14. @weridetogether6 But this warning or error still occurs. I use a monitor.
  15. @wraitii Do you mean that you let the prey escape in different directions when they are chased?
  16. @Angen, @Stan` I found a way to solve this problem, but I don't know where to put it. BOOL WINAPI GetDevice Gamma Ramp( HDC hDC, LPVOID lpRamp ) BOOL WINAPI Set Device Gamma Ramp (HDC hDC, LPVOID lpRamp); where lpRamp points to a 3 x 256 WORD array with gradients that need Gamma correction, such as void * lpGamma = NULL; WORD gMap [3] [256]= {0}; LpGamma = & gMap; HDC HDC = GetDC (NULL); GetDeviceGamma Ramp (hdc, lpGamma); // Get the current Gamma For (INT I = 0; I < 256; i+) { GMap [0] = 256*i; GMap [1] = 256*i; GMap [2] = 256*i; } SetDeviceGamma Ramp (hdc, lpGamma); // Set to Standard Gamma
  17. Yes, my latest version of operating system Win10 V1903 also encountered this warning. Is this really the problem caused by Win10?
  18. @Stan` Are you kidding me? When a hunter is chasing his prey, does he need to prepare shells on his javelin or sword? Ha-ha....
  19. @wraitii My friend, I have to say that when a rider is hunting for his prey, he should throw his weapon (javelin) as he chases it, not be very close or wait until the prey stops to hunt him. (Of course, hunting can continue if the prey stops.)
×
×
  • Create New...