summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSteven Fuller <relnev@icculus.org>2001-08-05 05:51:56 +0000
committerPatryk Obara <dreamer.tan@gmail.com>2019-08-20 02:22:36 +0200
commita5fdb9f7c852743d2d3c29d2db8862249929e3a0 (patch)
treebaa6ed008700b2669becbb7d75a22e1f8b109657 /src/main.c
parentf2c6ac73625670a1a99b665b75b1757e8bf4d3ec (diff)
Now in the Data loading phase.
Converted many '\\' to '/'. Partially implemented win32 file routines. Got texture code to work OK for now (still needs to be reimplemented). Partially implemented the main loop.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c105
1 files changed, 105 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 62c0c74..594e494 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,8 +5,20 @@
#include "fixer.h"
#include "3dc.h"
+#include "platform.h"
+#include "gamedef.h"
+#include "gameplat.h"
+#include "ffstdio.h"
+#include "vision.h"
+#include "comp_shp.h"
+#include "avp_envinfo.h"
#include "cdtrackselection.h"
+char LevelName[] = {"predbit6\0QuiteALongNameActually"};
+static ELO ELOLevelToLoad = {&LevelName};
+
+extern int ScanDrawMode; /* to fix image loading */
+
PROCESSORTYPES ReadProcessorType()
{
return PType_PentiumMMX;
@@ -14,6 +26,8 @@ PROCESSORTYPES ReadProcessorType()
int InitialiseWindowsSystem()
{
+ ScanDrawMode = ScanDrawD3DHardwareRGB;
+
return 0;
}
@@ -24,7 +38,98 @@ int ExitWindowsSystem()
int main(int argc, char *argv[])
{
+ int level_to_load = I_Num_Environments;
+
LoadCDTrackList();
+ SetFastRandom();
+
+ GetPathFromRegistry();
+
+#if MARINE_DEMO
+ ffInit("fastfile/mffinfo.txt","fastfile/");
+#elif ALIEN_DEMO
+ ffInit("alienfastfile/ffinfo.txt","alienfastfile/");
+#else
+ ffInit("fastfile/ffinfo.txt","fastfile/");
+#endif
+ InitGame();
+
+ InitialVideoMode();
+
+ Env_List[0] = &(ELOLevelToLoad);
+ level_to_load = 0;
+
+ InitialiseSystem();
+ InitialiseRenderer();
+
+/* InitOptionsMenu(); NOT YET */
+
+ LoadKeyConfiguration();
+
+ SoundSys_Start();
+ CDDA_Start();
+
+ InitTextStrings();
+
+ BuildMultiplayerLevelNameArray();
+
+ ChangeDirectDrawObject();
+ AvP.LevelCompleted = 0;
+ LoadSounds("PLAYER");
+
+ AvP.CurrentEnv = AvP.StartingEnv = 0; /* ??? */
+ SetLevelToLoad(AVP_ENVIRONMENT_INVASION); /* because the menus aren't implemented */
+
+// while(AvP_MainMenus()) {
+
+ d3d_light_ctrl.ctrl = LCCM_NORMAL;
+ d3d_overlay_ctrl.ctrl = OCCM_NORMAL;
+
+ // GetCorrectDirectDrawObject();
+
+ start_of_loaded_shapes = load_precompiled_shapes();
+
+ InitCharacter();
+
+ LoadRifFile(); /* sets up a map */
+
+ AssignAllSBNames();
+
+ StartGame();
+
+ ffcloseall();
+
+ AvP.MainLoopRunning = 1;
+
+/* ScanImagesForFMVs(); NOT YET */
+
+ ResetFrameCounter();
+
+/* Game_Has_Loaded(); NOT YET */
+
+ ResetFrameCounter();
+
+/* IngameKeyboardInput_ClearBuffer(); NOT YET */
+
+ while(AvP.MainLoopRunning) {
+ CheckForWindowsMessages();
+
+ switch(AvP.GameMode) {
+ case I_GM_Playing:
+ break;
+ case I_GM_Menus:
+ AvP.GameMode = I_GM_Playing;
+ break;
+ case I_GM_Paused:
+ break;
+ default:
+ fprintf(stderr, "AvP.MainLoopRunning: gamemode = %d\n", AvP.GameMode);
+ exit(EXIT_FAILURE);
+ }
+ break; /* TODO -- remove when loop works */
+ }
+
+// }
return 0;
}