Manage base palette as IDs instead of passing pointers around ($10 says I broke something). Corresponding engine change will be coming up; this is in prevision of highpal handling of game palettes.

git-svn-id: https://svn.eduke32.com/eduke32@1772 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2011-01-17 03:49:34 +00:00
parent 517bb2aa50
commit 4a2fd12f4b
11 changed files with 86 additions and 80 deletions

View file

@ -235,11 +235,13 @@ void G_PlayAnim(const char *fn,char t)
ANIM_LoadAnim(animbuf);
numframes = ANIM_NumFrames();
animpal = ANIM_GetPalette();
anim_pal = ANIM_GetPalette();
basepaltable[ANIMPAL] = anim_pal;
//setpalette(0L,256L,tempbuf);
//setbrightness(ud.brightness>>2,tempbuf,2);
P_SetGamePalette(g_player[myconnectindex].ps,animpal,10);
P_SetGamePalette(g_player[myconnectindex].ps,ANIMPAL,10);
#if defined(POLYMOST) && defined(USE_OPENGL)
gltexfiltermode = 0;
@ -271,7 +273,7 @@ void G_PlayAnim(const char *fn,char t)
if (g_restorePalette == 1)
{
P_SetGamePalette(g_player[myconnectindex].ps,animpal,0);
P_SetGamePalette(g_player[myconnectindex].ps,ANIMPAL,0);
g_restorePalette = 0;
}

View file

@ -344,7 +344,7 @@ RECHECK:
goto RECHECK;
}
fadepal(0,0,0, 0,63,7);
P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
G_DrawBackground();
M_DisplayMenus();
//g_player[myconnectindex].ps->palette = palette;

View file

@ -99,7 +99,11 @@ char boardfilename[BMAX_PATH] = {0}, currentboardfilename[BMAX_PATH] = {0};
static char g_rootDir[BMAX_PATH];
char g_modDir[BMAX_PATH] = "/";
uint8_t waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768], *animpal;
uint8_t water_pal[768],slime_pal[768],title_pal[768],dre_alms[768],ending_pal[768],*anim_pal;
uint8_t *basepaltable[BASEPALCOUNT] = { palette, water_pal, slime_pal, title_pal, dre_alms, ending_pal, NULL };
static int32_t g_skipDefaultCons = 0;
int32_t voting = -1;
@ -279,18 +283,20 @@ static void G_PatchStatusBar(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
// else rotatesprite(tx,ty,scl,0,BOTTOMSTATUSBAR,4,0,10+16+64,clx1,cly1,clx2+clofx-1,cly2+clofy-1);
}
void P_SetGamePalette(DukePlayer_t *player, uint8_t *pal, int32_t set)
void P_SetGamePalette(DukePlayer_t *player, uint8_t palid, int32_t set)
{
if (!(pal == palette || pal == waterpal || pal == slimepal || pal == drealms || pal == titlepal || pal == endingpal || pal == animpal))
pal = palette;
if (palid >= BASEPALCOUNT)
palid = BASEPAL;
if (player != g_player[screenpeek].ps)
{
player->palette = pal;
player->palette = palid;
return;
}
player->palette = palid;
setbrightness(ud.brightness>>2, (player->palette = pal), set);
setbrightness(ud.brightness>>2, basepaltable[palid], set);
}
int32_t G_PrintGameText(int32_t f, int32_t tile, int32_t x, int32_t y, const char *t,
@ -1916,7 +1922,7 @@ static void G_DisplayExtraScreens(void)
setview(0,0,xdim-1,ydim-1);
flushperms();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
fadepal(0,0,0, 0,64,7);
KB_FlushKeyboardQueue();
rotatesprite(0,0,65536L,0,3291,0,0,2+8+16+64+(ud.bgstretch?1024:0), 0,0,xdim-1,ydim-1);
@ -1943,7 +1949,7 @@ static void G_DisplayExtraScreens(void)
setview(0,0,xdim-1,ydim-1);
flushperms();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
fadepal(0,0,0, 0,64,7);
KB_FlushKeyboardQueue();
rotatesprite(0,0,65536L,0,TENSCREEN,0,0,2+8+16+64+(ud.bgstretch?1024:0), 0,0,xdim-1,ydim-1);
@ -1961,7 +1967,7 @@ extern int32_t g_doQuickSave;
void G_GameExit(const char *t)
{
if (*t != 0) g_player[myconnectindex].ps->palette = (uint8_t *) &palette[0];
if (*t != 0) g_player[myconnectindex].ps->palette = BASEPAL;
if (ud.recstat == 1) G_CloseDemoWrite();
else if (ud.recstat == 2)
@ -2534,12 +2540,12 @@ void G_DisplayRest(int32_t smoothratio)
// this takes care of fullscreen tint for OpenGL
if (getrendermode() >= 3)
{
if (pp->palette == waterpal)
if (pp->palette == WATERPAL)
{
static palette_t wp = { 224, 192, 255, 0 };
Bmemcpy(&hictinting[MAXPALOOKUPS-1], &wp, sizeof(palette_t));
}
else if (pp->palette == slimepal)
else if (pp->palette == SLIMEPAL)
{
static palette_t sp = { 208, 255, 192, 0 };
Bmemcpy(&hictinting[MAXPALOOKUPS-1], &sp, sizeof(palette_t));
@ -8698,7 +8704,7 @@ static void G_DisplayLogo(void)
//G_FadePalette(0,0,0,63);
if (logoflags & LOGO_3DRSCREEN)
{
P_SetGamePalette(g_player[myconnectindex].ps, drealms, 11); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, DREALMSPAL, 11); // JBF 20040308
fadepal(0,0,0, 0,64,7);
flushperms();
rotatesprite(0,0,65536L,0,DREALMS,0,0,2+8+16+(ud.bgstretch?1024:0), 0,0,xdim-1,ydim-1);
@ -8729,7 +8735,7 @@ static void G_DisplayLogo(void)
if (logoflags & LOGO_TITLESCREEN)
{
//g_player[myconnectindex].ps->palette = titlepal;
P_SetGamePalette(g_player[myconnectindex].ps, titlepal, 11); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 11); // JBF 20040308
flushperms();
rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16,0,0,xdim-1,ydim-1);
KB_FlushKeyboardQueue();
@ -8816,7 +8822,7 @@ static void G_DisplayLogo(void)
nextpage();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
S_PlaySound(NITEVISION_ONOFF);
//G_FadePalette(0,0,0,0);
@ -9006,15 +9012,15 @@ static void G_LoadExtraPalettes(void)
makepalookup(g_numRealPalettes + 2, tempbuf, 0, 15, 0, 1);
makepalookup(g_numRealPalettes + 3, tempbuf, 0, 0, 15, 1);
kread(fp,&waterpal[0],768);
kread(fp,&slimepal[0],768);
kread(fp,&titlepal[0],768);
kread(fp,&drealms[0],768);
kread(fp,&endingpal[0],768);
kread(fp,&water_pal[0],768);
kread(fp,&slime_pal[0],768);
kread(fp,&title_pal[0],768);
kread(fp,&dre_alms[0],768);
kread(fp,&ending_pal[0],768);
palette[765] = palette[766] = palette[767] = 0;
slimepal[765] = slimepal[766] = slimepal[767] = 0;
waterpal[765] = waterpal[766] = waterpal[767] = 0;
slime_pal[765] = slime_pal[766] = slime_pal[767] = 0;
water_pal[765] = water_pal[766] = water_pal[767] = 0;
kclose(fp);
}
@ -9218,7 +9224,7 @@ void G_BackToMenu(void)
int32_t G_EndOfLevel(void)
{
P_SetGamePalette(g_player[myconnectindex].ps, palette, 0);
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0);
P_UpdateScreenPal(g_player[myconnectindex].ps);
if (g_player[myconnectindex].ps->gm&MODE_EOL)
@ -9764,7 +9770,7 @@ CLEAN_DIRECTORY:
if (!g_player[i].sync) g_player[i].sync = (input_t *)Bcalloc(1, sizeof(input_t));
}
g_player[myconnectindex].ps->palette = (uint8_t *)&palette[0];
g_player[myconnectindex].ps->palette = BASEPAL;
i = 1;
for (j=numplayers; j<ud.multimode; j++)
@ -9904,7 +9910,7 @@ CLEAN_DIRECTORY:
ud.config.ScreenBPP = bpp[i];
}
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
S_MusicStartup();
S_SoundStartup();
@ -9915,7 +9921,7 @@ CLEAN_DIRECTORY:
clearview(0L);
//g_player[myconnectindex].ps->palette = palette;
//G_FadePalette(0,0,0,0);
P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
rotatesprite(320<<15,200<<15,65536L,0,LOADSCREEN,0,0,2+8+64+(ud.bgstretch?1024:0),0,0,xdim-1,ydim-1);
menutext(160,105,0,0,"LOADING SAVED GAME...");
nextpage();
@ -10327,7 +10333,7 @@ static void G_DoOrderScreen(void)
fadepal(0,0,0, 0,63,7);
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
KB_FlushKeyboardQueue();
rotatesprite(0,0,65536L,0,ORDERING,0,0,2+8+16+64+(ud.bgstretch?1024:0), 0,0,xdim-1,ydim-1);
fadepal(0,0,0, 63,0,-7);
@ -10432,7 +10438,7 @@ void G_BonusScreen(int32_t bonusonly)
case 0:
if (ud.lockout == 0)
{
P_SetGamePalette(g_player[myconnectindex].ps, endingpal, 11); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, ENDINGPAL, 11); // JBF 20040308
clearview(0L);
rotatesprite(0,50<<16,65536L,0,VICTORY1,0,0,2+8+16+64+128+(ud.bgstretch?1024:0),0,0,xdim-1,ydim-1);
nextpage();
@ -10495,7 +10501,7 @@ void G_BonusScreen(int32_t bonusonly)
KB_FlushKeyboardQueue();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 11); // JBF 20040308
rotatesprite(0,0,65536L,0,3292,0,0,2+8+16+64+(ud.bgstretch?1024:0), 0,0,xdim-1,ydim-1);
fadepal(0,0,0, 63,0,-1);
@ -10528,7 +10534,7 @@ void G_BonusScreen(int32_t bonusonly)
setview(0,0,xdim-1,ydim-1);
KB_FlushKeyboardQueue();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 11); // JBF 20040308
rotatesprite(0,0,65536L,0,3293,0,0,2+8+16+64+(ud.bgstretch?1024:0), 0,0,xdim-1,ydim-1);
fadepal(0,0,0, 63,0,-1);
while (!KB_KeyWaiting() && !MOUSE_GetButtons()&LEFT_MOUSE && !BUTTON(gamefunc_Fire) && !BUTTON(gamefunc_Open))
@ -10568,7 +10574,7 @@ void G_BonusScreen(int32_t bonusonly)
KB_FlushKeyBoardQueue();
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 11); // JBF 20040308
G_FadePalette(0,0,0,63);
clearview(0L);
menutext(160,60,0,0,"THANKS TO ALL OUR");
@ -10698,7 +10704,7 @@ ENDANM:
FRAGBONUS:
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 11); // JBF 20040308
G_FadePalette(0,0,0,63); // JBF 20031228
KB_FlushKeyboardQueue();
totalclock = 0;

View file

@ -227,7 +227,21 @@ extern palette_t DefaultCrosshairColors;
extern uint32_t g_frameDelay;
extern uint8_t waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768],*animpal;
#define BASEPALCOUNT 7
extern uint8_t water_pal[768],slime_pal[768],title_pal[768],dre_alms[768],ending_pal[768],*anim_pal;
extern uint8_t *basepaltable[BASEPALCOUNT];
typedef enum basepal_ {
BASEPAL = 0,
WATERPAL,
SLIMEPAL,
TITLEPAL,
DREALMSPAL,
ENDINGPAL,
ANIMPAL
} basepal_t;
extern user_defs ud;
@ -277,7 +291,7 @@ void G_Shutdown(void);
void G_UpdatePlayerFromMenu(void);
void M32RunScript(const char *s);
void P_DoQuote(int32_t q,DukePlayer_t *p);
void P_SetGamePalette(DukePlayer_t *player,uint8_t *pal,int32_t set);
void P_SetGamePalette(DukePlayer_t *player,uint8_t palid,int32_t set);
int32_t app_main(int32_t argc,const char **argv);
void computergetinput(int32_t snum,input_t *syn);
void fadepal(int32_t r,int32_t g,int32_t b,int32_t start,int32_t end,int32_t step);

View file

@ -4341,17 +4341,7 @@ nullquote:
case CON_SETGAMEPALETTE:
insptr++;
switch (Gv_GetVarX(*(insptr++)))
{
default:
case 0:P_SetGamePalette(g_player[vm.g_p].ps,palette ,0); break;
case 1:P_SetGamePalette(g_player[vm.g_p].ps,waterpal ,0); break;
case 2:P_SetGamePalette(g_player[vm.g_p].ps,slimepal ,0); break;
case 3:P_SetGamePalette(g_player[vm.g_p].ps,drealms ,0); break;
case 4:P_SetGamePalette(g_player[vm.g_p].ps,titlepal ,0); break;
case 5:P_SetGamePalette(g_player[vm.g_p].ps,endingpal,0); break;
case 6:P_SetGamePalette(g_player[vm.g_p].ps,animpal ,0); break;
}
P_SetGamePalette(g_player[vm.g_p].ps, Gv_GetVarX(*(insptr++)),0);
continue;
case CON_GETTEXTURECEILING:

View file

@ -555,7 +555,7 @@ void M_DisplayMenus(void)
if (g_netSync)
{
P_SetGamePalette(g_player[myconnectindex].ps, titlepal, 11);
P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 11);
rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1);
rotatesprite(160<<16,(104)<<16,60<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1);
@ -2613,7 +2613,7 @@ cheat_for_port_credits:
vid_gamma = (double)b/40960.f;
ud.brightness = (int32_t)(min(max((double)((vid_gamma-1.0)*10.0),0),15));
ud.brightness <<= 2;
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
}
b = (int32_t)(vid_contrast*40960.f);
@ -2622,7 +2622,7 @@ cheat_for_port_credits:
if (b != (vid_contrast*40960.f))
{
vid_contrast = (double)b/40960.f;
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
}
b = (int32_t)(vid_brightness*40960.f);
@ -2631,7 +2631,7 @@ cheat_for_port_credits:
if (b != (vid_brightness*40960.f))
{
vid_brightness = (double)b/40960.f;
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
}
if (x == 3)
@ -2640,7 +2640,7 @@ cheat_for_port_credits:
vid_contrast = DEFAULT_CONTRAST;
vid_brightness = DEFAULT_BRIGHTNESS;
ud.brightness = 0;
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
}
}

View file

@ -1928,7 +1928,7 @@ void Net_WaitForServer(void)
if ((g_netServer || ud.multimode > 1))
{
P_SetGamePalette(g_player[myconnectindex].ps, titlepal, 11);
P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 11);
rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1);
rotatesprite(160<<16,(104)<<16,60<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1);
@ -1955,7 +1955,7 @@ void Net_WaitForServer(void)
if (g_player[0].playerreadyflag > server_ready)
{
P_SetGamePalette(g_player[myconnectindex].ps, palette, 11);
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 11);
return;
}
}

View file

@ -698,25 +698,19 @@ static int32_t osdcmd_give(const osdfuncparm_t *parm)
void onvideomodechange(int32_t newmode)
{
uint8_t *pal;
uint8_t palid;
extern int32_t g_crosshairSum;
if (newmode)
{
if (g_player[screenpeek].ps->palette == palette ||
g_player[screenpeek].ps->palette == waterpal ||
g_player[screenpeek].ps->palette == titlepal ||
g_player[screenpeek].ps->palette == animpal ||
g_player[screenpeek].ps->palette == endingpal ||
g_player[screenpeek].ps->palette == drealms ||
g_player[screenpeek].ps->palette == slimepal)
pal = g_player[screenpeek].ps->palette;
if (g_player[screenpeek].ps->palette < BASEPALCOUNT)
palid = g_player[screenpeek].ps->palette;
else
pal = palette;
palid = BASEPAL;
}
else
{
pal = g_player[screenpeek].ps->palette;
palid = g_player[screenpeek].ps->palette;
}
#ifdef POLYMER
@ -737,7 +731,7 @@ void onvideomodechange(int32_t newmode)
}
#endif
setbrightness(ud.brightness>>2, pal, 0);
setbrightness(ud.brightness>>2, basepaltable[palid], 0);
g_restorePalette = 1;
g_crosshairSum = 0;
}
@ -1310,19 +1304,19 @@ static int32_t osdcmd_cvar_set_game(const osdfuncparm_t *parm)
{
ud.brightness = GAMMA_CALC;
ud.brightness <<= 2;
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
return r;
}
else if (!Bstrcasecmp(parm->name, "vid_brightness"))
{
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
return r;
}
else if (!Bstrcasecmp(parm->name, "vid_contrast"))
{
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
setbrightness(ud.brightness>>2,basepaltable[g_player[myconnectindex].ps->palette],0);
return r;
}

View file

@ -42,16 +42,16 @@ int32_t g_numSelfObituaries = 0;
void P_UpdateScreenPal(DukePlayer_t *p)
{
if (p->heat_on) p->palette = slimepal;
else if (p->cursectnum < 0) p->palette = palette;
if (p->heat_on) p->palette = SLIMEPAL;
else if (p->cursectnum < 0) p->palette = BASEPAL;
else if ((sector[p->cursectnum].ceilingpicnum >= FLOORSLIME)&&(sector[p->cursectnum].ceilingpicnum <=FLOORSLIME+2))
{
p->palette = slimepal;
p->palette = SLIMEPAL;
}
else
{
if (sector[p->cursectnum].lotag == 2) p->palette = waterpal;
else p->palette = palette;
if (sector[p->cursectnum].lotag == 2) p->palette = WATERPAL;
else p->palette = BASEPAL;
}
g_restorePalette = 1;
}

View file

@ -145,7 +145,7 @@ typedef struct {
uint32_t interface_toggle_flag;
uint8_t *palette;
uint8_t palette;
uint16_t max_actors_killed, actors_killed;
uint16_t gotweapon, zoom;

View file

@ -349,7 +349,7 @@ static void G_DoLoadScreen(char *statustext, int32_t percent)
if (!statustext)
{
//g_player[myconnectindex].ps->palette = palette;
P_SetGamePalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308
i = ud.screen_size;
ud.screen_size = 0;
G_UpdateScreenArea();
@ -402,7 +402,7 @@ static void G_DoLoadScreen(char *statustext, int32_t percent)
clearview(0L);
//g_player[myconnectindex].ps->palette = palette;
//G_FadePalette(0,0,0,0);
P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
}
/*Gv_SetVar(g_iReturnVarID,LOADSCREEN, -1, -1);*/
aGameVars[g_iReturnVarID].val.lValue = LOADSCREEN;
@ -764,7 +764,7 @@ void P_ResetStatus(int32_t snum)
p->on_warping_sector = 0;
p->spritebridge = 0;
p->sbs = 0;
p->palette = (uint8_t *) &palette[0];
p->palette = BASEPAL;
if (p->inv_amount[GET_STEROIDS] < 400)
{
@ -1891,7 +1891,7 @@ int32_t G_EnterLevel(int32_t g)
//g_player[myconnectindex].ps->palette = palette;
//G_FadePalette(0,0,0,0);
P_SetGamePalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308
P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308
P_UpdateScreenPal(g_player[myconnectindex].ps);
flushperms();