autodownload update
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7389 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -1045,7 +1045,7 @@ int downloadpackages()
|
||||
|
||||
bool requirepackage(int type, const char *path)
|
||||
{
|
||||
if(!havecurl || canceldownloads || !autodownload || type < 0 || type >= PCK_NUM || pendingpackages.access(path)) return false;
|
||||
if(!havecurl || canceldownloads || type < 0 || type >= PCK_NUM || pendingpackages.access(path)) return false;
|
||||
|
||||
package *pck = new package;
|
||||
pck->name = unixpath(newstring(path));
|
||||
|
||||
@@ -1111,7 +1111,10 @@ void showmapstats()
|
||||
}
|
||||
COMMAND(showmapstats, "");
|
||||
|
||||
VARP(showmodedescriptions, 0, 1, 1);extern bool canceldownloads;void startmap(const char *name, bool reset) // called just after a map load
|
||||
VARP(showmodedescriptions, 0, 1, 1);
|
||||
extern bool canceldownloads;
|
||||
|
||||
void startmap(const char *name, bool reset) // called just after a map load
|
||||
{
|
||||
canceldownloads = false;
|
||||
copystring(clientmap, name);
|
||||
|
||||
@@ -327,6 +327,7 @@ static inline Texture *lookupworldtexture(int tex, bool trydl = true)
|
||||
extern float skyfloor;
|
||||
extern void draw_envbox(int fogdist);
|
||||
|
||||
extern int autodownload;
|
||||
extern void setupcurl();
|
||||
extern bool requirepackage(int type, const char *path);
|
||||
extern int downloadpackages();
|
||||
|
||||
@@ -565,12 +565,12 @@ void loadsky(char *basename, bool reload)
|
||||
{
|
||||
defformatstring(name)("packages/%s_%s.jpg", basename, side[i]);
|
||||
sky[i] = textureload(name, 3);
|
||||
if(sky[i] == notexture && !reload)
|
||||
if(sky[i] == notexture && !reload && autodownload)
|
||||
{
|
||||
defformatstring(dl)("packages/%s", basename);
|
||||
requirepackage(PCK_SKYBOX, dl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -511,19 +511,19 @@ bool load_world(char *mname) // still supports all map formats that have
|
||||
c2skeepalive();
|
||||
|
||||
watch.start();
|
||||
loopi(256) if(texuse[i]) lookupworldtexture(i, true);
|
||||
loopi(256) if(texuse[i]) lookupworldtexture(i, autodownload ? true : false);
|
||||
int texloadtime = watch.stop();
|
||||
|
||||
c2skeepalive();
|
||||
|
||||
watch.start();
|
||||
preload_mapmodels(true);
|
||||
preload_mapmodels(autodownload ? true : false);
|
||||
int mdlloadtime = watch.stop();
|
||||
|
||||
c2skeepalive();
|
||||
|
||||
watch.start();
|
||||
audiomgr.preloadmapsounds(true);
|
||||
audiomgr.preloadmapsounds(autodownload ? true : false);
|
||||
int audioloadtime = watch.stop();
|
||||
|
||||
c2skeepalive();
|
||||
|
||||
Reference in New Issue
Block a user