mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-29 23:22:01 +00:00
say hello to TEI_SHOWLMP2
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@95 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
4f6b0592b7
commit
cc9d8d71d8
5 changed files with 226 additions and 2 deletions
|
@ -312,6 +312,8 @@ void CL_SendConnectPacket (
|
|||
fteprotextsupported |= PEXT_HEXEN2;
|
||||
fteprotextsupported |= PEXT_CUSTOMTEMPEFFECTS;
|
||||
fteprotextsupported |= PEXT_256PACKETENTITIES;
|
||||
// fteprotextsupported |= PEXT_64PLAYERS;
|
||||
fteprotextsupported |= PEXT_SHOWPIC;
|
||||
|
||||
fteprotextsupported &= ftepext;
|
||||
|
||||
|
@ -681,6 +683,7 @@ void CL_ClearState (void)
|
|||
|
||||
CL_ClearTEnts ();
|
||||
CL_ClearCustomTEnts();
|
||||
SCR_ShowPic_Clear();
|
||||
|
||||
if (cl.playernum[0] == -1)
|
||||
{ //left over from q2 connect.
|
||||
|
|
|
@ -3622,6 +3622,19 @@ void CL_ParseServerMessage (void)
|
|||
CMQ2_SetAreaPortalState(i, j!=0);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case svc_showpic:
|
||||
SCR_ShowPic_Create();
|
||||
break;
|
||||
case svc_hidepic:
|
||||
SCR_ShowPic_Hide();
|
||||
break;
|
||||
case svc_movepic:
|
||||
SCR_ShowPic_Move();
|
||||
break;
|
||||
case svc_updatepic:
|
||||
SCR_ShowPic_Update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -302,6 +302,208 @@ extern qboolean sb_showscores;
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//TEI_SHOWLMP2 (not 3)
|
||||
//
|
||||
typedef struct showpic_s {
|
||||
struct showpic_s *next;
|
||||
qbyte zone;
|
||||
short x, y;
|
||||
char *name;
|
||||
char *picname;
|
||||
} showpic_t;
|
||||
showpic_t *showpics;
|
||||
|
||||
static void SP_RecalcXY ( float *xx, float *yy, int origin )
|
||||
{
|
||||
int midx, midy;
|
||||
float x,y;
|
||||
|
||||
x = xx[0];
|
||||
y = yy[0];
|
||||
|
||||
midy = vid.height * 0.5;// >>1
|
||||
midx = vid.width * 0.5;// >>1
|
||||
|
||||
// Tei - new showlmp
|
||||
switch ( origin )
|
||||
{
|
||||
case SL_ORG_NW:
|
||||
break;
|
||||
case SL_ORG_NE:
|
||||
x = vid.width - x;//Inv
|
||||
break;
|
||||
case SL_ORG_SW:
|
||||
y = vid.height - y;//Inv
|
||||
break;
|
||||
case SL_ORG_SE:
|
||||
y = vid.height - y;//inv
|
||||
x = vid.width - x;//Inv
|
||||
break;
|
||||
case SL_ORG_CC:
|
||||
y = midy + (y - 8000);//NegCoded
|
||||
x = midx + (x - 8000);//NegCoded
|
||||
break;
|
||||
case SL_ORG_CN:
|
||||
x = midx + (x - 8000);//NegCoded
|
||||
break;
|
||||
case SL_ORG_CS:
|
||||
x = midx + (x - 8000);//NegCoded
|
||||
y = vid.height - y;//Inverse
|
||||
break;
|
||||
case SL_ORG_CW:
|
||||
y = midy + (y - 8000);//NegCoded
|
||||
break;
|
||||
case SL_ORG_CE:
|
||||
y = midy + (y - 8000);//NegCoded
|
||||
x = vid.height - x; //Inverse
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
xx[0] = x;
|
||||
yy[0] = y;
|
||||
}
|
||||
void SCR_ShowPics_Draw(void)
|
||||
{
|
||||
float x, y;
|
||||
showpic_t *sp;
|
||||
qpic_t *p;
|
||||
for (sp = showpics; sp; sp = sp->next)
|
||||
{
|
||||
x = sp->x;
|
||||
y = sp->y;
|
||||
SP_RecalcXY(&x, &y, sp->zone);
|
||||
p = Draw_SafeCachePic(sp->picname);
|
||||
if (!*sp->picname)
|
||||
continue;
|
||||
if (!p)
|
||||
continue;
|
||||
Draw_Pic(x, y, p);
|
||||
}
|
||||
}
|
||||
|
||||
void SCR_ShowPic_Clear(void)
|
||||
{
|
||||
showpic_t *sp;
|
||||
while(sp = showpics)
|
||||
{
|
||||
showpics = sp->next;
|
||||
|
||||
Z_Free(sp->name);
|
||||
Z_Free(sp->picname);
|
||||
Z_Free(sp);
|
||||
}
|
||||
}
|
||||
|
||||
showpic_t *SCR_ShowPic_Find(char *name)
|
||||
{
|
||||
showpic_t *sp, *last;
|
||||
for (sp = showpics; sp; sp = sp->next)
|
||||
{
|
||||
if (!strcmp(sp->name, name))
|
||||
return sp;
|
||||
}
|
||||
|
||||
if (showpics)
|
||||
{
|
||||
for (last = showpics; last->next; last = last->next)
|
||||
;
|
||||
}
|
||||
else
|
||||
last = NULL;
|
||||
sp = Z_Malloc(sizeof(showpic_t));
|
||||
if (last)
|
||||
{
|
||||
last->next = sp;
|
||||
sp->next = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
sp->next = showpics;
|
||||
showpics = sp;
|
||||
}
|
||||
sp->name = Z_Malloc(strlen(name)+1);
|
||||
strcpy(sp->name, name);
|
||||
sp->picname = Z_Malloc(1);
|
||||
sp->x = 0;
|
||||
sp->y = 0;
|
||||
sp->zone = 0;
|
||||
|
||||
return sp;
|
||||
}
|
||||
|
||||
void SCR_ShowPic_Create(void)
|
||||
{
|
||||
int zone = MSG_ReadByte();
|
||||
showpic_t *sp;
|
||||
char *s;
|
||||
|
||||
sp = SCR_ShowPic_Find(MSG_ReadString());
|
||||
|
||||
s = MSG_ReadString();
|
||||
|
||||
Z_Free(sp->picname);
|
||||
sp->picname = Z_Malloc(strlen(s)+1);
|
||||
strcpy(sp->picname, s);
|
||||
sp->zone = zone;
|
||||
sp->x = MSG_ReadShort();
|
||||
sp->y = MSG_ReadShort();
|
||||
|
||||
CL_CheckOrDownloadFile(sp->picname, false);
|
||||
}
|
||||
|
||||
void SCR_ShowPic_Hide(void)
|
||||
{
|
||||
showpic_t *sp, *prev;
|
||||
|
||||
sp = SCR_ShowPic_Find(MSG_ReadString());
|
||||
|
||||
if (sp == showpics)
|
||||
showpics = sp->next;
|
||||
else
|
||||
{
|
||||
for (prev = showpics; prev->next != sp; prev = prev->next)
|
||||
;
|
||||
prev->next = sp->next;
|
||||
}
|
||||
|
||||
Z_Free(sp->name);
|
||||
Z_Free(sp->picname);
|
||||
Z_Free(sp);
|
||||
}
|
||||
|
||||
void SCR_ShowPic_Move(void)
|
||||
{
|
||||
int zone = MSG_ReadByte();
|
||||
showpic_t *sp;
|
||||
|
||||
sp = SCR_ShowPic_Find(MSG_ReadString());
|
||||
|
||||
sp->zone = zone;
|
||||
sp->x = MSG_ReadShort();
|
||||
sp->y = MSG_ReadShort();
|
||||
}
|
||||
|
||||
void SCR_ShowPic_Update(void)
|
||||
{
|
||||
int zone = MSG_ReadByte();
|
||||
showpic_t *sp;
|
||||
char *s;
|
||||
|
||||
sp = SCR_ShowPic_Find(MSG_ReadString());
|
||||
|
||||
s = MSG_ReadString();
|
||||
|
||||
Z_Free(sp->picname);
|
||||
sp->picname = Z_Malloc(strlen(s)+1);
|
||||
strcpy(sp->picname, s);
|
||||
|
||||
CL_CheckOrDownloadFile(sp->picname, false);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
/*
|
||||
|
|
|
@ -177,6 +177,7 @@ void GLSCR_UpdateScreen (void)
|
|||
if (scr_drawdialog)
|
||||
{
|
||||
Sbar_Draw ();
|
||||
SCR_ShowPics_Draw();
|
||||
Draw_FadeScreen ();
|
||||
SCR_DrawNotifyString ();
|
||||
scr_copyeverything = true;
|
||||
|
@ -185,6 +186,7 @@ void GLSCR_UpdateScreen (void)
|
|||
{
|
||||
SCR_DrawLoading ();
|
||||
Sbar_Draw ();
|
||||
SCR_ShowPics_Draw();
|
||||
}
|
||||
else if (cl.intermission == 1 && key_dest == key_game)
|
||||
{
|
||||
|
@ -205,8 +207,9 @@ void GLSCR_UpdateScreen (void)
|
|||
SCR_DrawFPS ();
|
||||
SCR_DrawTurtle ();
|
||||
SCR_DrawPause ();
|
||||
SCR_CheckDrawCenterString ();
|
||||
Sbar_Draw ();
|
||||
SCR_ShowPics_Draw();
|
||||
SCR_CheckDrawCenterString ();
|
||||
glTexEnvi ( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
|
||||
#ifdef TEXTEDITOR
|
||||
if (editoractive)
|
||||
|
|
|
@ -161,10 +161,12 @@ void SWSCR_UpdateScreen (void)
|
|||
{
|
||||
SCR_DrawLoading ();
|
||||
Sbar_Draw ();
|
||||
SCR_ShowPics_Draw();
|
||||
}
|
||||
else if (scr_drawdialog)
|
||||
{
|
||||
Sbar_Draw ();
|
||||
SCR_ShowPics_Draw();
|
||||
Draw_FadeScreen ();
|
||||
SCR_DrawNotifyString ();
|
||||
scr_copyeverything = true;
|
||||
|
@ -187,8 +189,9 @@ void SWSCR_UpdateScreen (void)
|
|||
SCR_DrawTurtle ();
|
||||
SCR_DrawPause ();
|
||||
SCR_DrawFPS ();
|
||||
SCR_CheckDrawCenterString ();
|
||||
Sbar_Draw ();
|
||||
SCR_ShowPics_Draw();
|
||||
SCR_CheckDrawCenterString ();
|
||||
#ifdef TEXTEDITOR
|
||||
if (editoractive)
|
||||
Editor_Draw();
|
||||
|
|
Loading…
Reference in a new issue