mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-06 19:01:04 +03:00
Allow precaching image manually with r_precacheimages
This commit is contained in:
parent
d22dea5e8e
commit
7b59f07181
3 changed files with 16 additions and 6 deletions
|
@ -1294,7 +1294,7 @@ was there. This is used to test for texture thrashing.
|
|||
Also called by RE_EndRegistration
|
||||
===============
|
||||
*/
|
||||
void RB_ShowImages( void ) {
|
||||
void RB_ShowImages( qboolean quiet ) {
|
||||
int i;
|
||||
image_t *image;
|
||||
float x, y, w, h;
|
||||
|
@ -1340,8 +1340,10 @@ void RB_ShowImages( void ) {
|
|||
qglFinish();
|
||||
|
||||
end = ri.Milliseconds();
|
||||
ri.Printf( PRINT_ALL, "%i msec to draw all images\n", end - start );
|
||||
|
||||
if (!quiet) {
|
||||
ri.Printf(PRINT_ALL, "%i msec to draw all images\n", end - start);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1361,7 +1363,7 @@ const void *RB_SwapBuffers( const void *data ) {
|
|||
|
||||
// texture swapping test
|
||||
if ( r_showImages->integer ) {
|
||||
RB_ShowImages();
|
||||
RB_ShowImages(qfalse);
|
||||
}
|
||||
|
||||
cmd = (const swapBuffersCommand_t *)data;
|
||||
|
|
|
@ -1602,8 +1602,16 @@ Touch all images to make sure they are resident
|
|||
*/
|
||||
void RE_EndRegistration( void ) {
|
||||
R_SyncRenderThread();
|
||||
if (!Sys_LowPhysicalMemory()) {
|
||||
RB_ShowImages();
|
||||
if (r_precacheimages->integer) {
|
||||
int start, end;
|
||||
|
||||
start = Sys_Milliseconds();
|
||||
|
||||
RB_ShowImages(qtrue);
|
||||
|
||||
end = Sys_Milliseconds();
|
||||
|
||||
Com_Printf("RB_ShowImages: %5.2f seconds\n", (float)((end - start) / 1000.f));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1902,7 +1902,7 @@ void RB_StageIteratorLightmappedMultitextureUnfogged( void );
|
|||
void RB_AddQuadStamp( vec3_t origin, vec3_t left, vec3_t up, byte *color );
|
||||
void RB_AddQuadStampExt( vec3_t origin, vec3_t left, vec3_t up, byte *color, float s1, float t1, float s2, float t2 );
|
||||
|
||||
void RB_ShowImages( void );
|
||||
void RB_ShowImages( qboolean quiet );
|
||||
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue