Add precache_cubemap() to src/client/defs.h
This commit is contained in:
parent
8ba5bc56d2
commit
2a86794d67
3 changed files with 19 additions and 8 deletions
|
@ -78,7 +78,7 @@ Weapons_Init(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
for (int i = 0; i < g_weapons.length; i++)
|
||||
print(sprintf("Weapon-Weight order: %s, %i\n", g_weapons[g_weapon_weights[i]].name, i));
|
||||
#endif
|
||||
|
|
|
@ -104,6 +104,17 @@ void drawrect(vector pos, vector sz, float thickness, vector rgb, float al, opti
|
|||
drawfill(pos + [sz[0] - thickness, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl);
|
||||
}
|
||||
|
||||
void
|
||||
precache_cubemap(string path)
|
||||
{
|
||||
precache_pic(strcat(path, "_bk"));
|
||||
precache_pic(strcat(path, "_dn"));
|
||||
precache_pic(strcat(path, "_ft"));
|
||||
precache_pic(strcat(path, "_lf"));
|
||||
precache_pic(strcat(path, "_rt"));
|
||||
precache_pic(strcat(path, "_up"));
|
||||
}
|
||||
|
||||
struct
|
||||
{
|
||||
/* viewmodel stuff */
|
||||
|
|
|
@ -274,7 +274,7 @@ Sound_Precache(string shader)
|
|||
}
|
||||
|
||||
void
|
||||
Sound_Distance(string shader)
|
||||
Sound_Distance(entity target, string shader)
|
||||
{
|
||||
int r;
|
||||
float volume;
|
||||
|
@ -329,8 +329,8 @@ Sound_Distance(string shader)
|
|||
#endif
|
||||
|
||||
sound(
|
||||
world,
|
||||
CHAN_AUTO,
|
||||
target,
|
||||
5,
|
||||
argv(r),
|
||||
volume,
|
||||
ATTN_NONE,
|
||||
|
@ -437,10 +437,6 @@ Sound_Play(entity target, int chan, string shader)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (g_sounds[sample].distshader) {
|
||||
Sound_Distance(g_sounds[sample].distshader);
|
||||
}
|
||||
|
||||
sound(
|
||||
target,
|
||||
chan,
|
||||
|
@ -451,6 +447,10 @@ Sound_Play(entity target, int chan, string shader)
|
|||
flag,
|
||||
g_sounds[sample].offset
|
||||
);
|
||||
|
||||
if (g_sounds[sample].distshader) {
|
||||
Sound_Distance(target, g_sounds[sample].distshader);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue