From: MirceaKitsune Date: Sun, 26 Sep 2010 13:20:02 +0000 (+0300) Subject: First step toward implementing an artwork system; Draw a picture on the screen and... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d10de97b9c169bbd5f01beafbefc8c3ce8efc670;p=voretournament%2Fvoretournament.git First step toward implementing an artwork system; Draw a picture on the screen and detect if we won or lost. Don't use this yet, it just blocks your screen :P --- diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index 3da6dccd..7d803a60 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -251,6 +251,7 @@ float Sbar_WouldDrawScoreboard (); float view_set; float camera_mode; float chase_active_old; +string artwork_image; string NextFrameCommand; void CSQC_UpdateView(float w, float h) { @@ -259,6 +260,8 @@ void CSQC_UpdateView(float w, float h) float f, i, j; vector v, vo; + vector artwork_pos, artwork_size; + WaypointSprite_Load(); if(spectatee_status) @@ -675,6 +678,30 @@ void CSQC_UpdateView(float w, float h) } } + // Draw Artwork + if(intermission && !isdemo()) // match has ended + { + //if(getstati(STAT_WINNING)) + //localcmd("disconnect\n"); + + if(cvar("cl_artwork_stretch")) + { + artwork_size_x = vid_conwidth; + artwork_size_y = vid_conheight; + artwork_pos_x = 0; + artwork_pos_y = 0; + } + else + { + artwork_size_x = max(vid_conwidth, vid_conheight); + artwork_size_y = max(vid_conwidth, vid_conheight); + artwork_pos_x = (vid_conwidth - artwork_size_x) / 2; + artwork_pos_y = (vid_conheight - artwork_size_y) / 2; + } + + drawpic(artwork_pos, "gfx/hslimage", artwork_size, '1 1 1', 1, DRAWFLAG_NORMAL); + } + if(NextFrameCommand) { localcmd("\n", NextFrameCommand, "\n"); diff --git a/data/qcsrc/common/constants.qh b/data/qcsrc/common/constants.qh index ff54fb86..2f0d2ece 100644 --- a/data/qcsrc/common/constants.qh +++ b/data/qcsrc/common/constants.qh @@ -276,10 +276,11 @@ const float STAT_FUEL = 44; const float STAT_NB_METERSTART = 45; const float STAT_SHOTORG = 46; // compressShotOrigin const float STAT_LEADLIMIT = 47; -const float STAT_VORE_LOAD = 48; -const float STAT_VORE_DIGESTING = 49; -const float STAT_VORE_EATEN = 50; -const float STAT_VORE_CANLEAVE = 51; +const float STAT_WINNING = 48; +const float STAT_VORE_LOAD = 49; +const float STAT_VORE_DIGESTING = 50; +const float STAT_VORE_EATEN = 51; +const float STAT_VORE_CANLEAVE = 52; const float CTF_STATE_ATTACK = 1; const float CTF_STATE_DEFEND = 2; const float CTF_STATE_COMMANDER = 3; diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index e7df6cab..29d56e8e 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -654,6 +654,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_DAMAGE_FIRED, AS_INT, stat_fired); addstat(STAT_SHOTORG, AS_INT, stat_shotorg); addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit); + addstat(STAT_WINNING, AS_FLOAT, winning); addstat(STAT_VORE_LOAD, AS_INT, stat_stomachload); addstat(STAT_VORE_DIGESTING, AS_INT, stat_digesting); addstat(STAT_VORE_EATEN, AS_INT, stat_eaten);