mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-04 12:50:57 +00:00
Minor stylistic changes, fix FPS counter and other 2D drawing in Polymer.
git-svn-id: https://svn.eduke32.com/eduke32@5071 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
fa55f368c9
commit
8cc2cd8585
1 changed files with 45 additions and 46 deletions
|
@ -11835,12 +11835,9 @@ void nextpage(void)
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
omdtims = mdtims; mdtims = getticks();
|
omdtims = mdtims; mdtims = getticks();
|
||||||
|
|
||||||
{
|
for (int i = 0; i < Numsprites; i++)
|
||||||
int32_t i;
|
|
||||||
for (i=0; i<MAXSPRITES; i++)
|
|
||||||
if ((mdpause && spriteext[i].mdanimtims) || (spriteext[i].flags & SPREXT_NOMDANIM))
|
if ((mdpause && spriteext[i].mdanimtims) || (spriteext[i].flags & SPREXT_NOMDANIM))
|
||||||
spriteext[i].mdanimtims += mdtims - omdtims;
|
spriteext[i].mdanimtims += mdtims - omdtims;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
beforedrawrooms = 1;
|
beforedrawrooms = 1;
|
||||||
|
@ -17988,7 +17985,7 @@ int32_t setrendermode(int32_t renderer)
|
||||||
#ifdef USE_OPENGL
|
#ifdef USE_OPENGL
|
||||||
void setrollangle(int32_t rolla)
|
void setrollangle(int32_t rolla)
|
||||||
{
|
{
|
||||||
gtang = (float)rolla * PI * (1.f/1024.f);
|
gtang = (float)rolla * (PI * (1.f/1024.f));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -18016,15 +18013,13 @@ void invalidatetile(int16_t tilenume, int32_t pal, int32_t how)
|
||||||
#else
|
#else
|
||||||
if (getrendermode() >= REND_POLYMOST)
|
if (getrendermode() >= REND_POLYMOST)
|
||||||
{
|
{
|
||||||
int32_t hp, np;
|
|
||||||
|
|
||||||
const int32_t firstpal = (pal < 0) ? 0 : pal;
|
const int32_t firstpal = (pal < 0) ? 0 : pal;
|
||||||
const int32_t numpals = (pal < 0) ? MAXPALOOKUPS : 1;
|
const int32_t numpals = (pal < 0) ? MAXPALOOKUPS : 1;
|
||||||
|
|
||||||
for (hp = 0; hp <= 4; hp+=4)
|
for (int hp = 0; hp <= 4; hp+=4)
|
||||||
{
|
{
|
||||||
if (how & pow2long[hp])
|
if (how & pow2long[hp])
|
||||||
for (np = firstpal; np < firstpal+numpals; np++)
|
for (int np = firstpal; np < firstpal+numpals; np++)
|
||||||
gltexinvalidate(tilenume, np, hp);
|
gltexinvalidate(tilenume, np, hp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18047,11 +18042,16 @@ void setpolymost2dview(void)
|
||||||
if (getrendermode() < REND_POLYMOST) return;
|
if (getrendermode() < REND_POLYMOST) return;
|
||||||
|
|
||||||
bglViewport(0,0,xres,yres);
|
bglViewport(0,0,xres,yres);
|
||||||
|
|
||||||
bglMatrixMode(GL_PROJECTION);
|
bglMatrixMode(GL_PROJECTION);
|
||||||
bglLoadIdentity();
|
bglLoadIdentity();
|
||||||
bglOrtho(0,xres,yres,0,-1,1);
|
bglOrtho(0,xres,yres,0,-1,1);
|
||||||
|
|
||||||
|
if (getrendermode() == REND_POLYMER)
|
||||||
|
{
|
||||||
bglMatrixMode(GL_MODELVIEW);
|
bglMatrixMode(GL_MODELVIEW);
|
||||||
bglLoadIdentity();
|
bglLoadIdentity();
|
||||||
|
}
|
||||||
|
|
||||||
gloy1 = -1;
|
gloy1 = -1;
|
||||||
|
|
||||||
|
@ -18069,23 +18069,22 @@ void hash_init(hashtable_t *t)
|
||||||
|
|
||||||
void hash_free(hashtable_t *t)
|
void hash_free(hashtable_t *t)
|
||||||
{
|
{
|
||||||
hashitem_t *cur, *tmp;
|
|
||||||
int32_t i;
|
|
||||||
int32_t num;
|
|
||||||
|
|
||||||
if (t->items == NULL)
|
if (t->items == NULL)
|
||||||
return;
|
return;
|
||||||
// initprintf("*free, num:%d\n",t->size);
|
|
||||||
i= t->size-1;
|
int remaining = t->size - 1;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
cur = t->items[i];
|
hashitem_t *cur = t->items[remaining];
|
||||||
num = 0;
|
|
||||||
|
int num = 0;
|
||||||
|
|
||||||
while (cur)
|
while (cur)
|
||||||
{
|
{
|
||||||
tmp = cur;
|
hashitem_t * const tmp = cur;
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
// initprintf("Free %4d \"%s\"\n",tmp->key,(tmp->string)?tmp->string:".");
|
|
||||||
if (tmp->string)
|
if (tmp->string)
|
||||||
{
|
{
|
||||||
Bfree(tmp->string);
|
Bfree(tmp->string);
|
||||||
|
@ -18094,9 +18093,8 @@ void hash_free(hashtable_t *t)
|
||||||
Bfree(tmp);
|
Bfree(tmp);
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
// initprintf("#%4d: %3d\t",i,num);
|
} while (--remaining >= 0);
|
||||||
}
|
|
||||||
while (--i > -1);
|
|
||||||
Bfree(t->items);
|
Bfree(t->items);
|
||||||
t->items = 0;
|
t->items = 0;
|
||||||
}
|
}
|
||||||
|
@ -18115,17 +18113,14 @@ static inline uint32_t hash_getcode(const char *s)
|
||||||
|
|
||||||
void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace)
|
void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace)
|
||||||
{
|
{
|
||||||
hashitem_t *cur, *prev=NULL;
|
|
||||||
int32_t code;
|
|
||||||
|
|
||||||
if (EDUKE32_PREDICT_FALSE(t->items == NULL))
|
if (EDUKE32_PREDICT_FALSE(t->items == NULL))
|
||||||
{
|
{
|
||||||
initprintf("hash_add(): table not initialized!\n");
|
initprintf("hash_add(): table not initialized!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = hash_getcode(s) % t->size;
|
uint32_t code = hash_getcode(s) % t->size;
|
||||||
cur = t->items[code];
|
hashitem_t *cur = t->items[code];
|
||||||
|
|
||||||
if (!cur)
|
if (!cur)
|
||||||
{
|
{
|
||||||
|
@ -18137,6 +18132,8 @@ void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hashitem_t *prev = NULL;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (Bstrcmp(s,cur->string) == 0)
|
if (Bstrcmp(s,cur->string) == 0)
|
||||||
|
@ -18158,21 +18155,20 @@ void hash_add(hashtable_t *t, const char *s, intptr_t key, int32_t replace)
|
||||||
// delete at most once
|
// delete at most once
|
||||||
void hash_delete(hashtable_t *t, const char *s)
|
void hash_delete(hashtable_t *t, const char *s)
|
||||||
{
|
{
|
||||||
hashitem_t *cur, *prev=NULL;
|
|
||||||
int32_t code;
|
|
||||||
|
|
||||||
if (t->items == NULL)
|
if (t->items == NULL)
|
||||||
{
|
{
|
||||||
initprintf("hash_delete(): table not initialized!\n");
|
initprintf("hash_delete(): table not initialized!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = hash_getcode(s) % t->size;
|
uint32_t code = hash_getcode(s) % t->size;
|
||||||
cur = t->items[code];
|
hashitem_t *cur = t->items[code];
|
||||||
|
|
||||||
if (!cur)
|
if (!cur)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
hashitem_t *prev = NULL;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (Bstrcmp(s, cur->string) == 0)
|
if (Bstrcmp(s, cur->string) == 0)
|
||||||
|
@ -18186,7 +18182,7 @@ void hash_delete(hashtable_t *t, const char *s)
|
||||||
|
|
||||||
Bfree(cur);
|
Bfree(cur);
|
||||||
|
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
prev = cur;
|
prev = cur;
|
||||||
}
|
}
|
||||||
|
@ -18195,15 +18191,16 @@ void hash_delete(hashtable_t *t, const char *s)
|
||||||
|
|
||||||
intptr_t hash_find(const hashtable_t *t, const char *s)
|
intptr_t hash_find(const hashtable_t *t, const char *s)
|
||||||
{
|
{
|
||||||
hashitem_t *cur;
|
|
||||||
|
|
||||||
if (t->items == NULL)
|
if (t->items == NULL)
|
||||||
{
|
{
|
||||||
initprintf("hash_find(): table not initialized!\n");
|
initprintf("hash_find(): table not initialized!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cur = t->items[hash_getcode(s) % t->size]) == NULL) return -1;
|
hashitem_t *cur = t->items[hash_getcode(s) % t->size];
|
||||||
|
|
||||||
|
if (!cur)
|
||||||
|
return -1;
|
||||||
|
|
||||||
do
|
do
|
||||||
if (Bstrcmp(s, cur->string) == 0)
|
if (Bstrcmp(s, cur->string) == 0)
|
||||||
|
@ -18215,7 +18212,6 @@ intptr_t hash_find(const hashtable_t *t, const char *s)
|
||||||
|
|
||||||
intptr_t hash_findcase(const hashtable_t *t, const char *s)
|
intptr_t hash_findcase(const hashtable_t *t, const char *s)
|
||||||
{
|
{
|
||||||
hashitem_t *cur;
|
|
||||||
|
|
||||||
if (t->items == NULL)
|
if (t->items == NULL)
|
||||||
{
|
{
|
||||||
|
@ -18223,7 +18219,10 @@ intptr_t hash_findcase(const hashtable_t *t, const char *s)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cur=t->items[hash_getcode(s)%t->size]) == NULL) return -1;
|
hashitem_t *cur = t->items[hash_getcode(s) % t->size];
|
||||||
|
|
||||||
|
if (!cur)
|
||||||
|
return -1;
|
||||||
|
|
||||||
do
|
do
|
||||||
if (Bstrcasecmp(s, cur->string) == 0)
|
if (Bstrcasecmp(s, cur->string) == 0)
|
||||||
|
|
Loading…
Reference in a new issue