'Undid' stubbing of IndexedFont::IndexedFont and IndexedFont::GetFont().

Initialized ScreenDescriptorBlock to some default values.

Now AvP runs and exits with no errors with current main()
This commit is contained in:
Steven Fuller 2001-08-06 04:07:44 +00:00 committed by Patryk Obara
parent d0582ff279
commit 12c6a39177
4 changed files with 38 additions and 39 deletions

View file

@ -5,3 +5,5 @@ win95/awtexld.hpp line 79:
========
Changed filenames:
avp/win95/system.c (avp_load_rif calls)
========
is AvP.CurrentEnv and StartingEnv used?

View file

@ -44,10 +44,6 @@
{
public:
static IndexedFont* GetFont( FontIndex I_Font_ToGet );
// static IndexedFont* GetFont( FontIndex I_Font_ToGet )
// {
// return pIndexedFont[ I_Font_ToGet ];
// }
// can return NULL if no font loaded in that slot
static void UnloadFont( FontIndex I_Font_ToGet );
@ -164,21 +160,12 @@
static IndexedFont* pIndexedFont[ IndexedFonts_MAX_NUMBER_OF_FONTS ];
};
#if 0 /* moved elsewhere because of GCC! */
// Inline methods:
/*inline*/ /* static */ IndexedFont* IndexedFont::GetFont( FontIndex I_Font_ToGet )
inline /* static */ IndexedFont* IndexedFont::GetFont( FontIndex I_Font_ToGet )
{
return pIndexedFont[ I_Font_ToGet ];
}
#endif
#if 0
class IndexedFont_FixedSpace : public IndexedFont
{
public:
private:
};
#endif
/*
KJL 17:20:10 15/04/98 - May God have mercy on my soul
fixed space HUD font

View file

@ -14,10 +14,10 @@
#include "avp_envinfo.h"
#include "cdtrackselection.h"
char LevelName[] = {"predbit6\0QuiteALongNameActually"};
static ELO ELOLevelToLoad = {&LevelName};
char LevelName[] = {"predbit6\0QuiteALongNameActually"}; /* the real way to load levels */
extern int ScanDrawMode; /* to fix image loading */
extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock; /* this should be put in a header file */
PROCESSORTYPES ReadProcessorType()
{
@ -38,8 +38,6 @@ int ExitWindowsSystem()
int main(int argc, char *argv[])
{
int level_to_load = I_Num_Environments;
LoadCDTrackList();
SetFastRandom();
@ -57,8 +55,9 @@ int main(int argc, char *argv[])
InitialVideoMode();
Env_List[0] = &(ELOLevelToLoad);
level_to_load = 0;
/* Env_List can probably be removed */
// Env_List[0]->main = &(ELOLevelToLoad); /* overwrite the first entry of crappy env_list with LevelName */
Env_List[0]->main = LevelName;
InitialiseSystem();
InitialiseRenderer();
@ -78,7 +77,7 @@ int main(int argc, char *argv[])
AvP.LevelCompleted = 0;
LoadSounds("PLAYER");
AvP.CurrentEnv = AvP.StartingEnv = 0; /* ??? */
AvP.CurrentEnv = AvP.StartingEnv = 0; /* are these even used? */
SetLevelToLoad(AVP_ENVIRONMENT_INVASION); /* because the menus aren't implemented */
// while(AvP_MainMenus()) {
@ -86,6 +85,18 @@ int main(int argc, char *argv[])
d3d_light_ctrl.ctrl = LCCM_NORMAL;
d3d_overlay_ctrl.ctrl = OCCM_NORMAL;
/* this was in windows SetGameVideoMode: */
ScreenDescriptorBlock.SDB_Width = 640;
ScreenDescriptorBlock.SDB_Height = 480;
ScreenDescriptorBlock.SDB_CentreX = 640/2;
ScreenDescriptorBlock.SDB_CentreY = 480/2;
ScreenDescriptorBlock.SDB_ProjX = 640/2;
ScreenDescriptorBlock.SDB_ProjY = 480/2;
ScreenDescriptorBlock.SDB_ClipLeft = 0;
ScreenDescriptorBlock.SDB_ClipRight = 640;
ScreenDescriptorBlock.SDB_ClipUp = 0;
ScreenDescriptorBlock.SDB_ClipDown = 480;
// GetCorrectDirectDrawObject();
start_of_loaded_shapes = load_precompiled_shapes();
@ -130,6 +141,9 @@ int main(int argc, char *argv[])
break; /* TODO -- remove when loop works */
}
// }
// }
fprintf(stderr, "Now exiting Aliens vs Predator! At least it didn't crash!\n");
return 0;
}

View file

@ -27,15 +27,21 @@ void D3D_RenderHUDString_Centred(char *stringPtr, int centreX, int y, int colour
/* indexfnt.cpp */
#if 1
IndexedFont* IndexedFont::GetFont(FontIndex I_Font_ToGet)
{
fprintf(stderr, "IndexedFont::GetFont(%d)\n", I_Font_ToGet);
// return pIndexedFont[ I_Font_ToGet ];
IndexedFont* IndexedFont :: pIndexedFont[ IndexedFonts_MAX_NUMBER_OF_FONTS ];
return NULL;
IndexedFont::IndexedFont(FontIndex I_Font_New)
{
fprintf(stderr, "IndexedFont::IndexedFont(%d)\n", I_Font_New);
I_Font_Val = I_Font_New;
pIndexedFont[ I_Font_New ] = this;
}
IndexedFont::~IndexedFont()
{
fprintf(stderr, "IndexedFont::~IndexedFont()\n");
}
#endif
void IndexedFont::UnloadFont(FontIndex I_Font_ToGet)
{
@ -54,16 +60,6 @@ void IndexedFont_Proportional_PF::PFUnLoadHook(FontIndex I_Font_ToGet)
fprintf(stderr, "IndexedFont_Proportional_PF::PFUnLoadHook(%d)\n", I_Font_ToGet);
}
IndexedFont::IndexedFont(FontIndex I_Font_New)
{
fprintf(stderr, "IndexedFont::IndexedFont(%d)\n", I_Font_New);
}
IndexedFont::~IndexedFont()
{
fprintf(stderr, "IndexedFont::~IndexedFont()\n");
}
IndexedFont_HUD::IndexedFont_HUD(FontIndex I_Font_New) : IndexedFont(I_Font_New)
{
fprintf(stderr, "IndexedFont_HUD::IndexedFont_HUD(%d)\n", I_Font_New);