Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease Loading Time #27

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions source/pr_edict.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,15 +903,7 @@ if (!strcmp(com_token, "light"))
key = ED_FindField (keyname);
if (!key)
{
if (strcmp (keyname, "compiler") &&
strcmp (keyname, "r_skycolor") &&
strcmp (keyname, "sequence") &&
strcmp (keyname, "message2") && //dirty hack to keep the console clean. Dem lazy mappers
strcmp (keyname, "mangle") &&
strcmp (keyname, "Maxrange") &&
strcmp (keyname, "light_lev") &&
strcmp (keyname, "fog"))
Con_Printf ("'%s' is not a field\n", keyname);
// cypress -- removed useless conprints
continue;
}

Expand Down Expand Up @@ -1062,8 +1054,8 @@ void PR_LoadProgs (void)

if (progs->version != PROG_VERSION)
Sys_Error ("progs.dat has wrong version number (%i should be %i)", progs->version, PROG_VERSION);
if (progs->crc != PROGHEADER_CRC)
Con_Printf ("WARNING!!! progs.dat system vars have been modified, progdefs.h is out of date. Current one is %i\n", progs->crc);
// if (progs->crc != PROGHEADER_CRC)
// Con_Printf ("WARNING!!! progs.dat system vars have been modified, progdefs.h is out of date. Current one is %i\n", progs->crc);

pr_functions = (dfunction_t *)((byte *)progs + progs->ofs_functions);
pr_strings = (char *)progs + progs->ofs_strings;
Expand Down
2 changes: 1 addition & 1 deletion source/psp/video_hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int GL_LoadTexture8to4(const char *identifier, unsigned int width, unsigned int
int GL_LoadTextureLM (const char *identifier, int width, int height, const byte *data, int bpp, int filter, qboolean update, int forcopy);
int GL_LoadImages (const char *identifier, int width, int height, const byte *data, qboolean stretch_to_power_of_two, int filter, int mipmap_level, int bpp);
int GL_LoadTexturePixels (byte *data, char *identifier, int width, int height, int mode);
int loadtextureimage (char* filename, int matchwidth, int matchheight, qboolean complain, int filter);
int loadtextureimage (char* filename, int matchwidth, int matchheight, qboolean complain, int filter, int type);
int GL_LoadPaletteTexture (const char *identifier, int width, int height, const byte *data, byte *palette, int paltype, qboolean stretch_to_power_of_two, int filter, int mipmap_level);

//Crow_bar
Expand Down
18 changes: 9 additions & 9 deletions source/psp/video_hardware_QMB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void QMB_InitParticles (void)

loading_num_step = loading_num_step + 24;

if (!(particleimage = loadtextureimage("textures/particles/particlefont", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/particles/particlefont", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -471,7 +471,7 @@ void QMB_InitParticles (void)
SCR_UpdateScreen ();

// load the rest of the images
if(!(particleimage = loadtextureimage("textures/particles/q3particlefont", 0, 0, qfalse, GU_LINEAR)))
if(!(particleimage = loadtextureimage("textures/particles/q3particlefont", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -496,7 +496,7 @@ void QMB_InitParticles (void)

max_s = max_t = 128.0;

if (!(particleimage = loadtextureimage("textures/particles/flame", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/particles/flame", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -511,7 +511,7 @@ void QMB_InitParticles (void)
loading_cur_step++;
SCR_UpdateScreen ();

if (!(particleimage = loadtextureimage("textures/particles/inferno", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/particles/inferno", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -522,7 +522,7 @@ void QMB_InitParticles (void)
loading_cur_step++;
SCR_UpdateScreen ();

if (!(particleimage = loadtextureimage("textures/particles/zing1", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/particles/zing1", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -535,7 +535,7 @@ void QMB_InitParticles (void)
SCR_UpdateScreen ();
max_s = max_t = 128.0;

if (!(particleimage = loadtextureimage("textures/mzfl/mzfl0", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/mzfl/mzfl0", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -550,7 +550,7 @@ void QMB_InitParticles (void)

#ifdef SLIM

if (!(particleimage = loadtextureimage("textures/mzfl/mzfl1", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/mzfl/mzfl1", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -560,7 +560,7 @@ void QMB_InitParticles (void)

loading_cur_step++;
SCR_UpdateScreen ();
if (!(particleimage = loadtextureimage("textures/mzfl/mzfl2", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/mzfl/mzfl2", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand All @@ -574,7 +574,7 @@ void QMB_InitParticles (void)
#endif // SLIM

max_s = max_t = 64.0;
if (!(particleimage = loadtextureimage("textures/particles/bloodcloud", 0, 0, qfalse, GU_LINEAR)))
if (!(particleimage = loadtextureimage("textures/particles/bloodcloud", 0, 0, qfalse, GU_LINEAR, 0)))
{
//Clear_LoadingFill ();
return;
Expand Down
20 changes: 2 additions & 18 deletions source/psp/video_hardware_decals_QMB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,7 @@ void R_InitDecals (void)

if (!qmb_initialized)
return;
/*
decal_blood1 = loadtextureimage("textures/decals/blood_splat01", 0, 0, qfalse, GU_LINEAR);
decal_blood2 = loadtextureimage("textures/decals/blood_splat02", 0, 0, qfalse, GU_LINEAR);
decal_blood3 = loadtextureimage("textures/decals/blood_splat03", 0, 0, qfalse, GU_LINEAR);
decal_q3blood = loadtextureimage("textures/decals/blood_stain", 0, 0, qfalse, GU_LINEAR);
decal_burn = loadtextureimage("textures/decals/explo_burn01", 0, 0, qfalse, GU_LINEAR);
decal_mark = loadtextureimage("textures/decals/particle_burn01", 0, 0, qfalse, GU_LINEAR);
decal_glow = loadtextureimage("textures/decals/glow2", 0, 0, qfalse, GU_LINEAR);

decal_blood1 = GL_LoadTextureImage ("textures/decals/blood_splat01", "decals:blood_splat01", 128, 128, TEX_ALPHA | TEX_COMPLAIN);
decal_blood2 = GL_LoadTextureImage ("textures/decals/blood_splat02", "decals:blood_splat02", 128, 128, TEX_ALPHA | TEX_COMPLAIN);
decal_blood3 = GL_LoadTextureImage ("textures/decals/blood_splat03", "decals:blood_splat03", 128, 128, TEX_ALPHA | TEX_COMPLAIN);
decal_q3blood = GL_LoadTextureImage ("textures/decals/blood_stain", "decals:blood_stain", 64, 64, TEX_ALPHA | TEX_COMPLAIN);
decal_burn = GL_LoadTextureImage ("textures/decals/explo_burn01", "decals:explo_burn01", 128, 128, TEX_ALPHA | TEX_COMPLAIN);
decal_mark = GL_LoadTextureImage ("textures/decals/particle_burn01", "decals:particle_burn01", 64, 64, TEX_ALPHA | TEX_COMPLAIN);
decal_glow = GL_LoadTextureImage ("textures/decals/glow2", "decals:glow2", 64, 64, TEX_ALPHA | TEX_COMPLAIN);
*/

if ((i = COM_CheckParm("-decals")) && i + 1 < com_argc)
{
r_numdecals = Q_atoi(com_argv[i+1]);
Expand Down Expand Up @@ -389,7 +373,7 @@ void R_SpawnDecalBSP (vec3_t org, char *texname, int size)
if (!qmb_initialized)
return;

int tex = loadtextureimage(va("decals/%s",texname), 0, 0, qfalse, GU_LINEAR);
int tex = loadtextureimage(va("decals/%s",texname), 0, 0, qfalse, GU_LINEAR, 0);
if(!tex) //find in decals.wad
{
if(wadreload)
Expand Down
26 changes: 13 additions & 13 deletions source/psp/video_hardware_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ typedef struct
texel* vram;
} gltexture_t;

int loadtextureimage (char* filename, int matchwidth, int matchheight, qboolean complain, int filter);
int loadtextureimage (char* filename, int matchwidth, int matchheight, qboolean complain, int filter, int type);
void VID_SetPalette4(unsigned char* clut4pal);

#define MAX_GLTEXTURES 1024
Expand Down Expand Up @@ -363,7 +363,7 @@ qpic_t *Draw_CachePic (char *path)
// load the pic from disk
//

int index = loadtextureimage (str, 0, 0, qfalse, GU_LINEAR);
int index = loadtextureimage (str, 0, 0, qfalse, GU_LINEAR, 0);
if(index)
{
pic->pic.width = gltextures[index].original_width;
Expand Down Expand Up @@ -425,7 +425,7 @@ qpic_t *Draw_CacheImg (char *path)
// load the pic from disk
//

int index = loadtextureimage (path, 0, 0, qfalse, GU_LINEAR);
int index = loadtextureimage (path, 0, 0, qfalse, GU_LINEAR, 0);
if(index != -1)
{
pic->pic.width = gltextures[index].original_width;
Expand Down Expand Up @@ -531,11 +531,11 @@ void Draw_Init (void)
R_CreateDlightImage();

// now turn them into textures
char_texture = loadtextureimage ("gfx/charset", 0, 0, qfalse, GU_NEAREST);
char_texture = loadtextureimage ("gfx/charset", 0, 0, qfalse, GU_NEAREST, 0);
if (char_texture == 0)// did not find a matching TGA...
Sys_Error ("Could not load charset, make sure you have every folder and file installed properly\nDouble check that all of your files are in their correct places\nAnd that you have installed the game properly.\nRefer to the readme.txt file for help\n");

detail_texture = loadtextureimage ("gfx/detail", 0, 0, qfalse, GU_LINEAR);
detail_texture = loadtextureimage ("gfx/detail", 0, 0, qfalse, GU_LINEAR, 0);

if (detail_texture == 0)// did not find a matching TGA...
{
Expand All @@ -551,22 +551,22 @@ void Draw_Init (void)

sniper_scope = Draw_CachePic ("gfx/hud/scope_256");

zombie_skins[0][0] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR);
zombie_skins[0][0] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR, 1);


// PSP PHAT: Only have 1 Zombie skin.. this saves 192kB of VRAM, well worth it.

#ifdef SLIM

zombie_skins[0][1] = loadtextureimage ("models/ai/zfull.mdl_1", 0, 0, qtrue, GU_LINEAR);
zombie_skins[1][0] = loadtextureimage ("models/ai/zfull.mdl_2", 0, 0, qtrue, GU_LINEAR);
zombie_skins[1][1] = loadtextureimage ("models/ai/zfull.mdl_3", 0, 0, qtrue, GU_LINEAR);
zombie_skins[0][1] = loadtextureimage ("models/ai/zfull.mdl_1", 0, 0, qtrue, GU_LINEAR, 1);
zombie_skins[1][0] = loadtextureimage ("models/ai/zfull.mdl_2", 0, 0, qtrue, GU_LINEAR, 1);
zombie_skins[1][1] = loadtextureimage ("models/ai/zfull.mdl_3", 0, 0, qtrue, GU_LINEAR, 1);

#else

zombie_skins[0][1] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR);
zombie_skins[1][0] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR);
zombie_skins[1][1] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR);
zombie_skins[0][1] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR, 1);
zombie_skins[1][0] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR, 1);
zombie_skins[1][1] = loadtextureimage ("models/ai/zfull.mdl_0", 0, 0, qtrue, GU_LINEAR, 1);

#endif // SLIM

Expand Down Expand Up @@ -1006,7 +1006,7 @@ void Draw_LoadingFill(void)
switch(loading_step) {
case 1: text = "Loading Models.."; break;
case 2: text = "Loading World.."; break;
case 3: text = "Running Test Frame.."; break;
case 3: text = "Running Spawn Functions.."; break;
MotoLegacy marked this conversation as resolved.
Show resolved Hide resolved
case 4: text = "Loading Sounds.."; break;
default: text = "Initializing.."; break;
}
Expand Down
32 changes: 12 additions & 20 deletions source/psp/video_hardware_images.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ loadimagepixels
=============
*/
// HACK HACK HACK
byte* loadimagepixels (char* filename, qboolean complain, int matchwidth, int matchheight)
byte* loadimagepixels (char* filename, qboolean complain, int matchwidth, int matchheight, int type)
MotoLegacy marked this conversation as resolved.
Show resolved Hide resolved
{
FILE *f;
char basename[128], name[128];
Expand All @@ -1011,21 +1011,20 @@ byte* loadimagepixels (char* filename, qboolean complain, int matchwidth, int ma
}

com_netpath[0] = 0;
/*
sprintf (name, "%s.wal", basename);
if (data = LoadWAL(name))
return data;
*/

sprintf (name, "%s.tga", basename);
FS_FOpenFile (name, &f);
if (f)
return LoadTGA (f, matchwidth, matchheight);

sprintf (name, "%s.pcx", basename);
FS_FOpenFile (name, &f);
if (f)
return LoadPCX (f, matchwidth, matchheight);

// models only support loading PCX textures
if (type == 1)
return NULL;

sprintf (name, "%s.tga", basename);
FS_FOpenFile (name, &f);
if (f)
return LoadTGA (f, matchwidth, matchheight);

sprintf (name, "%s.jpg", basename);
FS_FOpenFile (name, &f);
Expand All @@ -1038,13 +1037,6 @@ byte* loadimagepixels (char* filename, qboolean complain, int matchwidth, int ma
if (f)
return LoadPNG (f, matchwidth, matchheight);

sprintf (name, "%s.bmp", basename);
FS_FOpenFile (name, &f);
if (f)
return LoadBMP (f, matchwidth, matchheight);
//if (complain)
// Con_Printf ("Couldn't load %s .tga .jpg .bmp .png \n", filename);

return NULL;
}

Expand All @@ -1054,13 +1046,13 @@ loadtextureimage
=============
*/

int loadtextureimage (char* filename, int matchwidth, int matchheight, qboolean complain, int filter)
int loadtextureimage (char* filename, int matchwidth, int matchheight, qboolean complain, int filter, int type)
{
int texture_index;
byte *data;

int hunk_start = Hunk_LowMark();
data = loadimagepixels (filename, complain, matchwidth, matchheight);
data = loadimagepixels (filename, complain, matchwidth, matchheight, type);
int hunk_stop = Hunk_LowMark();

if(!data)
Expand Down
14 changes: 7 additions & 7 deletions source/psp/video_hardware_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ R_InitOtherTextures
void R_InitOtherTextures (void)
{
//static decals
decal_blood1 = loadtextureimage ("textures/decals/blood_splat01", 0, 0, qfalse, GU_LINEAR);
decal_blood2 = loadtextureimage ("textures/decals/blood_splat02", 0, 0, qfalse, GU_LINEAR);
decal_blood3 = loadtextureimage ("textures/decals/blood_splat03", 0, 0, qfalse, GU_LINEAR);
decal_q3blood = loadtextureimage ("textures/decals/blood_stain", 0, 0, qfalse, GU_LINEAR);
decal_burn = loadtextureimage ("textures/decals/explo_burn01", 0, 0, qfalse, GU_LINEAR);
decal_mark = loadtextureimage ("textures/decals/particle_burn01", 0, 0, qfalse, GU_LINEAR);
decal_glow = loadtextureimage ("textures/decals/glow2", 0, 0, qfalse, GU_LINEAR);
decal_blood1 = loadtextureimage ("textures/decals/blood_splat01", 0, 0, qfalse, GU_LINEAR, 0);
decal_blood2 = loadtextureimage ("textures/decals/blood_splat02", 0, 0, qfalse, GU_LINEAR, 0);
decal_blood3 = loadtextureimage ("textures/decals/blood_splat03", 0, 0, qfalse, GU_LINEAR, 0);
decal_q3blood = loadtextureimage ("textures/decals/blood_stain", 0, 0, qfalse, GU_LINEAR, 0);
decal_burn = loadtextureimage ("textures/decals/explo_burn01", 0, 0, qfalse, GU_LINEAR, 0);
decal_mark = loadtextureimage ("textures/decals/particle_burn01", 0, 0, qfalse, GU_LINEAR, 0);
decal_glow = loadtextureimage ("textures/decals/glow2", 0, 0, qfalse, GU_LINEAR, 0);
}

/*
Expand Down
Loading
Loading