mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-14 16:31:38 +00:00
8d5b217266
r4169 | acceptthis | 2013-01-17 08:55:12 +0000 (Thu, 17 Jan 2013) | 31 lines removed MAX_VISEDICTS limit. PEXT2_REPLACEMENTDELTAS tweaked, now has 4 million entity limit. still not enabled by default. TE_BEAM now maps to a separate TEQW_BEAM to avoid conflicts with QW. added android multitouch emulation for windows/rawinput (in_simulatemultitouch). split topcolor/bottomcolor from scoreboard, for dp's colormap|1024 feature. now using utf-8 for windows consoles. qcc warnings/errors now give clickable console links for quick+easy editing. disabled menutint when the currently active item changes contrast or gamma (for OneManClan). Added support for drawfont/drawfontscale. tweaked the qcvm a little to reduce the number of pointers. .doll file loading. still experimental and will likely crash. requires csqc active, even if its a dummy progs. this will be fixed in time. Still other things that need cleaning up. windows: gl_font "?" shows the standard windows font-selection dialog, and can be used to select windows fonts. not all work. and you probably don't want to use windings. fixed splitscreen support when playing mvds. added mini-scoreboards to splitscreen. editor/debugger now shows asm if there's no linenumber info. also, pressing f1 for help shows the shortcuts. Added support for .framegroups files for psk(psa) and iqm formats. True support for ezquake's colour codes. Mutually exclusive with background colours. path command output slightly more readable. added support for digest_hex (MD4, SHA1, CRC16). skingroups now colourmap correctly. Fix terrain colour hints, and litdata from the wrong bsp. fix ftp dual-homed issue. support epsv command, and enable ipv6 (eprt still not supported). remove d3d11 compilation from the makefile. the required headers are not provided by mingw, and are not available to the build bot, so don't bother. fix v *= v.x and similar opcodes. fteqcc: fixed support for áéíóú type chars in names. utf-8 files now properly supported (even with the utf-8 bom/identifier). utf-16 also supported. fteqcc: fixed '#if 1 == 3 && 4' parsing. fteqcc: -Werror acts on the warning, rather than as a separate error. Line numbers are thus more readable. fteqcc: copyright message now includes compile date instead. fteqccgui: the treeview control is now coloured depending on whether there were warnings/errors in the last compile. fteqccgui: the output window is now focused and scrolls down as compilation progresses. pr_dumpplatform command dumps out some pragmas to convert more serious warnings to errors. This is to avoid the infamous 'fteqcc sucks cos my code sucks' issue. rewrote prespawn/modelist/soundlist code. server tracks progress now. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4167 fc73d0e0-1445-4013-8a0c-d673dee63da5
124 lines
2.7 KiB
C
124 lines
2.7 KiB
C
#include "quakedef.h"
|
|
#ifdef SWQUAKE
|
|
#include "sw.h"
|
|
|
|
|
|
|
|
texid_tf SW_AllocNewTexture(char *identifier, int w, int h, unsigned int flags)
|
|
{
|
|
texid_t n;
|
|
swimage_t *img;
|
|
if (w & 3)
|
|
return r_nulltex;
|
|
img = BZ_Malloc(sizeof(*img) - sizeof(img->data) + (w * h * 4));
|
|
|
|
Q_strncpy(img->name, identifier, sizeof(img->name));
|
|
img->width = w;
|
|
img->height = h;
|
|
img->pitch = w;
|
|
|
|
n.ptr = img;
|
|
n.ref = &img->com;
|
|
return n;
|
|
}
|
|
texid_tf SW_FindTexture(char *identifier, unsigned int flags)
|
|
{
|
|
return r_nulltex;
|
|
}
|
|
|
|
void SW_RGBToBGR(swimage_t *img)
|
|
{
|
|
int x, y;
|
|
unsigned int *d = img->data;
|
|
for (y = 0; y < img->height; y++)
|
|
{
|
|
for (x = 0; x < img->width; x++)
|
|
{
|
|
d[x] = (d[x]&0xff00ff00) | ((d[x]&0xff)<<16) | ((d[x]&0xff0000)>>16);
|
|
}
|
|
d += img->pitch;
|
|
}
|
|
}
|
|
void SW_Upload32(swimage_t *img, int w, int h, unsigned int *data)
|
|
{
|
|
int x, y;
|
|
unsigned int *out = img->data;
|
|
for (y = 0; y < h; y++)
|
|
{
|
|
for (x = 0; x < w; x++)
|
|
{
|
|
out[x] = *data++;
|
|
}
|
|
out += img->pitch;
|
|
}
|
|
SW_RGBToBGR(img);
|
|
}
|
|
void SW_Upload8(swimage_t *img, int w, int h, unsigned char *data)
|
|
{
|
|
int x, y;
|
|
unsigned int *out = img->data;
|
|
for (y = 0; y < h; y++)
|
|
{
|
|
for (x = 0; x < w; x++)
|
|
{
|
|
out[x] = d_8to24rgbtable[*data++];
|
|
}
|
|
out += img->pitch;
|
|
}
|
|
SW_RGBToBGR(img);
|
|
}
|
|
|
|
texid_tf SW_LoadTexture(char *identifier, int width, int height, uploadfmt_t fmt, void *data, unsigned int flags)
|
|
{
|
|
texid_t img = SW_FindTexture(identifier, flags);
|
|
if (!img.ptr)
|
|
img = SW_AllocNewTexture(identifier, width, height, flags);
|
|
if (!img.ptr)
|
|
return r_nulltex;
|
|
switch(fmt)
|
|
{
|
|
case TF_SOLID8:
|
|
SW_Upload8(img.ptr, width, height, data);
|
|
break;
|
|
case TF_TRANS8:
|
|
SW_Upload8(img.ptr, width, height, data);
|
|
break;
|
|
case TF_TRANS8_FULLBRIGHT:
|
|
SW_Upload8(img.ptr, width, height, data);
|
|
break;
|
|
case TF_RGBA32:
|
|
SW_Upload32(img.ptr, width, height, data);
|
|
break;
|
|
default:
|
|
//shouldn't happen, so I'm gonna leak
|
|
Con_Printf("SW_LoadTexture: unsupported format %i\n", fmt);
|
|
return r_nulltex;
|
|
}
|
|
return img;
|
|
}
|
|
texid_tf SW_LoadTexture8Pal24(char *identifier, int width, int height, qbyte *data, qbyte *palette24, unsigned int flags)
|
|
{
|
|
return r_nulltex;
|
|
}
|
|
texid_tf SW_LoadTexture8Pal32(char *identifier, int width, int height, qbyte *data, qbyte *palette32, unsigned int flags)
|
|
{
|
|
return r_nulltex;
|
|
}
|
|
texid_tf SW_LoadCompressed(char *name)
|
|
{
|
|
return r_nulltex;
|
|
}
|
|
void SW_Upload(texid_t tex, char *name, uploadfmt_t fmt, void *data, void *palette, int width, int height, unsigned int flags)
|
|
{
|
|
}
|
|
void SW_DestroyTexture(texid_t tex)
|
|
{
|
|
swimage_t *img = tex.ptr;
|
|
|
|
/*make sure its not in use by the renderer*/
|
|
SWRast_Sync(&commandqueue);
|
|
|
|
/*okay, it can be killed*/
|
|
BZ_Free(img);
|
|
}
|
|
#endif
|