Compare commits
23 Commits
eb6b127d9c
...
1f9f3635f0
Author | SHA1 | Date |
---|---|---|
Daniel Svensson | 1f9f3635f0 | |
RandomBrushes | 0630ea571e | |
Daniel Svensson | b7963e6241 | |
Marco Cawthorne | 57e9276670 | |
Marco Cawthorne | 1c5e82bec7 | |
Marco Cawthorne | 76e4258ad3 | |
Shpoike | 118dab975e | |
Daniel Svensson | 3b6cd9aac0 | |
Daniel Svensson | ab1e8d321a | |
Daniel Svensson | 317ca00298 | |
Daniel Svensson | 3672234c24 | |
Daniel Svensson | bdb5df93a9 | |
Daniel Svensson | c7eb4fb3b0 | |
Daniel Svensson | 21d3080fbe | |
Daniel Svensson | c95a739208 | |
Daniel Svensson | a4cc899989 | |
Daniel Svensson | c9687bfd7b | |
Daniel Svensson | 1c80a9f365 | |
Daniel Svensson | 8813af0e40 | |
Daniel Svensson | 9d6f5eb9cb | |
Daniel Svensson | 771500d9f8 | |
Daniel Svensson | 435a020cb8 | |
Daniel Svensson | 1c201c0321 |
|
@ -0,0 +1,98 @@
|
|||
name: main
|
||||
|
||||
on: [ push, pull_request, workflow_dispatch ]
|
||||
|
||||
jobs:
|
||||
cmake:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
profile: [ "Debug", "Release" ]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Get number of CPU cores
|
||||
uses: SimenB/github-actions-cpu-cores@v1
|
||||
id: cpu-cores
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: "Install Dependencies"
|
||||
run: |
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get -qq install --no-install-recommends \
|
||||
gettext \
|
||||
libasound2-dev \
|
||||
libbullet-dev \
|
||||
libgnutls28-dev \
|
||||
libopenxr-dev \
|
||||
libqscintilla2-qt5-dev \
|
||||
libsdl2-dev \
|
||||
libvorbis-dev \
|
||||
libvulkan-dev \
|
||||
libwayland-dev \
|
||||
libxcursor-dev \
|
||||
libxkbcommon-dev \
|
||||
libxrandr-dev \
|
||||
qtbase5-dev
|
||||
|
||||
# Disabled due to warnings that break the debug build with -Werror
|
||||
# libode-dev
|
||||
# libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
|
||||
|
||||
- name: "Configure: ${{ matrix.profile }}"
|
||||
run: |
|
||||
cmake -B build_${{ matrix.profile }} -DCMAKE_BUILD_TYPE=${{ matrix.profile }}
|
||||
|
||||
- name: "Build: ${{ matrix.profile }}"
|
||||
run: |
|
||||
cmake --build build_${{ matrix.profile }} --parallel ${{ steps.cpu-cores.outputs.count }}
|
||||
|
||||
wasm:
|
||||
strategy:
|
||||
# Concurrent builds currently broken:
|
||||
# https://github.com/mymindstorm/setup-emsdk/issues/20
|
||||
matrix:
|
||||
emsdk: [ "2.0.12" ] #, "3.1.8", "3.1.51" ]
|
||||
profile: [ "rel" ] #, "dbg" ]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Get number of CPU cores
|
||||
uses: SimenB/github-actions-cpu-cores@v1
|
||||
id: cpu-cores
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: mymindstorm/setup-emsdk@v13
|
||||
with:
|
||||
version: ${{ matrix.emsdk }}
|
||||
actions-cache-folder: "emsdk-cache-${{ matrix.emsdk }}"
|
||||
|
||||
- name: Verify emscripten
|
||||
run: emcc -v
|
||||
|
||||
- name: Build dependencies
|
||||
working-directory: engine
|
||||
run: |
|
||||
make -j ${{ steps.cpu-cores.outputs.count }} makelibs FTE_TARGET=web
|
||||
|
||||
- name: Build wasm
|
||||
working-directory: engine
|
||||
run: |
|
||||
# Currently fails to build
|
||||
sed -r -i '/define Q3(CLIENT|SERVER)/d' common/config_fteqw.h
|
||||
|
||||
make -j ${{ steps.cpu-cores.outputs.count }} FTE_TARGET=web web-${{ matrix.profile }}
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: fteqw-web-${{ matrix.profile }}-em${{ matrix.emsdk }}
|
||||
path: |
|
||||
engine/*/ftewebgl.js
|
||||
engine/*/ftewebgl.html
|
||||
engine/*/ftewebgl.wasm
|
||||
compression-level: 9
|
|
@ -2296,11 +2296,11 @@ libs-$(ARCH)/libjpeg.a:
|
|||
|
||||
ifeq ($(FTE_TARGET),web)
|
||||
libs-$(ARCH)/libz.a libs-$(ARCH)/libz.pc:
|
||||
test -f zlib-$(ZLIBVER).tar.gz || wget http://zlib.net/zlib-$(ZLIBVER).tar.gz
|
||||
test -f zlib-$(ZLIBVER).tar.gz || wget http://zlib.net/fossils/zlib-$(ZLIBVER).tar.gz
|
||||
-test -f libs-$(ARCH)/libz.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../zlib-$(ZLIBVER).tar.gz && cd zlib-$(ZLIBVER) && emconfigure ./configure --static && emmake $(MAKE) libz.a CC="$(CC) $(W32_CFLAGS) -fPIC" && cp libz.a ../ && $(TOOLOVERRIDES) $(AR) -s ../libz.a && cp zlib.h zconf.h zutil.h zlib.pc ../ )
|
||||
else
|
||||
libs-$(ARCH)/libz.a libs-$(ARCH)/libz.pc:
|
||||
test -f zlib-$(ZLIBVER).tar.gz || wget http://zlib.net/zlib-$(ZLIBVER).tar.gz
|
||||
test -f zlib-$(ZLIBVER).tar.gz || wget http://zlib.net/fossils/zlib-$(ZLIBVER).tar.gz
|
||||
-test -f libs-$(ARCH)/libz.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../zlib-$(ZLIBVER).tar.gz && cd zlib-$(ZLIBVER) && $(TOOLOVERRIDES) ./configure --static && $(TOOLOVERRIDES) $(MAKE) libz.a CC="$(CC) $(W32_CFLAGS) -fPIC" && cp libz.a ../ && $(TOOLOVERRIDES) $(AR) -s ../libz.a && cp zlib.h zconf.h zutil.h zlib.pc ../ )
|
||||
endif
|
||||
libs-$(ARCH)/libz9.a: libs-$(ARCH)/libz.a
|
||||
|
|
|
@ -244,7 +244,7 @@ float Master_ReadKeyFloat(serverinfo_t *server, unsigned int keynum);
|
|||
char *Master_ReadKeyString(serverinfo_t *server, unsigned int keynum);
|
||||
|
||||
int Master_SortServers(void);
|
||||
void Master_SetSortField(hostcachekey_t field, qboolean descending);
|
||||
void Master_SetSortField(hostcachekey_t field, unsigned int sortflags);
|
||||
hostcachekey_t Master_GetSortField(void);
|
||||
qboolean Master_GetSortDescending(void);
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ static unsigned int IN_GetKeyDest(void)
|
|||
|
||||
qboolean QDECL Plug_Input_IsKeyDown(int key)
|
||||
{
|
||||
extern qboolean keydown[K_MAX];
|
||||
extern unsigned int keydown[K_MAX];
|
||||
if (key >= 0 && key < K_MAX)
|
||||
return !!keydown[key];
|
||||
return false;
|
||||
|
|
|
@ -1006,7 +1006,7 @@ void SCR_CheckDrawCenterString (void)
|
|||
continue; //should probably allow the console with a scissor region or something.
|
||||
|
||||
#ifdef QUAKEHUD
|
||||
if (cl.playerview[pnum].sb_showscores) //this was annoying
|
||||
if (cl.playerview[pnum].sb_showscores || cl.playerview[pnum].sb_showteamscores) //this was annoying
|
||||
continue;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2553,8 +2553,7 @@ void Key_Unbindall_f (void)
|
|||
int i;
|
||||
|
||||
for (i=0 ; i<K_MAX ; i++)
|
||||
if (keybindings[i])
|
||||
Key_SetBinding (i, ~0, NULL, Cmd_ExecLevel);
|
||||
Key_SetBinding (i, ~0, NULL, Cmd_ExecLevel);
|
||||
}
|
||||
|
||||
void Key_Bind_c(int argn, const char *partial, struct xcommandargcompletioncb_s *ctx)
|
||||
|
|
|
@ -2211,64 +2211,12 @@ static qboolean Media_Roq_DecodeFrame (cin_t *cin, qboolean nosound, qboolean fo
|
|||
|
||||
if (doupdate)
|
||||
{
|
||||
//#define LIMIT(x) ((x)<0xFFFF)?(x)>>16:0xFF;
|
||||
#define LIMIT(x) ((((x) > 0xffffff) ? 0xff0000 : (((x) <= 0xffff) ? 0 : (x) & 0xff0000)) >> 16)
|
||||
unsigned char *pa=cin->roq.roqfilm->y[0];
|
||||
unsigned char *pb=cin->roq.roqfilm->u[0];
|
||||
unsigned char *pc=cin->roq.roqfilm->v[0];
|
||||
int pix=0;
|
||||
int num_columns=(cin->roq.roqfilm->width)>>1;
|
||||
int num_rows=cin->roq.roqfilm->height;
|
||||
int y;
|
||||
int x;
|
||||
|
||||
qbyte *framedata;
|
||||
|
||||
if (cin->roq.roqfilm->num_frames)
|
||||
cin->filmpercentage = cin->roq.roqfilm->frame_num / cin->roq.roqfilm->num_frames;
|
||||
else
|
||||
cin->filmpercentage = 0;
|
||||
|
||||
{
|
||||
framedata = cin->framedata;
|
||||
|
||||
for(y = 0; y < num_rows; ++y) //roq playing doesn't give nice data. It's still fairly raw.
|
||||
{ //convert it properly.
|
||||
for(x = 0; x < num_columns; ++x)
|
||||
{
|
||||
|
||||
int r, g, b, y1, y2, u, v, t;
|
||||
y1 = *(pa++); y2 = *(pa++);
|
||||
u = pb[x] - 128;
|
||||
v = pc[x] - 128;
|
||||
|
||||
y1 <<= 16;
|
||||
y2 <<= 16;
|
||||
r = 91881 * v;
|
||||
g = -22554 * u + -46802 * v;
|
||||
b = 116130 * u;
|
||||
|
||||
t=r+y1;
|
||||
framedata[pix] =(unsigned char) LIMIT(t);
|
||||
t=g+y1;
|
||||
framedata[pix+1] =(unsigned char) LIMIT(t);
|
||||
t=b+y1;
|
||||
framedata[pix+2] =(unsigned char) LIMIT(t);
|
||||
|
||||
t=r+y2;
|
||||
framedata[pix+4] =(unsigned char) LIMIT(t);
|
||||
t=g+y2;
|
||||
framedata[pix+5] =(unsigned char) LIMIT(t);
|
||||
t=b+y2;
|
||||
framedata[pix+6] =(unsigned char) LIMIT(t);
|
||||
pix+=8;
|
||||
|
||||
}
|
||||
if(y & 0x01) { pb += num_columns; pc += num_columns; }
|
||||
}
|
||||
}
|
||||
|
||||
uploadtexture(ctx, TF_RGBX32, cin->roq.roqfilm->width, cin->roq.roqfilm->height, cin->framedata, NULL);
|
||||
uploadtexture(ctx, TF_RGBX32, cin->roq.roqfilm->width, cin->roq.roqfilm->height, cin->roq.roqfilm->rgba[0], NULL);
|
||||
|
||||
if (!nosound)
|
||||
{
|
||||
|
@ -2308,7 +2256,6 @@ static cin_t *Media_RoQ_TryLoad(char *name)
|
|||
|
||||
cin->roq.roqfilm = roqfilm;
|
||||
|
||||
cin->framedata = BZ_Malloc(roqfilm->width*roqfilm->height*4);
|
||||
return cin;
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -6759,7 +6759,7 @@ static void QCBUILTIN PF_resourcestatus(pubprogfuncs_t *prinst, struct globalvar
|
|||
return;
|
||||
case RESTYPE_SOUND:
|
||||
sfx = NULL;
|
||||
for (idx=1 ; idx<MAX_PRECACHE_SOUNDS && cl.sound_name[idx] ; idx++)
|
||||
for (idx=1 ; idx<MAX_PRECACHE_SOUNDS; idx++)
|
||||
{
|
||||
if (!strcmp(cl.sound_name[idx], resname))
|
||||
{
|
||||
|
|
|
@ -582,7 +582,7 @@ void Mod_SubmodelLoaded(struct model_s *mod, int state);
|
|||
#ifdef RUNTIMELIGHTING
|
||||
struct relight_ctx_s;
|
||||
struct llightinfo_s;
|
||||
void LightPlane (struct relight_ctx_s *ctx, struct llightinfo_s *threadctx, lightstyleindex_t surf_styles[4], unsigned int *surf_expsamples, qbyte *surf_rgbsamples, qbyte *surf_deluxesamples, vec4_t surf_plane, vec4_t surf_texplanes[2], vec2_t exactmins, vec2_t exactmaxs, int texmins[2], int texsize[2], float lmscale); //special version that doesn't know what a face is or anything.
|
||||
void LightPlane (struct relight_ctx_s *ctx, struct llightinfo_s *threadctx, lightstyleindex_t surf_styles[MAXCPULIGHTMAPS], unsigned int *surf_expsamples, qbyte *surf_rgbsamples, qbyte *surf_deluxesamples, vec4_t surf_plane, vec4_t surf_texplanes[2], vec2_t exactmins, vec2_t exactmaxs, int texmins[2], int texsize[2], float lmscale); //special version that doesn't know what a face is or anything.
|
||||
struct relight_ctx_s *LightStartup(struct relight_ctx_s *ctx, struct model_s *model, qboolean shadows, qboolean skiplit);
|
||||
void LightReloadEntities(struct relight_ctx_s *ctx, const char *entstring, qboolean ignorestyles);
|
||||
void LightShutdown(struct relight_ctx_s *ctx);
|
||||
|
|
|
@ -16,6 +16,10 @@ typedef struct {
|
|||
unsigned char y0, y1, y2, y3, u, v;
|
||||
} roq_cell;
|
||||
|
||||
typedef struct {
|
||||
char p[16];
|
||||
} roq_cell_rgba;
|
||||
|
||||
typedef struct {
|
||||
int idx[4];
|
||||
} roq_qcell;
|
||||
|
@ -26,13 +30,14 @@ typedef struct roq_info_s {
|
|||
int buf_size;
|
||||
unsigned char *buf;
|
||||
roq_cell cells[256];
|
||||
roq_cell_rgba cells_rgba[256];
|
||||
roq_qcell qcells[256];
|
||||
short snd_sqr_arr[256];
|
||||
qofs_t roq_start, aud_pos, vid_pos;
|
||||
long *frame_offset;
|
||||
unsigned long num_frames, num_audio_bytes;
|
||||
int width, height, frame_num, audio_channels;
|
||||
unsigned char *y[2], *u[2], *v[2];
|
||||
byte_vec4_t *rgba[2];
|
||||
long stream_length;
|
||||
int audio_buf_size, audio_size;
|
||||
unsigned char *audio;
|
||||
|
|
|
@ -150,101 +150,70 @@ int max_frame;
|
|||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
static void apply_vector_2x2(roq_info *ri, int x, int y, roq_cell *cell)
|
||||
static void apply_vector_2x2(roq_info *ri, int x, int y, roq_cell_rgba *cell)
|
||||
{
|
||||
unsigned char *yptr;
|
||||
// place 2x2 vector codeword in framebuffer
|
||||
|
||||
yptr = ri->y[0] + (y * ri->width) + x;
|
||||
*yptr++ = cell->y0;
|
||||
*yptr++ = cell->y1;
|
||||
yptr += (ri->width - 2);
|
||||
*yptr++ = cell->y2;
|
||||
*yptr++ = cell->y3;
|
||||
ri->u[0][(y/2) * (ri->width/2) + x/2] = cell->u;
|
||||
ri->v[0][(y/2) * (ri->width/2) + x/2] = cell->v;
|
||||
int idxa = (y * ri->width) + x;
|
||||
int idxb = 0;
|
||||
|
||||
int *ptra = (int*) &ri->rgba[0][idxa][0];
|
||||
int *ptrb = (int*) &cell->p[idxb];
|
||||
|
||||
ptra[0] = ptrb[0];
|
||||
ptra[1] = ptrb[1];
|
||||
ptra += ri->width;
|
||||
ptra[0] = ptrb[2];
|
||||
ptra[1] = ptrb[3];
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
static void apply_vector_4x4(roq_info *ri, int x, int y, roq_cell *cell)
|
||||
static void apply_vector_4x4(roq_info *ri, int x, int y, roq_cell_rgba *cell)
|
||||
{
|
||||
unsigned long row_inc, c_row_inc;
|
||||
register unsigned char y0, y1, u, v;
|
||||
unsigned char *yptr, *uptr, *vptr;
|
||||
// upsample 2x2 vector codeword to 4x4 and place in framebuffer
|
||||
|
||||
yptr = ri->y[0] + (y * ri->width) + x;
|
||||
uptr = ri->u[0] + (y/2) * (ri->width/2) + x/2;
|
||||
vptr = ri->v[0] + (y/2) * (ri->width/2) + x/2;
|
||||
int idxa = (y * ri->width) + x;
|
||||
int idxb = 0;
|
||||
|
||||
row_inc = ri->width - 4;
|
||||
c_row_inc = (ri->width/2) - 2;
|
||||
*yptr++ = y0 = cell->y0; *uptr++ = u = cell->u; *vptr++ = v = cell->v;
|
||||
*yptr++ = y0;
|
||||
*yptr++ = y1 = cell->y1; *uptr++ = u; *vptr++ = v;
|
||||
*yptr++ = y1;
|
||||
int *ptra = (int*) &ri->rgba[0][idxa][0];
|
||||
int *ptrb = (int*) &cell->p[idxb];
|
||||
|
||||
yptr += row_inc;
|
||||
int i;
|
||||
for(i = 0; i < 4; i++) {
|
||||
ptra[0] = ptrb[0];
|
||||
ptra[1] = ptrb[0];
|
||||
ptra[2] = ptrb[1];
|
||||
ptra[3] = ptrb[1];
|
||||
|
||||
*yptr++ = y0;
|
||||
*yptr++ = y0;
|
||||
*yptr++ = y1;
|
||||
*yptr++ = y1;
|
||||
|
||||
yptr += row_inc; uptr += c_row_inc; vptr += c_row_inc;
|
||||
|
||||
*yptr++ = y0 = cell->y2; *uptr++ = u; *vptr++ = v;
|
||||
*yptr++ = y0;
|
||||
*yptr++ = y1 = cell->y3; *uptr++ = u; *vptr++ = v;
|
||||
*yptr++ = y1;
|
||||
|
||||
yptr += row_inc;
|
||||
|
||||
*yptr++ = y0;
|
||||
*yptr++ = y0;
|
||||
*yptr++ = y1;
|
||||
*yptr++ = y1;
|
||||
ptra += ri->width;
|
||||
if(i & 0x1) { // increase src pointer only every second dest line
|
||||
ptrb += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
static void apply_motion_4x4(roq_info *ri, int x, int y, unsigned char mv, char mean_x, char mean_y)
|
||||
{
|
||||
int i, mx, my;
|
||||
unsigned char *pa, *pb;
|
||||
int mx = x + 8 - (mv >> 4) - mean_x;
|
||||
int my = y + 8 - (mv & 0xf) - mean_y;
|
||||
|
||||
int idxa = (y * ri->width) + x;
|
||||
int idxb = (my * ri->width) + mx;
|
||||
|
||||
mx = x + 8 - (mv >> 4) - mean_x;
|
||||
my = y + 8 - (mv & 0xf) - mean_y;
|
||||
int *ptra = (int*) &ri->rgba[0][idxa][0];
|
||||
int *ptrb = (int*) &ri->rgba[1][idxb][0];
|
||||
|
||||
int i;
|
||||
for(i = 0; i < 4; i++) {
|
||||
ptra[0] = ptrb[0];
|
||||
ptra[1] = ptrb[1];
|
||||
ptra[2] = ptrb[2];
|
||||
ptra[3] = ptrb[3];
|
||||
|
||||
pa = ri->y[0] + (y * ri->width) + x;
|
||||
pb = ri->y[1] + (my * ri->width) + mx;
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
pa[0] = pb[0];
|
||||
pa[1] = pb[1];
|
||||
pa[2] = pb[2];
|
||||
pa[3] = pb[3];
|
||||
pa += ri->width;
|
||||
pb += ri->width;
|
||||
}
|
||||
|
||||
pa = ri->u[0] + (y/2) * (ri->width/2) + x/2;
|
||||
pb = ri->u[1] + (my/2) * (ri->width/2) + (mx + 1)/2;
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
pa[0] = pb[0];
|
||||
pa[1] = pb[1];
|
||||
pa += ri->width/2;
|
||||
pb += ri->width/2;
|
||||
}
|
||||
|
||||
pa = ri->v[0] + (y/2) * (ri->width/2) + x/2;
|
||||
pb = ri->v[1] + (my/2) * (ri->width/2) + (mx + 1)/2;
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
pa[0] = pb[0];
|
||||
pa[1] = pb[1];
|
||||
pa += ri->width/2;
|
||||
pb += ri->width/2;
|
||||
ptra += ri->width;
|
||||
ptrb += ri->width;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,50 +221,28 @@ unsigned char *pa, *pb;
|
|||
/* -------------------------------------------------------------------------- */
|
||||
static void apply_motion_8x8(roq_info *ri, int x, int y, unsigned char mv, char mean_x, char mean_y)
|
||||
{
|
||||
int mx, my, i;
|
||||
unsigned char *pa, *pb;
|
||||
int mx = x + 8 - (mv >> 4) - mean_x;
|
||||
int my = y + 8 - (mv & 0xf) - mean_y;
|
||||
|
||||
mx = x + 8 - (mv >> 4) - mean_x;
|
||||
my = y + 8 - (mv & 0xf) - mean_y;
|
||||
int idxa = (y * ri->width) + x;
|
||||
int idxb = (my * ri->width) + mx;
|
||||
|
||||
int *ptra = (int*) &ri->rgba[0][idxa][0];
|
||||
int *ptrb = (int*) &ri->rgba[1][idxb][0];
|
||||
|
||||
pa = ri->y[0] + (y * ri->width) + x;
|
||||
pb = ri->y[1] + (my * ri->width) + mx;
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
pa[0] = pb[0];
|
||||
pa[1] = pb[1];
|
||||
pa[2] = pb[2];
|
||||
pa[3] = pb[3];
|
||||
pa[4] = pb[4];
|
||||
pa[5] = pb[5];
|
||||
pa[6] = pb[6];
|
||||
pa[7] = pb[7];
|
||||
pa += ri->width;
|
||||
pb += ri->width;
|
||||
}
|
||||
int i;
|
||||
for(i = 0; i < 8; i++) {
|
||||
ptra[0] = ptrb[0];
|
||||
ptra[1] = ptrb[1];
|
||||
ptra[2] = ptrb[2];
|
||||
ptra[3] = ptrb[3];
|
||||
ptra[4] = ptrb[4];
|
||||
ptra[5] = ptrb[5];
|
||||
ptra[6] = ptrb[6];
|
||||
ptra[7] = ptrb[7];
|
||||
|
||||
pa = ri->u[0] + (y/2) * (ri->width/2) + x/2;
|
||||
pb = ri->u[1] + (my/2) * (ri->width/2) + (mx + 1)/2;
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
pa[0] = pb[0];
|
||||
pa[1] = pb[1];
|
||||
pa[2] = pb[2];
|
||||
pa[3] = pb[3];
|
||||
pa += ri->width/2;
|
||||
pb += ri->width/2;
|
||||
}
|
||||
|
||||
pa = ri->v[0] + (y/2) * (ri->width/2) + x/2;
|
||||
pb = ri->v[1] + (my/2) * (ri->width/2) + (mx + 1)/2;
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
pa[0] = pb[0];
|
||||
pa[1] = pb[1];
|
||||
pa[2] = pb[2];
|
||||
pa[3] = pb[3];
|
||||
pa += ri->width/2;
|
||||
pb += ri->width/2;
|
||||
ptra += ri->width;
|
||||
ptrb += ri->width;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,9 +284,7 @@ int i;
|
|||
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
if((ri->y[i] = BZF_Malloc(ri->width * ri->height)) == NULL ||
|
||||
(ri->u[i] = BZF_Malloc((ri->width * ri->height)/4)) == NULL ||
|
||||
(ri->v[i] = BZF_Malloc((ri->width * ri->height)/4)) == NULL)
|
||||
if((ri->rgba[i] = BZF_Malloc(ri->width * ri->height * sizeof(byte_vec4_t))) == NULL)
|
||||
{
|
||||
Con_Printf("Memory allocation error.\n");
|
||||
return NULL;
|
||||
|
@ -378,12 +323,8 @@ int i;
|
|||
VFS_CLOSE(ri->fp);
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
if(ri->y[i] != NULL)
|
||||
BZ_Free(ri->y[i]);
|
||||
if(ri->u[i] != NULL)
|
||||
BZ_Free(ri->u[i]);
|
||||
if(ri->v[i] != NULL)
|
||||
BZ_Free(ri->v[i]);
|
||||
if(ri->rgba[i] != NULL)
|
||||
BZ_Free(ri->rgba[i]);
|
||||
}
|
||||
if(ri->buf != NULL)
|
||||
BZ_Free(ri->buf);
|
||||
|
@ -392,6 +333,64 @@ int i;
|
|||
BZ_Free(ri);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#define LIMIT(x) ((((x) > 0xffffff) ? 0xff0000 : (((x) <= 0xffff) ? 0 : (x) & 0xff0000)) >> 16)
|
||||
void roq_cells_to_rgba(roq_info *ri)
|
||||
{
|
||||
char *pptr;
|
||||
int i, r, g, b, y, u, v, t;
|
||||
for(i = 0; i < 256; i++) {
|
||||
pptr = ri->cells_rgba[i].p;
|
||||
|
||||
u = ri->cells[i].u - 128;
|
||||
v = ri->cells[i].v - 128;
|
||||
|
||||
r = 91881 * v;
|
||||
g = -22554 * u + -46802 * v;
|
||||
b = 116130 * u;
|
||||
|
||||
// first pixel
|
||||
y = (ri->cells[i].y0) << 16;
|
||||
t = r + y;
|
||||
pptr[0] = LIMIT(t); // R
|
||||
t = g + y;
|
||||
pptr[1] = LIMIT(t); // G
|
||||
t = b + y;
|
||||
pptr[2] = LIMIT(t); // B
|
||||
pptr[3] = 255; // A
|
||||
|
||||
// second pixel
|
||||
y = (ri->cells[i].y1) << 16;
|
||||
t = r + y;
|
||||
pptr[4] = LIMIT(t); // R
|
||||
t = g + y;
|
||||
pptr[5] = LIMIT(t); // G
|
||||
t = b + y;
|
||||
pptr[6] = LIMIT(t); // B
|
||||
pptr[7] = 255; // A
|
||||
|
||||
// third pixel
|
||||
y = (ri->cells[i].y2) << 16;
|
||||
t = r + y;
|
||||
pptr[8] = LIMIT(t); // R
|
||||
t = g + y;
|
||||
pptr[9] = LIMIT(t); // G
|
||||
t = b + y;
|
||||
pptr[10] = LIMIT(t); // B
|
||||
pptr[11] = 255; // A
|
||||
|
||||
// fourth pixel
|
||||
y = (ri->cells[i].y3) << 16;
|
||||
t = r + y;
|
||||
pptr[12] = LIMIT(t); // R
|
||||
t = g + y;
|
||||
pptr[13] = LIMIT(t); // G
|
||||
t = b + y;
|
||||
pptr[14] = LIMIT(t); // B
|
||||
pptr[15] = 255; // A
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int roq_read_frame(roq_info *ri)
|
||||
|
@ -400,7 +399,7 @@ vfsfile_t *fp = ri->fp;
|
|||
unsigned int chunk_id = 0, chunk_arg = 0;
|
||||
unsigned long chunk_size = 0;
|
||||
int i, j, k, nv1, nv2, vqflg = 0, vqflg_pos = -1, vqid, bpos, xpos, ypos, xp, yp, x, y;
|
||||
unsigned char *tp, *buf;
|
||||
unsigned char *buf;
|
||||
int frame_stats[2][4] = {{0},{0}};
|
||||
roq_qcell *qcell;
|
||||
|
||||
|
@ -424,6 +423,7 @@ qofs_t fpos = ri->vid_pos;
|
|||
if((nv2 = chunk_arg & 0xff) == 0 && nv1 * 6 < chunk_size)
|
||||
nv2 = 256;
|
||||
VFS_READ(fp, ri->cells, nv1 * sizeof(roq_cell));
|
||||
roq_cells_to_rgba(ri);
|
||||
for(i = 0; i < nv2; i++)
|
||||
for(j = 0; j < 4; j++) ri->qcells[i].idx[j] = VFS_GETC(fp);
|
||||
}
|
||||
|
@ -472,14 +472,15 @@ qofs_t fpos = ri->vid_pos;
|
|||
{
|
||||
case RoQ_ID_MOT: break;
|
||||
case RoQ_ID_FCC:
|
||||
apply_motion_8x8(ri, xp, yp, buf[bpos++], (char)(chunk_arg >> 8), (char)(chunk_arg & 0xff));
|
||||
apply_motion_8x8(ri, xp, yp, buf[bpos], (char)(chunk_arg >> 8), (char)(chunk_arg & 0xff));
|
||||
bpos++;
|
||||
break;
|
||||
case RoQ_ID_SLD:
|
||||
qcell = ri->qcells + buf[bpos++];
|
||||
apply_vector_4x4(ri, xp, yp, ri->cells + qcell->idx[0]);
|
||||
apply_vector_4x4(ri, xp+4, yp, ri->cells + qcell->idx[1]);
|
||||
apply_vector_4x4(ri, xp, yp+4, ri->cells + qcell->idx[2]);
|
||||
apply_vector_4x4(ri, xp+4, yp+4, ri->cells + qcell->idx[3]);
|
||||
apply_vector_4x4(ri, xp, yp, ri->cells_rgba + qcell->idx[0]);
|
||||
apply_vector_4x4(ri, xp+4, yp, ri->cells_rgba + qcell->idx[1]);
|
||||
apply_vector_4x4(ri, xp, yp+4, ri->cells_rgba + qcell->idx[2]);
|
||||
apply_vector_4x4(ri, xp+4, yp+4, ri->cells_rgba + qcell->idx[3]);
|
||||
break;
|
||||
case RoQ_ID_CCC:
|
||||
for(k = 0; k < 4; k++)
|
||||
|
@ -500,20 +501,21 @@ qofs_t fpos = ri->vid_pos;
|
|||
{
|
||||
case RoQ_ID_MOT: break;
|
||||
case RoQ_ID_FCC:
|
||||
apply_motion_4x4(ri, x, y, buf[bpos++], (char)(chunk_arg >> 8), (char)(chunk_arg & 0xff));
|
||||
apply_motion_4x4(ri, x, y, buf[bpos], (char)(chunk_arg >> 8), (char)(chunk_arg & 0xff));
|
||||
bpos++;
|
||||
break;
|
||||
case RoQ_ID_SLD:
|
||||
qcell = ri->qcells + buf[bpos++];
|
||||
apply_vector_2x2(ri, x, y, ri->cells + qcell->idx[0]);
|
||||
apply_vector_2x2(ri, x+2, y, ri->cells + qcell->idx[1]);
|
||||
apply_vector_2x2(ri, x, y+2, ri->cells + qcell->idx[2]);
|
||||
apply_vector_2x2(ri, x+2, y+2, ri->cells + qcell->idx[3]);
|
||||
apply_vector_2x2(ri, x, y, ri->cells_rgba + qcell->idx[0]);
|
||||
apply_vector_2x2(ri, x+2, y, ri->cells_rgba + qcell->idx[1]);
|
||||
apply_vector_2x2(ri, x, y+2, ri->cells_rgba + qcell->idx[2]);
|
||||
apply_vector_2x2(ri, x+2, y+2, ri->cells_rgba + qcell->idx[3]);
|
||||
break;
|
||||
case RoQ_ID_CCC:
|
||||
apply_vector_2x2(ri, x, y, ri->cells + buf[bpos]);
|
||||
apply_vector_2x2(ri, x+2, y, ri->cells + buf[bpos+1]);
|
||||
apply_vector_2x2(ri, x, y+2, ri->cells + buf[bpos+2]);
|
||||
apply_vector_2x2(ri, x+2, y+2, ri->cells + buf[bpos+3]);
|
||||
apply_vector_2x2(ri, x, y, ri->cells_rgba + buf[bpos]);
|
||||
apply_vector_2x2(ri, x+2, y, ri->cells_rgba + buf[bpos+1]);
|
||||
apply_vector_2x2(ri, x, y+2, ri->cells_rgba + buf[bpos+2]);
|
||||
apply_vector_2x2(ri, x+2, y+2, ri->cells_rgba + buf[bpos+3]);
|
||||
bpos += 4;
|
||||
break;
|
||||
}
|
||||
|
@ -544,23 +546,13 @@ qofs_t fpos = ri->vid_pos;
|
|||
|
||||
if(ri->frame_num == 1)
|
||||
{
|
||||
memcpy(ri->y[1], ri->y[0], ri->width * ri->height);
|
||||
memcpy(ri->u[1], ri->u[0], (ri->width * ri->height)/4);
|
||||
memcpy(ri->v[1], ri->v[0], (ri->width * ri->height)/4);
|
||||
memcpy(ri->rgba[1], ri->rgba[0], ri->width * ri->height * sizeof(byte_vec4_t));
|
||||
}
|
||||
else
|
||||
{
|
||||
tp = ri->y[0];
|
||||
ri->y[0] = ri->y[1];
|
||||
ri->y[1] = tp;
|
||||
|
||||
tp = ri->u[0];
|
||||
ri->u[0] = ri->u[1];
|
||||
ri->u[1] = tp;
|
||||
|
||||
tp = ri->v[0];
|
||||
ri->v[0] = ri->v[1];
|
||||
ri->v[1] = tp;
|
||||
byte_vec4_t *tp = ri->rgba[0];
|
||||
ri->rgba[0] = ri->rgba[1];
|
||||
ri->rgba[1] = tp;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
@ -3052,7 +3052,7 @@ void Sbar_Draw (playerview_t *pv)
|
|||
R2D_ImageColours(1, 1, 1, 1);
|
||||
if (*cl.q2statusbar)
|
||||
Sbar_ExecuteLayoutString(cl.q2statusbar, seat);
|
||||
if (*cl.q2layout && (cl.q2frame.playerstate[seat].stats[Q2STAT_LAYOUTS] & 1))
|
||||
if (cl.q2frame.playerstate[seat].stats[Q2STAT_LAYOUTS] & 1)
|
||||
Sbar_ExecuteLayoutString(cl.q2layout[seat], seat);
|
||||
if (cl.q2frame.playerstate[seat].stats[Q2STAT_LAYOUTS] & 2)
|
||||
Sbar_Q2DrawInventory(seat);
|
||||
|
@ -3604,13 +3604,19 @@ ping time frags name
|
|||
Draw_FunStringWidth(x, y, s->team, 4*8, false, false); \
|
||||
} \
|
||||
},NOFILL)
|
||||
#define COLUMN_STAT(title, width, code, fill) COLUMN(title, width, { \
|
||||
if (!(s->spectator && s->spectator != 2)) \
|
||||
{ \
|
||||
code \
|
||||
} \
|
||||
}, fill)
|
||||
#define COLUMN_RULESET COLUMN(ruleset, 8*8, {Draw_FunStringWidth(x, y, s->ruleset, 8*8, false, false);},NOFILL)
|
||||
#define COLUMN_NAME COLUMN(name, namesize, {Draw_FunStringWidth(x, y, s->name, namesize, false, false);},NOFILL)
|
||||
#define COLUMN_KILLS COLUMN(kils, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetKills(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_TKILLS COLUMN(tkil, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetTKills(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_DEATHS COLUMN(dths, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetDeaths(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_TOUCHES COLUMN(tchs, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetTouches(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_CAPS COLUMN(caps, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetCaptures(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_KILLS COLUMN_STAT(kils, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetKills(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_TKILLS COLUMN_STAT(tkil, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetTKills(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_DEATHS COLUMN_STAT(dths, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetDeaths(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_TOUCHES COLUMN_STAT(tchs, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetTouches(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_CAPS COLUMN_STAT(caps, 4*8, {Draw_FunStringWidth(x, y, va("%4i", Stats_GetCaptures(k)), 4*8, false, false);},NOFILL)
|
||||
#define COLUMN_AFK COLUMN(afk, 0, {int cs = atoi(InfoBuf_ValueForKey(&s->userinfo, "chat")); if (cs)Draw_FunStringWidth(x+4, y, (cs&2)?"afk":"msg", 4*8, false, false);},NOFILL)
|
||||
|
||||
|
||||
|
|
|
@ -157,6 +157,7 @@ static void QDECL TP_EnemyColor_CB (struct cvar_s *var, char *oldvalue);
|
|||
TP_CVAR(loc_name_ga, "ga"); \
|
||||
TP_CVAR(loc_name_ya, "ya"); \
|
||||
TP_CVAR(loc_name_ra, "ra"); \
|
||||
TP_CVAR(loc_name_mh, "mh"); \
|
||||
TP_CVAR(loc_name_quad, "quad"); \
|
||||
TP_CVAR(loc_name_pent, "pent"); \
|
||||
TP_CVAR(loc_name_ring, "ring"); \
|
||||
|
|
|
@ -2423,7 +2423,7 @@ float MSG_ReadCoordFloat (void)
|
|||
return MSG_FromCoord(c, COORDTYPE_FLOAT_32);
|
||||
}
|
||||
|
||||
void MSG_ReadPos (vec3_t pos)
|
||||
void MSG_ReadPos (float pos[3])
|
||||
{
|
||||
pos[0] = MSG_ReadCoord();
|
||||
pos[1] = MSG_ReadCoord();
|
||||
|
@ -2452,7 +2452,7 @@ void MSG_ReadDir (vec3_t dir)
|
|||
}
|
||||
#endif
|
||||
#if 1//def Q2SERVER
|
||||
void MSG_WriteDir (sizebuf_t *sb, vec3_t dir)
|
||||
void MSG_WriteDir (sizebuf_t *sb, float dir[3])
|
||||
{
|
||||
int i, best;
|
||||
float d, bestd;
|
||||
|
|
|
@ -340,7 +340,7 @@ void MSG_WriteAngle16 (sizebuf_t *sb, float f);
|
|||
void MSGFTE_WriteDeltaUsercmd (sizebuf_t *buf, const short baseanges[3], const struct usercmd_s *from, const struct usercmd_s *cmd);
|
||||
void MSGQW_WriteDeltaUsercmd (sizebuf_t *sb, const struct usercmd_s *from, const struct usercmd_s *cmd);
|
||||
void MSGCL_WriteDeltaUsercmd (sizebuf_t *sb, const struct usercmd_s *from, const struct usercmd_s *cmd);
|
||||
void MSG_WriteDir (sizebuf_t *sb, float *dir);
|
||||
void MSG_WriteDir (sizebuf_t *sb, float dir[3]);
|
||||
|
||||
extern qboolean msg_badread; // set if a read goes beyond end of message
|
||||
extern struct netprim_s msg_nullnetprim;
|
||||
|
@ -371,7 +371,7 @@ char *MSG_ReadStringLine (void);
|
|||
|
||||
float MSG_ReadCoord (void);
|
||||
float MSG_ReadCoordFloat (void);
|
||||
void MSG_ReadPos (float *pos);
|
||||
void MSG_ReadPos (float pos[3]);
|
||||
float MSG_ReadAngle (void);
|
||||
float MSG_ReadAngle16 (void);
|
||||
void MSGQW_ReadDeltaUsercmd (const struct usercmd_s *from, struct usercmd_s *cmd, int qwprotocolver);
|
||||
|
|
|
@ -60,7 +60,7 @@ extern void BuildLightMapGammaTable (float g, float c);
|
|||
|
||||
#if defined(Q2BSPS) || defined(Q3BSPS)
|
||||
static qboolean CM_NativeTrace(model_t *model, int forcehullnum, const framestate_t *framestate, const vec3_t axis[3], const vec3_t start, const vec3_t end, const vec3_t mins, const vec3_t maxs, qboolean capsule, unsigned int contents, trace_t *trace);
|
||||
static unsigned int CM_NativeContents(struct model_s *model, int hulloverride, const framestate_t *framestate, const vec3_t axis[3], const vec3_t p, const vec3_t mins, const vec3_t maxs);
|
||||
static unsigned int CM_NativeContents(struct model_s *model, int hulloverride, const framestate_t *framestate, const vec3_t axis[3], const vec3_t point, const vec3_t mins, const vec3_t maxs);
|
||||
static unsigned int Q2BSP_PointContents(model_t *mod, const vec3_t axis[3], const vec3_t p);
|
||||
static int CM_PointCluster (model_t *mod, const vec3_t p, int *area);
|
||||
static void CM_InfoForPoint (struct model_s *mod, vec3_t pos, int *area, int *cluster, unsigned int *contentbits);
|
||||
|
@ -5504,12 +5504,12 @@ static int CM_PointContents (model_t *mod, const vec3_t p)
|
|||
return contents;
|
||||
}
|
||||
|
||||
static unsigned int CM_NativeContents(struct model_s *model, int hulloverride, const framestate_t *framestate, const vec3_t axis[3], const vec3_t p, const vec3_t mins, const vec3_t maxs)
|
||||
static unsigned int CM_NativeContents(struct model_s *model, int hulloverride, const framestate_t *framestate, const vec3_t axis[3], const vec3_t point, const vec3_t mins, const vec3_t maxs)
|
||||
{
|
||||
cminfo_t *prv = (cminfo_t*)model->meshinfo;
|
||||
int contents;
|
||||
if (!DotProduct(mins, mins) && !DotProduct(maxs, maxs))
|
||||
return CM_PointContents(model, p);
|
||||
return CM_PointContents(model, point);
|
||||
|
||||
if (!model) // map not loaded
|
||||
return 0;
|
||||
|
@ -5520,11 +5520,10 @@ static unsigned int CM_NativeContents(struct model_s *model, int hulloverride, c
|
|||
mleaf_t *leaf;
|
||||
q2cbrush_t *brush;
|
||||
q2cbrushside_t *brushside;
|
||||
vec3_t absmin, absmax;
|
||||
|
||||
int leaflist[64];
|
||||
|
||||
k = CM_BoxLeafnums (model, absmin, absmax, leaflist, 64, NULL);
|
||||
k = CM_BoxLeafnums (model, point, point, leaflist, 64, NULL);
|
||||
|
||||
contents = 0;
|
||||
for (k--; k >= 0; k--)
|
||||
|
@ -5544,7 +5543,7 @@ static unsigned int CM_NativeContents(struct model_s *model, int hulloverride, c
|
|||
brushside = brush->brushside;
|
||||
for ( j = 0; j < brush->numsides; j++, brushside++ )
|
||||
{
|
||||
if ( PlaneDiff (p, brushside->plane) > 0 )
|
||||
if (PlaneDiff (point, brushside->plane) > 0 )
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -896,8 +896,16 @@ static qboolean SSL_LoadPrivateCert(gnutls_certificate_credentials_t cred)
|
|||
const char *errstr;
|
||||
gnutls_pk_algorithm_t privalgo = GNUTLS_PK_RSA;
|
||||
|
||||
if (privf)VFS_CLOSE(privf);privf=NULL;
|
||||
if (pubf)VFS_CLOSE(pubf);pubf=NULL;
|
||||
if (privf)
|
||||
{
|
||||
VFS_CLOSE(privf);
|
||||
privf = NULL;
|
||||
}
|
||||
if (pubf)
|
||||
{
|
||||
VFS_CLOSE(pubf);
|
||||
pubf = NULL;
|
||||
}
|
||||
|
||||
Con_Printf("Generating new GNUTLS key+cert...\n");
|
||||
|
||||
|
|
|
@ -2289,7 +2289,7 @@ static void colourgen(const shaderpass_t *pass, int cnt, vec4_t *src, vec4_t *ds
|
|||
}
|
||||
#endif
|
||||
|
||||
static qboolean BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m);
|
||||
static void BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m);
|
||||
static void DeformGen_Text(int stringid, int cnt, vecV_t *src, vecV_t *dst, const mesh_t *mesh)
|
||||
{
|
||||
#define maxlen 32
|
||||
|
@ -2361,8 +2361,8 @@ static void DeformGen_Text(int stringid, int cnt, vecV_t *src, vecV_t *dst, cons
|
|||
textmesh.numindexes = i*6;
|
||||
textmesh.numvertexes = i*4;
|
||||
|
||||
if (!BE_GenTempMeshVBO(&shaderstate.sourcevbo, &textmesh))
|
||||
return;
|
||||
BE_GenTempMeshVBO(&shaderstate.sourcevbo, &textmesh);
|
||||
|
||||
shaderstate.meshcount = 1;
|
||||
shaderstate.meshes = &meshptr;
|
||||
#undef maxlen
|
||||
|
@ -4908,7 +4908,7 @@ static void DrawMeshes(void)
|
|||
}
|
||||
}
|
||||
|
||||
static qboolean BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m)
|
||||
static void BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m)
|
||||
{
|
||||
*vbo = &shaderstate.dummyvbo;
|
||||
|
||||
|
@ -5093,10 +5093,6 @@ static qboolean BE_GenTempMeshVBO(vbo_t **vbo, mesh_t *m)
|
|||
}
|
||||
shaderstate.dummyvbo.bones = m->bones;
|
||||
shaderstate.dummyvbo.numbones = m->numbones;
|
||||
shaderstate.meshcount = 1;
|
||||
shaderstate.meshes = &m;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GLBE_DrawMesh_List(shader_t *shader, int nummeshes, mesh_t **meshlist, vbo_t *vbo, texnums_t *texnums, unsigned int beflags)
|
||||
|
@ -5123,8 +5119,7 @@ void GLBE_DrawMesh_List(shader_t *shader, int nummeshes, mesh_t **meshlist, vbo_
|
|||
{
|
||||
m = *meshlist++;
|
||||
|
||||
if (!BE_GenTempMeshVBO(&shaderstate.sourcevbo, m))
|
||||
continue;
|
||||
BE_GenTempMeshVBO(&shaderstate.sourcevbo, m);
|
||||
|
||||
shaderstate.meshcount = 1;
|
||||
shaderstate.meshes = &m;
|
||||
|
@ -5172,8 +5167,7 @@ void GLBE_SubmitBatch(batch_t *batch)
|
|||
else
|
||||
{
|
||||
//we're only allowed one mesh per batch if there's no vbo info.
|
||||
if (!BE_GenTempMeshVBO(&shaderstate.sourcevbo, batch->mesh[0]))
|
||||
return;
|
||||
BE_GenTempMeshVBO(&shaderstate.sourcevbo, batch->mesh[0]);
|
||||
}
|
||||
|
||||
sh = batch->shader;
|
||||
|
|
|
@ -426,7 +426,7 @@ static image_t *Font_GetTrackerImage(unsigned int imid)
|
|||
{
|
||||
if (!*trackerimages[imid].name)
|
||||
return NULL;
|
||||
trackerimages[imid].image = Image_GetTexture(trackerimages[imid].name, NULL, IF_PREMULTIPLYALPHA|IF_UIPIC, NULL, NULL, 0, 0, TF_INVALID);
|
||||
trackerimages[imid].image = Image_GetTexture(trackerimages[imid].name, NULL, IF_PREMULTIPLYALPHA|IF_UIPIC|IF_NOPURGE, NULL, NULL, 0, 0, TF_INVALID);
|
||||
}
|
||||
if (!trackerimages[imid].image)
|
||||
return NULL;
|
||||
|
@ -443,7 +443,7 @@ qboolean Font_TrackerValid(unsigned int imid)
|
|||
{
|
||||
if (!*trackerimages[imid].name)
|
||||
return false;
|
||||
trackerimages[imid].image = Image_GetTexture(trackerimages[imid].name, NULL, IF_PREMULTIPLYALPHA|IF_UIPIC, NULL, NULL, 0, 0, TF_INVALID);
|
||||
trackerimages[imid].image = Image_GetTexture(trackerimages[imid].name, NULL, IF_PREMULTIPLYALPHA|IF_UIPIC|IF_NOPURGE, NULL, NULL, 0, 0, TF_INVALID);
|
||||
}
|
||||
if (!trackerimages[imid].image)
|
||||
return false;
|
||||
|
|
|
@ -5738,7 +5738,7 @@ void Terr_Brush_Draw(heightmap_t *hm, batch_t **batches, entity_t *e)
|
|||
{
|
||||
if (br->faces[j].relight && dorelight)
|
||||
{
|
||||
lightstyleindex_t styles[4] = {0,INVALID_LIGHTSTYLE,INVALID_LIGHTSTYLE,INVALID_LIGHTSTYLE};
|
||||
lightstyleindex_t styles[max(2,MAXCPULIGHTMAPS)] = {0,INVALID_LIGHTSTYLE};
|
||||
int texsize[2] = {br->faces[j].lmextents[0]-1, br->faces[j].lmextents[1]-1};
|
||||
vec2_t exactmins, exactmaxs;
|
||||
int m, k;
|
||||
|
|
|
@ -397,6 +397,11 @@ qboolean QDECL Mod_LoadHLModel (model_t *mod, void *buffer, size_t fsize)
|
|||
Q_snprintfz(shaders[i].name, sizeof(shaders[i].name), "common/hlmodel_fullbright");
|
||||
}
|
||||
}
|
||||
else if ( (tex[i].flags & HLMDLFL_MASKED) || (tex[i].flags & (HLMDLFL_MASKED | HLMDLFL_ALPHASOLID)))
|
||||
{
|
||||
shader = HLSHADER_MASKED;
|
||||
Q_snprintfz(shaders[i].name, sizeof(shaders[i].name), "common/hlmodel_masked");
|
||||
}
|
||||
else if (tex[i].flags & HLMDLFL_CHROME)
|
||||
{
|
||||
shader = HLSHADER_CHROME;
|
||||
|
@ -549,6 +554,32 @@ qboolean QDECL Mod_LoadHLModel (model_t *mod, void *buffer, size_t fsize)
|
|||
Q_snprintfz(texname, sizeof(texname), "%s*%i", mod->name, shaders[i].atlasid);
|
||||
shaders[i].defaulttex.base = Image_GetTexture(texname, "", IF_NOALPHA|IF_NOREPLACE, in, pal, tex[i].w, tex[i].h, TF_8PAL24);
|
||||
}
|
||||
else if (tex[i].flags & HLMDLFL_MASKED)
|
||||
{
|
||||
int k = 0;
|
||||
qbyte *in = (qbyte *) texheader + tex[i].offset;
|
||||
qbyte *pal = (qbyte *) texheader + tex[i].w * tex[i].h + tex[i].offset;
|
||||
qbyte alphaPal[1024]; /* 256 color 32-bit palette */
|
||||
|
||||
for (k = 0; k < 255; k+= 1) {
|
||||
int p = k * 4;
|
||||
int x = k * 3;
|
||||
alphaPal[p + 0] = pal[x + 0];
|
||||
alphaPal[p + 1] = pal[x + 1];
|
||||
alphaPal[p + 2] = pal[x + 2];
|
||||
alphaPal[p + 3] = 255;
|
||||
}
|
||||
|
||||
/* pal index 255 = always transparent ~eukara */
|
||||
alphaPal[255*4+0] = 0;
|
||||
alphaPal[255*4+1] = 0;
|
||||
alphaPal[255*4+2] = 0;
|
||||
alphaPal[255*4+3] = 0;
|
||||
|
||||
shaders[i].atlasid = j++;
|
||||
Q_snprintfz(texname, sizeof(texname), "%s*%i", mod->name, shaders[i].atlasid);
|
||||
shaders[i].defaulttex.base = Image_GetTexture(texname, "", IF_NOREPLACE, in, alphaPal, tex[i].w, tex[i].h, TF_8PAL32);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#define HLMDLFL_FLAT 0x0001
|
||||
#define HLMDLFL_CHROME 0x0002
|
||||
#define HLMDLFL_FULLBRIGHT 0x0004
|
||||
#define HLMDLFL_MASKED 0x0040
|
||||
#define HLMDLFL_ALPHASOLID 0x0800
|
||||
|
||||
#define HLSHADER_FULLBRIGHT \
|
||||
"{\n" \
|
||||
|
@ -37,6 +39,16 @@
|
|||
"}\n" \
|
||||
"}\n"
|
||||
|
||||
#define HLSHADER_MASKED \
|
||||
"{\n" \
|
||||
"program defaultskin#MASK=0.5\n" \
|
||||
"{\n" \
|
||||
"map $diffuse\n" \
|
||||
"rgbgen lightingdiffuse\n" \
|
||||
"alphaFunc GE128\n" \
|
||||
"}\n" \
|
||||
"}\n"
|
||||
|
||||
#define HLSHADER_FULLBRIGHTCHROME \
|
||||
"{\n" \
|
||||
"program defaultskin#CHROME\n" \
|
||||
|
|
|
@ -2700,7 +2700,7 @@ QCC_sref_t QCC_PR_StatementFlags ( QCC_opcode_t *op, QCC_sref_t var_a, QCC_sref_
|
|||
char typea[256], typeb[256];
|
||||
QCC_statement_t *statement;
|
||||
QCC_sref_t var_c=nullsref;
|
||||
|
||||
pbool nan_eq_cond, sym_cmp;
|
||||
|
||||
if (var_a.sym)
|
||||
{
|
||||
|
@ -3618,7 +3618,8 @@ QCC_sref_t QCC_PR_StatementFlags ( QCC_opcode_t *op, QCC_sref_t var_a, QCC_sref_
|
|||
|
||||
// self-comparison that is impacted when NaN
|
||||
// e.g. NaN == NaN, NaN != NaN, [NaN, 0, 0] == [NaN, 0, 0], etc.
|
||||
pbool nan_eq_cond = false;
|
||||
nan_eq_cond = false;
|
||||
|
||||
switch (op - pr_opcodes)
|
||||
{
|
||||
case OP_STATE:
|
||||
|
@ -3840,7 +3841,7 @@ QCC_sref_t QCC_PR_StatementFlags ( QCC_opcode_t *op, QCC_sref_t var_a, QCC_sref_
|
|||
QCC_PR_ParseWarning(WARN_STRICTTYPEMISMATCH, "'%s' type mismatch: %s with %s", op->name, typea, typeb);
|
||||
}
|
||||
|
||||
pbool sym_cmp = !nan_eq_cond && var_a.sym == var_b.sym && var_a.ofs == var_b.ofs;
|
||||
sym_cmp = !nan_eq_cond && var_a.sym == var_b.sym && var_a.ofs == var_b.ofs;
|
||||
|
||||
if ((var_a.sym->constant && var_b.sym->constant && !var_a.sym->temp && !var_b.sym->temp) || sym_cmp)
|
||||
{
|
||||
|
|
|
@ -960,8 +960,10 @@ static qboolean Route_Process(struct routecalc_s *r)
|
|||
{
|
||||
struct wpneighbour_s *l = &wp->neighbour[u];
|
||||
int linkidx = l->node;
|
||||
|
||||
float realcost = nodecost[nodeidx] + l->linkcost;
|
||||
|
||||
if (l->linkflags & r->denylinkflags)
|
||||
continue;
|
||||
#ifdef _DEBUG
|
||||
if (linkidx < 0 || linkidx >= n->numwaypoints)
|
||||
{
|
||||
|
|
|
@ -83,7 +83,7 @@ void SV_FindProxies(SOCKET sock, cluster_t *cluster, sv_t *defaultqtv)
|
|||
if (cluster->maxproxies >= 0 && cluster->numproxies >= cluster->maxproxies)
|
||||
{
|
||||
const char buffer[] = {dem_all, 1, 'P','r','o','x','y',' ','i','s',' ','f','u','l','l','.'};
|
||||
send(sock, buffer, strlen(buffer), 0);
|
||||
send(sock, buffer, sizeof(buffer), 0);
|
||||
closesocket(sock);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ void NET_InitUDPSocket(cluster_t *cluster, int port, int socketid)
|
|||
Sys_Printf(cluster, "opened udp port %i\n", port);
|
||||
}
|
||||
|
||||
SOCKET NET_ChooseSocket(SOCKET sock[2], netadr_t *toadr, netadr_t ina)
|
||||
SOCKET NET_ChooseSocket(SOCKET sock[SOCKETGROUPS], netadr_t *toadr, netadr_t ina)
|
||||
{
|
||||
#ifdef AF_INET6
|
||||
if (((struct sockaddr *)ina.sockaddr)->sa_family == AF_INET6)
|
||||
|
@ -120,7 +120,7 @@ SOCKET NET_ChooseSocket(SOCKET sock[2], netadr_t *toadr, netadr_t ina)
|
|||
*toadr = ina;
|
||||
return sock[SG_IPV6];
|
||||
}
|
||||
if (sock[0] == INVALID_SOCKET && sock[SG_IPV6] != INVALID_SOCKET)
|
||||
if (sock[SG_IPV4] == INVALID_SOCKET && sock[SG_IPV6] != INVALID_SOCKET)
|
||||
{
|
||||
struct sockaddr_in6 *out = (struct sockaddr_in6*)toadr->sockaddr;
|
||||
struct sockaddr_in *in = (struct sockaddr_in*)ina.sockaddr;
|
||||
|
|
|
@ -947,7 +947,7 @@ void Netchan_OutOfBandPrint (cluster_t *cluster, netadr_t adr, char *format, ...
|
|||
//int Netchan_IsLocal (netadr_t adr);
|
||||
void NET_InitUDPSocket(cluster_t *cluster, int port, int socketid);
|
||||
void NET_SendPacket(cluster_t *cluster, SOCKET sock, int length, void *data, netadr_t adr);
|
||||
SOCKET NET_ChooseSocket(SOCKET sock[], netadr_t *toadr, netadr_t in);
|
||||
SOCKET NET_ChooseSocket(SOCKET sock[SOCKETGROUPS], netadr_t *toadr, netadr_t in);
|
||||
qboolean Net_CompareAddress(netadr_t *s1, netadr_t *s2, int qp1, int qp2);
|
||||
qboolean Netchan_Process (netchan_t *chan, netmsg_t *msg);
|
||||
qboolean NQNetchan_Process(cluster_t *cluster, netchan_t *chan, netmsg_t *msg);
|
||||
|
|
10
fteqtv/qw.c
10
fteqtv/qw.c
|
@ -2728,7 +2728,7 @@ I've removed the following from this function as it covered the menu (~Moodles):
|
|||
else if (!strcmp(command, "guidemos"))
|
||||
{
|
||||
int maxshowndemos;
|
||||
char sizestr[7];
|
||||
char sizestr[11];
|
||||
int start;
|
||||
int i;
|
||||
|
||||
|
@ -2776,13 +2776,13 @@ I've removed the following from this function as it covered the menu (~Moodles):
|
|||
if (i >= cluster->availdemoscount)
|
||||
break;
|
||||
if (cluster->availdemos[i].size < 1024)
|
||||
sprintf(sizestr, "%4ib", cluster->availdemos[i].size);
|
||||
snprintf(sizestr, sizeof(sizestr), "%4ib", cluster->availdemos[i].size);
|
||||
else if (cluster->availdemos[i].size < 1024*1024)
|
||||
sprintf(sizestr, "%4ikb", cluster->availdemos[i].size/1024);
|
||||
snprintf(sizestr, sizeof(sizestr), "%4ikb", cluster->availdemos[i].size/1024);
|
||||
else if (cluster->availdemos[i].size < 1024*1024*1024)
|
||||
sprintf(sizestr, "%4imb", cluster->availdemos[i].size/(1024*1024));
|
||||
snprintf(sizestr, sizeof(sizestr), "%4imb", cluster->availdemos[i].size/(1024*1024));
|
||||
else// if (cluster->availdemos[i].size < 1024*1024*1024*1024)
|
||||
sprintf(sizestr, "%4igb", cluster->availdemos[i].size/(1024*1024*1024));
|
||||
snprintf(sizestr, sizeof(sizestr), "%4igb", cluster->availdemos[i].size/(1024*1024*1024));
|
||||
// else
|
||||
// *sizestr = 0;
|
||||
QW_StuffcmdToViewer(v, "menutext 32 %i \"%6s %-30s\" \"demo %s\"\n", (i-start)*8 + 52+16, sizestr, cluster->availdemos[i].name, cluster->availdemos[i].name);
|
||||
|
|
|
@ -233,7 +233,7 @@ mpic_t *Draw_CachePicSafe(const char *name, qbool crash, qbool ignorewad)
|
|||
mpic_t *Draw_CacheWadPic(const char *name)
|
||||
{
|
||||
char ftename[MAX_QPATH];
|
||||
Q_snprintf(ftename, sizeof(ftename), "gfx/%s.lmp", name);
|
||||
Q_snprintf(ftename, sizeof(ftename), "gfx/%s", name);
|
||||
return (mpic_t*)(qintptr_t)drawfuncs->LoadImage(ftename);
|
||||
}
|
||||
|
||||
|
|
|
@ -7969,8 +7969,8 @@ static void SCR_HUD_DrawNotImplemented(hud_t *hud)
|
|||
width = 8 * strlen(line1);
|
||||
height = 8;
|
||||
|
||||
if (!HUD_PrepareDraw(hud, width, height, &x, &y))
|
||||
return;
|
||||
if (!HUD_PrepareDraw(hud, width, height, &x, &y))
|
||||
return;
|
||||
|
||||
Draw_SString(x, y, line1, 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue