From a5fdb9f7c852743d2d3c29d2db8862249929e3a0 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Sun, 5 Aug 2001 05:51:56 +0000 Subject: Now in the Data loading phase. Converted many '\\' to '/'. Partially implemented win32 file routines. Got texture code to work OK for now (still needs to be reimplemented). Partially implemented the main loop. --- src/win95/aw.h | 14 ++++++++++++-- src/win95/awtexld.cpp | 22 ++++++++++++++++------ src/win95/db.c | 5 +++-- 3 files changed, 31 insertions(+), 10 deletions(-) (limited to 'src/win95') diff --git a/src/win95/aw.h b/src/win95/aw.h index a70be64..ed35da4 100644 --- a/src/win95/aw.h +++ b/src/win95/aw.h @@ -6,7 +6,12 @@ typedef struct AwBackupTexture * AW_BACKUPTEXTUREHANDLE; typedef struct DIRECTDRAWSURFACE { - int x; + int id; + + int w; + int h; + unsigned char *data; + int type; } DIRECTDRAWSURFACE; typedef DIRECTDRAWSURFACE * LPDIRECTDRAWSURFACE; @@ -14,7 +19,12 @@ typedef DIRECTDRAWSURFACE DDSurface; typedef struct DIRECT3DTEXTURE { - int x; + int id; + + int w; + int h; + unsigned char *data; + int type; } DIRECT3DTEXTURE; typedef DIRECT3DTEXTURE * LPDIRECT3DTEXTURE; diff --git a/src/win95/awtexld.cpp b/src/win95/awtexld.cpp index aa5f568..0d3ab5b 100644 --- a/src/win95/awtexld.cpp +++ b/src/win95/awtexld.cpp @@ -381,7 +381,7 @@ namespace AwTl AwTl::SurfUnion AwBackupTexture::Restore(AwTl::CreateTextureParms const & rParams) { using namespace AwTl; - + ChoosePixelFormat(rParams); if (!pixelFormat.validB) @@ -510,11 +510,14 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & _parmsR) { - fprintf(stderr, "AwBackupTexture::CreateTexture(...)\n"); + using namespace AwTl; + + fprintf(stderr, "AwBackupTexture::CreateTexture(...) This is where we could convert the image to RGB/RGBA, and so on\n"); - return static_cast(NULL); + SurfUnion pRet = static_cast(new D3DTexture); + + return pRet; #if 0 - using namespace AwTl; // which flags to use? unsigned fMyFlags = @@ -1390,7 +1393,8 @@ namespace AwTl { // CHECK_MEDIA_ERRORS("loading file headers") ON_ERROR_RETURN_NULL("loading file headers") - + +#if 0 ChoosePixelFormat(rParams); if (!pixelFormat.validB) @@ -1401,7 +1405,12 @@ namespace AwTl { awTlLastErr = pixelFormat.validB && driverDesc.ddP && (driverDesc.validB || !rParams.loadTextureB) ? AW_TLE_OK : AW_TLE_NOINIT; ON_ERROR_RETURN_NULL("initializing load") - +#endif + fprintf(stderr, "TexFileLoader::Load Pixel Format?! It's not implemented!\n"); + +/* TODO */ + AllocateBuffers(/* rParams.backupHP ? true : */ false, /* pixelFormat.palettizedB ? ? 1<