More compiling. Things are starting to get hacky (adding stubs, commenting
out unimplemented windows stuff, and so on).
This commit is contained in:
parent
5c497c61a6
commit
4db15e7459
13 changed files with 420 additions and 60 deletions
4
Makefile
4
Makefile
|
@ -10,14 +10,14 @@ LDLIBS += -L/usr/X11R6/lib -lX11 -lXext `sdl-config --libs`
|
||||||
|
|
||||||
AFLAGS = -g -Iinclude/ -w+macro-params -w+orphan-labels -w+number-overflow
|
AFLAGS = -g -Iinclude/ -w+macro-params -w+orphan-labels -w+number-overflow
|
||||||
|
|
||||||
ROOT = afont.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c mslhand.c object.c shpanim.c sphere.c tables.c vdb.c version.c
|
ROOT = main.c stubs.c afont.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp module.c morph.c mslhand.c object.c shpanim.c sphere.c tables.c vdb.c version.c
|
||||||
AVP = ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdor.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c bonusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c comp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c gamecmds.cpp gameflow.c gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c maps.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle.c pfarlocs.c pheromon.c pmove.c psndproj.c pvisible.c savegame.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c
|
AVP = ai_sight.c avpview.c bh_agun.c bh_ais.c bh_alien.c bh_binsw.c bh_cable.c bh_corpse.c bh_deathvol.c bh_debri.c bh_dummy.c bh_fan.c bh_far.c bh_fhug.c bh_gener.c bh_ldoor.c bh_lift.c bh_light.c bh_lnksw.c bh_ltfx.c bh_marin.c bh_mission.c bh_near.c bh_pargen.c bh_plachier.c bh_plift.c bh_pred.c bh_queen.c bh_rubberduck.c bh_selfdest.c bh_snds.c bh_spcl.c bh_swdor.c bh_track.c bh_types.c bh_videoscreen.c bh_waypt.c bh_weap.c bh_xeno.c bonusabilities.c cconvars.cpp cdtrackselection.cpp cheatmodes.c comp_map.c comp_shp.c consolelog.cpp davehook.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c gamecmds.cpp gameflow.c gamevars.cpp hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c maps.c mempool.c messagehistory.c missions.cpp movement.c paintball.c particle.c pfarlocs.c pheromon.c pmove.c psndproj.c pvisible.c savegame.c scream.cpp secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c
|
||||||
SHAPES = cube.c
|
SHAPES = cube.c
|
||||||
SUPPORT = consbind.cpp consbtch.cpp coordstr.cpp daemon.cpp r2base.cpp r2pos666.cpp reflist.cpp refobj.cpp scstring.cpp strtab.cpp strutil.c trig666.cpp wrapstr.cpp
|
SUPPORT = consbind.cpp consbtch.cpp coordstr.cpp daemon.cpp r2base.cpp r2pos666.cpp reflist.cpp refobj.cpp scstring.cpp strtab.cpp strutil.c trig666.cpp wrapstr.cpp
|
||||||
AVPWIN95 = avpchunk.cpp cheat.c chtcodes.cpp d3d_hud.cpp endianio.c ffread.cpp ffstdio.cpp gflwplat.c hierplace.cpp iofocus.cpp jsndsup.cpp kzsort.c langplat.c modcmds.cpp npcsetup.cpp objsetup.cpp pathchnk.cpp platsup.c pldghost.c projload.cpp strachnk.cpp system.c vision.c
|
AVPWIN95 = avpchunk.cpp cheat.c chtcodes.cpp d3d_hud.cpp endianio.c ffread.cpp ffstdio.cpp gflwplat.c hierplace.cpp iofocus.cpp jsndsup.cpp kzsort.c langplat.c modcmds.cpp npcsetup.cpp objsetup.cpp pathchnk.cpp platsup.c pldghost.c projload.cpp strachnk.cpp system.c vision.c
|
||||||
FRONTEND = avp_envinfo.c avp_intro.cpp
|
FRONTEND = avp_envinfo.c avp_intro.cpp
|
||||||
GADGETS = ahudgadg.cpp conscmnd.cpp conssym.cpp consvar.cpp gadget.cpp hudgadg.cpp rootgadg.cpp t_ingadg.cpp teletype.cpp textexp.cpp textin.cpp trepgadg.cpp
|
GADGETS = ahudgadg.cpp conscmnd.cpp conssym.cpp consvar.cpp gadget.cpp hudgadg.cpp rootgadg.cpp t_ingadg.cpp teletype.cpp textexp.cpp textin.cpp trepgadg.cpp
|
||||||
WIN95 = animchnk.cpp animobs.cpp bmpnames.cpp chnkload.cpp chnktype.cpp chunk.cpp chunkpal.cpp debuglog.cpp dummyobjectchunk.cpp enumchnk.cpp enumsch.cpp envchunk.cpp fail.c fragchnk.cpp gsprchnk.cpp hierchnk.cpp huffman.cpp iff.cpp iff_ilbm.cpp ilbm_ext.cpp io.c list_tem.cpp ltchunk.cpp media.cpp mishchnk.cpp obchunk.cpp oechunk.cpp our_mem.c plat_shp.c plspecfn.c shpchunk.cpp sndchunk.cpp sprchunk.cpp string.cpp toolchnk.cpp txioctrl.cpp wpchunk.cpp zsp.cpp
|
WIN95 = animchnk.cpp animobs.cpp awiffld.cpp bmpnames.cpp chnkload.cpp chnktexi.cpp chnktype.cpp chunk.cpp chunkpal.cpp debuglog.cpp dummyobjectchunk.cpp enumchnk.cpp enumsch.cpp envchunk.cpp fail.c fragchnk.cpp gsprchnk.cpp hierchnk.cpp huffman.cpp iff.cpp iff_ilbm.cpp ilbm_ext.cpp io.c list_tem.cpp ltchunk.cpp media.cpp mishchnk.cpp obchunk.cpp oechunk.cpp our_mem.c plat_shp.c plspecfn.c shpchunk.cpp sndchunk.cpp sprchunk.cpp string.cpp texio.c toolchnk.cpp txioctrl.cpp wpchunk.cpp zsp.cpp
|
||||||
|
|
||||||
# the following should really be autogenerated...
|
# the following should really be autogenerated...
|
||||||
|
|
||||||
|
|
4
notes.txt
Normal file
4
notes.txt
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
win95/awtexld.hpp line 79:
|
||||||
|
/* TODO */
|
||||||
|
/*|pixelFormat.ddpf.dwRGBAlphaBitMask*/
|
||||||
|
|
|
@ -194,13 +194,13 @@ TODO win95/alt_tab.cpp
|
||||||
win95/animchnk.cpp
|
win95/animchnk.cpp
|
||||||
win95/animobs.cpp
|
win95/animobs.cpp
|
||||||
TODO win95/awbmpld.cpp
|
TODO win95/awbmpld.cpp
|
||||||
TODO win95/awiffld.cpp
|
win95/awiffld.cpp
|
||||||
TODO win95/awpnmld.cpp
|
TODO win95/awpnmld.cpp
|
||||||
TODO win95/awtexld.cpp
|
TODO win95/awtexld.cpp
|
||||||
win95/bmpnames.cpp
|
win95/bmpnames.cpp
|
||||||
TODO win95/cd_player.c
|
TODO win95/cd_player.c
|
||||||
win95/chnkload.cpp
|
win95/chnkload.cpp
|
||||||
TODO win95/chnktexi.cpp
|
win95/chnktexi.cpp
|
||||||
win95/chnktype.cpp
|
win95/chnktype.cpp
|
||||||
win95/chunk.cpp
|
win95/chunk.cpp
|
||||||
win95/chunkpal.cpp
|
win95/chunkpal.cpp
|
||||||
|
@ -236,7 +236,7 @@ win95/shpchunk.cpp
|
||||||
win95/sndchunk.cpp
|
win95/sndchunk.cpp
|
||||||
win95/sprchunk.cpp
|
win95/sprchunk.cpp
|
||||||
win95/string.cpp
|
win95/string.cpp
|
||||||
TODO win95/texio.c
|
win95/texio.c
|
||||||
win95/toolchnk.cpp
|
win95/toolchnk.cpp
|
||||||
win95/txioctrl.cpp
|
win95/txioctrl.cpp
|
||||||
TODO win95/videomodes.cpp
|
TODO win95/videomodes.cpp
|
||||||
|
|
26
src/fixer.h
26
src/fixer.h
|
@ -8,6 +8,7 @@ extern "C" {
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <inttypes.h> // int64_t
|
#include <inttypes.h> // int64_t
|
||||||
|
|
||||||
#define PACKED __attribute__((packed))
|
#define PACKED __attribute__((packed))
|
||||||
|
@ -42,6 +43,8 @@ size_t _mbclen(const unsigned char *s);
|
||||||
|
|
||||||
#define RGBA_MAKE(r,g,b,a) (((r) << 24) | ((g) << 16) | ((b) << 8) | (a))
|
#define RGBA_MAKE(r,g,b,a) (((r) << 24) | ((g) << 16) | ((b) << 8) | (a))
|
||||||
|
|
||||||
|
#define MAX_PATH PATH_MAX
|
||||||
|
|
||||||
/* windows junk */
|
/* windows junk */
|
||||||
typedef int GUID;
|
typedef int GUID;
|
||||||
typedef int DPID;
|
typedef int DPID;
|
||||||
|
@ -86,17 +89,18 @@ typedef struct SYSTEMTIME
|
||||||
int wDay;
|
int wDay;
|
||||||
} SYSTEMTIME;
|
} SYSTEMTIME;
|
||||||
|
|
||||||
#define INVALID_HANDLE_VALUE -1
|
#define INVALID_HANDLE_VALUE -1
|
||||||
#define GENERIC_WRITE 0
|
#define GENERIC_WRITE 0
|
||||||
#define CREATE_ALWAYS 1
|
#define CREATE_ALWAYS 1
|
||||||
#define FILE_FLAG_RANDOM_ACCESS 2
|
#define FILE_FLAG_RANDOM_ACCESS 2
|
||||||
#define GENERIC_READ 3
|
#define GENERIC_READ 3
|
||||||
#define OPEN_EXISTING 4
|
#define OPEN_EXISTING 4
|
||||||
#define FILE_ATTRIBUTE_READONLY 5
|
#define FILE_ATTRIBUTE_READONLY 5
|
||||||
#define FILE_CURRENT 6
|
#define FILE_CURRENT 6
|
||||||
#define FILE_BEGIN 7
|
#define FILE_BEGIN 7
|
||||||
#define FILE_END 8
|
#define FILE_END 8
|
||||||
#define FILE_SHARE_READ 9
|
#define FILE_SHARE_READ 9
|
||||||
|
#define FILE_ATTRIBUTE_DIRECTORY 10
|
||||||
|
|
||||||
HANDLE CreateFile(const char *file, int write, int x, int y, int flags, int flags2, int z);
|
HANDLE CreateFile(const char *file, int write, int x, int y, int flags, int flags2, int z);
|
||||||
HANDLE CreateFileA(const char *file, int write, int x, int y, int flags, int flags2, int z);
|
HANDLE CreateFileA(const char *file, int write, int x, int y, int flags, int flags2, int z);
|
||||||
|
|
|
@ -829,9 +829,9 @@ typedef struct imageheader {
|
||||||
TEXTURE *ImagePtr; /* Pointer to texture in memory */
|
TEXTURE *ImagePtr; /* Pointer to texture in memory */
|
||||||
|
|
||||||
#if SupportWindows95
|
#if SupportWindows95
|
||||||
// LPDIRECTDRAWSURFACE DDSurface;
|
LPDIRECTDRAWSURFACE DDSurface;
|
||||||
// LPDIRECT3DTEXTURE D3DTexture;
|
LPDIRECT3DTEXTURE D3DTexture;
|
||||||
// D3DTEXTUREHANDLE D3DHandle;
|
D3DTEXTUREHANDLE D3DHandle;
|
||||||
AW_BACKUPTEXTUREHANDLE hBackup;
|
AW_BACKUPTEXTUREHANDLE hBackup;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
12
src/main.c
Normal file
12
src/main.c
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "3dc.h"
|
||||||
|
|
||||||
|
#include "fixer.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
231
src/stubs.c
Normal file
231
src/stubs.c
Normal file
|
@ -0,0 +1,231 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "fixer.h"
|
||||||
|
|
||||||
|
#include "3dc.h"
|
||||||
|
|
||||||
|
/* avpreg.cpp */
|
||||||
|
char* AvpCDPath = 0;
|
||||||
|
void GetPathFromRegistry()
|
||||||
|
{
|
||||||
|
extern char * SecondTex_Directory;
|
||||||
|
extern char * SecondSoundDir;
|
||||||
|
|
||||||
|
fprintf(stderr, "GetPathFromRegistry()\n");
|
||||||
|
|
||||||
|
SecondTex_Directory = "./graphics";
|
||||||
|
SecondSoundDir = "./sounds";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* psnd.c */
|
||||||
|
#include "psnd.h"
|
||||||
|
|
||||||
|
void Sound_Play(SOUNDINDEX soundNumber, char* format, ...)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Sound_Play(%d, %s)\n", soundNumber, format);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sound_Stop(int activeSoundNumber)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Sound_Stop(%d)\n", activeSoundNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sound_Update3d(int activeSoundNumber, VECTORCH* posn)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Sound_Update3d(%d, %p)\n", activeSoundNumber, posn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* dd_func.cpp */
|
||||||
|
void FlipBuffers()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "FlipBuffers()\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* dx_proj.cpp */
|
||||||
|
int use_mmx_math = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/* cd_player.c */
|
||||||
|
void CDDA_ChangeVolume(int volume)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_ChangeVolume(%d)\n", volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CDDA_CheckNumberOfTracks()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_CheckNumberOfTracks()\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CDDA_IsOn()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_IsOn()\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CDDA_IsPlaying()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_IsPlaying()\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDDA_Play(int CDDATrack)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_Play(%d)\n", CDDATrack);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDDA_PlayLoop(int CDDATrack)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_PlayLoop(%d)\n", CDDATrack);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDDA_Stop()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_Stop()\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDDA_SwitchOn()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CDDA_SwitchOn()\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* pldnet.c */
|
||||||
|
|
||||||
|
#include "pldnet.h"
|
||||||
|
|
||||||
|
MULTIPLAYER_START* marineStartPositions=0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* win32 api */
|
||||||
|
size_t _mbclen(const unsigned char *s)
|
||||||
|
{
|
||||||
|
return strlen((const char *)s);
|
||||||
|
}
|
||||||
|
|
||||||
|
HANDLE CreateFile(const char *file, int write, int x, int y, int flags, int flags2, int z)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CreateFile(%s, %d, %d, %d, %d, %d, %d)\n", file, write, x, y, flags, flags2, z);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
HANDLE CreateFileA(const char *file, int write, int x, int y, int flags, int flags2, int z)
|
||||||
|
{
|
||||||
|
return CreateFileA(file, write, x, y, flags, flags2, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WriteFile(HANDLE file, const void *data, int len, unsigned long *byteswritten, int x)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "WriteFile(%d, %p, %d, %p, %d)\n", file, data, len, byteswritten, x);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ReadFile(HANDLE file, void *data, int len, /* unsigned long */ void *bytesread, int x)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "ReadFile(%d, %p, %d, %p, %d)\n", file, data, len, bytesread, x);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetFileSize(HANDLE file, int x)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "GetFileSize(%d, %d)\n", file, x);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CloseHandle(HANDLE file)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CloseHandle(%d)\n", file);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int DeleteFile(const char *file)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "DeleteFile(%s)\n", file);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int DeleteFileA(const char *file)
|
||||||
|
{
|
||||||
|
return DeleteFile(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetDiskFreeSpace(int x, unsigned long *a, unsigned long *b, unsigned long *c, unsigned long *d)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "GetDiskFreeSpace(%d, %p, %p, %p, %p)\n", x, a, b, c, d);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CreateDirectory(char *dir, int x)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CreateDirectory(%s, %d)\n", dir, x);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MoveFile(const char *newfile, const char *oldfile)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "MoveFile(%s, %s)\n", newfile, oldfile);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MoveFileA(const char *newfile, const char *oldfile)
|
||||||
|
{
|
||||||
|
return MoveFile(newfile, oldfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
int CopyFile(const char *newfile, const char *oldfile, int x)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "CopyFile(%s, %s, %d)\n", newfile, oldfile, x);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetFileAttributes(const char *file)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "GetFileAttributes(%s)\n", file);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetFileAttributesA(const char *file)
|
||||||
|
{
|
||||||
|
return GetFileAttributes(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetFilePointer(HANDLE file, int x, int y, int z)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "SetFilePointer(%d, %d, %d, %d)\n", file, x, y, z);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SetEndOfFile(HANDLE file)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "SetEndOfFile(%d)\n", file);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* time in miliseconds */
|
||||||
|
int timeGetTime()
|
||||||
|
{
|
||||||
|
fprintf(stderr, "timeGetTime()\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -4,4 +4,27 @@
|
||||||
struct AwBackupTexture;
|
struct AwBackupTexture;
|
||||||
typedef struct AwBackupTexture * AW_BACKUPTEXTUREHANDLE;
|
typedef struct AwBackupTexture * AW_BACKUPTEXTUREHANDLE;
|
||||||
|
|
||||||
|
typedef struct DIRECTDRAWSURFACE
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
} DIRECTDRAWSURFACE;
|
||||||
|
|
||||||
|
typedef DIRECTDRAWSURFACE * LPDIRECTDRAWSURFACE;
|
||||||
|
typedef DIRECTDRAWSURFACE DDSurface;
|
||||||
|
|
||||||
|
typedef struct DIRECT3DTEXTURE
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
} DIRECT3DTEXTURE;
|
||||||
|
|
||||||
|
typedef DIRECT3DTEXTURE * LPDIRECT3DTEXTURE;
|
||||||
|
typedef DIRECT3DTEXTURE D3DTexture;
|
||||||
|
|
||||||
|
//typedef struct D3DTEXTUREHANDLE
|
||||||
|
//{
|
||||||
|
// int x;
|
||||||
|
//} D3DTEXTUREHANDLE;
|
||||||
|
|
||||||
|
typedef int D3DTEXTUREHANDLE;
|
||||||
|
|
||||||
#endif /* _INCLUDED_AW_H_ */
|
#endif /* _INCLUDED_AW_H_ */
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "advwin32.h"
|
#include "fixer.h"
|
||||||
|
|
||||||
#ifndef DB_LEVEL
|
#ifndef DB_LEVEL
|
||||||
#define DB_LEVEL 4
|
#define DB_LEVEL 4
|
||||||
#endif
|
#endif
|
||||||
|
@ -7,12 +8,10 @@
|
||||||
#define DB_COMMA ,
|
#define DB_COMMA ,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma warning(disable: 4701)
|
#include "awtexld.hpp"
|
||||||
#include "awTexLd.hpp"
|
|
||||||
#pragma warning(default: 4701)
|
|
||||||
|
|
||||||
#include "iff.hpp"
|
#include "iff.hpp"
|
||||||
#include "iff_ILBM.hpp"
|
#include "iff_ilbm.hpp"
|
||||||
|
|
||||||
#include "list_tem.hpp"
|
#include "list_tem.hpp"
|
||||||
|
|
||||||
|
@ -245,12 +244,12 @@ void AwIffLoader::LoadHeaderInfo(MediaMedium * pMedium)
|
||||||
|
|
||||||
if (!m_ifData.Load(pMedium) || !m_ifData.GetContents())
|
if (!m_ifData.Load(pMedium) || !m_ifData.GetContents())
|
||||||
{
|
{
|
||||||
if (NO_ERROR == (awTlLastWinErr = GetLastError()))
|
// if (NO_ERROR == (awTlLastWinErr = GetLastError()))
|
||||||
awTlLastErr = AW_TLE_BADFILEDATA;
|
// awTlLastErr = AW_TLE_BADFILEDATA;
|
||||||
else
|
// else
|
||||||
awTlLastErr = AW_TLE_CANTREADFILE;
|
// awTlLastErr = AW_TLE_CANTREADFILE;
|
||||||
|
|
||||||
db_log3("AwCreateTexture(): ERROR: IFF file load failed");
|
db_log3("AwCreateTexture() [AwIffLoader::LoadHeaderInfo] : ERROR: IFF file load failed");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -378,20 +377,20 @@ void AwIffLoader::OnBeginRestoring(unsigned nMaxPaletteSize)
|
||||||
|static_cast<unsigned>(m_pPalette[AwIffConvTransp::iTranspCol].b)>>pixelFormat.blueRightShift<<pixelFormat.blueLeftShift;
|
|static_cast<unsigned>(m_pPalette[AwIffConvTransp::iTranspCol].b)>>pixelFormat.blueRightShift<<pixelFormat.blueLeftShift;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
db_log3("AwCreateTexture(): ERROR: IFF mask field wrong");
|
db_log3("AwCreateTexture() [AwIffLoader::OnBeginRestoring] : ERROR: IFF mask field wrong");
|
||||||
awTlLastErr = AW_TLE_BADFILEDATA;
|
// awTlLastErr = AW_TLE_BADFILEDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
awTlLastErr = AW_TLE_CANTPALETTIZE; // no suitable chunk found
|
// awTlLastErr = AW_TLE_CANTPALETTIZE; // no suitable chunk found
|
||||||
db_log3("AwCreateTexture(): ERROR: No suitable IFF body chunk found");
|
db_log3("AwCreateTexture() [AwIffLoader::OnBeginRestoring] : ERROR: No suitable IFF body chunk found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
awTlLastErr = AW_TLE_BADFILEDATA;
|
// awTlLastErr = AW_TLE_BADFILEDATA;
|
||||||
db_log3("AwCreateTexture(): ERROR: IFF file not loaded or contains no image data");
|
db_log3("AwCreateTexture() [AwIffLoader::OnBeginRestoring] : ERROR: IFF file not loaded or contains no image data");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,8 +464,8 @@ void AwIffLoader::ConvertRow(AwTl::PtrUnion pDest, unsigned nDestWidth, AwTl::Pt
|
||||||
GenericConvertRow<AwIffConvTransp,unsigned>::Do(pDest, nDestWidth, pSrc.uintP+nSrcOffset, nSrcWidth, pPalette db_code1(DB_COMMA nPaletteSize));
|
GenericConvertRow<AwIffConvTransp,unsigned>::Do(pDest, nDestWidth, pSrc.uintP+nSrcOffset, nSrcWidth, pPalette db_code1(DB_COMMA nPaletteSize));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
db_log3("AwCreateTexture(): ERROR: IFF mask field wrong");
|
db_log3("AwCreateTexture() [AwIffLoader::ConvertRow] : ERROR: IFF mask field wrong");
|
||||||
awTlLastErr = AW_TLE_BADFILEDATA;
|
// awTlLastErr = AW_TLE_BADFILEDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -497,11 +496,7 @@ AwBackupTexture * AwIffLoader::CreateBackupTexture()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valid file ID fields: 'FORM' 'LIST' 'CAT ' - we can load them all
|
// Valid file ID fields: 'FORM' 'LIST' 'CAT ' - we can load them all
|
||||||
#ifdef _MSC_VER
|
|
||||||
// VC5.0 tries to compile out code that is in a library
|
|
||||||
// and it thinks isn't being used
|
|
||||||
#line 427
|
|
||||||
#endif
|
|
||||||
AWTEXLD_IMPLEMENT_DYNCREATE("FORM",AwIffLoader)
|
AWTEXLD_IMPLEMENT_DYNCREATE("FORM",AwIffLoader)
|
||||||
AWTEXLD_IMPLEMENT_DYNCREATE("LIST",AwIffLoader)
|
AWTEXLD_IMPLEMENT_DYNCREATE("LIST",AwIffLoader)
|
||||||
AWTEXLD_IMPLEMENT_DYNCREATE("CAT ",AwIffLoader)
|
AWTEXLD_IMPLEMENT_DYNCREATE("CAT ",AwIffLoader)
|
||||||
|
|
|
@ -1,6 +1,77 @@
|
||||||
#ifndef _INCLUDED_AWTEXLD_H_
|
#ifndef _INCLUDED_AWTEXLD_H_
|
||||||
#define _INCLUDED_AWTEXLD_H_
|
#define _INCLUDED_AWTEXLD_H_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#define _AWTL_DEFAULTPARM(v) = (v)
|
||||||
|
#else /* ! __cplusplus */
|
||||||
|
#define _AWTL_DEFAULTPARM(v)
|
||||||
|
#endif /* ? __cplusplus */
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define _AWTL_VARARG __cdecl
|
||||||
|
#else
|
||||||
|
#define _AWTL_VARARG
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "aw.h"
|
||||||
|
|
||||||
|
/******************************/
|
||||||
|
/* return codes & error codes */
|
||||||
|
/******************************/
|
||||||
|
|
||||||
|
typedef
|
||||||
|
enum AwTlErc
|
||||||
|
{
|
||||||
|
/* General Errors */
|
||||||
|
AW_TLE_OK /* apparent success */
|
||||||
|
, AW_TLE_DXERROR /* unexpected DirectX error - see awTlLastDxErr */
|
||||||
|
, AW_TLE_BADPARMS /* parameters passed to function were invalid, or requested unsupported functionality */
|
||||||
|
, AW_TLE_NOINIT /* initialization functions have not been successfully called */
|
||||||
|
/* File reading errors */
|
||||||
|
, AW_TLE_CANTOPENFILE /* file open failed - see awTlLastWinErr for the Windows error code */
|
||||||
|
, AW_TLE_CANTREADFILE /* unexpected error reading file - see awTlLastWinErr for the Windows error code */
|
||||||
|
, AW_TLE_EOFMET /* unexpected end of file encountered */
|
||||||
|
, AW_TLE_BADFILEFORMAT /* file format identifier not recognized */
|
||||||
|
, AW_TLE_BADFILEDATA /* file data not consistent */
|
||||||
|
/* Conversion errors */
|
||||||
|
, AW_TLE_CANTPALETTIZE /* texture format is palettized; file data is not */
|
||||||
|
, AW_TLE_IMAGETOOLARGE /* image size is larger in one or both dimensions than maximum texture size */
|
||||||
|
, AW_TLE_CANTRELOAD /* loading a new texture into an existing surface failed because the existing surface is an unsuitable size, etc. */
|
||||||
|
}
|
||||||
|
AW_TL_ERC;
|
||||||
|
|
||||||
|
|
||||||
|
/*********/
|
||||||
|
/* Flags */
|
||||||
|
/*********/
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
AW_TLF_DEFAULT = 0x00000000U /* no flags set */
|
||||||
|
, AW_TLF_TRANSP = 0x00000001U /* src data has transparency */
|
||||||
|
, AW_TLF_PREVSRC = 0x00000002U /* in AwRestoreTexture, use previously stored source data flags (AW_TLF_TRANSP only) */
|
||||||
|
, AW_TLF_COMPRESS = 0x00000004U /* use ALLOCONLOAD flag */
|
||||||
|
, AW_TLF_CHROMAKEY = 0x00000008U /* use chroma keying for transparency when the texture format has an alpha channel */
|
||||||
|
, AW_TLF_VIDMEM = 0x00000010U /* use Video memory for surfaces which are not textures */
|
||||||
|
, AW_TLF_PREVSRCALL = 0x00000020U /* in AwRestoreTexture, use ALL previously stored flags, except AW_TLF_CHECKLOST and AW_TLF_SKIPNOTLOST */
|
||||||
|
, AW_TLF_TEXTURE = 0x00000040U /* in AwCreateSurface, create a surface in the texture format with the texture flag set */
|
||||||
|
, AW_TLF_MINSIZE = 0x00000080U /* with the 'a' option, ensure all surfaces/textures created are at least as big as the rectangle specified even if the rect is partially off the image */
|
||||||
|
, AW_TLF_CHECKLOST = 0x00000100U /* checks for lost surfaces and calls restore on them */
|
||||||
|
, AW_TLF_SKIPNOTLOST = 0x00000200U /* if the above flag also is specified, does not bother trying to restore surfaces which weren't lost */
|
||||||
|
|
||||||
|
, _AW_TLF_FORCE32BITENUM = 0x0fffffffU /* probably entirely unnecessary */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* alt_tab junk */
|
||||||
|
#define ATIncludeSurfaceDb(p, d, s) fprintf(stderr, "ATIncludeSurfaceDb: %s/%d: %s\n", __FILE__, __LINE__, s)
|
||||||
|
#define ATIncludeTextureDb(p, d, s) fprintf(stderr, "ATIncludeTextureDb: %s/%d: %s\n", __FILE__, __LINE__, s)
|
||||||
|
|
||||||
|
extern D3DTexture * AwCreateTexture(char const * _argFormatS, ...);
|
||||||
|
extern DDSurface * AwCreateSurface(char const * _argFormatS, ...);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <d3d.h>
|
#include <d3d.h>
|
||||||
|
|
||||||
|
@ -557,6 +628,17 @@ extern DDSurface * _AWTL_VARARG AwCreateSurface(char const * _argFormatS, ...);
|
||||||
*/
|
*/
|
||||||
extern AW_TL_ERC AwDestroyBackupTexture(AW_BACKUPTEXTUREHANDLE _bH);
|
extern AW_TL_ERC AwDestroyBackupTexture(AW_BACKUPTEXTUREHANDLE _bH);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* End Wrappers */
|
/* End Wrappers */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef _INCLUDED_AWTEXLD_HPP_
|
#ifndef _INCLUDED_AWTEXLD_HPP_
|
||||||
#define _INCLUDED_AWTEXLD_HPP_
|
#define _INCLUDED_AWTEXLD_HPP_
|
||||||
|
|
||||||
#include "awTexLd.h"
|
#include "awtexld.h"
|
||||||
#include "media.hpp"
|
#include "media.hpp"
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#ifndef DB_COMMA
|
#ifndef DB_COMMA
|
||||||
|
@ -51,7 +51,7 @@ namespace AwTl {
|
||||||
unsigned blueLeftShift;
|
unsigned blueLeftShift;
|
||||||
unsigned blueRightShift;
|
unsigned blueRightShift;
|
||||||
|
|
||||||
DDPIXELFORMAT ddpf;
|
// DDPIXELFORMAT ddpf;
|
||||||
};
|
};
|
||||||
|
|
||||||
// DO SOMTHING ABOUT THIS
|
// DO SOMTHING ABOUT THIS
|
||||||
|
@ -76,7 +76,8 @@ namespace AwTl {
|
||||||
static_cast<unsigned>(_colP->r)>>pixelFormat.redRightShift<<pixelFormat.redLeftShift
|
static_cast<unsigned>(_colP->r)>>pixelFormat.redRightShift<<pixelFormat.redLeftShift
|
||||||
|static_cast<unsigned>(_colP->g)>>pixelFormat.greenRightShift<<pixelFormat.greenLeftShift
|
|static_cast<unsigned>(_colP->g)>>pixelFormat.greenRightShift<<pixelFormat.greenLeftShift
|
||||||
|static_cast<unsigned>(_colP->b)>>pixelFormat.blueRightShift<<pixelFormat.blueLeftShift
|
|static_cast<unsigned>(_colP->b)>>pixelFormat.blueRightShift<<pixelFormat.blueLeftShift
|
||||||
|pixelFormat.ddpf.dwRGBAlphaBitMask
|
/* TODO */
|
||||||
|
/*|pixelFormat.ddpf.dwRGBAlphaBitMask*/
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
static inline unsigned DoConv(BYTE const * _colP, Colour const * _paletteP db_code1(DB_COMMA unsigned _paletteSize))
|
static inline unsigned DoConv(BYTE const * _colP, Colour const * _paletteP db_code1(DB_COMMA unsigned _paletteSize))
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
#include <windows.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "fixer.h"
|
||||||
|
|
||||||
#include "string.hpp"
|
#include "string.hpp"
|
||||||
#ifndef DB_LEVEL
|
#ifndef DB_LEVEL
|
||||||
#define DB_LEVEL 4
|
#define DB_LEVEL 4
|
||||||
#endif
|
#endif
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "awTexLd.h"
|
|
||||||
|
#include "awtexld.h"
|
||||||
|
|
||||||
#include "chnkload.hpp"
|
#include "chnkload.hpp"
|
||||||
#include "chunkpal.hpp"
|
#include "chunkpal.hpp"
|
||||||
|
|
||||||
|
@ -16,12 +20,12 @@
|
||||||
#include "ffstdio.h"
|
#include "ffstdio.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CL_SUPPORT_ALTTAB
|
//#ifndef CL_SUPPORT_ALTTAB
|
||||||
#error "Please #define CL_SUPPORT_ALTTAB to 0 or 1 in projload.hpp"
|
// #error "Please #define CL_SUPPORT_ALTTAB to 0 or 1 in projload.hpp"
|
||||||
#endif
|
//#endif
|
||||||
#if CL_SUPPORT_ALTTAB
|
//#if CL_SUPPORT_ALTTAB
|
||||||
#include "alt_tab.h"
|
// #include "alt_tab.h"
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
#include "chnktexi.h"
|
#include "chnktexi.h"
|
||||||
|
|
||||||
|
@ -36,7 +40,9 @@ char const * cl_pszGameMode = NULL;
|
||||||
// used to determine if the display is palettized
|
// used to determine if the display is palettized
|
||||||
// currently assuming that if this is <= 8 then all
|
// currently assuming that if this is <= 8 then all
|
||||||
// surfaces et. except d3d textures have a global palette
|
// surfaces et. except d3d textures have a global palette
|
||||||
extern "C" extern int VideoModeColourDepth;
|
extern "C" {
|
||||||
|
extern int VideoModeColourDepth;
|
||||||
|
};
|
||||||
|
|
||||||
// useful filename handling functions
|
// useful filename handling functions
|
||||||
|
|
||||||
|
@ -649,7 +655,9 @@ char * CL_GetImageFileName(char * pszDestBuf, unsigned nBufSize, char const * ps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" extern void CheckForWindowsMessages(void);
|
extern "C" {
|
||||||
|
extern void CheckForWindowsMessages(void);
|
||||||
|
};
|
||||||
|
|
||||||
int CL_LoadImageOnce(char const * pszFileName, unsigned fFlagsEtc)
|
int CL_LoadImageOnce(char const * pszFileName, unsigned fFlagsEtc)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,8 +34,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "awTexLd.h"
|
#include "awtexld.h"
|
||||||
#include "alt_tab.h"
|
//#include "alt_tab.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define for experimental purposes
|
#define for experimental purposes
|
||||||
|
@ -1557,7 +1557,7 @@ static void DeallocateImageHeader(IMAGEHEADER * ihptr)
|
||||||
{
|
{
|
||||||
ReleaseD3DTexture(ihptr->D3DTexture);
|
ReleaseD3DTexture(ihptr->D3DTexture);
|
||||||
ihptr->D3DTexture = (void*) 0;
|
ihptr->D3DTexture = (void*) 0;
|
||||||
ihptr->D3DHandle = (void*) 0;
|
ihptr->D3DHandle = /* (void*) */ 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1573,7 +1573,7 @@ static void MinimizeImageHeader(IMAGEHEADER * ihptr)
|
||||||
{
|
{
|
||||||
ReleaseD3DTexture(ihptr->D3DTexture);
|
ReleaseD3DTexture(ihptr->D3DTexture);
|
||||||
ihptr->D3DTexture = (void*) 0;
|
ihptr->D3DTexture = (void*) 0;
|
||||||
ihptr->D3DHandle = (void*) 0;
|
ihptr->D3DHandle = /* (void*) */ 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue