1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

Compare commits

..

No commits in common. "master" and "experimental" have entirely different histories.

10 changed files with 41 additions and 154 deletions

View File

@ -70,7 +70,6 @@ Wine (Linux/macOS/Android) only: override `ddraw` in [winecfg](https://wiki.wine
- Another War
- Anstoss 3
- Arcanum: Of Steamworks and Magick Obscura
- Arcatera the Dark Brotherhood
- Army Men 2
- Army Men: Air Tactics
- Army Men: Toys in Space
@ -147,7 +146,6 @@ Wine (Linux/macOS/Android) only: override `ddraw` in [winecfg](https://wiki.wine
- Cloud Kingdom 3 (only with /ddraw command line parameter)
- Dark Earth
- Dark Reign: The Future of War
- Dark Secret of Africa
- Day Of The Tentacle
- Daytona
- Daytona USA (Sega - 1996)
@ -203,7 +201,6 @@ Wine (Linux/macOS/Android) only: override `ddraw` in [winecfg](https://wiki.wine
- Full Throttle
- Future Cop L.A.P.D
- G-Police
- Gateway (Remake)
- Geneforge
- Gilbert Goodmate And The Mushroom Of Phungoria
- Gorasul: The Legacy of the Dragon
@ -424,7 +421,6 @@ Wine (Linux/macOS/Android) only: override `ddraw` in [winecfg](https://wiki.wine
- Sudden Strike 2
- Superbike 2000
- Swarog
- The Jungle Book Groove Party
- The Curse Of Monkey Island
- The Dig
- The Last Express

View File

@ -9,6 +9,7 @@
#include <SysUtils.hpp>
#include <Registry.hpp>
#include <System.Hash.hpp>
#include <VersionHelpers.h>
#include "ConfigFormUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
@ -773,87 +774,6 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
BoxingLbl->Hint = upscaleHint + enableUpscaleHint;
BoxingChk->Hint = upscaleHint + enableUpscaleHint;
}
else if (lang == "polish" || (lang == "auto" && priID == LANG_POLISH)) {
LanguageImg->Visible = true;
/* -polish - made by WaRzillA @ github */
ConfigForm->Caption = L"Konfiguracja cnc-ddraw";
DisplayBtn->Caption = L"Ustawienia wyświetlania";
AdvancedBtn->Caption = L"Ustawienia zaawansowane";
HotkeyBtn->Caption = L"Skróty klawiaturowe";
CompatibilityBtn->Caption = L"Ustawienia kompatybilności";
RestoreDefaultsBtn->Caption = L"Przywróć ustawienia domyślne";
PresentationLbl->Caption = L"Tryb wyświetlania";
MaintasLbl->Caption = L"Zachowaj proporcje obrazu";
VsyncLbl->Caption = L"Włącz VSync";
AdjmouseLbl->Caption = L"Dostosuj czułość myszy";
DevmodeLbl->Caption = L"Zablokuj kursor w oknie/na ekranie";
RendererLbl->Caption = L"Silnik renderowania";
BorderLbl->Caption = L"Pokaż ramki okna w trybie okienkowym";
SavesettingsLbl->Caption = L"Zapamiętaj pozycję i rozmiar okna";
ShaderLbl->Caption = L"Shader OpenGL";
MaxfpsLbl->Caption = L"Ogranicz liczbę klatek na sekundę";
BoxingLbl->Caption = L"Włącz windowboxing / integer scaling ";
ToggleWindowedLbl->Caption = L"Przełącz na tryb okienkowy";
MaximizeWindowLbl->Caption = L"Maksymalizuj okno";
UnlockCursor1Lbl->Caption = L"Odblokuj kursor 1";
UnlockCursor2Lbl->Caption = L"Odblokuj kursor 2";
ScreenshotLbl->Caption = L"Zrzut ekranu";
MaxgameticksLbl->Caption = L"Ogranicz prędkość gry";
NoactivateappLbl->Caption = L"Napraw nieprawidłowe działanie Alt+Tab";
ResolutionsLbl->Caption = L"Odblokuj dodatkowe rozdzielczości ekranu";
MinfpsLbl->Caption = L"Wymuś wysokie FPS / Napraw zacinanie Freesync/G-Sync";
SinglecpuLbl->Caption = L"Napraw problemy z wydajnością i dźwiękiem";
NonexclusiveLbl->Caption = L"Napraw niewidoczne filmy / elementy interfejsu";
RendererCbx->Items->Clear();
RendererCbx->AddItem(L"Automatyczny", NULL);
RendererCbx->AddItem(L"Direct3D 9", NULL);
RendererCbx->AddItem(L"OpenGL", NULL);
RendererCbx->AddItem(L"GDI", NULL);
PresentationCbx->Items->Clear();
PresentationCbx->AddItem(L"Pełny ekran", NULL);
PresentationCbx->AddItem(L"Pełny ekran z upscalingiem", NULL);
PresentationCbx->AddItem(L"Tryb bezramkowy", NULL);
PresentationCbx->AddItem(L"Tryb okienkowy", NULL);
MaxgameticksCbx->Items->Clear();
MaxgameticksCbx->AddItem(L"Bez limitu", NULL);
MaxgameticksCbx->AddItem(L"Synchronizacja z odświeżaniem monitora", NULL);
MaxgameticksCbx->AddItem(L"Symulacja monitora 60 Hz", NULL);
MaxgameticksCbx->AddItem(L"1000 tików na sekundę", NULL);
MaxgameticksCbx->AddItem(L"500 tików na sekundę", NULL);
MaxgameticksCbx->AddItem(L"250 tików na sekundę", NULL);
MaxgameticksCbx->AddItem(L"125 tików na sekundę", NULL);
MaxgameticksCbx->AddItem(L"60 tików na sekundę", NULL);
MaxgameticksCbx->AddItem(L"30 tików na sekundę", NULL);
MaxgameticksCbx->AddItem(L"25 tików na sekundę", NULL);
MaxgameticksCbx->AddItem(L"15 tików na sekundę", NULL);
System::UnicodeString shaderHint =
L"Niektóre shadery działają tylko wtedy, gdy włączone jest skalowanie. \n\n";
System::UnicodeString upscaleHint =
L"Skalowanie musi być włączone, aby ta opcja działała. \n\n";
System::UnicodeString enableUpscaleHint =
L"Aby włączyć skalowanie, ustaw tryb wyświetlania na 'Tryb bezramkowy' \n"
"lub 'Pełny ekran z upscalingiem'. Dla 'Tryb okienkowy' \n"
"musisz zmienić rozmiar lub zmaksymalizować okno.";
ShaderLbl->Hint = shaderHint + enableUpscaleHint;
ShaderD3DCbx->Hint = shaderHint + enableUpscaleHint;
ShaderCbx->Hint = shaderHint + enableUpscaleHint;
MaintasLbl->Hint = upscaleHint + enableUpscaleHint;
MaintasChk->Hint = upscaleHint + enableUpscaleHint;
AdjmouseLbl->Hint = upscaleHint + enableUpscaleHint;
AdjmouseChk->Hint = upscaleHint + enableUpscaleHint;
BoxingLbl->Hint = upscaleHint + enableUpscaleHint;
BoxingChk->Hint = upscaleHint + enableUpscaleHint;
}
else {
IsEnglish = true;
@ -906,12 +826,6 @@ void TConfigForm::ApplyTranslation(TIniFile *ini)
LanguageImg->Picture->Graphic = png;
LanguageImg->Visible = true;
}
else if (priID == LANG_POLISH) {
TPngImage *png = new TPngImage();
png->LoadFromResourceName((int)HInstance, "PngImage_PL");
LanguageImg->Picture->Graphic = png;
LanguageImg->Visible = true;
}
} catch (...) {
}
@ -1285,6 +1199,11 @@ void __fastcall TConfigForm::FormCreate(TObject *Sender)
delete ini;
VsyncChk->Enabled = VsyncAllowed();
if (!VsyncChk->Enabled) {
VsyncChk->State = tssOff;
}
Initialized = true;
}
@ -1706,8 +1625,31 @@ bool TConfigForm::GetBool(TIniFile *ini, System::UnicodeString key, bool defValu
return s == "true" || s == "yes" || s == "1";
}
bool TConfigForm::VsyncAllowed()
{
if (GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "wine_get_version")) {
return true;
}
if (!IsWindows8OrGreater()) {
return true;
}
if (NonexclusiveChk->State == tssOff &&
(PresentationCbx->ItemIndex == 0 || PresentationCbx->ItemIndex == 1)) {
return true;
}
return false;
}
void __fastcall TConfigForm::PresentationCbxChange(TObject *Sender)
{
VsyncChk->Enabled = VsyncAllowed();
if (!VsyncChk->Enabled) {
VsyncChk->State = tssOff;
}
SaveSettings();
}
@ -1816,6 +1758,11 @@ void __fastcall TConfigForm::SinglecpuChkClick(TObject *Sender)
void __fastcall TConfigForm::NonexclusiveChkClick(TObject *Sender)
{
VsyncChk->Enabled = VsyncAllowed();
if (!VsyncChk->Enabled) {
VsyncChk->State = tssOff;
}
SaveSettings();
}

View File

@ -118,6 +118,7 @@ private: // Benutzer-Deklarationen
virtual void __fastcall CreateParams(TCreateParams & Params);
void SaveSettings();
bool GetBool(TIniFile *ini, System::UnicodeString key, bool defValue);
bool VsyncAllowed();
void ApplyTranslation(TIniFile *ini);
System::UnicodeString GetKeyText(WORD key);
WORD GetKeyCode(System::UnicodeString text);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

View File

@ -227,10 +227,6 @@
<ResourceType>RCDATA</ResourceType>
<ResourceId>PngImage_IT</ResourceId>
</RcItem>
<RcItem Include="Resources\pl.png">
<ResourceType>RCDATA</ResourceType>
<ResourceId>PngImage_PL</ResourceId>
</RcItem>
<RcItem Include="Resources\RU.png">
<ResourceType>RCDATA</ResourceType>
<ResourceId>PngImage_RU</ResourceId>
@ -368,7 +364,7 @@
<DeployFile LocalName=".\Win32\Release\cnc-ddraw config.exe" Configuration="Release" Class="ProjectOutput"/>
<DeployFile LocalName=".\Win32\Release\cnc-ddraw config.exe" Configuration="Release" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>cnc-ddraw config.exe</RemoteName>
<RemoteName>cnc-ddraw_config.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
@ -434,12 +430,6 @@
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="Resources\pl.png" Configuration="Release" Class="ProjectFile">
<Platform Name="Win32">
<RemoteDir>.\</RemoteDir>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>

View File

@ -4,7 +4,6 @@ PngImage_ES RCDATA "Resources\\ES.png"
PngImage_FR RCDATA "Resources\\fr.png"
PngImage_HU RCDATA "Resources\\hu.png"
PngImage_IT RCDATA "Resources\\IT.png"
PngImage_PL RCDATA "Resources\\pl.png"
PngImage_RU RCDATA "Resources\\RU.png"
PngImage_US RCDATA "Resources\\US.png"
PngImage_VN RCDATA "Resources\\VN.png"

View File

@ -106,7 +106,6 @@ typedef struct CNCDDRAWCONFIG
BOOL carma95_hack;
BOOL sirtech_hack;
BOOL flightsim98_hack;
BOOL darkcolony_hack;
} CNCDDRAWCONFIG;

View File

@ -116,7 +116,6 @@ void cfg_load()
GET_BOOL(g_config.carma95_hack, "carma95_hack", FALSE);
GET_BOOL(g_config.sirtech_hack, "sirtech_hack", FALSE);
GET_BOOL(g_config.flightsim98_hack, "flightsim98_hack", FALSE);
GET_BOOL(g_config.darkcolony_hack, "darkcolony_hack", FALSE);
GameHandlesClose = GameHandlesClose || g_config.infantryhack;
@ -374,7 +373,7 @@ static void cfg_create_ini()
"; The following settings are for cnc-ddraw config.exe\n"
"\n"
"\n"
"; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french, italian, vietnamese, polish\n"
"; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french, italian, vietnamese\n"
"configlang=auto\n"
"\n"
"; cnc-ddraw config program theme, possible values: Windows10, Cobalt XEMedia\n"
@ -404,12 +403,6 @@ static void cfg_create_ini()
"[Atrox]\n"
"nonexclusive=true\n"
"\n"
"; Arcatera the Dark Brotherhood\n"
"[darksun]\n"
"maxgameticks=60\n"
"maxfps=60\n"
"minfps=-1\n"
"\n"
"; Atomic Bomberman\n"
"[BM]\n"
"maxgameticks=60\n"
@ -541,7 +534,7 @@ static void cfg_create_ini()
"; Atlantis\n"
"[ATLANTIS]\n"
"renderer=opengl\n"
"maxgameticks=30\n"
"maxgameticks=60\n"
"center_cursor_fix=true\n"
"\n"
"; Airline Tycoon Deluxe\n"
@ -881,12 +874,6 @@ static void cfg_create_ini()
"[corsairs]\n"
"adjmouse=true\n"
"\n"
"; Dark Colony\n"
"[dc16]\n"
"maxgameticks=30\n"
"darkcolony_hack=true\n"
"hook_peekmessage=true\n"
"\n"
"; Divine Divinity\n"
"[div]\n"
"resolutions=2\n"
@ -902,12 +889,6 @@ static void cfg_create_ini()
"noactivateapp=true\n"
"limiter_type=2\n"
"\n"
"; Dark Secret of Africa\n"
"[Game/5]\n"
"checkfile=.\\CONFIG.CFG\n"
"maxfps=60\n"
"minfps=-1\n"
"\n"
"; Dark Reign: The Future of War\n"
"[DKReign]\n"
"maxgameticks=60\n"
@ -1631,10 +1612,6 @@ static void cfg_create_ini()
"fake_mode=352x240x32\n"
"fix_not_responding=true\n"
"\n"
"; Seven Games of the Soul\n"
"[faust]\n"
"maxgameticks=25\n"
"\n"
"; Swarog\n"
"[Swarog]\n"
"maxfps=60\n"

View File

@ -909,11 +909,6 @@ HRESULT dds_GetClipper(IDirectDrawSurfaceImpl* This, IDirectDrawClipperImpl** lp
HRESULT dds_GetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKEY lpColorKey)
{
if (!(This->flags & DDSD_CKSRCBLT))
{
return DDERR_NOCOLORKEY;
}
if (dwFlags != DDCKEY_SRCBLT || !lpColorKey)
{
TRACE(" NOT_IMPLEMENTED dwFlags=%08X, lpColorKey=%p\n", dwFlags, lpColorKey);
@ -1553,18 +1548,17 @@ HRESULT dd_CreateSurface(
if (dst_surface->hdc)
InterlockedIncrement(&g_dds_gdi_handles);
// CreateDIBSection cannot handle values higher than a WORD - 0xFF00 (guard lines);
DWORD map_offset = min(65280, dst_surface->pitch * g_config.guard_lines);
dst_surface->mapping =
CreateFileMappingA(
INVALID_HANDLE_VALUE,
NULL,
PAGE_READWRITE | SEC_COMMIT,
0,
bmp_size + 256 + map_offset,
bmp_size + 256,
NULL);
DWORD map_offset = 0;
if (dst_surface->mapping)
{
LPVOID data = MapViewOfFile(dst_surface->mapping, FILE_MAP_ALL_ACCESS, 0, 0, 0);

View File

@ -780,14 +780,6 @@ BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wM
BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
{
if (g_config.darkcolony_hack && !hWnd)
{
hWnd = g_ddraw.hwnd;
MSG msg;
real_PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE);
}
if (g_config.limiter_type == LIMIT_PEEKMESSAGE &&
g_ddraw.ticks_limiter.tick_length > 0 &&
InterlockedExchange(&g_ddraw.render.screen_updated, FALSE))
@ -2054,14 +2046,6 @@ HWND WINAPI fake_CreateWindowExA(
dwStyle &= ~WS_POPUP;
}
/* Dark Colony */
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Merc Direct Draw Driver") == 0 &&
lpWindowName && _strcmpi(lpWindowName, "Direct Draw Driver") == 0 &&
!dwExStyle)
{
dwExStyle |= WS_EX_APPWINDOW;
}
/* Fallout 1/2 */
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "GNW95 Class") == 0 &&
lpWindowName && strstr(lpWindowName, "FALLOUT"))