summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Fuller <relnev@icculus.org>2001-08-06 04:07:44 +0000
committerPatryk Obara <dreamer.tan@gmail.com>2019-08-20 02:22:36 +0200
commit12c6a39177837a5c4dc8928a78140b4c3bb8f47a (patch)
tree18c8210d0264a7b23a8f34008b3f10a994a87241 /src
parentd0582ff279a5453130c3adc1fb2606ab330be292 (diff)
'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()
Diffstat (limited to 'src')
-rw-r--r--src/avp/support/indexfnt.hpp15
-rw-r--r--src/main.c30
-rw-r--r--src/stubs2.cpp28
3 files changed, 35 insertions, 38 deletions
diff --git a/src/avp/support/indexfnt.hpp b/src/avp/support/indexfnt.hpp
index b1cf0ab..a8acb16 100644
--- a/src/avp/support/indexfnt.hpp
+++ b/src/avp/support/indexfnt.hpp
@@ -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
diff --git a/src/main.c b/src/main.c
index 594e494..1ab8cc5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}
diff --git a/src/stubs2.cpp b/src/stubs2.cpp
index 72cb86e..e2c8d8c 100644
--- a/src/stubs2.cpp
+++ b/src/stubs2.cpp
@@ -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)
+IndexedFont* IndexedFont :: pIndexedFont[ IndexedFonts_MAX_NUMBER_OF_FONTS ];
+
+IndexedFont::IndexedFont(FontIndex I_Font_New)
{
- fprintf(stderr, "IndexedFont::GetFont(%d)\n", I_Font_ToGet);
-// return pIndexedFont[ I_Font_ToGet ];
+ fprintf(stderr, "IndexedFont::IndexedFont(%d)\n", I_Font_New);
+
+ I_Font_Val = I_Font_New;
+
+ pIndexedFont[ I_Font_New ] = this;
+}
- return NULL;
+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);