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.
This commit is contained in:
parent
f2c6ac7362
commit
a5fdb9f7c8
16 changed files with 442 additions and 215 deletions
|
@ -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;
|
||||
|
|
|
@ -381,7 +381,7 @@ namespace AwTl
|
|||
AwTl::SurfUnion AwBackupTexture::Restore(AwTl::CreateTextureParms const & rParams)
|
||||
{
|
||||
using namespace AwTl;
|
||||
|
||||
|
||||
ChoosePixelFormat(rParams);
|
||||
|
||||
if (!pixelFormat.validB)
|
||||
|
@ -510,12 +510,15 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR
|
|||
|
||||
AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & _parmsR)
|
||||
{
|
||||
fprintf(stderr, "AwBackupTexture::CreateTexture(...)\n");
|
||||
|
||||
return static_cast<D3DTexture *>(NULL);
|
||||
#if 0
|
||||
using namespace AwTl;
|
||||
|
||||
fprintf(stderr, "AwBackupTexture::CreateTexture(...) This is where we could convert the image to RGB/RGBA, and so on\n");
|
||||
|
||||
SurfUnion pRet = static_cast<D3DTexture *>(new D3DTexture);
|
||||
|
||||
return pRet;
|
||||
#if 0
|
||||
|
||||
// which flags to use?
|
||||
unsigned fMyFlags =
|
||||
_parmsR.flags & AW_TLF_PREVSRCALL ? db_assert1(_parmsR.restoreH),
|
||||
|
@ -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<<pixelFormat.bitsPerPixel : */ 0);
|
||||
|
||||
// CHECK_MEDIA_ERRORS("allocating buffers")
|
||||
ON_ERROR_RETURN_NULL("allocating buffers")
|
||||
|
||||
|
@ -2079,6 +2088,7 @@ D3DTexture * _AWTL_VARARG AwCreateTexture(char const * _argFormatS, ...)
|
|||
parms.loadTextureB = true;
|
||||
bool bParmsOK = ParseParams(&parms, _argFormatS, ap);
|
||||
va_end(ap);
|
||||
|
||||
return bParmsOK ? LoadFromParams(&parms).textureP : NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ int db_option = 0; /* Default is off. */
|
|||
#define PROP_WIDTH 0
|
||||
|
||||
/* Logfile name */
|
||||
#define LOGFILE_NAME "LOGFILE.TXT"
|
||||
#define LOGFILE_NAME "logfile.txt"
|
||||
|
||||
/* Set this to 1 if the logfile name is an absolute path. Otherwise the
|
||||
* logfile will go in the directory that is current when db_log_init()
|
||||
|
@ -405,7 +405,8 @@ void db_log_init(void)
|
|||
sprintf( LogFileNameP, "%s", db_log_file_name );
|
||||
#else
|
||||
/* Append the log file name to the current working directory. */
|
||||
sprintf( LogFileNameP, "%s\\%s", getcwd( LogFileNameP, 240 ),
|
||||
/* TODO - path seperator */
|
||||
sprintf( LogFileNameP, "%s/%s", getcwd( LogFileNameP, 240 ),
|
||||
db_log_file_name );
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue