Commit 9f67e24b authored by Mike Wiering's avatar Mike Wiering

Removed DDUTIL and DSUTIL completely.

parent 0f5163ed
#ifndef _CGAMELIB_H
#define _CGAMELIB_H
/* Clean Game Library by Mike Wiering, Nijmegen */
/* Clean Game Library by Mike Wiering */
#include "cOSGameLib_121.h" /* OS specific functions */
......@@ -24,18 +24,18 @@ extern void WinInitSpriteAnimation (int,CLEAN_STRING,BOOL,OS,int*,OS*);
extern void WinSetObjectFocus (int,int,int,int,int,int,OS,int*,OS*);
// extern void WinCreateUserEvent (int,int,int,int,OS,int*,OS*);
extern void WinSetObjectRec (int,int,int,BOOL,int,int,
int,int,int,int,int,int,
int,int,int,int,int,
BOOL,int,int,int,int,int,int,int,int,int,int,int,int,
int,OS,int*,OS*
);
int,int,int,int,int,int,
int,int,int,int,int,
BOOL,int,int,int,int,int,int,int,int,int,int,int,int,
int,OS,int*,OS*
);
extern void WinGetObjectRec (int,OS,int*,int*,BOOL*,
int*,int*,int*,int*,int*,
int*,int*,int*,
int*,int*,int*,int*,int*,int*,
BOOL*,int*,int*,int*,int*,int*,int*,int*,int*,int*,int*,int*,int*,
int*,OS*
);
int*,int*,int*,int*,int*,
int*,int*,int*,
int*,int*,int*,int*,int*,int*,
BOOL*,int*,int*,int*,int*,int*,int*,int*,int*,int*,int*,int*,int*,
int*,OS*
);
extern void WinShowStatistic (int,int,CLEAN_STRING,int,int,int,int,CLEAN_STRING,int,BOOL,BOOL,BOOL,int,int,int,int,int,int,OS,int*,OS*);
extern void WinPlayMusic (CLEAN_STRING,BOOL,OS,int*,OS*);
extern void WinStopMusic (OS,int*,OS*);
......@@ -85,15 +85,15 @@ extern void WinSetBoundMap (int,int,int,OS,int*,OS*);
#define FC_OFFSCREEN (0x80000001)
/* game keys */
#define GK_UNKNOWN 0
#define GK_UNKNOWN 0
#define GK_BACKSPACE 8
#define GK_RETURN 10
#define GK_ESCAPE 11
#define GK_LEFT 12
#define GK_RIGHT 13
#define GK_UP 14
#define GK_DOWN 15
#define GK_ESCAPE 11
#define GK_LEFT 12
#define GK_RIGHT 13
#define GK_UP 14
#define GK_DOWN 15
#define GK_HOME 16
#define GK_END 17
//#define GK_PAGE_UP 18
......
#ifndef _COSGAMELIB_H
#define _COSGAMELIB_H
/* Clean Game Library by Mike Wiering, Nijmegen */
/* Clean Game Library by Mike Wiering */
/* DirectX implementation of the OS specific functions */
......@@ -13,23 +13,72 @@
#define WIN32_LEAN_AND_MEAN
#include <windowsx.h>
#include <ddraw.h>
/* DD functions from DDUTIL.H ... */
// #include "ddutil.h"
IDirectDrawPalette * DDLoadPalette(IDirectDraw *pdd, LPCSTR szBitmap);
IDirectDrawSurface * DDLoadBitmap(IDirectDraw *pdd, LPCSTR szBitmap, int dx, int dy);
HRESULT DDReLoadBitmap(IDirectDrawSurface *pdds, LPCSTR szBitmap);
HRESULT DDCopyBitmap(IDirectDrawSurface *pdds, HBITMAP hbm, int x, int y, int dx, int dy);
DWORD DDColorMatch(IDirectDrawSurface *pdds, COLORREF rgb);
HRESULT DDSetColorKey(IDirectDrawSurface *pdds, COLORREF rgb);
/* ... DD functions from DDUTIL.H */
/* sound functions from DSUTIL.H ... */
// #include "dsutil.h"
#include <mmsystem.h>
#include <dsound.h>
#include "ddutil.h"
#include "dsutil.h"
typedef struct
{
BYTE *pbWaveData; // pointer into wave resource (for restore)
DWORD cbWaveSize; // size of wave data (for restore)
int iAlloc; // number of buffers.
int iCurrent; // current buffer
IDirectSoundBuffer* Buffers[1]; // list of buffers
} SNDOBJ, *HSNDOBJ;
// SndObjCreate Loads a SNDOBJ from a Win32 resource in
// the current application.
HSNDOBJ SndObjCreate (IDirectSound *pDS, LPCTSTR lpName, int iConcurrent);
// SndObjDestroy Frees a SNDOBJ and releases all of its buffers.
void SndObjDestroy (HSNDOBJ hSO);
// SndObjPlay Plays a buffer in a SNDOBJ.
BOOL SndObjPlay (HSNDOBJ hSO, DWORD dwPlayFlags);
// SndObjStop Stops one or more buffers in a SNDOBJ.
BOOL SndObjStop (HSNDOBJ hSO);
// SndObjGetFreeBuffer returns one of the cloned buffers that is
// not currently playing
IDirectSoundBuffer *SndObjGetFreeBuffer (HSNDOBJ hSO);
/* ...sound functions from DSUTIL.H */
/* Game Result Codes */
#define GR_OK 0
#define GR_OK 0
#define GR_FAILED -1
#define GR_OS_ERROR -2 /* OS function returns an error */
#define GR_INVALID_BITMAP_ID -3
#define GR_INVALID_SPRITE_ID -4
#define GR_INVALID_MAP_ID -5
#define GR_NOT_FOUND -6 /* file or resource not found */
#define GR_OS_ERROR -2 /* OS function returns an error */
#define GR_INVALID_BITMAP_ID -3
#define GR_INVALID_SPRITE_ID -4
#define GR_INVALID_MAP_ID -5
#define GR_NOT_FOUND -6 /* file (or resource) not found */
/* display option bits */
#define DO_BLINK (1 << 0)
#define DO_BLINK (1 << 0)
#define DO_STRETCH (1 << 1)
#define DO_MIRROR_LEFT_RIGHT (1 << 2)
#define DO_MIRROR_UP_DOWN (1 << 3)
......@@ -68,14 +117,14 @@ extern void OSFlip (void);
/* initialize a game bitmap */
extern int OSInitGameBitmap (int id, char *name,
int bitmapwidth, int bitmapheight,
int blockwidth, int blockheight
);
int bitmapwidth, int bitmapheight,
int blockwidth, int blockheight
);
/* get bitmap info */
extern BOOL OSGetGameBitmapInfo (int id, int *width, int *height,
int *blockwidth, int *blockheight,
int *blockcountx, int *blockcounty
);
int *blockwidth, int *blockheight,
int *blockcountx, int *blockcounty
);
/* deinit a game bitmap */
extern int OSFreeGameBitmap (int id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment