Removed headers that were accidently checked in.
Lots of compiling.
This commit is contained in:
parent
f759e35cd8
commit
71fa444424
47 changed files with 312 additions and 1049 deletions
17
Makefile
17
Makefile
|
@ -1,7 +1,7 @@
|
|||
CC = gcc
|
||||
NASM = nasm
|
||||
|
||||
CFLAGS = -g -Wall -I. -Iinclude -Iwin95 -Iavp -Iavp/win95 -Iavp/support -Iavp/win95/frontend -Iavp/win95/gadgets
|
||||
CFLAGS = -g -Wall -Dengine=1 -I. -Iinclude -Iwin95 -Iavp -Iavp/win95 -Iavp/support -Iavp/win95/frontend -Iavp/win95/gadgets
|
||||
CXXFLAGS = $(CFLAGS)
|
||||
LDLIBS = -lm # /home/relnev/ElectricFence-2.2.2/libefence.a
|
||||
|
||||
|
@ -14,10 +14,13 @@ ROOT = afont.c frustum.c kshape.c map.c maths.c md5.c mem3dc.c mem3dcpp.cpp modu
|
|||
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 cheatmodes.c comp_map.c comp_shp.c consolelog.cpp deaths.c decal.c detaillevels.c dynamics.c dynblock.c equipmnt.c equiputl.cpp extents.c game.c gameflow.c hmodel.c hud.c inventry.c language.c lighting.c load_shp.c los.c maps.c mempool.c messagehistory.c movement.c paintball.c particle.c pfarlocs.c pheromon.c pmove.c psndproj.c pvisible.c secstats.c sfx.c stratdef.c targeting.c track.c triggers.c weapons.c
|
||||
SHAPES = cube.c
|
||||
SUPPORT =
|
||||
AVPWIN95 = avpchunk.cpp
|
||||
FRONTEND =
|
||||
AVPWIN95 = avpchunk.cpp ffstdio.cpp hierplace.cpp kzsort.c langplat.c npcsetup.cpp objsetup.cpp pathchnk.cpp platsup.c pldghost.c projload.cpp strachnk.cpp system.c vision.c
|
||||
# usr_io.c
|
||||
FRONTEND = avp_envinfo.c avp_intro.cpp
|
||||
# avp_menudata.c
|
||||
GADGETS =
|
||||
WIN95 = huffman.cpp string.cpp
|
||||
WIN95 = animchnk.cpp animobs.cpp chnkload.cpp chnktype.cpp chunk.cpp chunkpal.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
|
||||
# texio.c
|
||||
|
||||
# AVP:
|
||||
# unused?: avpitems.cpp avppages.cpp
|
||||
|
@ -38,11 +41,13 @@ SHAPESSRC = $(call SRCNAMES,$(SHAPES),avp/shapes)
|
|||
SHAPESOBJ = $(call OBJNAMES,$(SHAPES),avp/shapes)
|
||||
AVPWIN95SRC = $(call SRCNAMES,$(AVPWIN95),avp/win95)
|
||||
AVPWIN95OBJ = $(call OBJNAMES,$(AVPWIN95),avp/win95)
|
||||
FRONTENDSRC = $(call SRCNAMES,$(FRONTEND),avp/win95/frontend)
|
||||
FRONTENDOBJ = $(call OBJNAMES,$(FRONTEND),avp/win95/frontend)
|
||||
WIN95SRC = $(call SRCNAMES,$(WIN95),win95)
|
||||
WIN95OBJ = $(call OBJNAMES,$(WIN95),win95)
|
||||
|
||||
SRC = $(ROOTSRC) $(AVPSRC) $(SHAPESSRC) $(AVPWIN95SRC) $(WIN95SRC)
|
||||
OBJ = $(ROOTOBJ) $(AVPOBJ) $(SHAPESOBJ) $(AVPWIN95OBJ) $(WIN95OBJ)
|
||||
SRC = $(ROOTSRC) $(AVPSRC) $(SHAPESSRC) $(AVPWIN95SRC) $(FRONTENDSRC) $(WIN95SRC)
|
||||
OBJ = $(ROOTOBJ) $(AVPOBJ) $(SHAPESOBJ) $(AVPWIN95OBJ) $(FRONTENDOBJ) $(WIN95OBJ)
|
||||
|
||||
.SUFFIXES: .asm
|
||||
|
||||
|
|
|
@ -79,7 +79,6 @@
|
|||
enum TEXTSTRING_ID I_TextString_Description,
|
||||
OurBool bVisible_New
|
||||
);
|
||||
virtual ~MissionHint();
|
||||
|
||||
SCString* GetDesc(void) const;
|
||||
|
||||
|
@ -91,7 +90,8 @@
|
|||
);
|
||||
|
||||
static const List<MissionHint*>& GetAll(void);
|
||||
|
||||
|
||||
|
||||
// Protected methods:
|
||||
protected:
|
||||
|
||||
|
@ -104,7 +104,8 @@
|
|||
OurBool bVisible_Val;
|
||||
|
||||
static List<MissionHint*> List_pMissionHint;
|
||||
|
||||
public:
|
||||
virtual ~MissionHint();
|
||||
};
|
||||
// Inline methods:
|
||||
inline SCString* MissionHint::GetDesc(void) const
|
||||
|
@ -180,7 +181,7 @@
|
|||
enum MissionEffects MissionFX
|
||||
);
|
||||
|
||||
~MissionObjective();
|
||||
|
||||
|
||||
static void TestCompleteNext(void);
|
||||
|
||||
|
@ -241,7 +242,8 @@
|
|||
{
|
||||
return ( MOS_In == MOS_VisibleAndAchieved );
|
||||
}
|
||||
|
||||
public:
|
||||
~MissionObjective();
|
||||
};
|
||||
|
||||
inline int MissionObjective::bAchieved(void) const
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
(
|
||||
T& aT
|
||||
) : theT(aT),
|
||||
ExportVariable()
|
||||
ExportVariable<T>()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ public:
|
|||
T minVal_New,
|
||||
T maxVal_New
|
||||
) : theT(aT),
|
||||
BoundedExportVariable
|
||||
BoundedExportVariable<T>
|
||||
(
|
||||
minVal_New,
|
||||
maxVal_New
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#error "ffread.hpp requires C++ compilation"
|
||||
#endif
|
||||
|
||||
#include "fixer.h"
|
||||
|
||||
/*
|
||||
|
||||
Fastfile format:
|
||||
|
@ -28,7 +30,6 @@ Fastfile format:
|
|||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <windows.h>
|
||||
#include "list_tem.hpp"
|
||||
|
||||
enum FFError
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
#include "module.h"
|
||||
#include "stratdef.h"
|
||||
#include "gamedef.h"
|
||||
#include "AvP_EnvInfo.h"
|
||||
#include "AvP_UserProfile.h"
|
||||
#include "AvP_MP_Config.h"
|
||||
#include "avp_envinfo.h"
|
||||
#include "avp_userprofile.h"
|
||||
#include "avp_mp_config.h"
|
||||
#include "pldnet.h"
|
||||
|
||||
static enum AVP_ENVIRONMENT_ID MarineEpisodes[] =
|
||||
|
@ -5231,4 +5231,4 @@ BOOL DoesCooperativeLevelExist(int level)
|
|||
*/
|
||||
if(level<0 || level>=MAX_NO_OF_COOPERATIVE_EPISODES) return FALSE;
|
||||
return DoesNamedLevelExist(RifNamesForEnvironments[CooperativeEpisodes[level]]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,17 @@ extern "C"
|
|||
#include "3dc.h"
|
||||
//#include "intro.hpp"
|
||||
#include "inline.h"
|
||||
#include "smacker.h"
|
||||
#include "AvP_Menus.h"
|
||||
//#include "smacker.h"
|
||||
#include "avp_menus.h"
|
||||
extern int NormalFrameTime;
|
||||
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
|
||||
extern DDPIXELFORMAT DisplayPixelFormat;
|
||||
extern LPDIRECTDRAWSURFACE lpDDSBack;
|
||||
extern int GotAnyKey;
|
||||
extern int DebouncedGotAnyKey;
|
||||
|
||||
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
|
||||
extern AVPMENUGFX AvPMenuGfxStorage[];
|
||||
extern void DirectReadKeyboard(void);
|
||||
|
||||
|
||||
static IntroHasAlreadyBeenPlayed = 1;
|
||||
static int IntroHasAlreadyBeenPlayed = 1;
|
||||
|
||||
|
||||
void Show_CopyrightInfo(void);
|
||||
|
@ -30,6 +27,14 @@ extern void PlayBinkedFMV(char *filenamePtr);
|
|||
extern void DrawMainMenusBackdrop(void);
|
||||
extern void FadedScreen(int alpha);
|
||||
|
||||
void StartMenuMusic(void)
|
||||
{
|
||||
}
|
||||
|
||||
void PlayMenuMusic(void)
|
||||
{
|
||||
}
|
||||
|
||||
void WeWantAnIntro(void)
|
||||
{
|
||||
IntroHasAlreadyBeenPlayed = 0;
|
||||
|
@ -53,7 +58,7 @@ extern void PlayIntroSequence(void)
|
|||
FlipBuffers();
|
||||
ClearScreenToBlack();
|
||||
|
||||
PlayBinkedFMV("FMVs/logos.bik");
|
||||
//PlayBinkedFMV("FMVs/logos.bik");
|
||||
//PlayFMV("FMVs/rebellion.smk");
|
||||
|
||||
StartMenuMusic();
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
#include "stratdef.h"
|
||||
#include "platform.h"
|
||||
#include "gamedef.h"
|
||||
#include "hudgfx.h"
|
||||
//#include "hudgfx.h"
|
||||
#include "usr_io.h"
|
||||
|
||||
#include "AvP_Menus.h"
|
||||
#include "AvP_UserProfile.h"
|
||||
#include "avp_menus.h"
|
||||
#include "avp_userprofile.h"
|
||||
|
||||
#include "GammaControl.h"
|
||||
#include "gammacontrol.h"
|
||||
#include "bh_types.h"
|
||||
#include "pldnet.h"
|
||||
|
||||
#include "AvP_MP_Config.h"
|
||||
#include "DetailLevels.h"
|
||||
#include "CD_player.h"
|
||||
#include "avp_mp_config.h"
|
||||
#include "detaillevels.h"
|
||||
#include "cd_player.h"
|
||||
|
||||
#define MPLAYER_SUPPORT 1
|
||||
|
||||
|
|
|
@ -279,7 +279,7 @@ void Placed_Hierarchy_Sequence_Chunk::fill_data_block(char* data)
|
|||
*(int*)data=num_extra_data;
|
||||
data+=4;
|
||||
|
||||
for(i=0;i<num_extra_data;i++)
|
||||
for(int i=0;i<num_extra_data;i++)
|
||||
{
|
||||
*(int*) data=extra_data[i];
|
||||
data+=4;
|
||||
|
|
|
@ -1,249 +0,0 @@
|
|||
/*---------------------------------------------------------------------
|
||||
*
|
||||
* ia3d.h
|
||||
*
|
||||
*---------------------------------------------------------------------
|
||||
*
|
||||
* $Id: ia3d.h,v 1.1 2001/07/01 00:55:23 relnev Exp $
|
||||
*
|
||||
*---------------------------------------------------------------------
|
||||
*
|
||||
* ia3d header file. It's the part the outside world needs to see.
|
||||
*
|
||||
*---------------------------------------------------------------------
|
||||
*
|
||||
* AUREAL SEMICONDUCTOR, INC. PROPRIETARY AND CONFIDENTIAL
|
||||
* Copyright (c) 1996 Aureal Semiconductor, Inc. - All rights
|
||||
* reserved.
|
||||
*
|
||||
*---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _IA3D_H_
|
||||
#define _IA3D_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// A3d Class ID! {D8F1EEE0-F634-11cf-8700-00A0245D918B}
|
||||
DEFINE_GUID(CLSID_A3d,
|
||||
0xd8f1eee0, 0xf634, 0x11cf, 0x87, 0x0, 0x0, 0xa0, 0x24, 0x5d, 0x91, 0x8b);
|
||||
|
||||
// A3d Interface ID! {D8F1EEE1-F634-11cf-8700-00A0245D918B}
|
||||
DEFINE_GUID(IID_IA3d,
|
||||
0xd8f1eee1, 0xf634, 0x11cf, 0x87, 0x0, 0x0, 0xa0, 0x24, 0x5d, 0x91, 0x8b);
|
||||
|
||||
// GUID generated from UUGENID.EXE, Good until the year 3400 AD
|
||||
// A3d Interface ID! {fb80d1e0-98d3-11d1-90fb-006008a1f441}
|
||||
DEFINE_GUID(IID_IA3d2,
|
||||
0xfb80d1e0, 0x98d3, 0x11d1, 0x90, 0xfb, 0x00, 0x60, 0x08, 0xa1, 0xf4, 0x41);
|
||||
|
||||
// Bits for manipulating output modes
|
||||
|
||||
// Values for bOutputMode
|
||||
#define OUTPUT_MODE_STEREO 0x00000001
|
||||
#define OUTPUT_MODE_QUAD 0x00000002
|
||||
|
||||
// Values for FrontXtalkMode and bRearXtalkMode
|
||||
#define OUTPUT_HEADPHONES 0x00000001 // headphones
|
||||
#define OUTPUT_SPEAKERS_WIDE 0x00000002
|
||||
#define OUTPUT_SPEAKERS_NARROW 0x00000003
|
||||
|
||||
// Values for Resource Management Mode
|
||||
#define A3D_RESOURCE_MODE_OFF 0x00000000
|
||||
#define A3D_RESOURCE_MODE_NOTIFY 0x00000001
|
||||
#define A3D_RESOURCE_MODE_DYNAMIC 0x00000002
|
||||
#define A3D_RESOURCE_MODE_DYNAMIC_LOOPERS 0x00000003
|
||||
#define A3D_RESOURCE_MODE_LAST 0x00000003
|
||||
|
||||
|
||||
// Version Definitions for A3DCAPS
|
||||
|
||||
#define A3D_CURRENT_VERSION IA3DVERSION_RELEASE12
|
||||
|
||||
#define IA3DVERSION_RELEASE10 10
|
||||
#define IA3DVERSION_RELEASE12 12
|
||||
|
||||
// A3d Caps structure for A3d2 interface
|
||||
// If Fail to get IA3d2 interface, version of DLL is IA3DVERSION_PRE12
|
||||
|
||||
typedef struct __A3DCAPS_SOFTWARE
|
||||
{
|
||||
DWORD dwSize; // Use for internal version control
|
||||
DWORD dwVersion; // For Backwards capablities purposes
|
||||
DWORD dwFlags;
|
||||
DWORD dwReserved;
|
||||
DWORD dwReserved2;
|
||||
} A3DCAPS_SOFTWARE, *LPA3DCAPS_SOFTWARE;
|
||||
|
||||
typedef struct __A3DCAPS_HARDWARE
|
||||
{
|
||||
DWORD dwSize; // Use for internal version control
|
||||
DWORD dwFlags;
|
||||
DWORD dwReserved;
|
||||
DWORD dwReserved2;
|
||||
} A3DCAPS_HARDWARE, *LPA3DCAPS_HARDWARE;
|
||||
|
||||
|
||||
// Declare the IA3d Interface. It's not very complex at all.
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IA3d
|
||||
|
||||
typedef struct IA3d *LPIA3D;
|
||||
|
||||
DECLARE_INTERFACE_(IA3d, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IA3d
|
||||
STDMETHOD(SetOutputMode)(THIS_ DWORD dwFrontXtalkMode, DWORD dwBackXtalkMode, DWORD dwQuadMode) PURE;
|
||||
STDMETHOD(GetOutputMode)(THIS_ DWORD *lpdwFrontXtalkMode, DWORD *lpdwBackXtalkMode, DWORD *lpdwQuadMode) PURE;
|
||||
|
||||
STDMETHOD(SetResourceManagerMode) (THIS_ DWORD ) PURE;
|
||||
STDMETHOD(GetResourceManagerMode) (THIS_ DWORD *) PURE;
|
||||
|
||||
STDMETHOD(SetHFAbsorbFactor)(THIS_ FLOAT ) PURE;
|
||||
STDMETHOD(GetHFAbsorbFactor)(THIS_ FLOAT *) PURE;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// IA3d2 interface derived from IA3d
|
||||
|
||||
#undef INTERFACE
|
||||
#define INTERFACE IA3d2
|
||||
|
||||
typedef struct IA3d2 *LPIA3D2;
|
||||
|
||||
DECLARE_INTERFACE_(IA3d2, IUnknown)
|
||||
{
|
||||
// IUnknown
|
||||
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
|
||||
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release) (THIS) PURE;
|
||||
|
||||
// IA3d
|
||||
STDMETHOD(SetOutputMode)(THIS_ DWORD dwFrontXtalkMode, DWORD dwBackXtalkMode, DWORD dwQuadMode) PURE;
|
||||
STDMETHOD(GetOutputMode)(THIS_ DWORD *lpdwFrontXtalkMode, DWORD *lpdwBackXtalkMode, DWORD *lpdwQuadMode) PURE;
|
||||
|
||||
STDMETHOD(SetResourceManagerMode) (THIS_ DWORD ) PURE;
|
||||
STDMETHOD(GetResourceManagerMode) (THIS_ DWORD *) PURE;
|
||||
|
||||
STDMETHOD(SetHFAbsorbFactor)(THIS_ FLOAT ) PURE;
|
||||
STDMETHOD(GetHFAbsorbFactor)(THIS_ FLOAT *) PURE;
|
||||
|
||||
// New Methods inaddition to old ones
|
||||
STDMETHOD(RegisterVersion) (THIS_ DWORD dwVersionNr) PURE;
|
||||
STDMETHOD(GetSoftwareCaps) (THIS_ LPA3DCAPS_SOFTWARE lpCaps) PURE;
|
||||
STDMETHOD(GetHardwareCaps) (THIS_ LPA3DCAPS_HARDWARE lpCaps) PURE;
|
||||
};
|
||||
|
||||
|
||||
// The library function that gets things going. It returns an interface
|
||||
// pointer to DirectSound.
|
||||
|
||||
#define A3D_OK 1 // A3dCreate returns this upon detection of A3D Dll.
|
||||
#define A3D_OK_OLD_DLL 2 // A3dCreate returns this upon detection of A3D Dll but user's version is older than expected.
|
||||
|
||||
// Usefull Macros for C folks.
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define IA3d_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IA3d_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IA3d_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IA3d_SetOutputMode(p,a,b,c) (p)->lpVtbl->SetOutputMode(p,a,b,c)
|
||||
#define IA3d_GetOutputMode(p,a,b,c) (p)->lpVtbl->GetOutputMode(p,a,b,c)
|
||||
#define IA3d_SetResourceManagerMode(p,a) (p)->lpVtbl->SetResourceManagerMode(p,a)
|
||||
#define IA3d_GetResourceManagerMode(p,a) (p)->lpVtbl->GetResourceManagerMode(p,a)
|
||||
#define IA3d_SetHFAbsorbFactor(p,a) (p)->lpVtbl->SetHFAbsorbFactor(p,a)
|
||||
#define IA3d_GetHFAbsorbFactor(p,a) (p)->lpVtbl->GetHFAbsorbFactor(p,a)
|
||||
|
||||
// C function def
|
||||
#define IA3d2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IA3d2_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IA3d2_Release(p) (p)->lpVtbl->Release(p)
|
||||
#define IA3d2_SetOutputMode(p,a,b,c) (p)->lpVtbl->SetOutputMode(p,a,b,c)
|
||||
#define IA3d2_GetOutputMode(p,a,b,c) (p)->lpVtbl->GetOutputMode(p,a,b,c)
|
||||
#define IA3d2_SetResourceManagerMode(p,a) (p)->lpVtbl->SetResourceManagerMode(p,a)
|
||||
#define IA3d2_GetResourceManagerMode(p,a) (p)->lpVtbl->GetResourceManagerMode(p,a)
|
||||
#define IA3d2_SetHFAbsorbFactor(p,a) (p)->lpVtbl->SetHFAbsorbFactor(p,a)
|
||||
#define IA3d2_GetHFAbsorbFactor(p,a) (p)->lpVtbl->GetHFAbsorbFactor(p,a)
|
||||
#define IA3d2_RegisterVersion(p,a) (p)->lpVtbl->RegisterVersion(p,a)
|
||||
#define IA3d2_GetSoftwareCaps(p,a) (p)->lpVtbl->GetSoftwareCaps(p,a)
|
||||
#define IA3d2_GetHardwareCaps(p,a) (p)->lpVtbl->GetHardwareCaps(p,a)
|
||||
|
||||
#else
|
||||
#define IA3d_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IA3d_AddRef(p) (p)->AddRef()
|
||||
#define IA3d_Release(p) (p)->Release()
|
||||
#define IA3d_SetOutputMode(p,a,b,c) (p)->SetOutputMode(a,b,c)
|
||||
#define IA3d_GetOutputMode(p,a,b,c) (p)->GetOutputMode(a,b,c)
|
||||
#define IA3d_SetResourceManagerMode(p,a) (p)->SetResourceManagerMode(a)
|
||||
#define IA3d_GetResourceManagerMode(p,a) (p)->GetResourceManagerMode(a)
|
||||
#define IA3d_SetHFAbsorbFactor(p,a) (p)->SetHFAbsorbFactor(a)
|
||||
#define IA3d_GetHFAbsorbFactor(p,a) (p)->GetHFAbsorbFactor(a)
|
||||
|
||||
// C++ function def
|
||||
#define IA3d2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IA3d2_AddRef(p) (p)->AddRef()
|
||||
#define IA3d2_Release(p) (p)->Release()
|
||||
#define IA3d2_SetOutputMode(p,a,b,c) (p)->SetOutputMode(a,b,c)
|
||||
#define IA3d2_GetOutputMode(p,a,b,c) (p)->GetOutputMode(a,b,c)
|
||||
#define IA3d2_SetResourceManagerMode(p,a) (p)->SetResourceManagerMode(a)
|
||||
#define IA3d2_GetResourceManagerMode(p,a) (p)->GetResourceManagerMode(a)
|
||||
#define IA3d2_SetHFAbsorbFactor(p,a) (p)->SetHFAbsorbFactor(a)
|
||||
#define IA3d2_GetHFAbsorbFactor(p,a) (p)->GetHFAbsorbFactor(a)
|
||||
#define IA3d2_RegisterVersion(p,a) (p)->RegisterVersion(a)
|
||||
#define IA3d2_GetSoftwareCaps(p,a) (p)->GetSoftwareCaps(a)
|
||||
#define IA3d2_GetHardwareCaps(p,a) (p)->GetHardwareCaps(a)
|
||||
|
||||
#endif
|
||||
|
||||
// Convenience Macro A3D_REGISTER_VERSION()
|
||||
// Register version for backwards compatibility
|
||||
// Pass in any COM object from CLSID_A3d
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
#define A3D_UNKNOWN_QI(pU,I,ppI) (SUCCEEDED((pU)->lpVtbl->QueryInterface(pU,&I,ppI)))
|
||||
#else
|
||||
#define A3D_UNKNOWN_QI(pU,I,ppI) (SUCCEEDED((pU)->QueryInterface(I,ppI)))
|
||||
#endif
|
||||
|
||||
#define A3D_REGISTER_VERSION(p) \
|
||||
{ \
|
||||
LPIA3D2 __pIA3d2__=NULL; \
|
||||
IUnknown *__pU__ = (IUnknown *)p; \
|
||||
\
|
||||
if (p) \
|
||||
{ \
|
||||
if (A3D_UNKNOWN_QI(__pU__,IID_IA3d2,(void **)&__pIA3d2__))\
|
||||
{ \
|
||||
IA3d2_RegisterVersion(__pIA3d2__,A3D_CURRENT_VERSION); \
|
||||
IA3d2_Release(__pIA3d2__); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
}
|
||||
|
||||
// Helper functions in ia3d.lib
|
||||
|
||||
extern HRESULT WINAPI A3dInitialize(void);
|
||||
|
||||
extern void WINAPI A3dUninitialize(void);
|
||||
|
||||
extern HRESULT WINAPI A3dCreate(GUID * lpGUID, /* in, Prefered Driver Guid, NULL ok */
|
||||
void **ppDS, /* out, Direct Sound pointer */
|
||||
IUnknown FAR *pUnkOuter); /* in, Outer COM object, for Aggregate only NULL oK */
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // _IA3D_H_
|
|
@ -11,7 +11,8 @@ extern "C" {
|
|||
typedef struct menugraphic {
|
||||
char *filename;
|
||||
int image_number;
|
||||
LPDIRECTDRAWSURFACE image_ptr;
|
||||
// LPDIRECTDRAWSURFACE image_ptr;
|
||||
|
||||
AW_BACKUPTEXTUREHANDLE hBackup;
|
||||
short destx;
|
||||
short desty;
|
||||
|
|
|
@ -545,7 +545,7 @@ void InitNPCs(RIFFHANDLE h)
|
|||
|
||||
List<LoadedNPC> newnpcs;
|
||||
|
||||
for(i=0;i<HNPC_Last;i++)
|
||||
for(int i=0;i<HNPC_Last;i++)
|
||||
{
|
||||
if(Load_HNPC[i])
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.hpp>
|
||||
//#include <string.hpp>
|
||||
|
||||
#include "list_tem.hpp"
|
||||
#include "chnkload.hpp"
|
||||
|
@ -948,8 +948,10 @@ void add_placed_hierarchy(Placed_Hierarchy_Chunk* phc,const char* fname,const ch
|
|||
List<Chunk*> chlist;
|
||||
phc->lookup_child("INDSOUND",chlist);
|
||||
phtt->num_sounds=0;
|
||||
|
||||
//find the highest index
|
||||
for(LIF<Chunk*> chlif(&chlist);!chlif.done();chlif.next())
|
||||
LIF<Chunk*> chlif(&chlist);
|
||||
for(; !chlif.done(); chlif.next())
|
||||
{
|
||||
Indexed_Sound_Chunk* isc=(Indexed_Sound_Chunk*)chlif();
|
||||
phtt->num_sounds=max(phtt->num_sounds,isc->index+1);
|
||||
|
@ -3178,7 +3180,9 @@ void setup_generators (Environment_Data_Chunk * envd)
|
|||
//go through the list to find the number of each type of start location
|
||||
List<Chunk *> cl;
|
||||
soc->lookup_child("AVPGENER",cl);
|
||||
for (LIF<Chunk *> cli(&cl); !cli.done(); cli.next())
|
||||
|
||||
LIF<Chunk *> cli(&cl);
|
||||
for (; !cli.done(); cli.next())
|
||||
{
|
||||
AVP_Generator_Chunk * agc = (AVP_Generator_Chunk *)cli();
|
||||
if(agc->type) continue;
|
||||
|
@ -3272,7 +3276,9 @@ static void add_mission_to_list(AVP_Strategy_Chunk * asc,ObjectID id)
|
|||
|
||||
void SetupMissionObjectives()
|
||||
{
|
||||
for(LIF<MISSION_SETUP*> mlif(&mos_list);!mlif.done();mlif.next())
|
||||
LIF<MISSION_SETUP*> mlif(&mos_list);
|
||||
|
||||
for(; !mlif.done(); mlif.next())
|
||||
{
|
||||
MissionObjectiveStrategy * mos=(MissionObjectiveStrategy*) mlif()->asc->Strategy;
|
||||
assert (mos->mission_description_string>=0 && mos->mission_description_string<450);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "PathChnk.hpp"
|
||||
#include "pathchnk.hpp"
|
||||
|
||||
//macro for helping to force inclusion of chunks when using libraries
|
||||
FORCE_CHUNK_INCLUDE_IMPLEMENT(pathchnk)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Patrick 14/7/97----------------------------
|
||||
Source for Multi-Player ghost object support header
|
||||
d ----------------------------------------------------------------------*/
|
||||
----------------------------------------------------------------------*/
|
||||
#include "3dc.h"
|
||||
#include "inline.h"
|
||||
#include "module.h"
|
||||
|
@ -24,7 +24,7 @@ d ----------------------------------------------------------------------*/
|
|||
#include "psndplat.h"
|
||||
#include "bh_corpse.h"
|
||||
#include "bh_weap.h"
|
||||
#include "ShowCmds.h"
|
||||
#include "showcmds.h"
|
||||
|
||||
#define UseLocalAssert Yes
|
||||
#include "ourasert.h"
|
||||
|
@ -3669,16 +3669,20 @@ void MaintainGhosts(void)
|
|||
{
|
||||
if (ghostData->timer>ONE_FIXED*4)
|
||||
{
|
||||
ghostData->EventCounter += NormalFrameTime;
|
||||
/* EventCounter - was in anon. union with currentAnimSequence */
|
||||
ghostData->currentAnimSequence += NormalFrameTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
ghostData->EventCounter += MUL_FIXED(NormalFrameTime,ghostData->timer)/4;
|
||||
/* EventCounter */
|
||||
ghostData->currentAnimSequence += MUL_FIXED(NormalFrameTime,ghostData->timer)/4;
|
||||
}
|
||||
|
||||
while (ghostData->EventCounter >= FLARE_PARTICLE_GENERATION_TIME)
|
||||
/* EventCounter */
|
||||
while (ghostData->currentAnimSequence >= FLARE_PARTICLE_GENERATION_TIME)
|
||||
{
|
||||
ghostData->EventCounter -= FLARE_PARTICLE_GENERATION_TIME;
|
||||
/* EventCounter */
|
||||
ghostData->currentAnimSequence -= FLARE_PARTICLE_GENERATION_TIME;
|
||||
MakeFlareParticle(sbPtr->DynPtr);
|
||||
}
|
||||
|
||||
|
@ -3712,11 +3716,15 @@ void MaintainGhosts(void)
|
|||
int scale = ONE_FIXED-ghostData->timer/PROX_GRENADE_LIFETIME;
|
||||
scale = MUL_FIXED(scale,scale);
|
||||
scale = MUL_FIXED(scale,scale)*8;
|
||||
ghostData->EventCounter += NormalFrameTime + MUL_FIXED(NormalFrameTime,scale);
|
||||
|
||||
/* EventCounter */
|
||||
ghostData->currentAnimSequence += NormalFrameTime + MUL_FIXED(NormalFrameTime,scale);
|
||||
}
|
||||
while (ghostData->EventCounter >= PROX_GRENADE_SOUND_GENERATION_TIME)
|
||||
/* EventCounter */
|
||||
while (ghostData->currentAnimSequence >= PROX_GRENADE_SOUND_GENERATION_TIME)
|
||||
{
|
||||
ghostData->EventCounter -= PROX_GRENADE_SOUND_GENERATION_TIME;
|
||||
/* EventCounter */
|
||||
ghostData->currentAnimSequence -= PROX_GRENADE_SOUND_GENERATION_TIME;
|
||||
Sound_Play(SID_PROX_GRENADE_ACTIVE,"d",&(dynPtr->Position));
|
||||
}
|
||||
|
||||
|
|
|
@ -338,4 +338,4 @@ void Game_Has_Loaded(void)
|
|||
}
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
#include "inline.h"
|
||||
#include "module.h"
|
||||
|
||||
#include <string.hpp>
|
||||
|
||||
#include "list_tem.hpp"
|
||||
#include "chnkload.hpp"
|
||||
#include "projload.hpp"
|
||||
|
@ -45,7 +43,7 @@
|
|||
#include "pvisible.h"
|
||||
#include "psndplat.h"
|
||||
#include "jsndsup.h"
|
||||
#include "AvpReg.hpp"
|
||||
#include "avpreg.hpp"
|
||||
#include "ffstdio.h"
|
||||
|
||||
#include "decal.h"
|
||||
|
@ -172,7 +170,9 @@ void setup_paths(RIFFHANDLE h)
|
|||
if(!pathlist.size()) return;
|
||||
|
||||
//find the highest path index
|
||||
for(LIF<Chunk*> plif(&pathlist);!plif.done();plif.next())
|
||||
LIF<Chunk*> plif(&pathlist);
|
||||
|
||||
for(; !plif.done(); plif.next())
|
||||
{
|
||||
AVP_Path_Chunk* apc=(AVP_Path_Chunk*) plif();
|
||||
PathArraySize=max(PathArraySize,apc->PathID+1);
|
||||
|
@ -200,7 +200,7 @@ void setup_paths(RIFFHANDLE h)
|
|||
|
||||
path->modules_in_path=(AIMODULE**)PoolAllocateMem(sizeof(AIMODULE*)*length);
|
||||
|
||||
for(i=0;i<apc->PathLength;i++)
|
||||
for(int i=0;i<apc->PathLength;i++)
|
||||
{
|
||||
Object_Chunk* path_object=h->fc->get_object_by_index(apc->Path[i].module_index);
|
||||
if(!path_object)continue;
|
||||
|
@ -219,7 +219,7 @@ void setup_paths(RIFFHANDLE h)
|
|||
|
||||
if(apc->flags & PathFlag_BackAndForth)
|
||||
{
|
||||
for(i=path->path_length-2;i>0;i--)
|
||||
for(int i=path->path_length-2;i>0;i--)
|
||||
{
|
||||
path->modules_in_path[path->path_length]=path->modules_in_path[i];
|
||||
path->path_length++;
|
||||
|
@ -465,7 +465,9 @@ Global_Hierarchy_Store::Global_Hierarchy_Store (RIFFHANDLE h)
|
|||
|
||||
//find the highest sound index
|
||||
int max_index=-1;
|
||||
for(LIF<Chunk*> chlif(&chlist);!chlif.done();chlif.next())
|
||||
LIF<Chunk*> chlif(&chlist);
|
||||
|
||||
for(; !chlif.done(); chlif.next())
|
||||
{
|
||||
Indexed_Sound_Chunk* isc=(Indexed_Sound_Chunk*)chlif();
|
||||
max_index=max(max_index,isc->index);
|
||||
|
@ -664,7 +666,8 @@ void Global_Hierarchy_Store::setup_alternate_shape_sets(List <Object_ShapeNum_Pa
|
|||
List<Chunk*> chlist;
|
||||
fc->lookup_child("OBHALTSH",chlist);
|
||||
|
||||
for(LIF<Chunk*> chlif(&chlist);!chlif.done();chlif.next())
|
||||
LIF<Chunk*> chlif(&chlist);
|
||||
for(; !chlif.done(); chlif.next())
|
||||
{
|
||||
Object_Hierarchy_Alternate_Shape_Set_Chunk* ohassc=(Object_Hierarchy_Alternate_Shape_Set_Chunk*) chlif();
|
||||
|
||||
|
@ -688,7 +691,9 @@ void Global_Hierarchy_Store::setup_alternate_shape_sets(List <Object_ShapeNum_Pa
|
|||
hsr->replacement_id = 0;
|
||||
|
||||
//find the shape num for the new shape
|
||||
for(LIF<Object_ShapeNum_Pair*> olif(&osnp_lst);!olif.done();olif.next())
|
||||
LIF<Object_ShapeNum_Pair*> olif(&osnp_lst);
|
||||
|
||||
for(; !olif.done(); olif.next())
|
||||
{
|
||||
if(!strcmp(olif()->ob->object_data.o_name,rlif()->new_object_name))
|
||||
{
|
||||
|
@ -793,7 +798,7 @@ void Global_Hierarchy_Store::setup_alternate_shape_sets(List <Object_ShapeNum_Pa
|
|||
|
||||
|
||||
int pos=0;
|
||||
for(i=0;i<num_found_sets;i++)
|
||||
for(int i=0;i<num_found_sets;i++)
|
||||
{
|
||||
Hierarchy_Alternate_Shape_Set* hass=found_sets[i];
|
||||
for(int j=0;j<hass->num_replaced_shapes;j++)
|
||||
|
@ -1925,7 +1930,8 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
|
|||
MainScene.sm_module += 2;
|
||||
MainScene.sm_marray += 1;
|
||||
|
||||
for (int i=0; i<num_modules; i++)
|
||||
int i;
|
||||
for (i=0; i<num_modules; i++)
|
||||
{
|
||||
MainScene.sm_module[i] = Empty_Module;
|
||||
MainScene.sm_marray[i] = &MainScene.sm_module[i];
|
||||
|
@ -2431,7 +2437,8 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
|
|||
if(adj_ai_module!=this_ai_module_index)
|
||||
{
|
||||
//make sure not already in list
|
||||
for(LIF<int> adjlif(&adjacent_aimodule_list);!adjlif.done();adjlif.next())
|
||||
LIF<int> adjlif(&adjacent_aimodule_list);
|
||||
for(; !adjlif.done();adjlif.next())
|
||||
{
|
||||
if(adjlif()==adj_ai_module) break;
|
||||
}
|
||||
|
@ -2483,7 +2490,8 @@ BOOL copy_rif_data (RIFFHANDLE h, int flags,int progress_start,int progress_inte
|
|||
if(adj_ai_module!=this_ai_module_index)
|
||||
{
|
||||
//make sure not already in list
|
||||
for(LIF<int> adjlif(&adjacent_aimodule_list);!adjlif.done();adjlif.next())
|
||||
LIF<int> adjlif(&adjacent_aimodule_list);
|
||||
for(; !adjlif.done();adjlif.next())
|
||||
{
|
||||
if(adjlif()==adj_ai_module) break;
|
||||
}
|
||||
|
@ -2860,10 +2868,12 @@ static int first_free_pos = GLS_NOTINLIST;
|
|||
// reserves the next avaialbe position in the main shape list and returns it
|
||||
int GetMSLPos(void)
|
||||
{
|
||||
int pos;
|
||||
|
||||
if (GLS_NOTINLIST == first_free_pos)
|
||||
first_free_pos = msl_term_pos = start_of_loaded_shapes = load_precompiled_shapes();
|
||||
|
||||
for (int pos = first_free_pos; pos < msl_term_pos && FREE_SHAPE != mainshapelist[pos]; ++pos)
|
||||
for (pos = first_free_pos; pos < msl_term_pos && FREE_SHAPE != mainshapelist[pos]; ++pos)
|
||||
;
|
||||
|
||||
first_free_pos = pos+1;
|
||||
|
@ -3256,7 +3266,9 @@ void LoadModuleData()
|
|||
{
|
||||
if(this_mod->m_vmptr[j].vmod_data.vmodidata)
|
||||
{
|
||||
for(int k=j+1;k<vmod_no;k++)
|
||||
int k;
|
||||
|
||||
for(k=j+1;k<vmod_no;k++)
|
||||
{
|
||||
if(*((int *)this_mod->m_vmptr[k].vmod_name)>=this_mod->m_vmptr[j].vmod_data.vmodidata)
|
||||
{
|
||||
|
@ -3518,4 +3530,4 @@ void DeallocateSoundsAndPoolAllocatedMemory()
|
|||
PurgeMSLShapeList();
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -756,7 +756,7 @@ void LiftStrategy::fill_data_block(char* data)
|
|||
data+=4;
|
||||
*(int*)data=NumExternalLifts;
|
||||
data+=4;
|
||||
for(i=0;i<NumExternalLifts;i++)
|
||||
for(int i=0;i<NumExternalLifts;i++)
|
||||
{
|
||||
*(ExtLift*)data=ExternalLifts[i];
|
||||
data+=sizeof(ExtLift);
|
||||
|
@ -1146,7 +1146,7 @@ void MultiSwitchStrategy::fill_data_block(char* data)
|
|||
|
||||
*(int*)data=NumLinks;
|
||||
data+=4;
|
||||
for(i=0;i<NumLinks;i++)
|
||||
for(int i=0;i<NumLinks;i++)
|
||||
{
|
||||
*(ObjectID*)data=LinkedSwitches[i];
|
||||
data+=8;
|
||||
|
@ -1451,7 +1451,7 @@ void MissionObjectiveStrategy::fill_data_block(char* data)
|
|||
|
||||
*(int*)data=num_request_targets;
|
||||
data+=4;
|
||||
for( i=0;i<num_request_targets;i++)
|
||||
for(int i=0;i<num_request_targets;i++)
|
||||
{
|
||||
*(RequestTarget*)data=request_targets[i];
|
||||
data+=sizeof(RequestTarget);
|
||||
|
|
|
@ -377,16 +377,16 @@ class SwitchDoorStrategy : public AvpStrat
|
|||
SwitchDoorStrategy(const char* data_start,size_t);
|
||||
|
||||
ObjectID AssocDoor;
|
||||
union
|
||||
{
|
||||
//union
|
||||
//{
|
||||
int spare1;
|
||||
struct
|
||||
{
|
||||
unsigned int r6_flags:20;
|
||||
unsigned int r6_open_time:6; //in tenths of a second
|
||||
unsigned int r6_close_time:6; //in tenths of a second
|
||||
};
|
||||
};
|
||||
// struct
|
||||
// {
|
||||
// unsigned int r6_flags:20;
|
||||
// unsigned int r6_open_time:6; //in tenths of a second
|
||||
// unsigned int r6_close_time:6; //in tenths of a second
|
||||
// };
|
||||
//};
|
||||
|
||||
int spare2;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "bh_far.h"
|
||||
#include "pheromon.h"
|
||||
#include "huddefs.h"
|
||||
#include "hudgfx.h"
|
||||
//#include "hudgfx.h"
|
||||
#include "font.h"
|
||||
#include "bh_gener.h"
|
||||
#include "pvisible.h"
|
||||
|
@ -31,7 +31,7 @@ New sound system
|
|||
#include "progress_bar.h"
|
||||
#include "bh_rubberduck.h"
|
||||
#include "game_statistics.h"
|
||||
#include "CDTrackSelection.h"
|
||||
#include "cdtrackselection.h"
|
||||
|
||||
|
||||
// EXTERNS
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
****************************************************************************************KJL*/
|
||||
#include "vision.h"
|
||||
#include "krender.h"
|
||||
#include "frustrum.h"
|
||||
#include "frustum.h"
|
||||
#include "avpview.h"
|
||||
#include "game_statistics.h"
|
||||
|
||||
|
|
52
src/fixer.h
52
src/fixer.h
|
@ -24,6 +24,20 @@
|
|||
#define stricmp strcasecmp
|
||||
#define _stricmp strcasecmp
|
||||
|
||||
#define strnicmp strncasecmp
|
||||
#define _strnicmp strncasecmp
|
||||
|
||||
#define lstrlen strlen
|
||||
#define lstrcat strcat
|
||||
|
||||
#define _tcslen strlen
|
||||
#define _tcscpy strcpy
|
||||
|
||||
/* #define _mbclen strlen */
|
||||
size_t _mbclen(const unsigned char *s);
|
||||
|
||||
#define RGBA_MAKE(r,g,b,a) (((r) << 24) | ((g) << 16) | ((b) << 8) | (a))
|
||||
|
||||
/* windows junk */
|
||||
typedef int GUID;
|
||||
typedef int DPID;
|
||||
|
@ -33,6 +47,13 @@ typedef int LPARAM;
|
|||
typedef int HANDLE;
|
||||
|
||||
typedef int BOOL;
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned int DWORD;
|
||||
typedef long LONG;
|
||||
typedef char TCHAR;
|
||||
|
||||
#define TEXT(x) x
|
||||
|
||||
typedef struct RECT
|
||||
{
|
||||
|
@ -58,5 +79,34 @@ typedef struct SYSTEMTIME
|
|||
int wMonth;
|
||||
int wDay;
|
||||
} SYSTEMTIME;
|
||||
|
||||
|
||||
#define INVALID_HANDLE_VALUE -1
|
||||
#define GENERIC_WRITE 0
|
||||
#define CREATE_ALWAYS 1
|
||||
#define FILE_FLAG_RANDOM_ACCESS 2
|
||||
#define GENERIC_READ 3
|
||||
#define OPEN_EXISTING 4
|
||||
#define FILE_ATTRIBUTE_READONLY 5
|
||||
#define FILE_CURRENT 6
|
||||
#define FILE_BEGIN 7
|
||||
#define FILE_END 8
|
||||
|
||||
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);
|
||||
int WriteFile(HANDLE file, const void *data, int len, unsigned long *byteswritten, int x);
|
||||
int ReadFile(HANDLE file, void *data, int len, unsigned long *bytesread, int x);
|
||||
int GetFileSize(HANDLE file, int x);
|
||||
int CloseHandle(HANDLE file);
|
||||
int DeleteFile(const char *file);
|
||||
int DeleteFileA(const char *file);
|
||||
int GetDiskFreeSpace(int x, unsigned long *a, unsigned long *b, unsigned long *c, unsigned long *d);
|
||||
int CreateDirectory(char *dir, int x);
|
||||
int MoveFile(const char *newfile, const char *oldfile);
|
||||
int MoveFileA(const char *newfile, const char *oldfile);
|
||||
int CopyFile(const char *newfile, const char *oldfile, int x);
|
||||
int GetFileAttributes(const char *file);
|
||||
int GetFileAttributesA(const char *file);
|
||||
int SetFilePointer(HANDLE file, int x, int y, int z);
|
||||
int SetEndOfFile(HANDLE file);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -61,7 +61,7 @@ Animation_Chunk::Animation_Chunk(Chunk_With_Children* parent,const char* data,si
|
|||
fl->Textures[k]=*((int*)data);
|
||||
data+=4;
|
||||
}
|
||||
for(k=0;k<(2*ta->NumVerts)*fl->NumFrames;k++)
|
||||
for(int k=0;k<(2*ta->NumVerts)*fl->NumFrames;k++)
|
||||
{
|
||||
fl->UVCoords[k]=*((int*)data);
|
||||
data+=4;
|
||||
|
@ -164,7 +164,7 @@ void Animation_Chunk::fill_data_block(char* data_start)
|
|||
*(int*)data_start=fl->Textures[k];
|
||||
data_start+=4;
|
||||
}
|
||||
for(k=0;k<(2*ta->NumVerts)*fl->NumFrames;k++)
|
||||
for(int k=0;k<(2*ta->NumVerts)*fl->NumFrames;k++)
|
||||
{
|
||||
*(int*)data_start=fl->UVCoords[k];
|
||||
data_start+=4;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _animchnk_hpp
|
||||
#define _animchnk_hpp
|
||||
#include "chunk.hpp"
|
||||
#include "Chnktype.hpp"
|
||||
#include "chnktype.hpp"
|
||||
|
||||
struct TEXANIM;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "hierchnk.hpp"
|
||||
#include "Animobs.hpp"
|
||||
#include "animobs.hpp"
|
||||
#include "list_tem.hpp"
|
||||
#include <math.h>
|
||||
|
||||
|
@ -329,7 +329,8 @@ Object_Animation_Sequence_Chunk * Object_Animation_Sequences_Chunk::get_sequence
|
|||
List <Object_Animation_Sequence_Chunk *> seq_list;
|
||||
list_sequences(&seq_list);
|
||||
|
||||
for (LIF<Object_Animation_Sequence_Chunk *> sli(&seq_list); !sli.done(); sli.next())
|
||||
LIF<Object_Animation_Sequence_Chunk *> sli(&seq_list);
|
||||
for (; !sli.done(); sli.next())
|
||||
{
|
||||
Object_Animation_Sequence_Header_Chunk * oashc = sli()->get_header();
|
||||
if (oashc)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.hpp>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "string.hpp"
|
||||
|
||||
#include "list_tem.hpp"
|
||||
#include "chnkload.hpp"
|
||||
|
@ -476,9 +479,12 @@ RIFFHANDLE load_rif (const char * fname)
|
|||
CL_LogFile.lprintf("FAILED TO LOAD RIF: %s\n",fname);
|
||||
#endif
|
||||
ReleaseDirect3D();
|
||||
#if 0
|
||||
char message[200];
|
||||
sprintf(message,"Error loading %s",fname);
|
||||
MessageBox(NULL,message,"AvP",MB_OK+MB_SYSTEMMODAL);
|
||||
#endif
|
||||
fprintf(stderr, "load_rif: Error loading %s\n", fname);
|
||||
exit(0x111);
|
||||
return INVALID_RIFFHANDLE;
|
||||
}
|
||||
|
@ -510,9 +516,12 @@ RIFFHANDLE load_rif_non_env (const char * fname)
|
|||
#endif
|
||||
|
||||
ReleaseDirect3D();
|
||||
#if 0
|
||||
char message[200];
|
||||
sprintf(message,"Error loading %s",fname);
|
||||
MessageBox(NULL,message,"AvP",MB_OK+MB_SYSTEMMODAL);
|
||||
#endif
|
||||
fprintf(stderr, "load_rif_non_env: Error loading %s\n", fname);
|
||||
exit(0x111);
|
||||
return INVALID_RIFFHANDLE;
|
||||
}
|
||||
|
@ -667,7 +676,9 @@ static void setup_tex_conv_array (
|
|||
// load in the textures from the shape
|
||||
|
||||
max_indices = 0;
|
||||
for (LIF<BMP_Name> bns (&blsc->bmps); !bns.done(); bns.next())
|
||||
LIF<BMP_Name> bns (&blsc->bmps);
|
||||
|
||||
for (; !bns.done(); bns.next())
|
||||
{
|
||||
max_indices = max(bns().index,max_indices);
|
||||
}
|
||||
|
@ -707,7 +718,7 @@ static void setup_tex_conv_array (
|
|||
|
||||
}
|
||||
|
||||
CopyShapeAnimationHeader(SHAPEHEADER* shpfrom,SHAPEHEADER* shpto)
|
||||
void CopyShapeAnimationHeader(SHAPEHEADER* shpfrom,SHAPEHEADER* shpto)
|
||||
{
|
||||
GLOBALASSERT(shpfrom->numitems==shpto->numitems);
|
||||
GLOBALASSERT(shpfrom->animation_header);
|
||||
|
@ -1170,7 +1181,9 @@ BOOL load_rif_bitmaps (RIFFHANDLE h, int/* flags*/)
|
|||
|
||||
if (gbnc)
|
||||
{
|
||||
for (LIF<BMP_Name> bns (&gbnc->bmps); !bns.done(); bns.next())
|
||||
LIF<BMP_Name> bns (&gbnc->bmps);
|
||||
|
||||
for (; !bns.done(); bns.next())
|
||||
{
|
||||
h->max_index = max(bns().index,h->max_index);
|
||||
}
|
||||
|
@ -1286,9 +1299,12 @@ BOOL copy_rif_tlt (RIFFHANDLE h, int /*flags*/)
|
|||
ScreenDescriptorBlock.SDB_Flags &= ~(SDB_Flag_TLTSize|SDB_Flag_TLTShift);
|
||||
if (tltch->width != 256)
|
||||
{
|
||||
int shft;
|
||||
|
||||
ScreenDescriptorBlock.SDB_Flags |= SDB_Flag_TLTSize;
|
||||
ScreenDescriptorBlock.TLTSize = tltch->width;
|
||||
for (int shft = 0; 1<<shft < tltch->width; ++shft)
|
||||
|
||||
for (shft = 0; 1<<shft < tltch->width; ++shft)
|
||||
;
|
||||
if (1<<shft==tltch->width)
|
||||
{
|
||||
|
@ -1891,10 +1907,14 @@ void SetupAnimOnQuad(Shape_Chunk* sc,SHAPEHEADER* shp,TEXANIM* ta1,TEXANIM* ta2,
|
|||
if(ta1->ID!=ta2->ID)return;
|
||||
int VertConv[3];//conversion between vert nos in triangles and vert nos in quad
|
||||
int VertFrom,VertTo;//for remaining vert in second poly
|
||||
int i;
|
||||
|
||||
VertTo=6;
|
||||
for(int i=0;i<3;i++)
|
||||
for(i=0;i<3;i++)
|
||||
{
|
||||
for(int j=0;j<4;j++)
|
||||
int j;
|
||||
|
||||
for(j=0;j<4;j++)
|
||||
{
|
||||
if(sc->shape_data.poly_list[ta1->poly].vert_ind[i]==(shp->items[poly][j+4]))break;
|
||||
}
|
||||
|
@ -2018,7 +2038,7 @@ void SetupAnimatedTextures(Shape_Chunk* sc,SHAPEHEADER* shp,Animation_Chunk* ac,
|
|||
|
||||
}
|
||||
|
||||
for(i=0;i<ac->NumPolys;i++)
|
||||
for(int i=0;i<ac->NumPolys;i++)
|
||||
{
|
||||
TEXANIM* ta1,*ta2;
|
||||
ta1=ac->AnimList[i];
|
||||
|
@ -2028,6 +2048,8 @@ void SetupAnimatedTextures(Shape_Chunk* sc,SHAPEHEADER* shp,Animation_Chunk* ac,
|
|||
}
|
||||
else if(mgd[ta1->poly]>ta1->poly)
|
||||
{
|
||||
int j;
|
||||
|
||||
for(j=0;j<ac->NumPolys;j++)
|
||||
{
|
||||
if(ac->AnimList[j]->poly==mgd[ta1->poly])break;
|
||||
|
@ -2119,7 +2141,9 @@ void SetupAnimatingShape(Shape_Chunk* sc,SHAPEHEADER* shp, Shape_Merge_Data_Chun
|
|||
int numseq=0;
|
||||
List<Chunk *> chlist;
|
||||
sc->lookup_child("ANIMSEQU",chlist);
|
||||
for(LIF<Chunk*> chlif(&chlist);!chlif.done();chlif.next())
|
||||
|
||||
LIF<Chunk*> chlif(&chlist);
|
||||
for(;!chlif.done();chlif.next())
|
||||
{
|
||||
Anim_Shape_Sequence_Chunk* assc=(Anim_Shape_Sequence_Chunk*)chlif();
|
||||
numseq=max(assc->sequence_data.SequenceNum+1,numseq);
|
||||
|
@ -2164,7 +2188,7 @@ void SetupAnimatingShape(Shape_Chunk* sc,SHAPEHEADER* shp, Shape_Merge_Data_Chun
|
|||
|
||||
|
||||
sas->vertex_normals=(int*)PoolAllocateMem(sizeof(VECTORCH)*cas->num_verts);
|
||||
for(i=0;i<cas->num_verts;i++)
|
||||
for(int i=0;i<cas->num_verts;i++)
|
||||
{
|
||||
sas->vertex_normals[i*3]=(int)(cas->v_normal_list[i].x*ONE_FIXED);
|
||||
sas->vertex_normals[i*3+1]=(int)(cas->v_normal_list[i].y*ONE_FIXED);
|
||||
|
@ -2174,7 +2198,7 @@ void SetupAnimatingShape(Shape_Chunk* sc,SHAPEHEADER* shp, Shape_Merge_Data_Chun
|
|||
sas->num_frames=cas->NumFrames;
|
||||
sas->anim_frames=(shapeanimationframe*)PoolAllocateMem(sizeof(shapeanimationframe)*cas->NumFrames);
|
||||
|
||||
for(i=0;i<cas->NumFrames;i++)
|
||||
for(int i=0;i<cas->NumFrames;i++)
|
||||
{
|
||||
const ChunkAnimFrame* caf=cas->Frames[i];
|
||||
shapeanimationframe* saf=&sas->anim_frames[i];
|
||||
|
@ -2188,7 +2212,7 @@ void SetupAnimatingShape(Shape_Chunk* sc,SHAPEHEADER* shp, Shape_Merge_Data_Chun
|
|||
}
|
||||
|
||||
saf->item_normals=(int*) PoolAllocateMem(sizeof(VECTORCH)*shp->numitems);
|
||||
for(j=0;j<caf->num_polys;j++)
|
||||
for(int j=0;j<caf->num_polys;j++)
|
||||
{
|
||||
saf->item_normals[PolyConv[j]*3]=(int)(caf->p_normal_list[j].x*ONE_FIXED);
|
||||
saf->item_normals[PolyConv[j]*3+1]=(int)(caf->p_normal_list[j].y*ONE_FIXED);
|
||||
|
@ -2203,6 +2227,8 @@ void SetupAnimatingShape(Shape_Chunk* sc,SHAPEHEADER* shp, Shape_Merge_Data_Chun
|
|||
|
||||
//find a sequence which has some frames;
|
||||
shapeanimationsequence* sas=0;
|
||||
int i;
|
||||
|
||||
for(i=0;i<shp->animation_header->num_sequences;i++)
|
||||
{
|
||||
sas=&shp->animation_header->anim_sequences[i];
|
||||
|
@ -2588,7 +2614,8 @@ BOOL copy_sprite_to_shapeheader (RIFFHANDLE h, SHAPEHEADER *& shphd,Sprite_Heade
|
|||
// load in the textures from the shape
|
||||
|
||||
local_max_index = 0;
|
||||
for (LIF<BMP_Name> bns (&blsc->bmps); !bns.done(); bns.next())
|
||||
LIF<BMP_Name> bns (&blsc->bmps);
|
||||
for (; !bns.done(); bns.next())
|
||||
{
|
||||
local_max_index = max(bns().index,local_max_index);
|
||||
}
|
||||
|
@ -3157,9 +3184,10 @@ void merge_polygons_in_chunkshape (ChunkShape & shp, Shape_Merge_Data_Chunk * sm
|
|||
|
||||
int mpoly=mgd[i];
|
||||
//find the 'unique vertex' in the second triangle
|
||||
for(int j=0;j<3;j++)
|
||||
int j, k;
|
||||
for(j=0;j<3;j++)
|
||||
{
|
||||
for(int k=0;k<3;k++)
|
||||
for(k=0;k<3;k++)
|
||||
{
|
||||
if(shp.poly_list[mpoly].vert_ind[j]==shp.poly_list[i].vert_ind[k])break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <string.hpp>
|
||||
#include "string.hpp"
|
||||
#ifndef DB_LEVEL
|
||||
#define DB_LEVEL 4
|
||||
#endif
|
||||
|
|
|
@ -1079,10 +1079,12 @@ ChunkAnimSequence& ChunkAnimSequence::operator=(const ChunkAnimSequence &seq)
|
|||
|
||||
void ChunkAnimSequence::UpdateNormalsAndExtents(ChunkShape const * cs,List<int>* poly_not_in_bb)
|
||||
{
|
||||
int i;
|
||||
|
||||
if(!cs) return;
|
||||
num_verts=cs->num_verts;
|
||||
if(!v_normal_list)v_normal_list=new ChunkVectorFloat[cs->num_verts];
|
||||
for(int i=0;i<num_verts;i++)
|
||||
for(i=0;i<num_verts;i++)
|
||||
{
|
||||
v_normal_list[i].x=0;
|
||||
v_normal_list[i].y=0;
|
||||
|
@ -1169,8 +1171,10 @@ void ChunkAnimSequence::UpdateNormalsAndExtents(ChunkShape const * cs,List<int>*
|
|||
|
||||
void ChunkAnimSequence::DeleteInterpolatedFrames()
|
||||
{
|
||||
int i;
|
||||
int NewNumFrames=NumFrames;
|
||||
for(int i=0;i<NumFrames;i++)
|
||||
|
||||
for(i=0;i<NumFrames;i++)
|
||||
{
|
||||
if(Frames[i]->flags & animframeflag_interpolated_frame)NewNumFrames--;
|
||||
}
|
||||
|
@ -1218,4 +1222,4 @@ void ChunkAnimSequence::GenerateInterpolatedFrames(ChunkShape const *cs)
|
|||
Frames=NewFrames;
|
||||
NumFrames=NewNumFrames;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -586,14 +586,3 @@ Chunk* Chunk_With_Children::DynCreate(const char* data)
|
|||
}
|
||||
return new Miscellaneous_Chunk(this,data,(data + 12), (*(int *) (data + 8))-12);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,9 @@ BOOL IsFixedPalette(Chunk_With_Children * parent)
|
|||
{
|
||||
List<Chunk *> plist;
|
||||
parent->lookup_child("PRSETPAL",plist);
|
||||
for (LIF<Chunk *> plit(&plist); !plit.done(); plit.next())
|
||||
|
||||
LIF<Chunk *> plit(&plist);
|
||||
for (; !plit.done(); plit.next())
|
||||
{
|
||||
for (LIF<Preset_Palette> findconst(&((Preset_Palette_Chunk *)plit())->pplist); !findconst.done(); findconst.next())
|
||||
{
|
||||
|
@ -291,7 +293,9 @@ Environment_TLT_Chunk::Environment_TLT_Chunk (Chunk_With_Children * parent, cons
|
|||
: Chunk (parent, "ENVTXLIT"), width (*((int*)(sdata))),
|
||||
num_levels (*((int*)(sdata+4))), flags(*(int *)(sdata+28)), table (0), filename(0)
|
||||
{
|
||||
for (int i=0; i<ChunkTLT_NumReserved; ++i) reserved[i] = *(int *)(sdata+8+(i<<2));
|
||||
int i;
|
||||
|
||||
for (i=0; i<ChunkTLT_NumReserved; ++i) reserved[i] = *(int *)(sdata+8+(i<<2));
|
||||
|
||||
if (flags & ChunkTLTFlag_ExternalFile)
|
||||
{
|
||||
|
@ -340,6 +344,8 @@ size_t Environment_TLT_Chunk::size_chunk()
|
|||
|
||||
void Environment_TLT_Chunk::fill_data_block (char * data_start)
|
||||
{
|
||||
int i;
|
||||
|
||||
strncpy (data_start, identifier, 8);
|
||||
|
||||
data_start += 8;
|
||||
|
@ -353,7 +359,7 @@ void Environment_TLT_Chunk::fill_data_block (char * data_start)
|
|||
|
||||
data_start += 8;
|
||||
|
||||
for (int i=0; i < ChunkTLT_NumReserved ; ++i, data_start+=4)
|
||||
for (i=0; i < ChunkTLT_NumReserved ; ++i, data_start+=4)
|
||||
*((int *)data_start) = reserved[i];
|
||||
|
||||
*(int *)data_start = flags;
|
||||
|
@ -774,7 +780,9 @@ void RIF_Child_Chunk::CreateMD5Chunk(BMP_Flags const & rcbmp, int const * md5id)
|
|||
RIF_Child_Chunk::RIF_Child_Chunk (Chunk_With_Children * const parent, const char * sdata, size_t const /*ssize*/)
|
||||
: Chunk(parent,"RIFCHILD"), egm_parent((Environment_Game_Mode_Chunk * const)parent)
|
||||
{
|
||||
for (int i=0; i<ChunkRIFChild_NumReserved; i++, sdata+=4)
|
||||
int i;
|
||||
|
||||
for (i=0; i<ChunkRIFChild_NumReserved; i++, sdata+=4)
|
||||
{
|
||||
reserved[i] = *((int *) sdata);
|
||||
}
|
||||
|
@ -912,7 +920,9 @@ Coloured_Polygons_Lookup_Chunk::Coloured_Polygons_Lookup_Chunk (Chunk_With_Child
|
|||
: Chunk (parent, "CLRLOOKP"), flags (*((int*)(sdata))),
|
||||
filename(0), table (0)
|
||||
{
|
||||
for (int i=0; i<ChunkCPLU_NumReserved; ++i) reserved[i] = *(int *)(sdata+4+(i<<2));
|
||||
int i;
|
||||
|
||||
for (i=0; i<ChunkCPLU_NumReserved; ++i) reserved[i] = *(int *)(sdata+4+(i<<2));
|
||||
|
||||
if (flags & ChunkCPLUFlag_ExternalFile)
|
||||
{
|
||||
|
@ -961,6 +971,8 @@ size_t Coloured_Polygons_Lookup_Chunk::size_chunk()
|
|||
|
||||
void Coloured_Polygons_Lookup_Chunk::fill_data_block (char * data_start)
|
||||
{
|
||||
int i;
|
||||
|
||||
strncpy (data_start, identifier, 8);
|
||||
|
||||
data_start += 8;
|
||||
|
@ -973,7 +985,7 @@ void Coloured_Polygons_Lookup_Chunk::fill_data_block (char * data_start)
|
|||
|
||||
data_start += 4;
|
||||
|
||||
for (int i=0; i < ChunkCPLU_NumReserved ; ++i, data_start+=4)
|
||||
for (i=0; i < ChunkCPLU_NumReserved ; ++i, data_start+=4)
|
||||
*((int *)data_start) = reserved[i];
|
||||
|
||||
if (flags & ChunkCPLUFlag_ExternalFile)
|
||||
|
@ -1003,5 +1015,3 @@ void Coloured_Polygons_Lookup_Chunk::fill_data_block (char * data_start)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,13 +25,3 @@ fail (const char * format, ...)
|
|||
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void FAILHandleCompilerWarningMessage(void)
|
||||
{
|
||||
int temp;
|
||||
|
||||
temp = D3DRMMAP_PERSPCORRECT;
|
||||
temp = D3DRMMAP_WRAPU;
|
||||
temp = D3DRMMAP_WRAPV;
|
||||
temp = D3DRMGROUP_ALLGROUPS;
|
||||
}
|
|
@ -700,7 +700,9 @@ inline _base_HashTable<TYPE,ARG_TYPE,CMP_ARG_TYPE>::_base_HashTable(_base_HashTa
|
|||
{
|
||||
for (unsigned i=0; i<tableSize; ++i) { chainPA[i] = NULL; }
|
||||
|
||||
for( HashTable<TYPE>::ConstIterator it(ht); !it.Done(); it.Next() )
|
||||
|
||||
// for(HashTable<TYPE>::ConstIterator it(ht); !it.Done(); it.Next() )
|
||||
for (_base_HashTable::ConstIterator it(ht); !it.Done(); it.Next() )
|
||||
{
|
||||
AddRegardless( it.Get() );
|
||||
}
|
||||
|
|
|
@ -298,6 +298,7 @@ Object_Hierarchy_Alternate_Shape_Set_Chunk::Object_Hierarchy_Alternate_Shape_Set
|
|||
Object_Hierarchy_Alternate_Shape_Set_Chunk::Object_Hierarchy_Alternate_Shape_Set_Chunk(Chunk_With_Children* parent,const char* data,size_t)
|
||||
:Chunk(parent,"OBHALTSH")
|
||||
{
|
||||
int i;
|
||||
|
||||
Shape_Set_Num=*(int*)data;
|
||||
data+=4;
|
||||
|
@ -310,7 +311,7 @@ Object_Hierarchy_Alternate_Shape_Set_Chunk::Object_Hierarchy_Alternate_Shape_Set
|
|||
int num_shapes=*(int*)data;
|
||||
data+=4;
|
||||
|
||||
for(int i=0;i<num_shapes;i++)
|
||||
for(i=0;i<num_shapes;i++)
|
||||
{
|
||||
Replaced_Shape_Details* rsd=new Replaced_Shape_Details;
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#include "advwin32.h"
|
||||
#include "iff.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#if defined(_CPPRTTI) && !defined(NDEBUG)
|
||||
#include <typeinfo>
|
||||
|
|
|
@ -48,11 +48,13 @@ namespace IFF
|
|||
#else
|
||||
inline void DisplayMessage(char const * pszTitle,char const * pszText)
|
||||
{
|
||||
::printf("%s\n%s\n",pszTitle,pszText);
|
||||
::printf("DisplayMessage\n%s\n%s\n",pszTitle,pszText);
|
||||
/*
|
||||
while (::kbhit())
|
||||
::getch();
|
||||
while (!::kbhit() || '\r' != ::getch())
|
||||
;
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -121,17 +123,17 @@ namespace IFF
|
|||
#undef BYTE
|
||||
#pragma message("BYTE was defined - undefining")
|
||||
#endif
|
||||
typedef signed char BYTE;
|
||||
typedef unsigned char UBYTE;
|
||||
typedef int8_t BYTE;
|
||||
typedef uint8_t UBYTE;
|
||||
|
||||
typedef signed short INT16;
|
||||
typedef unsigned short UINT16;
|
||||
typedef int16_t INT16;
|
||||
typedef uint16_t UINT16;
|
||||
|
||||
typedef signed INT32;
|
||||
typedef unsigned UINT32;
|
||||
typedef int32_t INT32;
|
||||
typedef uint32_t UINT32;
|
||||
|
||||
typedef signed __int64 INT64;
|
||||
typedef unsigned __int64 UINT64;
|
||||
typedef int64_t INT64;
|
||||
typedef uint64_t UINT64;
|
||||
|
||||
struct RGBTriple
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "advwin32.h"
|
||||
#include "iff_ILBM.hpp"
|
||||
#include "iff_ilbm.hpp"
|
||||
|
||||
IFF_IMPLEMENT_DYNCREATE("ILBM","BMHD",IlbmBmhdChunk)
|
||||
IFF_IMPLEMENT_DYNCREATE("ILBM","CMAP",IlbmCmapChunk)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "3dc.h"
|
||||
|
||||
#include <sys\stat.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "inline.h"
|
||||
|
@ -600,11 +600,12 @@ void (*SetVideoMode[]) (void) = {
|
|||
|
||||
*/
|
||||
|
||||
void InitialiseSystem(HINSTANCE hInstance, int nCmdShow)
|
||||
|
||||
void InitialiseSystem()
|
||||
{
|
||||
BOOL rc;
|
||||
|
||||
HINSTANCE hInstance = 0;
|
||||
int nCmdShow = 1;
|
||||
|
||||
/*
|
||||
Pick up processor type
|
||||
*/
|
||||
|
@ -1764,15 +1765,6 @@ void InitPrintQueue(void)
|
|||
AND ONLY ONCE!!!!
|
||||
*/
|
||||
|
||||
#if debug || PreBeta
|
||||
extern LPDIRECTDRAWSURFACE lpDDDbgFont;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include "advwin32.h"
|
||||
#include "media.hpp"
|
||||
|
||||
void * MediaMedium::GetWriteBuffer(unsigned * pSize, unsigned /*nDesiredSize*/)
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "huffman.hpp"
|
||||
|
||||
|
||||
#include <mbstring.h>
|
||||
|
||||
#ifdef cencon
|
||||
#define new my_new
|
||||
#endif
|
||||
|
@ -644,7 +642,8 @@ void File_Chunk::post_input_processing()
|
|||
child_lists.delete_first_entry();
|
||||
}
|
||||
|
||||
for (LIF<Shape_Chunk *> sli(&shplist); !sli.done(); sli.next())
|
||||
LIF<Shape_Chunk *> sli(&shplist);
|
||||
for (; !sli.done(); sli.next())
|
||||
{
|
||||
Shape_Chunk::max_id = max (Shape_Chunk::max_id,sli()->get_header()->file_id_num);
|
||||
}
|
||||
|
|
|
@ -228,7 +228,8 @@ BOOL Object_Chunk::assoc_with_shape_no(File_Chunk *fc)
|
|||
List<Chunk *> chlst;
|
||||
fc->lookup_child("REBSHAPE",chlst);
|
||||
|
||||
for (LIF<Chunk *> l(&chlst); !l.done(); l.next())
|
||||
LIF<Chunk *> l(&chlst);
|
||||
for (; !l.done(); l.next())
|
||||
{
|
||||
shp = (Shape_Chunk *)l();
|
||||
shphd = shp->get_header();
|
||||
|
@ -1233,6 +1234,8 @@ Object_Track_Chunk2::Object_Track_Chunk2 (Chunk_With_Children * parent,const cha
|
|||
Object_Track_Chunk2::Object_Track_Chunk2 (Chunk_With_Children * parent,const char * data, size_t /*size*/)
|
||||
: Chunk (parent, "OBJTRAK2")
|
||||
{
|
||||
int i;
|
||||
|
||||
num_sections=*(int*)data;
|
||||
data+=4;
|
||||
|
||||
|
@ -1241,7 +1244,7 @@ Object_Track_Chunk2::Object_Track_Chunk2 (Chunk_With_Children * parent,const cha
|
|||
else
|
||||
sections=0;
|
||||
|
||||
for(int i=0;i<num_sections;i++)
|
||||
for(i=0;i<num_sections;i++)
|
||||
{
|
||||
sections[i]=*(ChunkTrackSection*)data;
|
||||
data+=sizeof(ChunkTrackSection);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#if objedit
|
||||
#include "Template.hpp"
|
||||
#include "template.hpp"
|
||||
#endif
|
||||
|
||||
#include "OEChunk.h"
|
||||
#include "Chunk.hpp"
|
||||
#include "oechunk.h"
|
||||
#include "chunk.hpp"
|
||||
|
||||
#ifdef cencon
|
||||
#define new my_new
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef _oechunk_h_
|
||||
#define _oechunk_h_ 1
|
||||
|
||||
#include "Chunk.hpp"
|
||||
#include "chunk.hpp"
|
||||
#include "obchunk.hpp"
|
||||
|
||||
#if objedit
|
||||
#include "Template.hpp"
|
||||
#include "template.hpp"
|
||||
#endif
|
||||
//#if engine
|
||||
//#define VECTOR VECTORCH
|
||||
|
|
606
src/win95/rad.h
606
src/win95/rad.h
|
@ -1,606 +0,0 @@
|
|||
#ifndef __RAD__
|
||||
#define __RAD__
|
||||
|
||||
#define RADCOPYRIGHT "Copyright (C) 1994-98 RAD Game Tools, Inc."
|
||||
|
||||
#ifndef __RADRES__
|
||||
|
||||
// __RADDOS__ means DOS code (16 or 32 bit)
|
||||
// __RAD16__ means 16 bit code (Win16)
|
||||
// __RAD32__ means 32 bit code (DOS, Win386, Win32s, Mac)
|
||||
// __RADWIN__ means Windows code (Win16, Win386, Win32s)
|
||||
// __RADWINEXT__ means Windows 386 extender (Win386)
|
||||
// __RADNT__ means Win32s code
|
||||
// __RADMAC__ means Macintosh
|
||||
// __RAD68K__ means 68K Macintosh
|
||||
// __RADPPC__ means PowerMac
|
||||
|
||||
|
||||
#if (defined(__MWERKS__) && !defined(__INTEL__)) || defined(THINK_C) || defined(powerc) || defined(macintosh) || defined(__powerc)
|
||||
|
||||
#define __RADMAC__
|
||||
#if defined(powerc) || defined(__powerc)
|
||||
#define __RADPPC__
|
||||
#else
|
||||
#define __RAD68K__
|
||||
#endif
|
||||
|
||||
#define __RAD32__
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __DOS__
|
||||
#define __RADDOS__
|
||||
#endif
|
||||
|
||||
#ifdef __386__
|
||||
#define __RAD32__
|
||||
#endif
|
||||
|
||||
#ifdef _Windows //For Borland
|
||||
#ifdef __WIN32__
|
||||
#define WIN32
|
||||
#else
|
||||
#define __WINDOWS__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS //For MS
|
||||
#ifndef _WIN32
|
||||
#define __WINDOWS__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define __RADWIN__
|
||||
#define __RADNT__
|
||||
#define __RAD32__
|
||||
#else
|
||||
#ifdef __NT__
|
||||
#define __RADWIN__
|
||||
#define __RADNT__
|
||||
#define __RAD32__
|
||||
#else
|
||||
#ifdef __WINDOWS_386__
|
||||
#define __RADWIN__
|
||||
#define __RADWINEXT__
|
||||
#define __RAD32__
|
||||
#else
|
||||
#ifdef __WINDOWS__
|
||||
#define __RADWIN__
|
||||
#define __RAD16__
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#define __RADWIN__
|
||||
#define __RADNT__
|
||||
#define __RAD32__
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (!defined(__RADDOS__) && !defined(__RADWIN__) && !defined(__RADMAC__))
|
||||
#error RAD.H did not detect your platform. Define __DOS__, __WINDOWS__, WIN32, macintosh, or powerc.
|
||||
#endif
|
||||
|
||||
#ifdef __RADMAC__
|
||||
|
||||
// this define is for CodeWarrior 11's stupid new libs (even though
|
||||
// we don't use longlong's).
|
||||
|
||||
#define __MSL_LONGLONG_SUPPORT__
|
||||
|
||||
#define RADLINK
|
||||
#define RADEXPLINK
|
||||
|
||||
#ifdef __CFM68K__
|
||||
#ifdef __RADINDLL__
|
||||
#define RADEXPFUNC RADDEFFUNC __declspec(export)
|
||||
#else
|
||||
#define RADEXPFUNC RADDEFFUNC __declspec(import)
|
||||
#endif
|
||||
#else
|
||||
#define RADEXPFUNC RADDEFFUNC
|
||||
#endif
|
||||
#define RADASMLINK
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __RADNT__
|
||||
#ifndef _WIN32
|
||||
#define _WIN32
|
||||
#endif
|
||||
#ifndef WIN32
|
||||
#define WIN32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __RADWIN__
|
||||
#ifdef __RAD32__
|
||||
#ifdef __RADNT__
|
||||
|
||||
#define RADLINK __stdcall
|
||||
#define RADEXPLINK __stdcall
|
||||
|
||||
#ifdef __RADINEXE__
|
||||
#define RADEXPFUNC RADDEFFUNC
|
||||
#else
|
||||
#ifndef __RADINDLL__
|
||||
#define RADEXPFUNC RADDEFFUNC __declspec(dllimport)
|
||||
#ifdef __BORLANDC__
|
||||
#if __BORLANDC__<=0x460
|
||||
#undef RADEXPFUNC
|
||||
#define RADEXPFUNC RADDEFFUNC
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define RADEXPFUNC RADDEFFUNC __declspec(dllexport)
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define RADLINK __pascal
|
||||
#define RADEXPLINK __far __pascal
|
||||
#define RADEXPFUNC RADDEFFUNC
|
||||
#endif
|
||||
#else
|
||||
#define RADLINK __pascal
|
||||
#define RADEXPLINK __far __pascal __export
|
||||
#define RADEXPFUNC RADDEFFUNC
|
||||
#endif
|
||||
#else
|
||||
#define RADLINK __pascal
|
||||
#define RADEXPLINK __pascal
|
||||
#define RADEXPFUNC RADDEFFUNC
|
||||
#endif
|
||||
|
||||
#define RADASMLINK __cdecl
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __RADWIN__
|
||||
#ifndef _WINDOWS
|
||||
#define _WINDOWS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define RADDEFFUNC extern "C"
|
||||
#define RADDEFSTART extern "C" {
|
||||
#define RADDEFEND }
|
||||
#else
|
||||
#define RADDEFFUNC
|
||||
#define RADDEFSTART
|
||||
#define RADDEFEND
|
||||
#endif
|
||||
|
||||
|
||||
RADDEFSTART
|
||||
|
||||
#define s8 signed char
|
||||
#define u8 unsigned char
|
||||
#define u32 unsigned long
|
||||
#define s32 signed long
|
||||
|
||||
#ifdef __RAD32__
|
||||
#define PTR4
|
||||
|
||||
#define u16 unsigned short
|
||||
#define s16 signed short
|
||||
|
||||
#ifdef __RADMAC__
|
||||
|
||||
#include <string.h>
|
||||
#include <memory.h>
|
||||
#include <OSUtils.h>
|
||||
|
||||
#define radstrlen strlen
|
||||
|
||||
#define radmemset memset
|
||||
|
||||
#define radmemcmp memcmp
|
||||
|
||||
#define radmemcpy(dest,source,size) BlockMoveData((Ptr)(source),(Ptr)(dest),size)
|
||||
|
||||
#define radmemcpydb(dest,source,size) BlockMoveData((Ptr)(source),(Ptr)(dest),size)
|
||||
|
||||
#define radstrcat strcat
|
||||
|
||||
#define radstrcpy strcpy
|
||||
|
||||
static u32 inline radsqr(s32 a) { return(a*a); }
|
||||
|
||||
#ifdef __RAD68K__
|
||||
|
||||
#pragma parameter __D0 mult64anddiv(__D0,__D1,__D2)
|
||||
u32 mult64anddiv(u32 m1,u32 m2,u32 d) ={0x4C01,0x0C01,0x4C42,0x0C01};
|
||||
// muls.l d1,d1:d0 divs.l d2,d1:d0
|
||||
|
||||
#pragma parameter radconv32a(__A0,__D0)
|
||||
void radconv32a(void* p,u32 n) ={0x4A80,0x600C,0x2210,0xE059,0x4841,0xE059,0x20C1,0x5380,0x6EF2};
|
||||
// tst.l d0 bra.s @loope @loop: move.l (a0),d1 ror.w #8,d1 swap d1 ror.w #8,d1 move.l d1,(a0)+ sub.l #1,d0 bgt.s @loop @loope:
|
||||
|
||||
#else
|
||||
|
||||
u32 mult64anddiv(u32 m1,u32 m2,u32 d);
|
||||
|
||||
void radconv32a(void* p,u32 n);
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
|
||||
u32 radsqr(s32 a);
|
||||
#pragma aux radsqr = "mul eax" parm [eax] modify [EDX eax];
|
||||
|
||||
u32 mult64anddiv(u32 m1,u32 m2,u32 d);
|
||||
#pragma aux mult64anddiv = "mul ecx" "div ebx" parm [eax] [ecx] [ebx] modify [EDX eax];
|
||||
|
||||
s32 radabs(s32 ab);
|
||||
#pragma aux radabs = "test eax,eax" "jge skip" "neg eax" "skip:" parm [eax];
|
||||
|
||||
#define radabs32 radabs
|
||||
|
||||
u32 DOSOut(const char* str);
|
||||
#pragma aux DOSOut = "cld" "mov ecx,0xffffffff" "xor eax,eax" "mov edx,edi" "repne scasb" "not ecx" "dec ecx" "mov ebx,1" "mov ah,0x40" "int 0x21" parm [EDI] modify [EAX EBX ECX EDX EDI] value [ecx];
|
||||
|
||||
void DOSOutNum(const char* str,u32 len);
|
||||
#pragma aux DOSOutNum = "mov ah,0x40" "mov ebx,1" "int 0x21" parm [edx] [ecx] modify [eax ebx];
|
||||
|
||||
u32 ErrOut(const char* str);
|
||||
#pragma aux ErrOut = "cld" "mov ecx,0xffffffff" "xor eax,eax" "mov edx,edi" "repne scasb" "not ecx" "dec ecx" "xor ebx,ebx" "mov ah,0x40" "int 0x21" parm [EDI] modify [EAX EBX ECX EDX EDI] value [ecx];
|
||||
|
||||
void ErrOutNum(const char* str,u32 len);
|
||||
#pragma aux ErrOutNum = "mov ah,0x40" "xor ebx,ebx" "int 0x21" parm [edx] [ecx] modify [eax ebx];
|
||||
|
||||
void radmemset16(void* dest,u16 value,u32 size);
|
||||
#pragma aux radmemset16 = "cld" "mov bx,ax" "shl eax,16" "mov ax,bx" "mov bl,cl" "shr ecx,1" "rep stosd" "mov cl,bl" "and cl,1" "rep stosw" parm [EDI] [EAX] [ECX] modify [EAX EDX EBX ECX EDI];
|
||||
|
||||
void radmemset(void* dest,u8 value,u32 size);
|
||||
#pragma aux radmemset = "cld" "mov ah,al" "mov bx,ax" "shl eax,16" "mov ax,bx" "mov bl,cl" "shr ecx,2" "and bl,3" "rep stosd" "mov cl,bl" "rep stosb" parm [EDI] [AL] [ECX] modify [EAX EDX EBX ECX EDI];
|
||||
|
||||
void radmemset32(void* dest,u32 value,u32 size);
|
||||
#pragma aux radmemset32 = "cld" "rep stosd" parm [EDI] [EAX] [ECX] modify [EAX EDX EBX ECX EDI];
|
||||
|
||||
void radmemcpy(void* dest,const void* source,u32 size);
|
||||
#pragma aux radmemcpy = "cld" "mov bl,cl" "shr ecx,2" "rep movsd" "mov cl,bl" "and cl,3" "rep movsb" parm [EDI] [ESI] [ECX] modify [EBX ECX EDI ESI];
|
||||
|
||||
void __far *radfmemcpy(void __far* dest,const void __far* source,u32 size);
|
||||
#pragma aux radfmemcpy = "cld" "push es" "push ds" "mov es,cx" "mov ds,dx" "mov ecx,eax" "shr ecx,2" "rep movsd" "mov cl,al" "and cl,3" "rep movsb" "pop ds" "pop es" parm [CX EDI] [DX ESI] [EAX] modify [ECX EDI ESI] value [CX EDI];
|
||||
|
||||
void radmemcpydb(void* dest,const void* source,u32 size); //Destination bigger
|
||||
#pragma aux radmemcpydb = "std" "mov bl,cl" "lea esi,[esi+ecx-4]" "lea edi,[edi+ecx-4]" "shr ecx,2" "rep movsd" "and bl,3" "jz dne" "add esi,3" "add edi,3" "mov cl,bl" "rep movsb" "dne:" "cld" parm [EDI] [ESI] [ECX] modify [EBX ECX EDI ESI];
|
||||
|
||||
char* radstrcpy(void* dest,const void* source);
|
||||
#pragma aux radstrcpy = "cld" "mov edx,edi" "lp:" "mov al,[esi]" "inc esi" "mov [edi],al" "inc edi" "cmp al,0" "jne lp" parm [EDI] [ESI] modify [EAX EDX EDI ESI] value [EDX];
|
||||
|
||||
char __far* radfstrcpy(void __far* dest,const void __far* source);
|
||||
#pragma aux radfstrcpy = "cld" "push es" "push ds" "mov es,cx" "mov ds,dx" "mov edx,edi" "lp:" "lodsb" "stosb" "test al,0xff" "jnz lp" "pop ds" "pop es" parm [CX EDI] [DX ESI] modify [EAX EDX EDI ESI] value [CX EDX];
|
||||
|
||||
char* radstpcpy(void* dest,const void* source);
|
||||
#pragma aux radstpcpy = "cld" "lp:" "mov al,[esi]" "inc esi" "mov [edi],al" "inc edi" "cmp al,0" "jne lp" "dec edi" parm [EDI] [ESI] modify [EAX EDI ESI] value [EDI];
|
||||
|
||||
char* radstpcpyrs(void* dest,const void* source);
|
||||
#pragma aux radstpcpyrs = "cld" "lp:" "mov al,[esi]" "inc esi" "mov [edi],al" "inc edi" "cmp al,0" "jne lp" "dec esi" parm [EDI] [ESI] modify [EAX EDI ESI] value [ESI];
|
||||
|
||||
u32 radstrlen(const void* dest);
|
||||
#pragma aux radstrlen = "cld" "mov ecx,0xffffffff" "xor eax,eax" "repne scasb" "not ecx" "dec ecx" parm [EDI] modify [EAX ECX EDI] value [ECX];
|
||||
|
||||
char* radstrcat(void* dest,const void* source);
|
||||
#pragma aux radstrcat = "cld" "mov ecx,0xffffffff" "mov edx,edi" "xor eax,eax" "repne scasb" "dec edi" "lp:" "lodsb" "stosb" "test al,0xff" "jnz lp" \
|
||||
parm [EDI] [ESI] modify [EAX ECX EDI ESI] value [EDX];
|
||||
|
||||
char* radstrchr(const void* dest,char chr);
|
||||
#pragma aux radstrchr = "cld" "lp:" "lodsb" "cmp al,dl" "je fnd" "cmp al,0" "jnz lp" "mov esi,1" "fnd:" "dec esi" parm [ESI] [DL] modify [EAX ESI] value [esi];
|
||||
|
||||
s8 radmemcmp(const void* s1,const void* s2,u32 len);
|
||||
#pragma aux radmemcmp = "cld" "rep cmpsb" "setne al" "jbe end" "neg al" "end:" parm [EDI] [ESI] [ECX] modify [ECX EDI ESI];
|
||||
|
||||
s8 radstrcmp(const void* s1,const void* s2);
|
||||
#pragma aux radstrcmp = "lp:" "mov al,[esi]" "mov ah,[edi]" "cmp al,ah" "jne set" "cmp al,0" "je set" "inc esi" "inc edi" "jmp lp" "set:" "setne al" "jbe end" "neg al" "end:" \
|
||||
parm [EDI] [ESI] modify [EAX EDI ESI];
|
||||
|
||||
s8 radstricmp(const void* s1,const void* s2);
|
||||
#pragma aux radstricmp = "lp:" "mov al,[esi]" "mov ah,[edi]" "cmp al,'a'" "jb c1" "cmp al,'z'" "ja c1" "sub al,32" "c1:" "cmp ah,'a'" "jb c2" "cmp ah,'z'" "ja c2" "sub ah,32" "c2:" "cmp al,ah" "jne set" "cmp al,0" "je set" \
|
||||
"inc esi" "inc edi" "jmp lp" "set:" "setne al" "jbe end" "neg al" "end:" \
|
||||
parm [EDI] [ESI] modify [EAX EDI ESI];
|
||||
|
||||
s8 radstrnicmp(const void* s1,const void* s2,u32 len);
|
||||
#pragma aux radstrnicmp = "lp:" "mov al,[esi]" "mov ah,[edi]" "cmp al,'a'" "jb c1" "cmp al,'z'" "ja c1" "sub al,32" "c1:" "cmp ah,'a'" "jb c2" "cmp ah,'z'" "ja c2" "sub ah,32" "c2:" "cmp al,ah" "jne set" "cmp al,0" "je set" \
|
||||
"dec ecx" "jz set" "inc esi" "inc edi" "jmp lp" "set:" "setne al" "jbe end" "neg al" "end:" \
|
||||
parm [EDI] [ESI] [ECX] modify [EAX ECX EDI ESI];
|
||||
|
||||
char* radstrupr(void* s1);
|
||||
#pragma aux radstrupr = "mov ecx,edi" "lp:" "mov al,[edi]" "cmp al,'a'" "jb c1" "cmp al,'z'" "ja c1" "sub [edi],32" "c1:" "inc edi" "cmp al,0" "jne lp" parm [EDI] modify [EAX EDI] value [ecx];
|
||||
|
||||
char* radstrlwr(void* s1);
|
||||
#pragma aux radstrlwr = "mov ecx,edi" "lp:" "mov al,[edi]" "cmp al,'A'" "jb c1" "cmp al,'Z'" "ja c1" "add [edi],32" "c1:" "inc edi" "cmp al,0" "jne lp" parm [EDI] modify [EAX EDI] value [ecx];
|
||||
|
||||
u32 radstru32(const void* dest);
|
||||
#pragma aux radstru32 = "cld" "xor ecx,ecx" "xor ebx,ebx" "xor edi,edi" "lodsb" "cmp al,45" "jne skip2" "mov edi,1" "jmp skip" "lp:" "mov eax,10" "mul ecx" "lea ecx,[eax+ebx]" \
|
||||
"skip:" "lodsb" "skip2:" "cmp al,0x39" "ja dne" "cmp al,0x30" "jb dne" "mov bl,al" "sub bl,0x30" "jmp lp" "dne:" "test edi,1" "jz pos" "neg ecx" "pos:" \
|
||||
parm [ESI] modify [EAX EBX EDX EDI ESI] value [ecx];
|
||||
|
||||
u16 GetDS();
|
||||
#pragma aux GetDS = "mov ax,ds" value [ax];
|
||||
|
||||
#ifdef __RADWINEXT__
|
||||
|
||||
#define _16To32(ptr16) ((void*)(((GetSelectorBase((u16)(((u32)(ptr16))>>16))+((u16)(u32)(ptr16)))-GetSelectorBase(GetDS()))))
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __RADWIN__
|
||||
#define int86 int386
|
||||
#define int86x int386x
|
||||
#endif
|
||||
|
||||
#define u32regs x
|
||||
#define u16regs w
|
||||
|
||||
#else
|
||||
|
||||
#define radstrcpy strcpy
|
||||
#define radstrcat strcat
|
||||
#define radmemcpy memcpy
|
||||
#define radmemcpydb memmove
|
||||
#define radmemcmp memcmp
|
||||
#define radmemset memset
|
||||
#define radstrlen strlen
|
||||
#define radstrchr strchr
|
||||
#define radtoupper toupper
|
||||
#define radstru32(s) ((u32)atol(s))
|
||||
#define radstricmp _stricmp
|
||||
#define radstrcmp strcmp
|
||||
#define radstrupr _strupr
|
||||
#define radstrlwr _strlwr
|
||||
#define BreakPoint() _asm {int 3}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#pragma warning( disable : 4035)
|
||||
|
||||
typedef char* RADPCHAR;
|
||||
|
||||
u32 __inline radsqr(u32 m) {
|
||||
_asm {
|
||||
mov eax,[m]
|
||||
mul eax
|
||||
}
|
||||
}
|
||||
|
||||
u32 __inline mult64anddiv(u32 m1,u32 m2, u32 d) {
|
||||
_asm {
|
||||
mov eax,[m1]
|
||||
mov ecx,[m2]
|
||||
mul ecx
|
||||
mov ecx,[d]
|
||||
div ecx
|
||||
}
|
||||
}
|
||||
|
||||
s32 __inline radabs(s32 ab) {
|
||||
_asm {
|
||||
mov eax,[ab]
|
||||
test eax,eax
|
||||
jge skip
|
||||
neg eax
|
||||
skip:
|
||||
}
|
||||
}
|
||||
|
||||
u8 __inline radinp(u16 p) {
|
||||
_asm {
|
||||
mov dx,[p]
|
||||
in al,dx
|
||||
}
|
||||
}
|
||||
|
||||
void __inline radoutp(u16 p,u8 v) {
|
||||
_asm {
|
||||
mov dx,[p]
|
||||
mov al,[v]
|
||||
out dx,al
|
||||
}
|
||||
}
|
||||
|
||||
RADPCHAR __inline radstpcpy(char* p1, char* p2) {
|
||||
_asm {
|
||||
mov edx,[p1]
|
||||
mov ecx,[p2]
|
||||
cld
|
||||
lp:
|
||||
mov al,[ecx]
|
||||
inc ecx
|
||||
mov [edx],al
|
||||
inc edx
|
||||
cmp al,0
|
||||
jne lp
|
||||
dec edx
|
||||
mov eax,edx
|
||||
}
|
||||
}
|
||||
|
||||
RADPCHAR __inline radstpcpyrs(char* p1, char* p2) {
|
||||
_asm {
|
||||
mov edx,[p1]
|
||||
mov ecx,[p2]
|
||||
cld
|
||||
lp:
|
||||
mov al,[ecx]
|
||||
inc ecx
|
||||
mov [edx],al
|
||||
inc edx
|
||||
cmp al,0
|
||||
jne lp
|
||||
dec ecx
|
||||
mov eax,ecx
|
||||
}
|
||||
}
|
||||
|
||||
void __inline radmemset16(void* dest,u16 value,u32 sizeb) {
|
||||
_asm {
|
||||
mov edi,[dest]
|
||||
mov ax,[value]
|
||||
mov ecx,[sizeb]
|
||||
shl eax,16
|
||||
cld
|
||||
mov ax,[value]
|
||||
mov bl,cl
|
||||
shr ecx,1
|
||||
rep stosd
|
||||
mov cl,bl
|
||||
and cl,1
|
||||
rep stosw
|
||||
}
|
||||
}
|
||||
|
||||
void __inline radmemset32(void* dest,u32 value,u32 sizeb) {
|
||||
_asm {
|
||||
mov edi,[dest]
|
||||
mov eax,[value]
|
||||
mov ecx,[sizeb]
|
||||
cld
|
||||
rep stosd
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning( default : 4035)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define PTR4 __far
|
||||
|
||||
#define u16 unsigned int
|
||||
#define s16 signed int
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
|
||||
u32 radsqr(s32 a);
|
||||
#pragma aux radsqr = "shl edx,16" "mov dx,ax" "mov eax,edx" "xor edx,edx" "mul eax" "shld edx,eax,16" parm [dx ax] modify [DX ax] value [dx ax];
|
||||
|
||||
s16 radabs(s16 ab);
|
||||
#pragma aux radabs = "test ax,ax" "jge skip" "neg ax" "skip:" parm [ax] value [ax];
|
||||
|
||||
s32 radabs32(s32 ab);
|
||||
#pragma aux radabs32 = "test dx,dx" "jge skip" "neg dx" "neg ax" "sbb dx,0" "skip:" parm [dx ax] value [dx ax];
|
||||
|
||||
u32 DOSOut(const char far* dest);
|
||||
#pragma aux DOSOut = "cld" "and edi,0xffff" "mov dx,di" "mov ecx,0xffffffff" "xor eax,eax" 0x67 "repne scasb" "not ecx" "dec ecx" "mov bx,1" "push ds" "push es" "pop ds" "mov ah,0x40" "int 0x21" "pop ds" "movzx eax,cx" "shr ecx,16" \
|
||||
parm [ES DI] modify [AX BX CX DX DI ES] value [CX AX];
|
||||
|
||||
void DOSOutNum(const char far* str,u16 len);
|
||||
#pragma aux DOSOutNum = "push ds" "mov ds,cx" "mov cx,bx" "mov ah,0x40" "mov bx,1" "int 0x21" "pop ds" parm [cx dx] [bx] modify [ax bx cx];
|
||||
|
||||
u32 ErrOut(const char far* dest);
|
||||
#pragma aux ErrOut = "cld" "and edi,0xffff" "mov dx,di" "mov ecx,0xffffffff" "xor eax,eax" 0x67 "repne scasb" "not ecx" "dec ecx" "xor bx,bx" "push ds" "push es" "pop ds" "mov ah,0x40" "int 0x21" "pop ds" "movzx eax,cx" "shr ecx,16" \
|
||||
parm [ES DI] modify [AX BX CX DX DI ES] value [CX AX];
|
||||
|
||||
void ErrOutNum(const char far* str,u16 len);
|
||||
#pragma aux ErrOutNum = "push ds" "mov ds,cx" "mov cx,bx" "mov ah,0x40" "xor bx,bx" "int 0x21" "pop ds" parm [cx dx] [bx] modify [ax bx cx];
|
||||
|
||||
void radmemset(void far *dest,u8 value,u32 size);
|
||||
#pragma aux radmemset = "cld" "and edi,0ffffh" "shl ecx,16" "mov cx,bx" "mov ah,al" "mov bx,ax" "shl eax,16" "mov ax,bx" "mov bl,cl" "shr ecx,2" 0x67 "rep stosd" "mov cl,bl" "and cl,3" "rep stosb" parm [ES DI] [AL] [CX BX];
|
||||
|
||||
void radmemset16(void far* dest,u16 value,u32 size);
|
||||
#pragma aux radmemset16 = "cld" "and edi,0ffffh" "shl ecx,16" "mov cx,bx" "mov bx,ax" "shl eax,16" "mov ax,bx" "mov bl,cl" "shr ecx,1" "rep stosd" "mov cl,bl" "and cl,1" "rep stosw" parm [ES DI] [AX] [CX BX];
|
||||
|
||||
void radmemcpy(void far* dest,const void far* source,u32 size);
|
||||
#pragma aux radmemcpy = "cld" "push ds" "mov ds,dx" "and esi,0ffffh" "and edi,0ffffh" "shl ecx,16" "mov cx,bx" "shr ecx,2" 0x67 "rep movsd" "mov cl,bl" "and cl,3" "rep movsb" "pop ds" parm [ES DI] [DX SI] [CX BX] modify [CX SI DI ES];
|
||||
|
||||
s8 radmemcmp(const void far* s1,const void far* s2,u32 len);
|
||||
#pragma aux radmemcmp = "cld" "push ds" "mov ds,dx" "shl ecx,16" "mov cx,bx" "rep cmpsb" "setne al" "jbe end" "neg al" "end:" "pop ds" parm [ES DI] [DX SI] [CX BX] modify [CX SI DI ES];
|
||||
|
||||
char far* radstrcpy(void far* dest,const void far* source);
|
||||
#pragma aux radstrcpy = "cld" "push ds" "mov ds,dx" "and esi,0xffff" "and edi,0xffff" "mov dx,di" "lp:" "lodsb" "stosb" "test al,0xff" "jnz lp" "pop ds" parm [ES DI] [DX SI] modify [AX DX DI SI ES] value [es dx];
|
||||
|
||||
char far* radstpcpy(void far* dest,const void far* source);
|
||||
#pragma aux radstpcpy = "cld" "push ds" "mov ds,dx" "and esi,0xffff" "and edi,0xffff" "lp:" "lodsb" "stosb" "test al,0xff" "jnz lp" "dec di" "pop ds" parm [ES DI] [DX SI] modify [DI SI ES] value [es di];
|
||||
|
||||
u32 radstrlen(const void far* dest);
|
||||
#pragma aux radstrlen = "cld" "and edi,0xffff" "mov ecx,0xffffffff" "xor eax,eax" 0x67 "repne scasb" "not ecx" "dec ecx" "movzx eax,cx" "shr ecx,16" parm [ES DI] modify [AX CX DI ES] value [CX AX];
|
||||
|
||||
char far* radstrcat(void far* dest,const void far* source);
|
||||
#pragma aux radstrcat = "cld" "and edi,0xffff" "mov ecx,0xffffffff" "and esi,0xffff" "push ds" "mov ds,dx" "mov dx,di" "xor eax,eax" 0x67 "repne scasb" "dec edi" "lp:" "lodsb" "stosb" "test al,0xff" "jnz lp" "pop ds" \
|
||||
parm [ES DI] [DX SI] modify [AX CX DI SI ES] value [es dx];
|
||||
|
||||
char far* radstrchr(const void far* dest,char chr);
|
||||
#pragma aux radstrchr = "cld" "lp:" 0x26 "lodsb" "cmp al,dl" "je fnd" "cmp al,0" "jnz lp" "xor ax,ax" "mov es,ax" "mov si,1" "fnd:" "dec si" parm [ES SI] [DL] modify [AX SI ES] value [es si];
|
||||
|
||||
s8 radstricmp(const void far* s1,const void far* s2);
|
||||
#pragma aux radstricmp = "and edi,0xffff" "push ds" "mov ds,dx" "and esi,0xffff" "lp:" "mov al,[esi]" "mov ah,[edi]" "cmp al,'a'" "jb c1" "cmp al,'z'" "ja c1" "sub al,32" "c1:" \
|
||||
"cmp ah,'a'" "jb c2" "cmp ah,'z'" "ja c2" "sub ah,32" "c2:" "cmp al,ah" "jne set" "cmp al,0" "je set" \
|
||||
"inc esi" "inc edi" "jmp lp" "set:" "setne al" "jbe end" "neg al" "end:" "pop ds" \
|
||||
parm [ES DI] [DX SI] modify [AX DI SI];
|
||||
|
||||
u32 radstru32(const void far* dest);
|
||||
#pragma aux radstru32 = "cld" "xor ecx,ecx" "xor ebx,ebx" "xor edi,edi" 0x26 "lodsb" "cmp al,45" "jne skip2" "mov edi,1" "jmp skip" "lp:" "mov eax,10" "mul ecx" "lea ecx,[eax+ebx]" \
|
||||
"skip:" 0x26 "lodsb" "skip2:" "cmp al,0x39" "ja dne" "cmp al,0x30" "jb dne" "mov bl,al" "sub bl,0x30" "jmp lp" "dne:" "test edi,1" "jz pos" "neg ecx" "pos:" \
|
||||
"movzx eax,cx" "shr ecx,16" parm [ES SI] modify [AX BX DX DI SI] value [cx ax];
|
||||
|
||||
u32 mult64anddiv(u32 m1,u32 m2,u32 d);
|
||||
#pragma aux mult64anddiv = "shl ecx,16" "mov cx,ax" "shrd eax,edx,16" "mov ax,si" "mul ecx" "shl edi,16" "mov di,bx" "div edi" "shld edx,eax,16" "and edx,0xffff" "and eax,0xffff" parm [cx ax] [dx si] [di bx] \
|
||||
modify [ax bx cx dx si di] value [dx ax];
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
RADDEFEND
|
||||
|
||||
#define u32neg1 ((u32)(s32)-1)
|
||||
#define RAD_align(var) var; u8 junk##var[4-(sizeof(var)&3)];
|
||||
#define RAD_align_after(var) u8 junk##var[4-(sizeof(var)&3)]={0};
|
||||
#define RAD_align_init(var,val) var=val; u8 junk##var[4-(sizeof(var)&3)]={0};
|
||||
#define RAD_align_array(var,num) var[num]; u8 junk##var[4-(sizeof(var)&3)];
|
||||
#define RAD_align_string(var,str) char var[]=str; u8 junk##var[4-(sizeof(var)&3)]={0};
|
||||
|
||||
RADEXPFUNC void PTR4* RADEXPLINK radmalloc(u32 numbytes);
|
||||
RADEXPFUNC void RADEXPLINK radfree(void PTR4* ptr);
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
|
||||
char bkbhit();
|
||||
#pragma aux bkbhit = "mov ah,1" "int 0x16" "lahf" "shr eax,14" "and eax,1" "xor al,1" ;
|
||||
|
||||
char bgetch();
|
||||
#pragma aux bgetch = "xor ah,ah" "int 0x16" "test al,0xff" "jnz done" "mov al,ah" "or al,0x80" "done:" modify [AX];
|
||||
|
||||
void BreakPoint();
|
||||
#pragma aux BreakPoint = "int 3";
|
||||
|
||||
u8 radinp(u16 p);
|
||||
#pragma aux radinp = "in al,dx" parm [DX];
|
||||
|
||||
u8 radtoupper(u8 p);
|
||||
#pragma aux radtoupper = "cmp al,'a'" "jb c1" "cmp al,'z'" "ja c1" "sub al,32" "c1:" parm [al] value [al];
|
||||
|
||||
void radoutp(u16 p,u8 v);
|
||||
#pragma aux radoutp = "out dx,al" parm [DX] [AL];
|
||||
|
||||
#endif
|
||||
|
||||
// for multi-processor machines
|
||||
|
||||
#ifdef __RADNT__
|
||||
#define LockedIncrement(var) _asm { lock inc [var] }
|
||||
#define LockedDecrement(var) _asm { lock dec [var] }
|
||||
#else
|
||||
#define LockedIncrement(var) _asm { inc [var] }
|
||||
#define LockedDecrement(var) _asm { dec [var] }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -423,7 +423,9 @@ BOOL Shape_Chunk::assoc_with_object_list(File_Chunk *fc)
|
|||
|
||||
for (LIF<char *> n(&(hdptr->object_names_store)); !n.done(); n.next())
|
||||
{
|
||||
for (LIF<Chunk *> l(&chlst); !l.done(); l.next())
|
||||
LIF<Chunk *> l(&chlst);
|
||||
|
||||
for (; !l.done(); l.next())
|
||||
{
|
||||
ob = (Object_Chunk *)l();
|
||||
if ( !strcmp(ob->object_data.o_name, n()) )
|
||||
|
@ -955,6 +957,8 @@ BOOL Shape_Polygon_Chunk::output_chunk (HANDLE &hand)
|
|||
|
||||
void Shape_Polygon_Chunk::fill_data_block(char * data_start)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
strncpy (data_start, identifier, 8);
|
||||
|
||||
data_start += 8;
|
||||
|
@ -963,12 +967,12 @@ void Shape_Polygon_Chunk::fill_data_block(char * data_start)
|
|||
|
||||
data_start += 4;
|
||||
|
||||
for (int i=0;i<num_polys;i++) {
|
||||
for (i=0;i<num_polys;i++) {
|
||||
*((int *) (data_start + i*36)) = poly_data[i].engine_type;
|
||||
*((int *) (data_start + i*36 + 4)) = poly_data[i].normal_index;
|
||||
*((int *) (data_start + i*36 + 8)) = poly_data[i].flags;
|
||||
*((int *) (data_start + i*36 + 12)) = poly_data[i].colour;
|
||||
for (int j = 0; j<poly_data[i].num_verts; j++)
|
||||
for (j = 0; j<poly_data[i].num_verts; j++)
|
||||
*((int *) (data_start + i*36 + 16 + j*4)) = poly_data[i].vert_ind[j];
|
||||
for (; j<5; j++)
|
||||
*((int *) (data_start + i*36 + 16 + j*4)) = -1;
|
||||
|
@ -1129,7 +1133,7 @@ uv_data (NULL), num_uvs (*((int *) uvdata))
|
|||
|
||||
}
|
||||
|
||||
Shape_UV_Coord_Chunk::output_chunk (HANDLE &hand)
|
||||
BOOL Shape_UV_Coord_Chunk::output_chunk (HANDLE &hand)
|
||||
{
|
||||
unsigned long junk;
|
||||
BOOL ok;
|
||||
|
@ -1237,7 +1241,7 @@ tex_fns (), num_tex_fns (*((int *) tfndata))
|
|||
|
||||
}
|
||||
|
||||
Shape_Texture_Filenames_Chunk::output_chunk (HANDLE &hand)
|
||||
BOOL Shape_Texture_Filenames_Chunk::output_chunk (HANDLE &hand)
|
||||
{
|
||||
unsigned long junk;
|
||||
BOOL ok;
|
||||
|
@ -1251,8 +1255,7 @@ Shape_Texture_Filenames_Chunk::output_chunk (HANDLE &hand)
|
|||
|
||||
if (!ok) return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2288,7 +2291,9 @@ void Shape_Morphing_Data_Chunk::prepare_for_output()
|
|||
List<Chunk *> cl;
|
||||
lookup_child("SUBSHAPE",cl);
|
||||
|
||||
for (LIF<Chunk *> cli(&cl); !cli.done(); cli.next())
|
||||
LIF<Chunk *> cli(&cl);
|
||||
|
||||
for (; !cli.done(); cli.next())
|
||||
{
|
||||
max_id = max (max_id, ((Shape_Sub_Shape_Chunk *)cli())->get_header()->file_id_num);
|
||||
}
|
||||
|
|
|
@ -266,7 +266,7 @@ Sprite_Header_Chunk::Sprite_Header_Chunk(const char * file_name, Chunk_With_Chil
|
|||
}
|
||||
|
||||
|
||||
Sprite_Header_Chunk::write_file(const char* fname)
|
||||
int Sprite_Header_Chunk::write_file(const char* fname)
|
||||
{
|
||||
HANDLE rif_file;
|
||||
|
||||
|
@ -287,7 +287,7 @@ Sprite_Header_Chunk::write_file(const char* fname)
|
|||
return 0;
|
||||
}
|
||||
|
||||
Sprite_Header_Chunk::output_chunk(HANDLE & hand)
|
||||
BOOL Sprite_Header_Chunk::output_chunk(HANDLE & hand)
|
||||
{
|
||||
unsigned long junk;
|
||||
BOOL ok;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef _sprchunk_hpp
|
||||
#define _sprchunk_hpp
|
||||
#include "chunk.hpp"
|
||||
#include "Chnktype.hpp"
|
||||
//#include "stdafx.h"
|
||||
#include "chnktype.hpp"
|
||||
|
||||
struct Frame
|
||||
{
|
||||
int Texture;
|
||||
|
@ -24,7 +24,7 @@ public:
|
|||
Sprite_Header_Chunk(Chunk_With_Children* parent)
|
||||
: Chunk_With_Children(parent,"SPRIHEAD"){}
|
||||
|
||||
write_file(const char* fname);
|
||||
int write_file(const char* fname);
|
||||
virtual BOOL output_chunk(HANDLE &hand);
|
||||
#if cencon
|
||||
virtual void post_input_processing();
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
#include "3dc.h"
|
||||
|
||||
#include <conio.h>
|
||||
#include <sys\stat.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "inline.h"
|
||||
|
||||
|
@ -19,7 +18,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <sys\stat.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "system.h"
|
||||
#include "equates.h"
|
||||
|
|
|
@ -116,6 +116,8 @@ Module_Waypoint_Chunk::Module_Waypoint_Chunk(Chunk_With_Children* parent,const c
|
|||
int first_ground_waypoint=-1;
|
||||
for(int i=0;i<NumWaypoints;i++)
|
||||
{
|
||||
int j;
|
||||
|
||||
ChunkWaypoint* cw=&Waypoints[i];
|
||||
cw->index=i;
|
||||
|
||||
|
@ -139,7 +141,7 @@ Module_Waypoint_Chunk::Module_Waypoint_Chunk(Chunk_With_Children* parent,const c
|
|||
else
|
||||
cw->WayLinks=0;
|
||||
|
||||
for(int j=0;j<cw->NumWPLinks;j++)
|
||||
for(j=0;j<cw->NumWPLinks;j++)
|
||||
{
|
||||
cw->WayLinks[j]=*(WaypointLink*)data;
|
||||
data+=sizeof(WaypointLink);
|
||||
|
@ -244,6 +246,8 @@ void Module_Waypoint_Chunk::fill_data_block(char* data_start)
|
|||
|
||||
for(int i=0;i<NumWaypoints;i++)
|
||||
{
|
||||
int j;
|
||||
|
||||
ChunkWaypoint* cw=&Waypoints[i];
|
||||
|
||||
*(ChunkVectorInt*)data_start=cw->min;
|
||||
|
@ -270,7 +274,7 @@ void Module_Waypoint_Chunk::fill_data_block(char* data_start)
|
|||
*(int*)data_start=cw->NumWPLinks;
|
||||
data_start+=4;
|
||||
|
||||
for(int j=0;j<cw->NumWPLinks;j++)
|
||||
for(j=0;j<cw->NumWPLinks;j++)
|
||||
{
|
||||
*(WaypointLink*)data_start=cw->WayLinks[j];
|
||||
data_start+=sizeof(WaypointLink);
|
||||
|
@ -299,9 +303,11 @@ void Module_Waypoint_Chunk::TransferWaypointData(Module_Waypoint_Chunk* mwc_from
|
|||
|
||||
if(mwc_from->NumWaypoints)
|
||||
{
|
||||
int i;
|
||||
|
||||
ChunkWaypoint* new_wp=new ChunkWaypoint[NumWaypoints+mwc_from->NumWaypoints];
|
||||
//first take alien waypoints from this chunk
|
||||
for(int i=0;i<NumAlienWaypoints;i++)
|
||||
for(i=0;i<NumAlienWaypoints;i++)
|
||||
{
|
||||
new_wp[i]=AlienWaypoints[i];
|
||||
//set pointers to zero so the memory doesn't get deallocated when the old
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue