From 218ca90543758a20ac326e444ca0643174ca7384 Mon Sep 17 00:00:00 2001 From: Rebellion Developments Date: Thu, 16 Mar 2000 11:25:00 +0100 Subject: Import Aliens vs Predator - Gold (Build 116) Source code release, imported from: https://www.gamefront.com/games/aliens-vs-predator-3/file/avp-gold-complete-source-code All text files were converted to Unix format. --- 3dc/win95/VRAMTIME.C | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 3dc/win95/VRAMTIME.C (limited to '3dc/win95/VRAMTIME.C') diff --git a/3dc/win95/VRAMTIME.C b/3dc/win95/VRAMTIME.C new file mode 100644 index 0000000..a4fae03 --- /dev/null +++ b/3dc/win95/VRAMTIME.C @@ -0,0 +1,33 @@ +#include + +#include "vramtime.h" + +static DWORD transition_times_matrix[][VWS_MAXSTATES] = +{ +/* from DDRELEASE */ + { 0, 20, 0, 100, 100 }, +/* from D3DTEXRELEASE */ + { 20, 0, 100, 100, 100 }, +/* from DDCREATE */ + { 0, 100, 0, 20, 100 }, +/* from D3DTEXCREATE */ + { 20, 100, 20, 20, 100 }, +/* from UNKNOWN */ + { 100, 100, 100, 100, 100 } +}; + + +void WaitForVRamReady(VRAM_WAIT_STATE vws) +{ + static DWORD old_time = 0; + static VRAM_WAIT_STATE old_vws = VWS_UNKNOWN; + + DWORD new_time; + + if (0==old_time) old_time = timeGetTime(); + + do new_time = timeGetTime(); while (new_time - old_time < transition_times_matrix[old_vws][vws]); + + old_time = new_time; + old_vws = vws; +} -- cgit v1.3