git-svn-id: https://svn.eduke32.com/eduke32@921 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-07-30 02:51:32 +00:00
parent e344cf477e
commit 534d1f4c89
6 changed files with 116 additions and 78 deletions

View file

@ -568,7 +568,7 @@ int mdloadskin_trytexcache(char *fn, int len, int pal, char effect, texcachehead
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
{
// lacking the necessary extensions to do this
initprintf("Warning: the GL driver lacks necessary functions to use caching\n");
OSD_Printf("Warning: the GL driver lacks necessary functions to use caching\n");
glusetexcache = 0;
return -1;
}
@ -745,7 +745,7 @@ int mdloadskin(md2model *m, int number, int pal, int surf)
if ((filh = kopen4load(fn, 0)) < 0)
{
initprintf("Skin %s not found.\n",fn);
OSD_Printf("Skin %s not found.\n",fn);
skinfile[0] = 0;
return 0;
}
@ -773,7 +773,7 @@ int mdloadskin(md2model *m, int number, int pal, int surf)
if (daskinloader(filh,&fptr,&bpl,&xsiz,&ysiz,&osizx,&osizy,&hasalpha,pal,(globalnoeffect)?0:hictinting[pal].f,m,number,surf))
{
kclose(filh);
initprintf("Failed loading skin file \"%s\"\n", fn);
OSD_Printf("Failed loading skin file \"%s\"\n", fn);
skinfile[0] = 0;
return(0);
}
@ -860,7 +860,7 @@ int mdloadskin(md2model *m, int number, int pal, int surf)
if (ysiz == pow2long[j]) { i |= 2; }
}
cachead.flags = (i!=3) | (hasalpha ? 2 : 0);
initprintf("No cached tex for %s.\n",fn);
OSD_Printf("No cached tex for %s.\n",fn);
writexcache(fn, picfillen, pal<<8, (globalnoeffect)?0:hictinting[pal].f, &cachead);
}

View file

@ -1225,7 +1225,7 @@ int trytexcache(char *fn, int len, int dameth, char effect, texcacheheader *head
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
{
// lacking the necessary extensions to do this
initprintf("Warning: the GL driver lacks necessary functions to use caching\n");
OSD_Printf("Warning: the GL driver lacks necessary functions to use caching\n");
glusetexcache = 0;
return -1;
}
@ -1274,11 +1274,11 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
unsigned int padx=0, pady=0;
GLuint gi;
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) {initprintf("\n");return;}
if (!glinfo.texcompr || !glusetexcompr || !glusetexcache) {OSD_Printf("\n");return;}
if (!bglCompressedTexImage2DARB || !bglGetCompressedTexImageARB)
{
// lacking the necessary extensions to do this
initprintf("Warning: the GL driver lacks necessary functions to use caching\n");
OSD_Printf("Warning: the GL driver lacks necessary functions to use caching\n");
glusetexcache = 0;
return;
}
@ -1292,11 +1292,11 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
// try to create the cache directory
if (Bmkdir(TEXCACHEDIR, S_IRWXU) < 0)
{
initprintf("Failed to create texture cache directory %s\n", TEXCACHEDIR);
OSD_Printf("Failed to create texture cache directory %s\n", TEXCACHEDIR);
glusetexcache = 0;
return;
}
else initprintf("Created texture cache directory %s\n", TEXCACHEDIR);
else OSD_Printf("Created texture cache directory %s\n", TEXCACHEDIR);
}
else
{
@ -1323,7 +1323,7 @@ void writexcache(char *fn, int len, int dameth, char effect, texcacheheader *hea
for (fp = 0; fp < 16; phex(mdsum[fp++], cp), cp+=2);
sprintf(cp, "-%x-%x%x", len, dameth, effect);
initprintf("Writing cached tex: %s\n", cachefn);
OSD_Printf("Writing cached tex: %s\n", cachefn);
fil = Bopen(cachefn,BO_BINARY|BO_CREAT|BO_TRUNC|BO_RDWR,BS_IREAD|BS_IWRITE);
if (fil < 0) return;
@ -1452,7 +1452,7 @@ int gloadtile_cached(int fil, texcacheheader *head, int *doalloc, pthtyp *pth,in
format = B_LITTLE32(format);
if (pict.format != format)
{
initprintf("invalid texture cache file format %d %d\n",pict.format, format);
OSD_Printf("invalid texture cache file format %d %d\n",pict.format, format);
goto failure;
}
}
@ -1522,7 +1522,7 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
if ((filh = kopen4load(fn, 0)) < 0)
{
initprintf("hightile: %s (pic %d) not found\n", fn, dapic);
OSD_Printf("hightile: %s (pic %d) not found\n", fn, dapic);
if (facen > 0)
hicr->skybox->ignore = 1;
else
@ -1719,7 +1719,7 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
if (ysiz == pow2long[j]) { x |= 2; }
}
cachead.flags = (x!=3) | (hasalpha != 255 ? 2 : 0);
initprintf("No cached tex for tile %d pal %d.\n",dapic,dapalnum);
OSD_Printf("No cached tex for tile %d pal %d.\n",dapic,dapalnum);
writexcache(fn, picfillen+(dapalnum<<8), dameth, effect, &cachead);
}

View file

@ -118,7 +118,6 @@ extern void loadefs(const char *fn);
extern int furthestangle(int iActor,int angs);
extern void execute(int iActor,int iPlayer,int lDist);
extern void overwritesprite(int thex,int they,int tilenum,int shade,int stat,int dapalnum);
extern inline int minitext(int x,int y,const char *t,int p,int sb);
extern void gamenumber(int x,int y,int n,int s);
extern void Shutdown(void);
extern void getpackets(void);
@ -191,7 +190,6 @@ extern inline void setstatusbarscale(int sc);
extern void setgamepalette(player_struct *player, char *pal, int set);
extern void fadepal(int r, int g, int b, int start, int end, int step);
extern inline int minitextshade(int x,int y,const char *t,int s,int p,int sb);
extern inline int gametext_z(int small, int starttile, int x,int y,const char *t,int s,int p,int orientation,int x1, int y1, int x2, int y2,int z);
extern void txdigitalnumberz(int starttile, int x,int y,int n,int s,int pal,int cs,int x1, int y1, int x2, int y2, int z);
extern void myosx(int x,int y,int tilenum,int shade,int orientation);
@ -199,6 +197,11 @@ extern void myospalx(int x,int y,int tilenum,int shade,int orientation,int p);
extern void ResetGameVars(void);
extern void ResetActorGameVars(int iActor);
extern int minitext_(int x,int y,const char *t,int s,int p,int sb);
#define minitextshade(x, y, t, s, p, sb) minitext_(x,y,t,s,p,sb)
#define minitext(x, y, t, p, sb) minitext_(x,y,t,0,p,sb)
#define gametext(x,y,t,s,dabits) gametext_z(0,STARTALPHANUM, x,y,t,s,0,dabits,0, 0, xdim-1, ydim-1, 65536)
#define gametextpal(x,y,t,s,p) gametext_z(0,STARTALPHANUM, x,y,t,s,p,26,0, 0, xdim-1, ydim-1, 65536)
#define mgametext(x,y,t,s,dabits) gametext_z(2,STARTALPHANUM, x,y,t,s,0,dabits,0, 0, xdim-1, ydim-1, 65536)

View file

@ -405,7 +405,7 @@ static inline int mpgametext(int y,const char *t,int s,int dabits)
return(gametext_z(0,STARTALPHANUM, 5,y,t,s,0,dabits,0, 0, xdim-1, ydim-1, 65536));
}
static int minitext_(int x,int y,const char *t,int s,int p,int sb)
int minitext_(int x,int y,const char *t,int s,int p,int sb)
{
int ac;
char ch,cmode;
@ -417,6 +417,25 @@ static int minitext_(int x,int y,const char *t,int s,int p,int sb)
usehightile = (ht && !r_downsize);
while (*t)
{
if (*t == '^' && isdigit(*(t+1)))
{
char smallbuf[4];
t++;
if (isdigit(*(t+1)))
{
smallbuf[0] = *(t++);
smallbuf[1] = *(t++);
smallbuf[2] = '\0';
p = atol(smallbuf);
}
else
{
smallbuf[0] = *(t++);
smallbuf[1] = '\0';
p = atol(smallbuf);
}
continue;
}
ch = Btoupper(*t);
if (ch == 32)
{
@ -436,16 +455,6 @@ static int minitext_(int x,int y,const char *t,int s,int p,int sb)
return (x);
}
inline int minitextshade(int x,int y,const char *t,int s,int p,int sb)
{
return (minitext_(x,y,(char *)stripcolorcodes(t),s,p,sb));
}
inline int minitext(int x,int y,const char *t,int p,int sb)
{
return (minitext_(x,y,(char *)stripcolorcodes(t),0,p,sb));
}
#if 0
static void gamenumber(int x,int y,int n,char s)
{
@ -3175,7 +3184,7 @@ static void drawoverheadmap(int cposx, int cposy, int czoom, short cang)
else if (j > (65536<<1)) j = (65536<<1);
rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),j,daang,i,sprite[g_player[p].ps->i].shade,
(g_player[p].ps->cursectnum > -1)?sector[g_player[p].ps->cursectnum].floorpal:0,
(g_player[p].ps->cursectnum > -1)?sector[g_player[p].ps->cursectnum].floorpal:0,
(sprite[g_player[p].ps->i].cstat&2)>>1,windowx1,windowy1,windowx2,windowy2);
}
}
@ -3399,7 +3408,7 @@ void displayrest(int smoothratio)
if (ud.overhead_on == 2)
{
a = (ud.screen_size > 2)?scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100):5;
a = (ud.screen_size > 2)?scale(tilesizy[ud.screen_size==4?INVENTORYBOX:BOTTOMSTATUSBAR],ud.statusbarscale,100):5;
minitext(5,200-a-6-6-6-6,volume_names[ud.volume_number],0,2+8+16);
minitext(5,200-a-6-6-6-6-6,map[ud.volume_number*MAXLEVELS + ud.level_number].name,0,2+8+16);
}
@ -3505,22 +3514,22 @@ void displayrest(int smoothratio)
// JBF 20040124: display level stats in screen corner
if (ud.levelstats && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
{
i = (ud.screen_size > 2)?scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100):5;
i = (ud.screen_size > 2)?scale(tilesizy[ud.screen_size==4?INVENTORYBOX:BOTTOMSTATUSBAR],ud.statusbarscale,100):5;
Bsprintf(tempbuf,"T:%d:%02d",
Bsprintf(tempbuf,"T:^15%d:%02d",
(g_player[myconnectindex].ps->player_par/(26*60)),
(g_player[myconnectindex].ps->player_par/26)%60);
minitext(5,200-i-6-6-6,tempbuf,10,26);
if (ud.player_skill > 3 || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY)))
Bsprintf(tempbuf,"K:%d",(ud.multimode>1 &&!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))?g_player[i].ps->frag-g_player[i].ps->fraggedself:g_player[myconnectindex].ps->actors_killed);
Bsprintf(tempbuf,"K:^15%d",(ud.multimode>1 &&!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))?g_player[i].ps->frag-g_player[i].ps->fraggedself:g_player[myconnectindex].ps->actors_killed);
else
Bsprintf(tempbuf,"K:%d/%d",g_player[myconnectindex].ps->actors_killed,
Bsprintf(tempbuf,"K:^15%d/%d",g_player[myconnectindex].ps->actors_killed,
g_player[myconnectindex].ps->max_actors_killed>g_player[myconnectindex].ps->actors_killed?
g_player[myconnectindex].ps->max_actors_killed:g_player[myconnectindex].ps->actors_killed);
minitext(5,200-i-6-6,tempbuf,10,26);
Bsprintf(tempbuf,"S:%d/%d", g_player[myconnectindex].ps->secret_rooms,g_player[myconnectindex].ps->max_secret_rooms);
Bsprintf(tempbuf,"S:^15%d/%d", g_player[myconnectindex].ps->secret_rooms,g_player[myconnectindex].ps->max_secret_rooms);
minitext(5,200-i-6,tempbuf,10,26);
}
if (tintf > 0 || dotint) palto(tintr,tintg,tintb,tintf|128);

View file

@ -51,6 +51,8 @@ static char *mousebuttonnames[] = { "Left", "Right", "Middle", "Thumb", "Wheel U
extern int voting;
#define USERMAPENTRYLENGTH 25
void cmenu(int cm)
{
current_menu = cm;
@ -2227,14 +2229,26 @@ cheat_for_port_credits:
if (finddirshigh)
{
int len;
dir = finddirshigh;
for (i=0; i<6; i++) if (!dir->prev) break;
for (i=0; i<5; i++) if (!dir->prev) break;
else dir=dir->prev;
for (i=6; i>-7 && dir; i--, dir=dir->next)
for (i=5; i>-8 && dir; i--, dir=dir->next)
{
if (dir == finddirshigh && currentlist == 0) c=0;
else c=16;
minitextshade(40,1+12+32+8*(7-i),dir->name,c,0,26);
len = Bstrlen(dir->name);
Bstrncpy(tempbuf,dir->name,len);
if (len > USERMAPENTRYLENGTH)
{
len = USERMAPENTRYLENGTH-3;
tempbuf[len] = 0;
while (len < USERMAPENTRYLENGTH)
tempbuf[len++] = '.';
}
tempbuf[len] = 0;
minitextshade(40,1+12+32+8*(6-i),tempbuf,c,0,26);
}
}
@ -2242,14 +2256,26 @@ cheat_for_port_credits:
if (findfileshigh)
{
int len;
dir = findfileshigh;
for (i=0; i<7; i++) if (!dir->prev) break;
for (i=0; i<6; i++) if (!dir->prev) break;
else dir=dir->prev;
for (i=7; i>-7 && dir; i--, dir=dir->next)
for (i=6; i>-8 && dir; i--, dir=dir->next)
{
if (dir == findfileshigh && currentlist == 1) c=0;
else c=16;
minitextshade(180,1+12+32+8*(7-i),dir->name,c,2,26);
len = Bstrlen(dir->name);
Bstrncpy(tempbuf,dir->name,len);
if (len > USERMAPENTRYLENGTH)
{
len = USERMAPENTRYLENGTH-3;
tempbuf[len] = 0;
while (len < USERMAPENTRYLENGTH)
tempbuf[len++] = '.';
}
tempbuf[len] = 0;
minitextshade(180,1+12+32+8*(6-i),tempbuf,c,2,26);
}
}

View file

@ -3192,47 +3192,47 @@ void checksectors(int snum)
short j,hitscanwall;
if (p->cursectnum > -1)
switch (sector[p->cursectnum].lotag)
{
switch (sector[p->cursectnum].lotag)
{
case 32767:
sector[p->cursectnum].lotag = 0;
FTA(9,p);
p->secret_rooms++;
return;
case -1:
for (i=connecthead;i>=0;i=connectpoint2[i])
g_player[i].ps->gm = MODE_EOL;
sector[p->cursectnum].lotag = 0;
if (ud.from_bonus)
{
ud.level_number = ud.from_bonus;
ud.m_level_number = ud.level_number;
ud.from_bonus = 0;
}
else
{
ud.level_number++;
if (ud.level_number > MAXLEVELS-1)
ud.level_number = 0;
ud.m_level_number = ud.level_number;
}
return;
case -2:
sector[p->cursectnum].lotag = 0;
p->timebeforeexit = 26*8;
p->customexitsound = sector[p->cursectnum].hitag;
return;
default:
if (sector[p->cursectnum].lotag >= 10000 && sector[p->cursectnum].lotag < 16383)
{
if (snum == screenpeek || (gametype_flags[ud.coop]&GAMETYPE_FLAG_COOPSOUND))
spritesound(sector[p->cursectnum].lotag-10000,p->i);
case 32767:
sector[p->cursectnum].lotag = 0;
}
break;
FTA(9,p);
p->secret_rooms++;
return;
case -1:
for (i=connecthead;i>=0;i=connectpoint2[i])
g_player[i].ps->gm = MODE_EOL;
sector[p->cursectnum].lotag = 0;
if (ud.from_bonus)
{
ud.level_number = ud.from_bonus;
ud.m_level_number = ud.level_number;
ud.from_bonus = 0;
}
else
{
ud.level_number++;
if (ud.level_number > MAXLEVELS-1)
ud.level_number = 0;
ud.m_level_number = ud.level_number;
}
return;
case -2:
sector[p->cursectnum].lotag = 0;
p->timebeforeexit = 26*8;
p->customexitsound = sector[p->cursectnum].hitag;
return;
default:
if (sector[p->cursectnum].lotag >= 10000 && sector[p->cursectnum].lotag < 16383)
{
if (snum == screenpeek || (gametype_flags[ud.coop]&GAMETYPE_FLAG_COOPSOUND))
spritesound(sector[p->cursectnum].lotag-10000,p->i);
sector[p->cursectnum].lotag = 0;
}
break;
}
}
//After this point the the player effects the map with space