This is fun.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1924 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6b2b084b76
commit
1730d4dc81
11 changed files with 188 additions and 110 deletions
|
@ -1227,7 +1227,9 @@ void CL_RotateAroundTag(entity_t *ent, int num, int tagent, int tagnum)
|
|||
|
||||
if (ang)
|
||||
{
|
||||
ang[0]*=-1;
|
||||
AngleVectors(ang, axis[0], axis[1], axis[2]);
|
||||
ang[0]*=-1;
|
||||
VectorInverse(axis[1]);
|
||||
|
||||
frame2ness = CL_EntLerpFactor(tagent);
|
||||
|
@ -1277,8 +1279,46 @@ void CL_RotateAroundTag(entity_t *ent, int num, int tagent, int tagnum)
|
|||
}
|
||||
else //hrm.
|
||||
{
|
||||
memcpy(ent->axis, axis, sizeof(temp));
|
||||
VectorCopy(org, ent->origin);
|
||||
old[0] = ent->axis[0][0];
|
||||
old[1] = ent->axis[1][0];
|
||||
old[2] = ent->axis[2][0];
|
||||
old[3] = ent->origin[0];
|
||||
old[4] = ent->axis[0][1];
|
||||
old[5] = ent->axis[1][1];
|
||||
old[6] = ent->axis[2][1];
|
||||
old[7] = ent->origin[1];
|
||||
old[8] = ent->axis[0][2];
|
||||
old[9] = ent->axis[1][2];
|
||||
old[10] = ent->axis[2][2];
|
||||
old[11] = ent->origin[2];
|
||||
|
||||
parent[0] = axis[0][0];
|
||||
parent[1] = axis[1][0];
|
||||
parent[2] = axis[2][0];
|
||||
parent[3] = org[0];
|
||||
parent[4] = axis[0][1];
|
||||
parent[5] = axis[1][1];
|
||||
parent[6] = axis[2][1];
|
||||
parent[7] = org[1];
|
||||
parent[8] = axis[0][2];
|
||||
parent[9] = axis[1][2];
|
||||
parent[10] = axis[2][2];
|
||||
parent[11] = org[2];
|
||||
|
||||
R_ConcatTransforms((void*)old, (void*)parent, (void*)result);
|
||||
|
||||
ent->axis[0][0] = result[0];
|
||||
ent->axis[1][0] = result[1];
|
||||
ent->axis[2][0] = result[2];
|
||||
ent->origin[0] = result[3];
|
||||
ent->axis[0][1] = result[4];
|
||||
ent->axis[1][1] = result[5];
|
||||
ent->axis[2][1] = result[6];
|
||||
ent->origin[1] = result[7];
|
||||
ent->axis[0][2] = result[8];
|
||||
ent->axis[1][2] = result[9];
|
||||
ent->axis[2][2] = result[10];
|
||||
ent->origin[2] = result[11];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -391,10 +391,7 @@ Interactive line editing and console scrollback
|
|||
*/
|
||||
void Key_Console (int key)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
HANDLE th;
|
||||
char *clipText;
|
||||
#endif
|
||||
|
||||
if (con_current->redirect)
|
||||
{
|
||||
|
@ -427,7 +424,7 @@ void Key_Console (int key)
|
|||
|
||||
if (key == K_SPACE && con_current->commandcompletion)
|
||||
{
|
||||
if (keydown[K_SHIFT] && Cmd_CompleteCommand(key_lines[edit_line]+1, true, true, con_current->commandcompletion))
|
||||
if (keydown[K_CTRL] && Cmd_CompleteCommand(key_lines[edit_line]+1, true, true, con_current->commandcompletion))
|
||||
{
|
||||
CompleteCommand (true);
|
||||
return;
|
||||
|
@ -547,27 +544,34 @@ void Key_Console (int key)
|
|||
|
||||
if (key == K_HOME)
|
||||
{
|
||||
if (keydown[K_CTRL])
|
||||
con_current->display = con_current->current - con_current->totallines + 10;
|
||||
else
|
||||
key_linepos = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (key == K_END)
|
||||
{
|
||||
if (keydown[K_CTRL])
|
||||
con_current->display = con_current->current;
|
||||
else
|
||||
key_linepos = strlen(key_lines[edit_line]);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if (((key=='V' || key=='v') && keydown[K_CTRL]) || keydown[K_SHIFT] && key == K_INS)
|
||||
if (((key=='C' || key=='c') && keydown[K_CTRL]) || (keydown[K_CTRL] && key == K_INS))
|
||||
{
|
||||
if (OpenClipboard(NULL))
|
||||
Sys_SaveClipboard(key_lines[edit_line]+1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (((key=='V' || key=='v') && keydown[K_CTRL]) || (keydown[K_SHIFT] && key == K_INS))
|
||||
{
|
||||
th = GetClipboardData(CF_TEXT);
|
||||
if (th)
|
||||
{
|
||||
clipText = GlobalLock(th);
|
||||
clipText = Sys_GetClipboard();
|
||||
if (clipText)
|
||||
{
|
||||
int i;
|
||||
int len;
|
||||
len = strlen(clipText);
|
||||
if (len + strlen(key_lines[edit_line]) > MAXCMDLINE - 1)
|
||||
|
@ -577,17 +581,19 @@ void Key_Console (int key)
|
|||
memmove (key_lines[edit_line] + key_linepos + len,
|
||||
key_lines[edit_line] + key_linepos, strlen(key_lines[edit_line]) - key_linepos + 1);
|
||||
memcpy (key_lines[edit_line] + key_linepos, clipText, len);
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (key_lines[edit_line][key_linepos+i] == '\r')
|
||||
key_lines[edit_line][key_linepos+i] = ' ';
|
||||
else if (key_lines[edit_line][key_linepos+i] == '\n')
|
||||
key_lines[edit_line][key_linepos+i] = ';';
|
||||
}
|
||||
key_linepos += len;
|
||||
}
|
||||
Sys_CloseClipboard(clipText);
|
||||
}
|
||||
GlobalUnlock(th);
|
||||
}
|
||||
CloseClipboard();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (key < 32 || key > 127)
|
||||
return; // non printable
|
||||
|
|
|
@ -399,10 +399,10 @@ void M_AddItemsToDownloadMenu(menu_t *m)
|
|||
int prefixlen;
|
||||
p = availablepackages;
|
||||
|
||||
MC_AddWhiteText(m, 4, 40, "W H (want, have)", false);
|
||||
MC_AddRedText(m, 4, 40, "W H (want, have)", false);
|
||||
|
||||
prefixlen = strlen(info->pathprefix);
|
||||
y = 48;
|
||||
y = 48+4;
|
||||
for (p = availablepackages; p; p = p->next)
|
||||
{
|
||||
if (strncmp(p->fullname, info->pathprefix, prefixlen))
|
||||
|
@ -421,7 +421,7 @@ void M_AddItemsToDownloadMenu(menu_t *m)
|
|||
break;
|
||||
if (!mo)
|
||||
{
|
||||
MC_AddConsoleCommand(m, 5*8, y, path+prefixlen, va("menu_download \"%s/\"", path));
|
||||
MC_AddConsoleCommand(m, 6*8, y, path+prefixlen, va("menu_download \"%s/\"", path));
|
||||
y += 8;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ cvar_t r_stainfadeammount = {"r_stainfadeammount", "1"};
|
|||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","1"};
|
||||
cvar_t vid_wait = {"vid_wait","0"};
|
||||
cvar_t _vid_wait_override = {"_vid_wait_override", "0", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH};
|
||||
cvar_t _vid_wait_override = {"_vid_wait_override", "", NULL, CVAR_ARCHIVE};
|
||||
|
||||
static cvar_t vid_stretch = {"vid_stretch","1", NULL, CVAR_ARCHIVE|CVAR_RENDERERLATCH};
|
||||
//cvar_t _windowed_mouse = {"_windowed_mouse","1", CVAR_ARCHIVE};
|
||||
|
@ -452,6 +452,7 @@ void Renderer_Init(void)
|
|||
|
||||
//but register ALL vid_ commands.
|
||||
Cvar_Register (&vid_wait, VIDCOMMANDGROUP);
|
||||
_vid_wait_override.name2 = "vid_vsync";
|
||||
Cvar_Register (&_vid_wait_override, VIDCOMMANDGROUP);
|
||||
Cvar_Register (&vid_stretch, VIDCOMMANDGROUP);
|
||||
Cvar_Register (&_windowed_mouse, VIDCOMMANDGROUP);
|
||||
|
|
|
@ -478,7 +478,9 @@ static int DSOUND_GetDMAPos(soundcardinfo_t *sc)
|
|||
|
||||
s >>= (sc->sn.samplebits/8) - 1;
|
||||
|
||||
// s = (s/shm->numchannels % (shm->samples-1))*shm->numchannels;
|
||||
s &= (sc->sn.samples) - 1;
|
||||
|
||||
// s = (s/sc->sn.numchannels % (sc->sn.samples-1));
|
||||
|
||||
return s;
|
||||
}
|
||||
|
@ -707,7 +709,7 @@ int DSOUND_InitCard (soundcardinfo_t *sc, int cardnum)
|
|||
// create the secondary buffer we'll actually work with
|
||||
memset (&dsbuf, 0, sizeof(dsbuf));
|
||||
dsbuf.dwSize = sizeof(DSBUFFERDESC);
|
||||
dsbuf.dwFlags = DSBCAPS_CTRLFREQUENCY; //dmw 29 may, 2003 removed locsoftware
|
||||
dsbuf.dwFlags = DSBCAPS_CTRLFREQUENCY|DSBCAPS_LOCSOFTWARE; //dmw 29 may, 2003 removed locsoftware
|
||||
if (snd_inactive.value)
|
||||
{
|
||||
dsbuf.dwFlags |= DSBCAPS_GLOBALFOCUS;
|
||||
|
|
|
@ -594,25 +594,6 @@ void S_Init (void)
|
|||
|
||||
// create a piece of DMA memory
|
||||
|
||||
/* if (fakedma)
|
||||
{
|
||||
cursndcard = Z_Malloc(sizeof(*sndcardinfo));
|
||||
cursndcard->next = sndcardinfo;
|
||||
sndcardinfo = cursndcard;
|
||||
|
||||
shm = (void *) Hunk_AllocName(sizeof(*shm), "shm");
|
||||
shm->splitbuffer = 0;
|
||||
shm->samplebits = 16;
|
||||
shm->speed = 22050;
|
||||
shm->numchannels = 2;
|
||||
shm->samples = 44100;
|
||||
shm->samplepos = 0;
|
||||
shm->soundalive = true;
|
||||
shm->gamealive = true;
|
||||
shm->submission_chunk = 1;
|
||||
shm->buffer = Hunk_AllocName(1<<16, "shmbuf");
|
||||
}
|
||||
*/
|
||||
if (sndcardinfo)
|
||||
Con_SafePrintf ("Sound sampling rate: %i\n", sndcardinfo->sn.speed);
|
||||
|
||||
|
@ -1000,11 +981,8 @@ void S_ClearBuffer (soundcardinfo_t *sc)
|
|||
void *buffer;
|
||||
|
||||
int clear;
|
||||
//#if defined(_WIN32) && !defined(NODIRECTX)
|
||||
// if (!sound_started || (!sc->sn.buffer && !sc->pDSBuf))
|
||||
//#else
|
||||
|
||||
if (!sound_started || !sc->sn.buffer)
|
||||
//#endif
|
||||
return;
|
||||
|
||||
if (sc->sn.samplebits == 8)
|
||||
|
@ -1018,45 +996,6 @@ void S_ClearBuffer (soundcardinfo_t *sc)
|
|||
Q_memset(sc->sn.buffer, clear, sc->sn.samples * sc->sn.samplebits/8);
|
||||
sc->Unlock(sc, buffer);
|
||||
}
|
||||
/*
|
||||
#if defined(_WIN32) && !defined(NODIRECTX)
|
||||
if (sc->pDSBuf)
|
||||
{
|
||||
DWORD dwSize;
|
||||
DWORD *pData;
|
||||
int reps;
|
||||
HRESULT hresult;
|
||||
|
||||
reps = 0;
|
||||
|
||||
while ((hresult = sc->pDSBuf->lpVtbl->Lock(sc->pDSBuf, 0, sc->gSndBufSize, (void**)&pData, &dwSize, NULL, NULL, 0)) != DS_OK)
|
||||
{
|
||||
if (hresult != DSERR_BUFFERLOST)
|
||||
{
|
||||
Con_Printf ("S_ClearBuffer: DS::Lock Sound Buffer Failed\n");
|
||||
S_ShutdownCard (sc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (++reps > 10000)
|
||||
{
|
||||
Con_Printf ("S_ClearBuffer: DS: couldn't restore buffer\n");
|
||||
S_ShutdownCard (sc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Q_memset(pData, clear, sc->sn.samples * sc->sn.samplebits/8);
|
||||
|
||||
sc->pDSBuf->lpVtbl->Unlock(sc->pDSBuf, pData, dwSize, NULL, 0);
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Q_memset(sc->sn.buffer, clear, sc->sn.samples * sc->sn.samplebits/8);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -190,7 +190,7 @@ S_LoadSound_t AudioInputPlugins[8] =
|
|||
S_LoadWavSound
|
||||
|
||||
#ifdef AVAIL_OGGVORBIS
|
||||
// , S_LoadOVSound
|
||||
, S_LoadOVSound
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -476,3 +476,15 @@ void Sys_ServerActivity(void)
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *Sys_GetClipboard(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
void Sys_CloseClipboard(char *bf)
|
||||
{
|
||||
}
|
||||
void Sys_SaveClipboard(char *text)
|
||||
{
|
||||
}
|
|
@ -303,3 +303,16 @@ void Sys_LowFPPrecision(void)
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
char *Sys_GetClipboard(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
void Sys_CloseClipboard(char *bf)
|
||||
{
|
||||
}
|
||||
void Sys_SaveClipboard(char *text)
|
||||
{
|
||||
}
|
|
@ -737,11 +737,72 @@ double Sys_DoubleTime (void)
|
|||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
//clipboard
|
||||
HANDLE clipboardhandle;
|
||||
char *Sys_GetClipboard(void)
|
||||
{
|
||||
char *clipText;
|
||||
if (OpenClipboard(NULL))
|
||||
{
|
||||
clipboardhandle = GetClipboardData(CF_TEXT);
|
||||
if (clipboardhandle)
|
||||
{
|
||||
clipText = GlobalLock(clipboardhandle);
|
||||
if (clipText)
|
||||
return clipText;
|
||||
|
||||
//failed at the last hurdle
|
||||
|
||||
GlobalUnlock(clipboardhandle);
|
||||
}
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
clipboardhandle = NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
void Sys_CloseClipboard(char *bf)
|
||||
{
|
||||
if (clipboardhandle)
|
||||
{
|
||||
GlobalUnlock(clipboardhandle);
|
||||
CloseClipboard();
|
||||
clipboardhandle = NULL;
|
||||
}
|
||||
}
|
||||
void Sys_SaveClipboard(char *text)
|
||||
{
|
||||
HANDLE glob;
|
||||
char *temp;
|
||||
if (!OpenClipboard(NULL))
|
||||
return;
|
||||
EmptyClipboard();
|
||||
|
||||
glob = GlobalAlloc(GMEM_MOVEABLE, strlen(text) + 1);
|
||||
if (glob == NULL)
|
||||
{
|
||||
CloseClipboard();
|
||||
return;
|
||||
}
|
||||
|
||||
temp = GlobalLock(glob);
|
||||
if (temp != NULL)
|
||||
{
|
||||
strcpy(temp, text);
|
||||
GlobalUnlock(glob);
|
||||
SetClipboardData(CF_TEXT, glob);
|
||||
}
|
||||
else
|
||||
GlobalFree(glob);
|
||||
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//end of clipboard
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -60,6 +60,10 @@ double Sys_DoubleTime (void);
|
|||
|
||||
char *Sys_ConsoleInput (void);
|
||||
|
||||
char *Sys_GetClipboard(void); //A stub would return NULL
|
||||
void Sys_CloseClipboard(char *buf); //a stub would do nothing
|
||||
void Sys_SaveClipboard(char *text); //a stub would do nothing.
|
||||
|
||||
//stuff for dynamic dedicated console -> gfx and back.
|
||||
void Sys_CloseTerminal (void);
|
||||
qboolean Sys_InitTerminal (void);
|
||||
|
|
Loading…
Reference in a new issue