mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Fixes mouse on win32 and some other relatively minor issues, drops win9x support, adds BUILD_NOLARGEPAGES and BUILD_WIN9X environment var support to disable large page support and force 9x to pass OS version check, fixes issue with crosshair turning white during the next run after starting the game with a new cfg but quitting at the menu instead of entering a level
git-svn-id: https://svn.eduke32.com/eduke32@1532 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
53691113d4
commit
a6dec44579
9 changed files with 185 additions and 172 deletions
|
@ -12,7 +12,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SYSTEM_POOL_SIZE (64 * 1048576)
|
#define SYSTEM_POOL_SIZE (128 * 1048576)
|
||||||
|
|
||||||
extern int32_t _buildargc;
|
extern int32_t _buildargc;
|
||||||
extern const char **_buildargv;
|
extern const char **_buildargv;
|
||||||
|
|
|
@ -1633,7 +1633,7 @@ static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
|
||||||
static void* lastWin32mmap; /* Used as a hint */
|
static void* lastWin32mmap; /* Used as a hint */
|
||||||
#endif /* DEFAULT_GRANULARITY_ALIGNED */
|
#endif /* DEFAULT_GRANULARITY_ALIGNED */
|
||||||
#ifdef ENABLE_LARGE_PAGES
|
#ifdef ENABLE_LARGE_PAGES
|
||||||
static int largepagesavailable = 1;
|
int largepagesavailable = 1;
|
||||||
#endif /* ENABLE_LARGE_PAGES */
|
#endif /* ENABLE_LARGE_PAGES */
|
||||||
static FORCEINLINE void* win32mmap(size_t size) {
|
static FORCEINLINE void* win32mmap(size_t size) {
|
||||||
void* baseaddress = 0;
|
void* baseaddress = 0;
|
||||||
|
|
|
@ -41,6 +41,7 @@ DEALINGS IN THE SOFTWARE.
|
||||||
#define USE_MAGIC_HEADERS 0
|
#define USE_MAGIC_HEADERS 0
|
||||||
#define MAXTHREADSINPOOL 1
|
#define MAXTHREADSINPOOL 1
|
||||||
#define FINEGRAINEDBINS 1
|
#define FINEGRAINEDBINS 1
|
||||||
|
#define ENABLE_LARGE_PAGES
|
||||||
|
|
||||||
#ifndef UNREFERENCED_PARAMETER
|
#ifndef UNREFERENCED_PARAMETER
|
||||||
#define UNREFERENCED_PARAMETER(x) x=x
|
#define UNREFERENCED_PARAMETER(x) x=x
|
||||||
|
@ -85,7 +86,6 @@ DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
/*#define FORCEINLINE*/
|
/*#define FORCEINLINE*/
|
||||||
#define ENABLE_LARGE_PAGES
|
|
||||||
#include "malloc.c.h"
|
#include "malloc.c.h"
|
||||||
#ifdef NDEBUG /* Disable assert checking on release builds */
|
#ifdef NDEBUG /* Disable assert checking on release builds */
|
||||||
#undef DEBUG
|
#undef DEBUG
|
||||||
|
|
|
@ -173,7 +173,7 @@ int32_t main(int32_t argc, char *argv[])
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
nedcreatepool(SYSTEM_POOL_SIZE, -1);
|
nedcreatepool(SYSTEM_POOL_SIZE, -1);
|
||||||
atexit(neddestroysyspool);
|
// atexit(neddestroysyspool);
|
||||||
|
|
||||||
buildkeytranslationtable();
|
buildkeytranslationtable();
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ static const char * GetDInputError(HRESULT code);
|
||||||
static void ShowErrorBox(const char *m);
|
static void ShowErrorBox(const char *m);
|
||||||
static void ShowDDrawErrorBox(const char *m, HRESULT r);
|
static void ShowDDrawErrorBox(const char *m, HRESULT r);
|
||||||
static void ShowDInputErrorBox(const char *m, HRESULT r);
|
static void ShowDInputErrorBox(const char *m, HRESULT r);
|
||||||
static BOOL CheckWinVersion(void);
|
static inline BOOL CheckWinVersion(void);
|
||||||
static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
static BOOL InitDirectDraw(void);
|
static BOOL InitDirectDraw(void);
|
||||||
static void UninitDirectDraw(void);
|
static void UninitDirectDraw(void);
|
||||||
|
@ -134,7 +134,8 @@ static char key_names[256][24];
|
||||||
static uint32_t lastKeyDown = 0;
|
static uint32_t lastKeyDown = 0;
|
||||||
static uint32_t lastKeyTime = 0;
|
static uint32_t lastKeyTime = 0;
|
||||||
|
|
||||||
static OSVERSIONINFO osv;
|
static OSVERSIONINFOEX osv;
|
||||||
|
extern int32_t largepagesavailable;
|
||||||
|
|
||||||
void (*keypresscallback)(int32_t,int32_t) = 0;
|
void (*keypresscallback)(int32_t,int32_t) = 0;
|
||||||
void (*mousepresscallback)(int32_t,int32_t) = 0;
|
void (*mousepresscallback)(int32_t,int32_t) = 0;
|
||||||
|
@ -280,25 +281,28 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in
|
||||||
|
|
||||||
if (CheckWinVersion() || hPrevInst)
|
if (CheckWinVersion() || hPrevInst)
|
||||||
{
|
{
|
||||||
MessageBox(0, "This application requires Windows 2000/XP or better to run.",
|
MessageBox(0, "This application requires Windows 2000 or better to run.",
|
||||||
apptitle, MB_OK|MB_ICONSTOP);
|
apptitle, MB_OK|MB_ICONSTOP);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attempt to enable SeLockMemoryPrivilege, Vista/7 only */
|
/* Attempt to enable SeLockMemoryPrivilege, 2003/Vista/7 only */
|
||||||
if (osv.dwMajorVersion == 6)
|
if (Bgetenv("BUILD_NOLARGEPAGES") == NULL &&
|
||||||
|
(osv.dwMajorVersion == 6 || (osv.dwMajorVersion == 5 && osv.dwMinorVersion == 2)))
|
||||||
{
|
{
|
||||||
HANDLE token;
|
HANDLE token;
|
||||||
if(OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
|
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
|
||||||
{
|
{
|
||||||
TOKEN_PRIVILEGES privs;
|
TOKEN_PRIVILEGES privs;
|
||||||
privs.PrivilegeCount = 1;
|
privs.PrivilegeCount = 1;
|
||||||
if(LookupPrivilegeValue(NULL, SE_LOCK_MEMORY_NAME, &privs.Privileges[0].Luid))
|
if (LookupPrivilegeValue(NULL, SE_LOCK_MEMORY_NAME, &privs.Privileges[0].Luid))
|
||||||
{
|
{
|
||||||
privs.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;
|
privs.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;
|
||||||
if(!AdjustTokenPrivileges(token, FALSE, &privs, 0, NULL, NULL) || GetLastError()!=S_OK)
|
|
||||||
|
if (!AdjustTokenPrivileges(token, FALSE, &privs, 0, NULL, NULL) || GetLastError() != S_OK)
|
||||||
{
|
{
|
||||||
// failure... no large page support for us
|
// failure...
|
||||||
|
largepagesavailable = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CloseHandle(token);
|
CloseHandle(token);
|
||||||
|
@ -307,7 +311,7 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in
|
||||||
|
|
||||||
nedcreatepool(SYSTEM_POOL_SIZE, -1);
|
nedcreatepool(SYSTEM_POOL_SIZE, -1);
|
||||||
|
|
||||||
atexit(neddestroysyspool);
|
// atexit(neddestroysyspool);
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||||
UNREFERENCED_PARAMETER(nCmdShow);
|
UNREFERENCED_PARAMETER(nCmdShow);
|
||||||
|
@ -492,9 +496,7 @@ static int32_t set_windowpos(const osdfuncparm_t *parm)
|
||||||
|
|
||||||
static void print_os_version(void)
|
static void print_os_version(void)
|
||||||
{
|
{
|
||||||
const char *ver = NULL;
|
const char *ver = "";
|
||||||
// I was going to call this 'windows_9x_is_awful', but I couldn't justify ever setting it to 0
|
|
||||||
int32_t awful_windows_9x = 0;
|
|
||||||
|
|
||||||
switch (osv.dwPlatformId)
|
switch (osv.dwPlatformId)
|
||||||
{
|
{
|
||||||
|
@ -510,7 +512,7 @@ static void print_os_version(void)
|
||||||
ver = "XP";
|
ver = "XP";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ver = "Server 2003";
|
ver = osv.wProductType == VER_NT_WORKSTATION ? "XP x64" : "Server 2003";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -521,13 +523,10 @@ static void print_os_version(void)
|
||||||
switch (osv.dwMinorVersion)
|
switch (osv.dwMinorVersion)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
ver = "Vista";
|
ver = osv.wProductType == VER_NT_WORKSTATION ? "Vista" : "Server 2008";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ver = "7";
|
ver = osv.wProductType == VER_NT_WORKSTATION ? "7" : "Server 2008 R2";
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ver = "";
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -535,22 +534,20 @@ static void print_os_version(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VER_PLATFORM_WIN32_WINDOWS:
|
case VER_PLATFORM_WIN32_WINDOWS:
|
||||||
awful_windows_9x = 1;
|
|
||||||
if (osv.dwMinorVersion < 10)
|
if (osv.dwMinorVersion < 10)
|
||||||
ver = "95";
|
ver = "95";
|
||||||
else if (osv.dwMinorVersion < 90)
|
else if (osv.dwMinorVersion < 90)
|
||||||
ver = "98";
|
ver = "98";
|
||||||
else ver = "Me";
|
else ver = "Me";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
|
||||||
ver = "";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ver != NULL)
|
initprintf("OS: Windows %s (%lu.%lu.%lu) %s\n", ver, osv.dwMajorVersion, osv.dwMinorVersion,
|
||||||
initprintf("OS: Windows %s (%lu.%lu.%lu) %s\n", ver, osv.dwMajorVersion, osv.dwMinorVersion,
|
osv.dwPlatformId == VER_PLATFORM_WIN32_NT ? osv.dwBuildNumber : osv.dwBuildNumber&0xffff,
|
||||||
awful_windows_9x?osv.dwBuildNumber&0xffff:osv.dwBuildNumber,osv.szCSDVersion);
|
osv.szCSDVersion);
|
||||||
|
|
||||||
|
if (largepagesavailable)
|
||||||
|
initprintf("Large page support available\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -887,134 +884,139 @@ void setkeypresscallback(void (*callback)(int32_t, int32_t)) { keypresscallback
|
||||||
void setmousepresscallback(void (*callback)(int32_t, int32_t)) { mousepresscallback = callback; }
|
void setmousepresscallback(void (*callback)(int32_t, int32_t)) { mousepresscallback = callback; }
|
||||||
void setjoypresscallback(void (*callback)(int32_t, int32_t)) { joypresscallback = callback; }
|
void setjoypresscallback(void (*callback)(int32_t, int32_t)) { joypresscallback = callback; }
|
||||||
|
|
||||||
|
#define DINPUT_EVENTS 4
|
||||||
|
|
||||||
DWORD WINAPI ProcessMouse(LPVOID lpThreadParameter)
|
DWORD WINAPI ProcessMouse(LPVOID lpThreadParameter)
|
||||||
{
|
{
|
||||||
|
int32_t result;
|
||||||
|
DIDEVICEOBJECTDATA didod[DINPUT_EVENTS];
|
||||||
|
DWORD dwElements;
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(lpThreadParameter);
|
UNREFERENCED_PARAMETER(lpThreadParameter);
|
||||||
|
|
||||||
while (moustat && lpDID[MOUSE])
|
while (moustat && lpDID[MOUSE])
|
||||||
{
|
{
|
||||||
if (!appactive)
|
if (!appactive || !mousegrab)
|
||||||
{
|
{
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((WaitForSingleObject(inputevt[MOUSE], INFINITE)) != WAIT_OBJECT_0)
|
if ((WaitForSingleObject(inputevt[MOUSE], INFINITE)) != WAIT_OBJECT_0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
dwElements = DINPUT_EVENTS;
|
||||||
|
|
||||||
|
result = IDirectInputDevice7_GetDeviceData(lpDID[MOUSE], sizeof(DIDEVICEOBJECTDATA),
|
||||||
|
(LPDIDEVICEOBJECTDATA)&didod[0], &dwElements, 0);
|
||||||
|
|
||||||
|
if (!dwElements || result != DI_OK)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
do
|
||||||
{
|
{
|
||||||
/*DWORD i;*/
|
switch (didod[dwElements-1].dwOfs)
|
||||||
uint32_t t;
|
|
||||||
int32_t result;
|
|
||||||
DIDEVICEOBJECTDATA didod;
|
|
||||||
DWORD dwElements = 1;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
if (!mousegrab)
|
case DIMOFS_X:
|
||||||
break;
|
mousex += (int16_t)didod[dwElements-1].dwData;
|
||||||
|
break;
|
||||||
t = getticks();
|
case DIMOFS_Y:
|
||||||
result = IDirectInputDevice7_GetDeviceData(lpDID[MOUSE], sizeof(DIDEVICEOBJECTDATA),
|
mousey += (int16_t)didod[dwElements-1].dwData;
|
||||||
(LPDIDEVICEOBJECTDATA)&didod, &dwElements, 0);
|
break;
|
||||||
|
case DIMOFS_Z:
|
||||||
if (!dwElements || result != DI_OK)
|
{
|
||||||
break;
|
if ((int32_t)didod[dwElements-1].dwData > 0) // wheel up
|
||||||
// else if (result == DI_OK)
|
|
||||||
{
|
{
|
||||||
// process the mouse events
|
if (mousewheel[0] > 0 && mousepresscallback) mousepresscallback(5,0);
|
||||||
// mousex=0;
|
mousewheel[0] = getticks();
|
||||||
// mousey=0;
|
mouseb |= 16;
|
||||||
// for (i=0; i<dwElements; i++)
|
if (mousepresscallback) mousepresscallback(5, 1);
|
||||||
{
|
}
|
||||||
if (didod.dwOfs == DIMOFS_X)
|
else if ((int32_t)didod[dwElements-1].dwData < 0) // wheel down
|
||||||
mousex += (int16_t)didod.dwData;
|
{
|
||||||
else if (didod.dwOfs == DIMOFS_Y)
|
if (mousewheel[1] > 0 && mousepresscallback) mousepresscallback(6,0);
|
||||||
mousey += (int16_t)didod.dwData;
|
mousewheel[1] = getticks();
|
||||||
else if (didod.dwOfs == DIMOFS_Z)
|
mouseb |= 32;
|
||||||
{
|
if (mousepresscallback) mousepresscallback(6, 1);
|
||||||
if ((int32_t)didod.dwData > 0) // wheel up
|
|
||||||
{
|
|
||||||
if (mousewheel[0] > 0 && mousepresscallback) mousepresscallback(5,0);
|
|
||||||
mousewheel[0] = t;
|
|
||||||
mouseb |= 16; if (mousepresscallback) mousepresscallback(5, 1);
|
|
||||||
}
|
|
||||||
else if ((int32_t)didod.dwData < 0) // wheel down
|
|
||||||
{
|
|
||||||
if (mousewheel[1] > 0 && mousepresscallback) mousepresscallback(6,0);
|
|
||||||
mousewheel[1] = t;
|
|
||||||
mouseb |= 32; if (mousepresscallback) mousepresscallback(6, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs >= DIMOFS_BUTTON0 && didod.dwOfs <= DIMOFS_BUTTON7)
|
|
||||||
{
|
|
||||||
if (didod.dwOfs == DIMOFS_BUTTON0)
|
|
||||||
{
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 1;
|
|
||||||
else mouseb &= ~1;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(1, (mouseb&1)==1);
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs == DIMOFS_BUTTON1)
|
|
||||||
{
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 2;
|
|
||||||
else mouseb &= ~2;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(2, (mouseb&2)==2);
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs == DIMOFS_BUTTON2)
|
|
||||||
{
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 4;
|
|
||||||
else mouseb &= ~4;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(3, (mouseb&4)==4);
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs == DIMOFS_BUTTON3)
|
|
||||||
{
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 8;
|
|
||||||
else mouseb &= ~8;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(4, (mouseb&8)==8);
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs == DIMOFS_BUTTON4)
|
|
||||||
{
|
|
||||||
OSD_Printf("got button4\n");
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 64;
|
|
||||||
else mouseb &= ~64;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(7, (mouseb&64)==64);
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs == DIMOFS_BUTTON5)
|
|
||||||
{
|
|
||||||
OSD_Printf("got button5\n");
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 128;
|
|
||||||
else mouseb &= ~128;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(8, (mouseb&128)==128);
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs == DIMOFS_BUTTON6)
|
|
||||||
{
|
|
||||||
OSD_Printf("got button6\n");
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 256;
|
|
||||||
else mouseb &= ~256;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(9, (mouseb&256)==256);
|
|
||||||
}
|
|
||||||
else if (didod.dwOfs == DIMOFS_BUTTON7)
|
|
||||||
{
|
|
||||||
OSD_Printf("got button7\n");
|
|
||||||
if (didod.dwData & 0x80) mouseb |= 512;
|
|
||||||
else mouseb &= ~512;
|
|
||||||
if (mousepresscallback)
|
|
||||||
mousepresscallback(10, (mouseb&512)==512);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (1);
|
break;
|
||||||
|
|
||||||
|
case DIMOFS_BUTTON0:
|
||||||
|
{
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 1;
|
||||||
|
else mouseb &= ~1;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(1, mouseb & 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIMOFS_BUTTON1:
|
||||||
|
{
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 2;
|
||||||
|
else mouseb &= ~2;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(2, mouseb & 2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIMOFS_BUTTON2:
|
||||||
|
{
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 4;
|
||||||
|
else mouseb &= ~4;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(3, mouseb & 4);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIMOFS_BUTTON3:
|
||||||
|
{
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 8;
|
||||||
|
else mouseb &= ~8;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(4, mouseb & 8);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIMOFS_BUTTON4:
|
||||||
|
{
|
||||||
|
OSD_Printf("got button4\n");
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 64;
|
||||||
|
else mouseb &= ~64;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(7, mouseb & 64);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIMOFS_BUTTON5:
|
||||||
|
{
|
||||||
|
OSD_Printf("got button5\n");
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 128;
|
||||||
|
else mouseb &= ~128;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(8, mouseb & 128);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIMOFS_BUTTON6:
|
||||||
|
{
|
||||||
|
OSD_Printf("got button6\n");
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 256;
|
||||||
|
else mouseb &= ~256;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(9, mouseb & 256);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DIMOFS_BUTTON7:
|
||||||
|
{
|
||||||
|
OSD_Printf("got button7\n");
|
||||||
|
if (didod[dwElements-1].dwData & 0x80) mouseb |= 512;
|
||||||
|
else mouseb &= ~512;
|
||||||
|
if (mousepresscallback)
|
||||||
|
mousepresscallback(10, mouseb & 512);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
while (--dwElements);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// initmouse() -- init mouse input
|
// initmouse() -- init mouse input
|
||||||
//
|
//
|
||||||
|
@ -1043,7 +1045,7 @@ int32_t initmouse(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetThreadPriority(mousethread, THREAD_PRIORITY_ABOVE_NORMAL);
|
SetThreadPriority(mousethread, THREAD_PRIORITY_TIME_CRITICAL);
|
||||||
ResumeThread(mousethread);
|
ResumeThread(mousethread);
|
||||||
// initprintf("OK\n");
|
// initprintf("OK\n");
|
||||||
|
|
||||||
|
@ -1305,7 +1307,8 @@ static BOOL CALLBACK InitDirectInput_enum(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRe
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
d = "OTHER"; break;
|
// d = "OTHER"; break;
|
||||||
|
return DIENUM_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
initprintf(" * %s: %s\n", d, lpddi->tszProductName);
|
initprintf(" * %s: %s\n", d, lpddi->tszProductName);
|
||||||
|
@ -3410,16 +3413,20 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp)
|
||||||
#ifdef POLYMER
|
#ifdef POLYMER
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc.")) {
|
if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc."))
|
||||||
|
{
|
||||||
pr_ati_fboworkaround = 1;
|
pr_ati_fboworkaround = 1;
|
||||||
initprintf("Enabling ATI FBO color attachment workaround.\n");
|
initprintf("Enabling ATI FBO color attachment workaround.\n");
|
||||||
|
|
||||||
if (!Bstrncmp(glinfo.renderer,"Radeon X1", 9)) {
|
if (!Bstrncmp(glinfo.renderer,"Radeon X1", 9))
|
||||||
|
{
|
||||||
pr_ati_nodepthoffset = 1;
|
pr_ati_nodepthoffset = 1;
|
||||||
initprintf("Enabling ATI R520 polygon offset workaround.\n");
|
initprintf("Enabling ATI R520 polygon offset workaround.\n");
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
pr_ati_nodepthoffset = 0;
|
pr_ati_nodepthoffset = 0;
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
pr_ati_fboworkaround = 0;
|
pr_ati_fboworkaround = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -4160,24 +4167,22 @@ static void ShowErrorBox(const char *m)
|
||||||
//
|
//
|
||||||
// CheckWinVersion() -- check to see what version of Windows we happen to be running under
|
// CheckWinVersion() -- check to see what version of Windows we happen to be running under
|
||||||
//
|
//
|
||||||
static BOOL CheckWinVersion(void)
|
static inline BOOL CheckWinVersion(void)
|
||||||
{
|
{
|
||||||
ZeroMemory(&osv, sizeof(osv));
|
ZeroMemory(&osv, sizeof(osv));
|
||||||
osv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
osv.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
||||||
|
|
||||||
if (!GetVersionEx(&osv)) return TRUE;
|
if (!GetVersionEx(&osv)) return TRUE;
|
||||||
|
|
||||||
// haha, yeah, like it will work on Win32s
|
// we don't like anything older than Windows 2000
|
||||||
if (osv.dwPlatformId == VER_PLATFORM_WIN32s) return TRUE;
|
else if (osv.dwMajorVersion >= 5) return FALSE;
|
||||||
|
|
||||||
// we don't like NT 3.51
|
// BUILD_WIN9X variable allows attempting to run on 9x, for masochists and sodomites
|
||||||
if (osv.dwMajorVersion < 4) return TRUE;
|
else if (Bgetenv("BUILD_WIN9X") != NULL && osv.dwMajorVersion == 4 &&
|
||||||
|
osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
// nor do we like NT 4
|
else return TRUE;
|
||||||
if (osv.dwPlatformId == VER_PLATFORM_WIN32_NT &&
|
|
||||||
osv.dwMajorVersion == 4) return TRUE;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1314,6 +1314,7 @@ void ExtShowWallData(int16_t wallnum) //F6
|
||||||
case BOSS3:
|
case BOSS3:
|
||||||
case TANK:
|
case TANK:
|
||||||
case NEWBEAST:
|
case NEWBEAST:
|
||||||
|
case NEWBEASTSTAYPUT:
|
||||||
case BOSS4:
|
case BOSS4:
|
||||||
|
|
||||||
numsprite[sprite[i].picnum]++;
|
numsprite[sprite[i].picnum]++;
|
||||||
|
@ -1422,6 +1423,7 @@ void ExtShowWallData(int16_t wallnum) //F6
|
||||||
case BOSS3:
|
case BOSS3:
|
||||||
case TANK:
|
case TANK:
|
||||||
case NEWBEAST:
|
case NEWBEAST:
|
||||||
|
case NEWBEASTSTAYPUT:
|
||||||
case BOSS4:
|
case BOSS4:
|
||||||
numsprite[sprite[i].hitag]++;
|
numsprite[sprite[i].hitag]++;
|
||||||
default:
|
default:
|
||||||
|
@ -10343,7 +10345,8 @@ void ExtPreCheckKeys(void) // just before drawrooms
|
||||||
case LIZMANSPITTING :
|
case LIZMANSPITTING :
|
||||||
case LIZMANFEEDING :
|
case LIZMANFEEDING :
|
||||||
case LIZMANJUMP :
|
case LIZMANJUMP :
|
||||||
|
case NEWBEASTSTAYPUT :
|
||||||
|
case BOSS1STAYPUT :
|
||||||
{
|
{
|
||||||
int32_t k;
|
int32_t k;
|
||||||
if (frames!=0)
|
if (frames!=0)
|
||||||
|
@ -10593,6 +10596,8 @@ void ExtAnalyzeSprites(void)
|
||||||
case LIZMANSPITTING :
|
case LIZMANSPITTING :
|
||||||
case LIZMANFEEDING :
|
case LIZMANFEEDING :
|
||||||
case LIZMANJUMP :
|
case LIZMANJUMP :
|
||||||
|
case NEWBEASTSTAYPUT :
|
||||||
|
case BOSS1STAYPUT :
|
||||||
if (skill!=4)
|
if (skill!=4)
|
||||||
{
|
{
|
||||||
if (tspr->lotag>skill+1)
|
if (tspr->lotag>skill+1)
|
||||||
|
|
|
@ -11087,6 +11087,9 @@ CLEAN_DIRECTORY:
|
||||||
|
|
||||||
MAIN_LOOP_RESTART:
|
MAIN_LOOP_RESTART:
|
||||||
|
|
||||||
|
G_GetCrosshairColor();
|
||||||
|
G_SetCrosshairColor(CrosshairColors.r, CrosshairColors.g, CrosshairColors.b);
|
||||||
|
|
||||||
if (ud.warp_on == 0)
|
if (ud.warp_on == 0)
|
||||||
{
|
{
|
||||||
if (ud.multimode > 1 && boardfilename[0] != 0)
|
if (ud.multimode > 1 && boardfilename[0] != 0)
|
||||||
|
|
|
@ -144,7 +144,7 @@ static const char *C_GetLabelType(int32_t type)
|
||||||
if (x[0]) Bstrcat(x, " or ");
|
if (x[0]) Bstrcat(x, " or ");
|
||||||
Bstrcat(x, LabelTypeText[i]);
|
Bstrcat(x, LabelTypeText[i]);
|
||||||
}
|
}
|
||||||
return strdup(x);
|
return Bstrdup(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUMKEYWORDS (int32_t)(sizeof(keyw)/sizeof(keyw[0]))
|
#define NUMKEYWORDS (int32_t)(sizeof(keyw)/sizeof(keyw[0]))
|
||||||
|
|
|
@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
#include "duke3d.h"
|
#include "duke3d.h"
|
||||||
|
|
||||||
const char *s_buildDate = "20091006";
|
const char *s_buildDate = "20091015";
|
||||||
char *MusicPtr = NULL;
|
char *MusicPtr = NULL;
|
||||||
int32_t g_musicSize;
|
int32_t g_musicSize;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue