mirror of
https://github.com/nzp-team/glquake.git
synced 2024-11-22 03:51:04 +00:00
Increase model brightness again, add waypoint loading
This commit is contained in:
parent
61bdecc763
commit
e310a7be26
4 changed files with 98 additions and 3 deletions
BIN
nzportable.3dsx
BIN
nzportable.3dsx
Binary file not shown.
BIN
nzportable.elf
BIN
nzportable.elf
Binary file not shown.
|
@ -755,9 +755,9 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
//Shpuld
|
//Shpuld
|
||||||
if(r_model_brightness.value)
|
if(r_model_brightness.value)
|
||||||
{
|
{
|
||||||
lightcolor[0] += 32;
|
lightcolor[0] += 48;
|
||||||
lightcolor[1] += 32;
|
lightcolor[1] += 48;
|
||||||
lightcolor[2] += 32;
|
lightcolor[2] += 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
glPushMatrix ();
|
glPushMatrix ();
|
||||||
|
|
|
@ -1123,6 +1123,7 @@ This is called at the start of each level
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
extern float scr_centertime_off;
|
extern float scr_centertime_off;
|
||||||
|
void Load_Waypoint ();
|
||||||
|
|
||||||
#ifdef QUAKE2
|
#ifdef QUAKE2
|
||||||
void SV_SpawnServer (char *server, char *startspot)
|
void SV_SpawnServer (char *server, char *startspot)
|
||||||
|
@ -1278,12 +1279,106 @@ void SV_SpawnServer (char *server)
|
||||||
if (host_client->active)
|
if (host_client->active)
|
||||||
SV_SendServerinfo (host_client);
|
SV_SendServerinfo (host_client);
|
||||||
|
|
||||||
|
Load_Waypoint ();
|
||||||
Con_DPrintf ("Server spawned.\n");
|
Con_DPrintf ("Server spawned.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//ZOMBIE AI THINGS BELOVE THIS!!!
|
//ZOMBIE AI THINGS BELOVE THIS!!!
|
||||||
#define W_MAX_TEMPSTRING 2048
|
#define W_MAX_TEMPSTRING 2048
|
||||||
char *w_string_temp;
|
char *w_string_temp;
|
||||||
|
int W_fopen (void)
|
||||||
|
{
|
||||||
|
int h = 0;
|
||||||
|
|
||||||
|
Con_DPrintf("Loading waypoint file %s\n", va("%s/maps/%s.way",com_gamedir, sv.name));
|
||||||
|
|
||||||
|
Sys_FileOpenRead (va("%s/maps/%s.way",com_gamedir, sv.name), &h);
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
void W_fclose (int h)
|
||||||
|
{
|
||||||
|
Sys_FileClose(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *W_fgets (int h)
|
||||||
|
{
|
||||||
|
// reads one line (up to a \n) into a string
|
||||||
|
int i;
|
||||||
|
int count;
|
||||||
|
char buffer;
|
||||||
|
|
||||||
|
count = Sys_FileRead(h, &buffer, 1);
|
||||||
|
if (count && buffer == '\r') // carriage return
|
||||||
|
{
|
||||||
|
count = Sys_FileRead(h, &buffer, 1); // skip
|
||||||
|
}
|
||||||
|
if (!count) // EndOfFile
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while (count && buffer != '\n')
|
||||||
|
{
|
||||||
|
if (i < 128-1) // no place for character in temp string
|
||||||
|
{
|
||||||
|
w_string_temp[i++] = buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
// read next character
|
||||||
|
count = Sys_FileRead(h, &buffer, 1);
|
||||||
|
if (count && buffer == '\r') // carriage return
|
||||||
|
{
|
||||||
|
count = Sys_FileRead(h, &buffer, 1); // skip
|
||||||
|
}
|
||||||
|
};
|
||||||
|
w_string_temp[i] = 0;
|
||||||
|
|
||||||
|
return (w_string_temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *W_substring (char *p, int offset, int length)
|
||||||
|
{
|
||||||
|
int maxoffset; // 2001-10-25 Enhanced temp string handling by Maddes
|
||||||
|
|
||||||
|
// cap values
|
||||||
|
maxoffset = strlen(p);
|
||||||
|
if (offset > maxoffset)
|
||||||
|
{
|
||||||
|
offset = maxoffset;
|
||||||
|
}
|
||||||
|
if (offset < 0)
|
||||||
|
offset = 0;
|
||||||
|
// 2001-10-25 Enhanced temp string handling by Maddes start
|
||||||
|
if (length >= maxoffset)
|
||||||
|
length = maxoffset-1;
|
||||||
|
// 2001-10-25 Enhanced temp string handling by Maddes end
|
||||||
|
if (length < 0)
|
||||||
|
length = 0;
|
||||||
|
|
||||||
|
p += offset;
|
||||||
|
strncpy(w_string_temp, p, length);
|
||||||
|
w_string_temp[length]=0;
|
||||||
|
|
||||||
|
return w_string_temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void W_stov (char *v, vec3_t out)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
vec3_t d;
|
||||||
|
|
||||||
|
for (i=0; i<3; i++)
|
||||||
|
{
|
||||||
|
while(v && (v[0] == ' ' || v[0] == '\'')) //skip unneeded data
|
||||||
|
v++;
|
||||||
|
d[i] = atof(v);
|
||||||
|
while (v && v[0] != ' ') // skip to next space
|
||||||
|
v++;
|
||||||
|
}
|
||||||
|
VectorCopy (d, out);
|
||||||
|
}
|
||||||
|
|
||||||
waypoint_ai waypoints[MAX_WAYPOINTS];
|
waypoint_ai waypoints[MAX_WAYPOINTS];
|
||||||
void Load_Waypoint ()
|
void Load_Waypoint ()
|
||||||
|
|
Loading…
Reference in a new issue