Esempio n. 1
0
static
void Draw_Pixel_Init(SDL_Surface *super,
                     Sint16 x, Sint16 y, Uint32 color)
{
  Draw_Init();
  Draw_Pixel(super, x, y, color);
}
Esempio n. 2
0
static
void Draw_FillCircle_Init(SDL_Surface *super,
                          Sint16 x0, Sint16 y0, Uint16 r,
                          Uint32 color)
{
  Draw_Init();
  Draw_FillCircle(super, x0, y0, r, color);
}
Esempio n. 3
0
static
void Draw_Line_Init(SDL_Surface *super,
                    Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2,
                    Uint32 color)
{
  Draw_Init();
  Draw_Line(super, x1, y1, x2, y2, color);
}
Esempio n. 4
0
static
void Draw_FillRound_Init(SDL_Surface *super,
                         Sint16 x0,Sint16 y0, Uint16 w,Uint16 h,
                         Uint16 corner, Uint32 color)
{
  Draw_Init();
  Draw_FillRound(super, x0, y0, w, h, corner, color);
}
Esempio n. 5
0
static
void Draw_Rect_Init(SDL_Surface *super,
                    Sint16 x,Sint16 y, Uint16 w,Uint16 h,
                    Uint32 color)
{
  Draw_Init();
  Draw_Rect(super, x, y, w, h, color);
}
Esempio n. 6
0
static
void Draw_VLine_Init(SDL_Surface *super,
                     Sint16 x0,Sint16 y0, Sint16 y1,
                     Uint32 color)
{
  Draw_Init();
  Draw_VLine(super, x0, y0, y1, color);
}
Esempio n. 7
0
static
void Draw_FillEllipse_Init(SDL_Surface *super,
                           Sint16 x0, Sint16 y0,
                           Uint16 Xradius, Uint16 Yradius,
                           Uint32 color)
{
  Draw_Init();
  Draw_FillEllipse(super, x0, y0, Xradius, Yradius, color);
}
Esempio n. 8
0
bool
Host_Init(quakeparms_t *parms)
{
    if (standard_quake)
	minimum_memory = MINIMUM_MEMORY;
    else
	minimum_memory = MINIMUM_MEMORY_LEVELPAK;

    if (COM_CheckParm("-minmemory"))
	parms->memsize = minimum_memory;

    host_parms = *parms;

    if (parms->memsize < minimum_memory)
       return Sys_Error("Only %4.1f megs of memory reported, can't execute game",
             parms->memsize / (float)0x100000);

    com_argc = parms->argc;
    com_argv = parms->argv;

    Memory_Init(parms->membase, parms->memsize);
    Cbuf_Init();
    Cmd_Init();
    V_Init();
    Chase_Init();
    COM_Init();
    Host_InitLocal();
    if (!W_LoadWadFile("gfx.wad"))
       return false;

    Key_Init();
    Con_Init();
    M_Init();
    PR_Init();
    Mod_Init(R_ModelLoader());
    NET_Init();
    SV_Init();

    Con_Printf("Exe: " __TIME__ " " __DATE__ "\n");
    Con_Printf("%4.1f megabyte heap\n", parms->memsize / (1024 * 1024.0));

    R_InitTextures();		// needed even for dedicated servers

    if (cls.state != ca_dedicated) {
	host_basepal = (byte*)COM_LoadHunkFile("gfx/palette.lmp");
	if (!host_basepal)
	    return Sys_Error("Couldn't load gfx/palette.lmp");
	host_colormap = (byte*)COM_LoadHunkFile("gfx/colormap.lmp");
	if (!host_colormap)
	    return Sys_Error("Couldn't load gfx/colormap.lmp");


   if (coloredlights)
      host_fullbrights = 256-host_colormap[16384]; // leilei - variable our fullbright counts if available

	VID_Init(host_basepal);

	Draw_Init();
	SCR_Init();
	R_Init();

	S_Init();
	CDAudio_Init();
    BGM_Init();

	Sbar_Init();
	CL_Init();

	IN_Init();
    }

    Hunk_AllocName(0, "-HOST_HUNKLEVEL-");
    host_hunklevel = Hunk_LowMark();

    host_initialized = true;
    Sys_Printf("========Quake Initialized=========\n");

    /* In case exec of quake.rc fails */
    if (!setjmp(host_abort)) {
	Cbuf_InsertText("exec quake.rc\n");
	Cbuf_Execute();
    }

    return true;
}
Esempio n. 9
0
/*
====================
Host_Init
====================
*/
void Host_Init (quakeparms_t *parms)
{

	if (standard_quake)
		minimum_memory = MINIMUM_MEMORY;
	else
		minimum_memory = MINIMUM_MEMORY_LEVELPAK;

	if (COM_CheckParm ("-minmemory"))
		parms->memsize = minimum_memory;

	host_parms = *parms;

	if (parms->memsize < minimum_memory)
		Sys_Error ("Only %4.1f megs of memory available, can't execute game", parms->memsize / (float)0x100000);

	com_argc = parms->argc;
	com_argv = parms->argv;

	Memory_Init (parms->membase, parms->memsize);
	Cbuf_Init ();
	Cmd_Init ();	
	V_Init ();

	// jkrige - removed chase
	//Chase_Init ();
	// jkrige - removed chase

	Host_InitVCR (parms);
	COM_Init (parms->basedir);
	Host_InitLocal ();
	W_LoadWadFile ("gfx.wad");
	Key_Init ();
	Con_Init ();	
	M_Init ();	
	PR_Init ();
	Mod_Init ();
	NET_Init ();
	SV_Init ();

	Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
	Con_Printf ("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0));
	
	R_InitTextures ();		// needed even for dedicated servers
 
	if (cls.state != ca_dedicated)
	{
		host_basepal = (byte *)COM_LoadHunkFile ("gfx/palette.lmp");
		if (!host_basepal)
			Sys_Error ("Couldn't load gfx/palette.lmp");
		host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp");
		if (!host_colormap)
			Sys_Error ("Couldn't load gfx/colormap.lmp");

#ifndef _WIN32 // on non win32, mouse comes before video for security reasons
		IN_Init ();
#endif
		VID_Init (host_basepal);

		Draw_Init ();
		SCR_Init ();
		R_Init ();
#ifndef	_WIN32
	// on Win32, sound initialization has to come before video initialization, so we
	// can put up a popup if the sound hardware is in use
		S_Init ();

		// jkrige - fmod sound system (system)
		FMOD_Init();
		// jkrige - fmod sound system (system)
#else

#ifdef	GLQUAKE
	// FIXME: doesn't use the new one-window approach yet
		S_Init ();

		// jkrige - fmod sound system (system)
		FMOD_Init();
		// jkrige - fmod sound system (system)
#endif

#endif	// _WIN32

		// jkrige - fmod sound system (music)
		//CDAudio_Init ();
		// jkrige - fmod sound system (music)

		Sbar_Init ();
		CL_Init ();
#ifdef _WIN32 // on non win32, mouse comes before video for security reasons
		IN_Init ();
#endif
	}

	Cbuf_InsertText ("exec quake.rc\n");

	Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
	host_hunklevel = Hunk_LowMark ();

	host_initialized = true;
	
	Sys_Printf ("========Quake Initialized=========\n");	
}
Esempio n. 10
0
/*
====================
Host_Init
====================
*/
void Host_Init (void)
{
	if (standard_quake)
		minimum_memory = MINIMUM_MEMORY;
	else	minimum_memory = MINIMUM_MEMORY_LEVELPAK;

	if (COM_CheckParm ("-minmemory"))
		host_parms->memsize = minimum_memory;

	if (host_parms->memsize < minimum_memory)
		Sys_Error ("Only %4.1f megs of memory available, can't execute game", host_parms->memsize / (float)0x100000);

	com_argc = host_parms->argc;
	com_argv = host_parms->argv;

	Memory_Init (host_parms->membase, host_parms->memsize);
	Cbuf_Init ();
	Cmd_Init ();
	LOG_Init (host_parms);
	Cvar_Init (); //johnfitz
	COM_Init ();
	COM_InitFilesystem ();
	Host_InitLocal ();
	W_LoadWadFile (); //johnfitz -- filename is now hard-coded for honesty
	if (cls.state != ca_dedicated)
	{
		Key_Init ();
		Con_Init ();
	}
	PR_Init ();
	Mod_Init ();
	NET_Init ();
	SV_Init ();

	Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
	Con_Printf ("%4.1f megabyte heap\n", host_parms->memsize/ (1024*1024.0));

	if (cls.state != ca_dedicated)
	{
		host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp", NULL);
		if (!host_colormap)
			Sys_Error ("Couldn't load gfx/colormap.lmp");

		V_Init ();
		Chase_Init ();
		M_Init ();
		ExtraMaps_Init (); //johnfitz
		Modlist_Init (); //johnfitz
		DemoList_Init (); //ericw
		VID_Init ();
		IN_Init ();
		TexMgr_Init (); //johnfitz
		Draw_Init ();
		SCR_Init ();
		R_Init ();
		S_Init ();
		CDAudio_Init ();
		BGM_Init();
		Sbar_Init ();
		CL_Init ();
	}

	Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
	host_hunklevel = Hunk_LowMark ();

	host_initialized = true;
	Con_Printf ("\n========= Quake Initialized =========\n\n");

	if (cls.state != ca_dedicated)
	{
		Cbuf_InsertText ("exec quake.rc\n");
	// johnfitz -- in case the vid mode was locked during vid_init, we can unlock it now.
		// note: two leading newlines because the command buffer swallows one of them.
		Cbuf_AddText ("\n\nvid_unlock\n");
	}

	if (cls.state == ca_dedicated)
	{
		Cbuf_AddText ("exec autoexec.cfg\n");
		Cbuf_AddText ("stuffcmds");
		Cbuf_Execute ();
		if (!sv.active)
			Cbuf_AddText ("map start\n");
	}
}
Esempio n. 11
0
void VID_Open()
{
	int width, height, fullscreen;

	fullscreen = vid_fullscreen.value;
	width = vid_width.value;
	height = vid_height.value;

#warning Fix this.
#ifndef GLQUAKE
	if (width > MAXWIDTH)
	{
		Com_Printf("VID: Maximum supported width is %d\n", MAXWIDTH);
		width = MAXWIDTH;
	}
	if (height > MAXHEIGHT)
	{
		Com_Printf("VID: Maximum supported height is %d\n", MAXHEIGHT);
		height = MAXHEIGHT;
	}
#endif

	vid.colormap = host_colormap;
	vid.aspect = ((float)height / (float)width) * (320.0 / 240.0);

#ifndef GLQUAKE
	vid.maxwarpwidth = WARP_WIDTH;
	vid.maxwarpheight = WARP_HEIGHT;
#endif

	Sys_Thread_LockMutex(display_mutex);
	display = Sys_Video_Open(vid_mode.string, width, height, fullscreen, host_basepal);
	Sys_Thread_UnlockMutex(display_mutex);
	if (display)
	{
		width = Sys_Video_GetWidth(display);
		height = Sys_Video_GetHeight(display);

#ifndef GLQUAKE
		if (width > MAXWIDTH || height > MAXHEIGHT)
			Sys_Error("Fullscreen display size (%dx%d) exceeds the maximum allowed display size (%dx%d)\n", width, height, MAXWIDTH, MAXHEIGHT);
#endif

#ifndef GLQUAKE
		if (VID_SW_AllocBuffers(width, height))
#endif
		{
			vid.numpages = Sys_Video_GetNumBuffers(display);

			set_up_conwidth_conheight();

#ifndef GLQUAKE
			vid.rowbytes = Sys_Video_GetBytesPerRow(display);
			vid.buffer = Sys_Video_GetBuffer(display);
#endif

			if (windowtitle)
				Sys_Video_SetWindowTitle(display, windowtitle);

			mouse_grabbed = 2;
			refresh_mouse_grab_state();

			R_Init();

			V_UpdatePalette(true);
#ifdef GLQUAKE
			Check_Gamma(host_basepal);
			VID_SetPalette(host_basepal);

			vid.recalc_refdef = 1;				// force a surface cache flush

			R_InitGL();
			GL_Particles_TextureInit();
#endif

			Draw_Init();
			M_VidInit();
			Sbar_Init();
			SCR_Init();
			CSTC_PictureInit();
			Skin_Init();

			return;
		}

		Sys_Thread_LockMutex(display_mutex);

		Sys_Video_Close(display);

		display = 0;

		Sys_Thread_UnlockMutex(display_mutex);
	}

	Sys_Error("VID: Unable to open a display\n");
}
Esempio n. 12
0
void Host_Init(quakeparms_t *parms) {
    if (standard_quake)
        minimum_memory = MINIMUM_MEMORY;
    else
        minimum_memory = MINIMUM_MEMORY_LEVELPAK;

    if (COM_CheckParm("-minmemory"))
        parms->memsize = minimum_memory;

    host_parms = *parms;

    if (parms->memsize < minimum_memory)
        Sys_Error("Only %4.1f megs of memory available, can't execute game", parms->memsize / (float) 0x100000);

    com_argc = parms->argc;
    com_argv = parms->argv;

    Memory_Init(parms->membase, parms->memsize);
    Cbuf_Init();
    Cmd::Init();
    V_Init();
    NN_init();
    COM_Init();
    Host_InitLocal();
    W_LoadWadFile("gfx.wad");
    Key_Init();
    Con_Init();
    M_Init();
    PR_Init();
    Mod_Init();
    NET_Init();
    SV_Init();
    Bot_Init();

    Con_Printf("Exe: "__TIME__" "__DATE__"\n");
    Con_Printf("%4.1f megabyte heap\n", parms->memsize / (1024 * 1024.0));

    if (cls.state != ca_dedicated) {
        host_basepal = (byte *) COM_LoadHunkFile("gfx/palette.lmp");
        if (!host_basepal)
            Sys_Error("Couldn't load gfx/palette.lmp");
        host_colormap = (byte *) COM_LoadHunkFile("gfx/colormap.lmp");
        if (!host_colormap)
            Sys_Error("Couldn't load gfx/colormap.lmp");

        IN_Init();
        VID_Init(host_basepal);
        Draw_Init();
        SCR_Init();
        R_Init();
        TextureManager::Init();
        S_Init();
        CDAudio_Init();
        Sbar_Init();
        CL_Init();
    }

    Cbuf_InsertText("exec quake.rc\n");

    Hunk_AllocName(0, "-HOST_HUNKLEVEL-");
    host_hunklevel = Hunk_LowMark();

    host_initialized = true;

    Sys_Printf("========Quake Initialized=========\n");
}
Esempio n. 13
0
/*
====================
Host_Init
====================
*/
void Host_Init (quakeparms_t *parms)
{
	#if defined(_WIN32) && defined(GLQUAKE)
	FILE *fp = fopen("opengl32.dll","r");
	if (fp) {
		// exists
		fclose(fp);
		Sys_Error ("OpenGL32.dll found in Quake folder.  You must delete this file from your Quake folder to run this engine.");
	}
	#endif // Windows only

	if (standard_quake)
		minimum_memory = MINIMUM_MEMORY;
	else
		minimum_memory = MINIMUM_MEMORY_LEVELPAK;

	if (COM_CheckParm ("-minmemory"))
		parms->memsize = minimum_memory;

	host_parms = *parms;

	if (parms->memsize < minimum_memory)
		Sys_Error ("Only %4.1f megs of memory available, can't execute game and memsize = %i and minimum memory is %i", parms->memsize / (float)0x100000, parms->memsize, minimum_memory);

	com_argc = parms->argc;
	com_argv = parms->argv;
#ifdef SUPPORTS_CHEATFREE
	// JPG 3.00 - moved this here
#if defined(_WIN32)
	srand(time(NULL) ^ _getpid());
#else
	srand(time(NULL) ^ getpid());
#endif
#endif

	Memory_Init (parms->membase, parms->memsize);
	Cbuf_Init ();
	Cmd_Init ();
	Cvar_Init ();
	V_Init ();
	Chase_Init ();
	Host_InitVCR (parms);
	COM_Init (parms->basedir);
	Host_InitLocal ();

	W_LoadWadFile ("gfx.wad");
	Key_Init ();

	Con_Init ();
	M_Init ();
	PR_Init ();
	Mod_Init ();
#ifdef PROQUAKE_EXTENSION
	Security_Init ();	// JPG 3.20 - cheat free
#endif
	NET_Init ();
	SV_Init ();
#ifdef PROQUAKE_EXTENSION
	IPLog_Init ();	// JPG 1.05 - ip address logging

	Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
#endif
#ifdef PSP_SYSTEM_STATS
	Con_Printf ("Insomnia ProQuake Engine v 4.71 Rev4\n"); //(EBOOT: "__TIME__" "__DATE__")\n");

	int currentCPU = scePowerGetCpuClockFrequency();
	int currentVRAM = sceGeEdramGetSize();
    int currentVRAMADD = sceGeEdramGetAddr();
	int currentRAMAVAIL = sceKernelTotalFreeMemSize();

#ifdef NORMAL_MODEL
	Con_Printf ("PSP Normal 32MB RAM Mode \n");
#endif
#ifdef SLIM_MODEL
	Con_Printf ("PSP Slim 64MB RAM Mode \n");
#endif

	Con_Printf ("%4.1f megabyte heap \n",parms->memsize/ (1024*1024.0));
	Con_Printf ("%4.1f PSP application heap \n",1.0f*PSP_HEAP_SIZE_MB);
	Con_Printf ("%d VRAM \n",currentVRAM);
    Con_Printf ("%d VRAM Address \n",currentVRAMADD);
    Con_Printf ("%d Current Total RAM \n",currentRAMAVAIL);

	Con_Printf ("CPU Speed %d MHz\n", currentCPU);
	Con_Printf ("%s \n", com_gamedir);

	
	
	R_InitTextures ();		// needed even for dedicated servers
#else
	Con_Printf ("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0));
#endif

	if (cls.state != ca_dedicated)
	{
		host_basepal = (byte *)COM_LoadHunkFile ("gfx/palette.lmp");
		if (!host_basepal)
			Sys_Error ("Couldn't load gfx/palette.lmp");
		host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp");
		if (!host_colormap)
			Sys_Error ("Couldn't load gfx/colormap.lmp");

#ifndef _WIN32 // on non win32, mouse comes before video for security reasons
		IN_Init ();
#endif
		VID_Init (host_basepal);

        Draw_Init ();
		SCR_Init ();
		R_Init ();
#ifndef	_WIN32
	// on Win32, sound initialization has to come before video initialization, so we
	// can put up a popup if the sound hardware is in use
		S_Init ();
#else

#ifdef	GLQUAKE
	// FIXME: doesn't use the new one-window approach yet
		S_Init ();
#endif

#endif	// _WIN32
		CDAudio_Init ();
		Sbar_Init ();
		CL_Init ();
#ifdef _WIN32 // on non win32, mouse comes before video for security reasons
		IN_Init ();
#endif

#ifdef _WIN32
		// Baker: 3.99m to get sys info
		// must be AFTER video init stuff
		Sys_InfoInit();  // We don't care about dedicated servers for this

		// Baker 3.76 - Autoplay demo

		if (com_argc >= 2)
		{
			char *infile = com_argv[1];

			if (infile[0] && infile[0] != '-' && infile[0] != '+') {
				char tmp[1024] = {0}, *ext = COM_FileExtension(infile);

				if (!strncasecmp(ext, "dem", sizeof("dem")))
					snprintf(tmp, sizeof(tmp), "playdemo \"%s\"\n", infile);

				if (tmp[0])
				{
					nostartdemos = true;
					Cbuf_AddText(tmp);
				}
			}
		}
#endif


	}

	Cbuf_InsertText ("exec quake.rc\n");

#ifdef PROQUAKE_EXTENSION
	// Baker 3.80x: this is a hack

	if (!isDedicated) {

		Cbuf_AddText ("\nsavefov\n");
		Cbuf_AddText ("savesensitivity\n");
	}
#endif
	Hunk_AllocName (0, "-HOST_HUNKLEVEL-");
	host_hunklevel = Hunk_LowMark ();

	host_initialized = true;

	Con_Printf ("Host Initialized\n");
	Sys_Printf ("========Quake Initialized=========\n");
}