char string[VM_STRINGTEMP_LENGTH];
VM_VarString(0, string, sizeof(string));
- Con_Printf("======%S ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+ Con_Printf("======%s ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
if(prog->self)
{
ed = PRVM_G_EDICT(prog->self->ofs);
PRVM_ED_Print(ed);
}
- PRVM_ERROR ("%s: Program error", PRVM_NAME);
+ PRVM_ERROR ("%s: Program error in function %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
}
/*
char string[VM_STRINGTEMP_LENGTH];
VM_VarString(0, string, sizeof(string));
- Con_Printf("======%s OBJECT ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+ Con_Printf("======OBJECT ERROR======\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
if(prog->self)
{
ed = PRVM_G_EDICT (prog->self->ofs);
else
// objerror has to display the object fields -> else call
PRVM_ERROR ("VM_objecterror: self not defined !");
+ Con_Printf("%s OBJECT ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
}
/*
*/
void VM_drawpic(void)
{
- const char *pic;
+ const char *picname;
float *size, *pos, *rgb;
int flag;
VM_SAFEPARMCOUNT(6,VM_drawpic);
- pic = PRVM_G_STRING(OFS_PARM1);
+ picname = PRVM_G_STRING(OFS_PARM1);
- if(!pic)
+ if(!picname)
{
Con_Printf("VM_drawpic: %s passed null picture name !\n", PRVM_NAME);
PRVM_G_FLOAT(OFS_RETURN) = -1;
return;
}
- VM_CheckEmptyString (pic);
+ VM_CheckEmptyString (picname);
// is pic cached ? no function yet for that
if(!1)
{
- Con_Printf("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, pic);
+ Con_Printf("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, picname);
PRVM_G_FLOAT(OFS_RETURN) = -4;
return;
}
if(pos[2] || size[2])
Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
- DrawQ_Pic(pos[0], pos[1], pic, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
+ DrawQ_Pic(pos[0], pos[1], Draw_CachePic(picname, true), size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
if(pos[2] || size[2])
Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
- DrawQ_Pic(pos[0], pos[1], 0, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
+ DrawQ_Pic(pos[0], pos[1], NULL, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
name = PRVM_G_STRING( OFS_PARM0 );
VM_CheckEmptyString( name );
- CL_CloseVideo( CL_GetVideo( name ) );
+ CL_CloseVideo( CL_GetVideoByName( name ) );
}
/*
state = (clvideostate_t)((int)PRVM_G_FLOAT( OFS_PARM1 ));
- video = CL_GetVideo( name );
+ video = CL_GetVideoByName( name );
if( video && state > CLVIDEO_UNUSED && state < CLVIDEO_STATECOUNT )
CL_SetVideoState( video, state );
}
name = PRVM_G_STRING( OFS_PARM0 );
VM_CheckEmptyString( name );
- video = CL_GetVideo( name );
+ video = CL_GetVideoByName( name );
if( video )
PRVM_G_FLOAT( OFS_RETURN ) = (int)video->state;
else
name = PRVM_G_STRING( OFS_PARM0 );
VM_CheckEmptyString( name );
- video = CL_GetVideo( name );
+ video = CL_GetVideoByName( name );
if( video )
CL_RestartVideo( video );
}
p = &vm_polygons[vm_drawpolygons_num];
picname = PRVM_G_STRING(OFS_PARM0);
if(picname[0])
- p->tex = Draw_CachePic(picname, false)->tex;
+ p->tex = Draw_CachePic(picname, true)->tex;
else
p->tex = r_texture_notexture;
p->flags = (unsigned char)PRVM_G_FLOAT(OFS_PARM1);