mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
Split r3159..r3161, part 3: MSVC, nedmalloc, *layer, startup windows.
git-svn-id: https://svn.eduke32.com/eduke32@3168 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d37278ec58
commit
9dd3748b03
12 changed files with 98 additions and 58 deletions
|
@ -100,6 +100,7 @@
|
|||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <direct.h>
|
||||
# define inline __inline
|
||||
# define longlong(x) x##i64
|
||||
static inline float nearbyintf(float x)
|
||||
|
@ -500,7 +501,13 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff
|
|||
# else
|
||||
# define Btell tell
|
||||
# endif
|
||||
# ifdef _MSC_VER
|
||||
# define Bstat stat
|
||||
# define Bfstat fstat
|
||||
# else
|
||||
# define Bstat stat
|
||||
# define Bfstat fstat
|
||||
# endif
|
||||
# define Bfileno fileno
|
||||
# define Bferror ferror
|
||||
# define Bfopen fopen
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _STDINT
|
||||
#define _STDINT
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
|
@ -245,3 +246,4 @@ typedef uint64_t uintmax_t;
|
|||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
||||
#endif
|
|
@ -595,7 +595,7 @@ NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedpmemalign(nedpo
|
|||
/*! \ingroup v2malloc
|
||||
\brief Allocates a block of memory sized \em size from pool \em p, aligned to \em alignment and according to the flags \em flags.
|
||||
*/
|
||||
NEDMALLOCDEPRECATED NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedpmalloc2(nedpool *p, size_t size, size_t alignment=0, unsigned flags=0) THROWSPEC;
|
||||
NEDMALLOCEXTSPEC NEDMALLOCNOALIASATTR NEDMALLOCPTRATTR void * nedpmalloc2(nedpool *p, size_t size, size_t alignment=0, unsigned flags=0) THROWSPEC;
|
||||
/*! \ingroup v2malloc
|
||||
\brief Resizes the block of memory at \em mem in pool \em p to size \em size, aligned to \em alignment and according to the flags \em flags.
|
||||
*/
|
||||
|
|
|
@ -315,7 +315,7 @@ char *listsearchpath(int32_t initp)
|
|||
|
||||
int32_t addsearchpath(const char *p)
|
||||
{
|
||||
struct stat st;
|
||||
struct Bstat st;
|
||||
char *s;
|
||||
searchpath_t *srch;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define _WIN32_IE 0x0400
|
||||
//#define _WIN32_IE 0x0400
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#include <windows.h>
|
||||
#include <shlobj.h>
|
||||
|
@ -570,8 +570,8 @@ char *Bgetsystemdrives(void)
|
|||
|
||||
int32_t Bfilelength(int32_t fd)
|
||||
{
|
||||
struct stat st;
|
||||
if (fstat(fd, &st) < 0) return -1;
|
||||
struct Bstat st;
|
||||
if (Bfstat(fd, &st) < 0) return -1;
|
||||
return(int32_t)(st.st_size);
|
||||
}
|
||||
|
||||
|
@ -643,7 +643,7 @@ struct Bdirent *Breaddir(BDIR *dir)
|
|||
{
|
||||
BDIR_real *dirr = (BDIR_real *)dir;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
struct Bstat st;
|
||||
char *fn;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
@ -294,7 +294,7 @@ bwglSetPixelFormatProcPtr bwglSetPixelFormat;
|
|||
bwglSwapIntervalEXTProcPtr bwglSwapIntervalEXT;
|
||||
bwglCreateContextAttribsARBProcPtr bwglCreateContextAttribsARB;
|
||||
|
||||
static HANDLE hGLDLL, hGLUDLL;
|
||||
static HMODULE hGLDLL, hGLUDLL;
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
|
||||
|
|
|
@ -527,7 +527,7 @@ int32_t initinput(void)
|
|||
for (i=0; i<SDLK_LAST; i++)
|
||||
{
|
||||
if (!keytranslation[i]) continue;
|
||||
Bstrncpyz(key_names[ keytranslation[i] ], SDL_GetKeyName(i), sizeof(key_names[i]));
|
||||
Bstrncpyz(key_names[ keytranslation[i] ], SDL_GetKeyName((SDLKey)i), sizeof(key_names[i]));
|
||||
}
|
||||
#else
|
||||
for (i=0; i<SDL_NUM_SCANCODES; i++)
|
||||
|
|
|
@ -192,9 +192,9 @@ static void PopulateForm(void)
|
|||
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
||||
if (i == mode3d)
|
||||
{
|
||||
g_signal_handlers_block_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
||||
g_signal_handlers_block_by_func(box3d, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||
gtk_combo_box_set_active_iter(box3d, &iter);
|
||||
g_signal_handlers_unblock_by_func(box3d, on_vmode3dcombo_changed, NULL);
|
||||
g_signal_handlers_unblock_by_func(box3d, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||
}
|
||||
|
||||
// only 8-bit modes get used for 2D
|
||||
|
@ -204,9 +204,9 @@ static void PopulateForm(void)
|
|||
gtk_list_store_set(modes2d, &iter, 0,buf, 1,i, -1);
|
||||
if (i == mode2d)
|
||||
{
|
||||
g_signal_handlers_block_by_func(box2d, on_vmode2dcombo_changed, NULL);
|
||||
g_signal_handlers_block_by_func(box2d, (gpointer)on_vmode2dcombo_changed, NULL);
|
||||
gtk_combo_box_set_active_iter(box2d, &iter);
|
||||
g_signal_handlers_unblock_by_func(box2d, on_vmode2dcombo_changed, NULL);
|
||||
g_signal_handlers_unblock_by_func(box2d, (gpointer)on_vmode2dcombo_changed, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ static GtkWidget *create_window(void)
|
|||
// 2D video mode label
|
||||
stwidgets.vmode2dlabel = gtk_label_new_with_mnemonic("_2D Video mode:");
|
||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode2dlabel), 0.3, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||
|
||||
// 2D video mode combo
|
||||
{
|
||||
|
@ -268,14 +268,15 @@ static GtkWidget *create_window(void)
|
|||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode2dcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode2dcombo, 1,2, 0,1,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 6);
|
||||
gtk_widget_add_accelerator(stwidgets.vmode2dcombo, "grab_focus", stwidgets.accel_group,
|
||||
GDK_2, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
// Fullscreen checkbox
|
||||
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.fullscreencheck, 2,3, 0,1, GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.fullscreencheck, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||
gtk_widget_add_accelerator(stwidgets.fullscreencheck, "grab_focus", stwidgets.accel_group,
|
||||
GDK_F, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
@ -283,7 +284,7 @@ static GtkWidget *create_window(void)
|
|||
// 3D video mode label
|
||||
stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_3D Video mode:");
|
||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 1,2, GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 1,2, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||
|
||||
// 3D video mode combo
|
||||
{
|
||||
|
@ -297,17 +298,19 @@ static GtkWidget *create_window(void)
|
|||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.vmode3dcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 1,2,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0);
|
||||
gtk_widget_add_accelerator(stwidgets.vmode3dcombo, "grab_focus", stwidgets.accel_group,
|
||||
GDK_3, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
// Empty horizontal layout
|
||||
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, 0, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,1, 2,3, (GtkAttachOptions)0,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
|
||||
// Always show config checkbox
|
||||
stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show configuration on start");
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,2, 3,4, GTK_FILL, 0, 4, 6);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,2, 3,4, GTK_FILL, (GtkAttachOptions)0, 4, 6);
|
||||
gtk_widget_add_accelerator(stwidgets.alwaysshowcheck, "grab_focus", stwidgets.accel_group,
|
||||
GDK_A, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
@ -348,7 +351,7 @@ static GtkWidget *create_window(void)
|
|||
GDK_C, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_add_accelerator(stwidgets.cancelbutton, "clicked", stwidgets.accel_group,
|
||||
GDK_Escape, 0,
|
||||
GDK_Escape, (GdkModifierType)0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
stwidgets.cancelbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||
|
@ -371,7 +374,7 @@ static GtkWidget *create_window(void)
|
|||
GDK_S, GDK_MOD1_MASK,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
gtk_widget_add_accelerator(stwidgets.startbutton, "clicked", stwidgets.accel_group,
|
||||
GDK_Return, 0,
|
||||
GDK_Return, (GdkModifierType)0,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
|
||||
stwidgets.startbuttonalign = gtk_alignment_new(0.5, 0.5, 0, 0);
|
||||
|
|
|
@ -8,10 +8,25 @@
|
|||
#define CINTERFACE
|
||||
|
||||
// bug in the dx headers
|
||||
#define bMAKEDIPROP(prop) ((REFGUID)(prop))
|
||||
#define bDIPROP_BUFFERSIZE bMAKEDIPROP(1)
|
||||
#define bDIPROP_DEADZONE bMAKEDIPROP(5)
|
||||
#if defined (_MSC_VER) || !defined(__cplusplus)
|
||||
#define bDIPROP_BUFFERSIZE MAKEDIPROP(1)
|
||||
#define bDIPROP_DEADZONE MAKEDIPROP(5)
|
||||
#define bDIPROP_SATURATION MAKEDIPROP(6)
|
||||
#else
|
||||
#define bMAKEDIPROP(prop) ((REFGUID)(prop))
|
||||
#define bDIPROP_BUFFERSIZE bMAKEDIPROP(1)
|
||||
#define bDIPROP_DEADZONE bMAKEDIPROP(5)
|
||||
#define bDIPROP_SATURATION bMAKEDIPROP(6)
|
||||
#endif
|
||||
|
||||
// wtf, Microsoft?
|
||||
#if defined (_MSC_VER) && defined(__cplusplus)
|
||||
# define bREFGUID (REFGUID)
|
||||
# define bREFIID (REFIID)
|
||||
#else
|
||||
# define bREFGUID &
|
||||
# define bREFIID &
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <ddraw.h>
|
||||
|
@ -22,6 +37,10 @@
|
|||
|
||||
#include <math.h> // pow
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <algorithm>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
@ -59,7 +78,7 @@ static int32_t winlayer_have_ATI = 0;
|
|||
int32_t _buildargc = 0;
|
||||
const char **_buildargv = NULL;
|
||||
static char *argvbuf = NULL;
|
||||
extern int32_t app_main(int32_t argc, const char *argv[]);
|
||||
extern int32_t app_main(int32_t argc, const char **argv);
|
||||
extern void app_crashhandler(void);
|
||||
|
||||
// Windows crud
|
||||
|
@ -362,9 +381,13 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in
|
|||
#ifndef DEBUGGINGAIDS
|
||||
if ((nedhandle = LoadLibrary("nedmalloc.dll")))
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
nedalloc::nedpool_t *(WINAPI *nedcreatepool)(size_t, int);
|
||||
if ((nedcreatepool = (nedalloc::nedpool_t *(WINAPI *)(size_t, int))GetProcAddress(nedhandle, "nedcreatepool")))
|
||||
#else
|
||||
nedpool *(WINAPI *nedcreatepool)(size_t, int);
|
||||
|
||||
if ((nedcreatepool = (void *)GetProcAddress(nedhandle, "nedcreatepool")))
|
||||
#endif
|
||||
nedcreatepool(SYSTEM_POOL_SIZE, -1);
|
||||
}
|
||||
#else
|
||||
|
@ -964,7 +987,7 @@ void getjoydeadzone(int32_t axis, uint16_t *dead, uint16_t *satur)
|
|||
dipdw.diph.dwHow = DIPH_BYOFFSET;
|
||||
}
|
||||
|
||||
result = IDirectInputDevice7_GetProperty(lpDID, bDIPROP_DEADZONE, &dipdw.diph);
|
||||
result = IDirectInputDevice7_GetProperty(lpDID, bDIPROP_DEADZONE, (LPDIPROPHEADER)&dipdw.diph);
|
||||
if (FAILED(result))
|
||||
{
|
||||
//ShowDInputErrorBox("Failed getting joystick dead zone", result);
|
||||
|
@ -1110,7 +1133,7 @@ static BOOL InitDirectInput(void)
|
|||
}
|
||||
}
|
||||
|
||||
aDirectInputCreateA = (void *)GetProcAddress(hDInputDLL, "DirectInputCreateA");
|
||||
aDirectInputCreateA = (HRESULT(WINAPI *)(HINSTANCE, DWORD, LPDIRECTINPUT7A *, LPUNKNOWN))GetProcAddress(hDInputDLL, "DirectInputCreateA");
|
||||
if (!aDirectInputCreateA) ShowErrorBox("Error fetching DirectInputCreateA()");
|
||||
|
||||
result = aDirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &lpDI, NULL);
|
||||
|
@ -1133,11 +1156,12 @@ static BOOL InitDirectInput(void)
|
|||
*devicedef.did = NULL;
|
||||
|
||||
// initprintf(" - Creating %s device\n", devicedef.name);
|
||||
result = IDirectInput7_CreateDeviceEx(lpDI, &guidDevs, &IID_IDirectInputDevice7, (void *)&dev, NULL);
|
||||
result = IDirectInput7_CreateDeviceEx(lpDI, bREFGUID guidDevs, bREFIID IID_IDirectInputDevice7, (LPVOID *)&dev, NULL);
|
||||
|
||||
if (FAILED(result)) { HorribleDInputDeath("Failed creating device", result); }
|
||||
else if (result != DI_OK) initprintf(" Created device with warning: %s\n",GetDInputError(result));
|
||||
|
||||
result = IDirectInputDevice7_QueryInterface(dev, &IID_IDirectInputDevice7, (LPVOID *)&dev2);
|
||||
result = IDirectInputDevice7_QueryInterface(dev, bREFIID IID_IDirectInputDevice7, (LPVOID *)&dev2);
|
||||
IDirectInputDevice7_Release(dev);
|
||||
if (FAILED(result)) { HorribleDInputDeath("Failed querying DirectInput7 interface for device", result); }
|
||||
else if (result != DI_OK) initprintf(" Queried IDirectInputDevice7 interface with warning: %s\n",GetDInputError(result));
|
||||
|
@ -1683,7 +1707,7 @@ static void ToggleDesktopComposition(BOOL compEnable)
|
|||
static HRESULT(WINAPI *aDwmEnableComposition)(UINT);
|
||||
|
||||
if (!hDWMApiDLL && (hDWMApiDLL = LoadLibrary("DWMAPI.DLL")))
|
||||
aDwmEnableComposition = (void *)GetProcAddress(hDWMApiDLL, "DwmEnableComposition");
|
||||
aDwmEnableComposition = (HRESULT(WINAPI *)(UINT))GetProcAddress(hDWMApiDLL, "DwmEnableComposition");
|
||||
|
||||
if (aDwmEnableComposition)
|
||||
{
|
||||
|
@ -2271,7 +2295,7 @@ static int32_t setgammaramp(WORD gt[3][256])
|
|||
|
||||
if (!(DDdwCaps2 & DDCAPS2_PRIMARYGAMMA)) return -1;
|
||||
|
||||
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, &IID_IDirectDrawGammaControl, (LPVOID)&gam);
|
||||
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, bREFIID IID_IDirectDrawGammaControl, (LPVOID *)&gam);
|
||||
if (hr != DD_OK)
|
||||
{
|
||||
// ShowDDrawErrorBox("Error querying gamma control", hr);
|
||||
|
@ -2343,7 +2367,7 @@ static int32_t getgammaramp(WORD gt[3][256])
|
|||
|
||||
if (!(DDdwCaps2 & DDCAPS2_PRIMARYGAMMA)) return -1;
|
||||
|
||||
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, &IID_IDirectDrawGammaControl, (LPVOID)&gam);
|
||||
hr = IDirectDrawSurface_QueryInterface(lpDDSPrimary, bREFIID IID_IDirectDrawGammaControl, (LPVOID *)&gam);
|
||||
if (hr != DD_OK)
|
||||
{
|
||||
ShowDDrawErrorBox("Error querying gamma control", hr);
|
||||
|
@ -2403,7 +2427,7 @@ static BOOL InitDirectDraw(void)
|
|||
}
|
||||
|
||||
// get the pointer to DirectDrawEnumerate
|
||||
aDirectDrawEnumerate = (void *)GetProcAddress(hDDrawDLL, "DirectDrawEnumerateA");
|
||||
aDirectDrawEnumerate = (HRESULT(WINAPI *)(LPDDENUMCALLBACK, LPVOID))GetProcAddress(hDDrawDLL, "DirectDrawEnumerateA");
|
||||
if (!aDirectDrawEnumerate)
|
||||
{
|
||||
ShowErrorBox("Error fetching DirectDrawEnumerate()");
|
||||
|
@ -2416,7 +2440,7 @@ static BOOL InitDirectDraw(void)
|
|||
aDirectDrawEnumerate(InitDirectDraw_enum, NULL);
|
||||
|
||||
// get the pointer to DirectDrawCreate
|
||||
aDirectDrawCreate = (void *)GetProcAddress(hDDrawDLL, "DirectDrawCreate");
|
||||
aDirectDrawCreate = (HRESULT(WINAPI *)(GUID *, LPDIRECTDRAW *, IUnknown *))GetProcAddress(hDDrawDLL, "DirectDrawCreate");
|
||||
if (!aDirectDrawCreate)
|
||||
{
|
||||
ShowErrorBox("Error fetching DirectDrawCreate()");
|
||||
|
@ -3812,13 +3836,13 @@ static BOOL RegisterWindowClass(void)
|
|||
wcx.cbClsExtra = 0;
|
||||
wcx.cbWndExtra = 0;
|
||||
wcx.hInstance = hInstance;
|
||||
wcx.hIcon = LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
||||
wcx.hIcon = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
|
||||
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wcx.hbrBackground = (HBRUSH)COLOR_GRAYTEXT;
|
||||
wcx.lpszMenuName = NULL;
|
||||
wcx.lpszClassName = WindowClass;
|
||||
wcx.hIconSm = LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
||||
wcx.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(100), IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
|
||||
if (!RegisterClassEx(&wcx))
|
||||
{
|
||||
|
|
|
@ -603,7 +603,7 @@ int32_t CONFIG_ReadSetup(void)
|
|||
// #ifdef _WIN32
|
||||
if (g_noSetup == 0 && g_modDir[0] == '/')
|
||||
{
|
||||
struct stat st;
|
||||
struct Bstat st;
|
||||
SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&g_modDir[0]);
|
||||
|
||||
if (Bstat(g_modDir, &st))
|
||||
|
@ -792,7 +792,7 @@ void CONFIG_WriteSetup(uint32_t flags)
|
|||
SCRIPT_PutNumber(ud.config.scripthandle, "Screen Setup", "ScreenWidth",ud.config.ScreenWidth,FALSE,FALSE); // JBF 20031206
|
||||
|
||||
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",&g_grpNamePtr[0]);
|
||||
SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",g_grpNamePtr);
|
||||
|
||||
// XXX: should be "if compiled without startup GUI"
|
||||
#if !defined __linux || defined HAVE_GTK2
|
||||
|
|
|
@ -5101,7 +5101,7 @@ repeatcase:
|
|||
if (Bstrcmp(setupfilename,SETUPFILENAME) == 0) // not set to something else via -cfg
|
||||
{
|
||||
char temp[BMAX_PATH];
|
||||
struct stat st;
|
||||
struct Bstat st;
|
||||
int32_t fullscreen = ud.config.ScreenMode;
|
||||
int32_t xdim = ud.config.ScreenWidth, ydim = ud.config.ScreenHeight, bpp = ud.config.ScreenBPP;
|
||||
int32_t usemouse = ud.config.UseMouse, usejoy = ud.config.UseJoystick;
|
||||
|
|
|
@ -354,9 +354,9 @@ static void PopulateForm(unsigned char pgs)
|
|||
gtk_list_store_set(modes3d, &iter, 0,buf, 1,i, -1);
|
||||
if (i == mode3d)
|
||||
{
|
||||
g_signal_handlers_block_by_func(stwidgets.vmode3dcombo, on_vmode3dcombo_changed, NULL);
|
||||
g_signal_handlers_block_by_func(stwidgets.vmode3dcombo, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(stwidgets.vmode3dcombo), &iter);
|
||||
g_signal_handlers_unblock_by_func(stwidgets.vmode3dcombo, on_vmode3dcombo_changed, NULL);
|
||||
g_signal_handlers_unblock_by_func(stwidgets.vmode3dcombo, (gpointer)on_vmode3dcombo_changed, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -461,9 +461,9 @@ static void PopulateForm(unsigned char pgs)
|
|||
if (!Bstrcasecmp(fg->name, settings.selectedgrp))
|
||||
{
|
||||
GtkTreeSelection *sel = gtk_tree_view_get_selection(gamelist);
|
||||
g_signal_handlers_block_by_func(sel, on_gamelist_selection_changed, NULL);
|
||||
g_signal_handlers_block_by_func(sel, (gpointer)on_gamelist_selection_changed, NULL);
|
||||
gtk_tree_selection_select_iter(sel, &iter);
|
||||
g_signal_handlers_unblock_by_func(sel, on_gamelist_selection_changed, NULL);
|
||||
g_signal_handlers_unblock_by_func(sel, (gpointer)on_gamelist_selection_changed, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -524,9 +524,9 @@ static GtkWidget *create_window(void)
|
|||
stwidgets.vmode3dlabel = gtk_label_new_with_mnemonic("_Video mode:");
|
||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.vmode3dlabel), 0.3, 0);
|
||||
#ifdef POLYMER
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 0);
|
||||
#else
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, 0, 4, 7);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dlabel, 0,1, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||
#endif
|
||||
|
||||
// 3D video mode combo
|
||||
|
@ -543,17 +543,18 @@ static GtkWidget *create_window(void)
|
|||
}
|
||||
|
||||
#ifdef POLYMER
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0);
|
||||
#else
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, 0, 4, 7);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.vmode3dcombo, 1,2, 0,1, GTK_EXPAND | GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||
#endif
|
||||
|
||||
// Fullscreen checkbox
|
||||
stwidgets.displayvlayout = gtk_vbox_new(TRUE, 0);
|
||||
#ifdef POLYMER
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, 0, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 0);
|
||||
#else
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, 0, 4, 7);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.displayvlayout, 2,3, 0,1, GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||
#endif
|
||||
|
||||
stwidgets.fullscreencheck = gtk_check_button_new_with_mnemonic("_Fullscreen");
|
||||
|
@ -568,7 +569,7 @@ static GtkWidget *create_window(void)
|
|||
// Input devices LabelText
|
||||
stwidgets.inputdevlabel = gtk_label_new_with_mnemonic("_Input devices:");
|
||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.inputdevlabel), 0.3, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevlabel, 0,1, 1,2, GTK_FILL, 0, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevlabel, 0,1, 1,2, GTK_FILL, (GtkAttachOptions)0, 4, 0);
|
||||
|
||||
// Input devices combo
|
||||
{
|
||||
|
@ -582,12 +583,13 @@ static GtkWidget *create_window(void)
|
|||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.inputdevcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevcombo, 1,2, 1,2, GTK_EXPAND | GTK_FILL, 0, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.inputdevcombo, 1,2, 1,2,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 0);
|
||||
|
||||
// Custom mod LabelText
|
||||
stwidgets.custommodlabel = gtk_label_new_with_mnemonic("Custom _game:");
|
||||
gtk_misc_set_alignment(GTK_MISC(stwidgets.custommodlabel), 0.3, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodlabel, 0,1, 2,3, GTK_FILL, 0, 4, 7);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodlabel, 0,1, 2,3, GTK_FILL, (GtkAttachOptions)0, 4, 7);
|
||||
|
||||
// Custom mod combo
|
||||
{
|
||||
|
@ -601,19 +603,21 @@ static GtkWidget *create_window(void)
|
|||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, FALSE);
|
||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(stwidgets.custommodcombo), cell, "text", 0, NULL);
|
||||
}
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodcombo, 1,2, 2,3, GTK_EXPAND | GTK_FILL, 0, 4, 7);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.custommodcombo, 1,2, 2,3,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)0, 4, 7);
|
||||
|
||||
// Empty horizontal layout
|
||||
stwidgets.emptyhlayout = gtk_hbox_new(TRUE, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,3, 3,4, 0, GTK_EXPAND | GTK_FILL, 4, 0);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.emptyhlayout, 0,3, 3,4, (GtkAttachOptions)0,
|
||||
(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 4, 0);
|
||||
|
||||
// Autoload checkbox
|
||||
stwidgets.autoloadcheck = gtk_check_button_new_with_mnemonic("_Enable \"autoload\" folder");
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.autoloadcheck, 0,3, 4,5, GTK_FILL, 0, 2, 2);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.autoloadcheck, 0,3, 4,5, GTK_FILL, (GtkAttachOptions)0, 2, 2);
|
||||
|
||||
// Always show config checkbox
|
||||
stwidgets.alwaysshowcheck = gtk_check_button_new_with_mnemonic("_Always show this window at startup");
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,3, 5,6, GTK_FILL, 0, 2, 2);
|
||||
gtk_table_attach(GTK_TABLE(stwidgets.configtlayout), stwidgets.alwaysshowcheck, 0,3, 5,6, GTK_FILL, (GtkAttachOptions)0, 2, 2);
|
||||
|
||||
// Configuration tab
|
||||
stwidgets.configtab = gtk_label_new("Configuration");
|
||||
|
|
Loading…
Reference in a new issue