#include "dungeon.h"
/*
- * Extract the "WIN32" flag from the compiler
- */
-#if defined(__WIN32__) || defined(__WINNT__) || defined(__NT__)
-# ifndef WIN32
-# define WIN32
-# endif
-#endif
-
-/*
* Available graphic modes
*/
#define GRAPHICS_NONE 0
#define MMNOMMIO /* Multimedia file I/O support */
#define MMNOMMSYSTEM /* General MMSYSTEM functions */
+#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
+
/*
* Standard sound names
*/
*/
#include "readdib.h"
- /*
- * Hack -- Fake declarations from "dos.h"
- */
-#ifdef WIN32
-#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
-#else /* WIN32 */
-#define FA_LABEL 0x08 /* Volume label */
-#define FA_DIREC 0x10 /* Directory */
-unsigned _cdecl _dos_getfileattr(concptr, unsigned *);
-#endif /* WIN32 */
-
-/*
- * Silliness in WIN32 drawing routine
- */
-#ifdef WIN32
-# define MoveTo(H,X,Y) MoveToEx(H, X, Y, NULL)
-#endif /* WIN32 */
+#define MoveTo(H,X,Y) MoveToEx(H, X, Y, NULL)
/*
* Silliness for Windows 95
static bool check_file(concptr s)
{
char path[1024];
-
-#ifdef WIN32
-
DWORD attrib;
-#else /* WIN32 */
-
- unsigned int attrib;
-
-#endif /* WIN32 */
-
/* Copy it */
strcpy(path, s);
-#ifdef WIN32
-
/* Examine */
attrib = GetFileAttributes(path);
/* Prohibit directory */
if (attrib & FILE_ATTRIBUTE_DIRECTORY) return FALSE;
-#else /* WIN32 */
-
- /* Examine and verify */
- if (_dos_getfileattr(path, &attrib)) return FALSE;
-
- /* Prohibit something */
- if (attrib & FA_LABEL) return FALSE;
-
- /* Prohibit directory */
- if (attrib & FA_DIREC) return FALSE;
-
-#endif /* WIN32 */
-
/* Success */
return TRUE;
}
int i;
char path[1024];
-
-#ifdef WIN32
-
DWORD attrib;
-#else /* WIN32 */
-
- unsigned int attrib;
-
-#endif /* WIN32 */
-
/* Copy it */
strcpy(path, s);
/* Remove trailing backslash */
if (i && (path[i - 1] == '\\')) path[--i] = '\0';
-#ifdef WIN32
-
/* Examine */
attrib = GetFileAttributes(path);
/* Require directory */
if (!(attrib & FILE_ATTRIBUTE_DIRECTORY)) return FALSE;
-#else /* WIN32 */
-
- /* Examine and verify */
- if (_dos_getfileattr(path, &attrib)) return FALSE;
-
- /* Prohibit something */
- if (attrib & FA_LABEL) return FALSE;
-
- /* Require directory */
- if (!(attrib & FA_DIREC)) return FALSE;
-
-#endif /* WIN32 */
-
/* Success */
return TRUE;
}
/* Build the path */
path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_external(i)]);
-#ifdef WIN32
-
/* Play the sound, catch errors */
return (PlaySound(buf, 0, SND_FILENAME | SND_ASYNC));
-
-#else /* WIN32 */
-
- /* Play the sound, catch errors */
- return (sndPlaySound(buf, SND_ASYNC));
-
-#endif /* WIN32 */
}
/*
current_music_type = n;
current_music_id = v;
-#ifdef WIN32
-
mop.lpstrDeviceType = mci_device_type;
mop.lpstrElementName = buf;
mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0);
mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop);
return 0;
-
-#endif /* WIN32 */
}
*/
static int term_xtra_win_delay(int v)
{
-
-#ifdef WIN32
-
/* Sleep */
Sleep(v);
-#else /* WIN32 */
-
- DWORD t;
- MSG msg;
-
- /* Final count */
- t = GetTickCount() + v;
-
- /* Wait for it */
- while (GetTickCount() < t)
- {
- /* Handle messages */
- if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
-
-#endif /* WIN32 */
-
/* Success */
return 0;
}