Subversion Repositories eduke32

Compare Revisions

Regard whitespace Rev 5071 → Rev 5070

/polymer/eduke32/build/src/engine.c
11835,9 → 11835,12
#ifdef USE_OPENGL
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))
spriteext[i].mdanimtims += mdtims - omdtims;
}
#endif
 
beforedrawrooms = 1;
17985,7 → 17988,7
#ifdef USE_OPENGL
void setrollangle(int32_t rolla)
{
gtang = (float)rolla * (PI * (1.f/1024.f));
gtang = (float)rolla * PI * (1.f/1024.f);
}
#endif
 
18013,13 → 18016,15
#else
if (getrendermode() >= REND_POLYMOST)
{
int32_t hp, np;
 
const int32_t firstpal = (pal < 0) ? 0 : pal;
const int32_t numpals = (pal < 0) ? MAXPALOOKUPS : 1;
 
for (int hp = 0; hp <= 4; hp+=4)
for (hp = 0; hp <= 4; hp+=4)
{
if (how & pow2long[hp])
for (int np = firstpal; np < firstpal+numpals; np++)
for (np = firstpal; np < firstpal+numpals; np++)
gltexinvalidate(tilenume, np, hp);
}
 
18042,16 → 18047,11
if (getrendermode() < REND_POLYMOST) return;
 
bglViewport(0,0,xres,yres);
 
bglMatrixMode(GL_PROJECTION);
bglLoadIdentity();
bglOrtho(0,xres,yres,0,-1,1);
 
if (getrendermode() == REND_POLYMER)
{
bglMatrixMode(GL_MODELVIEW);
bglLoadIdentity();
}
 
gloy1 = -1;
 
18069,22 → 18069,23
 
void hash_free(hashtable_t *t)
{
hashitem_t *cur, *tmp;
int32_t i;
int32_t num;
 
if (t->items == NULL)
return;
 
int remaining = t->size - 1;
 
// initprintf("*free, num:%d\n",t->size);
i= t->size-1;
do
{
hashitem_t *cur = t->items[remaining];
 
int num = 0;
 
cur = t->items[i];
num = 0;
while (cur)
{
hashitem_t * const tmp = cur;
tmp = cur;
cur = cur->next;
 
// initprintf("Free %4d \"%s\"\n",tmp->key,(tmp->string)?tmp->string:".");
if (tmp->string)
{
Bfree(tmp->string);
18093,8 → 18094,9
Bfree(tmp);
num++;
}
} while (--remaining >= 0);
 
// initprintf("#%4d: %3d\t",i,num);
}
while (--i > -1);
Bfree(t->items);
t->items = 0;
}
18113,6 → 18115,9
 
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))
{
initprintf("hash_add(): table not initialized!\n");
18119,8 → 18124,8
return;
}
 
uint32_t code = hash_getcode(s) % t->size;
hashitem_t *cur = t->items[code];
code = hash_getcode(s) % t->size;
cur = t->items[code];
 
if (!cur)
{
18132,8 → 18137,6
return;
}
 
hashitem_t *prev = NULL;
 
do
{
if (Bstrcmp(s,cur->string) == 0)
18155,6 → 18158,9
// delete at most once
void hash_delete(hashtable_t *t, const char *s)
{
hashitem_t *cur, *prev=NULL;
int32_t code;
 
if (t->items == NULL)
{
initprintf("hash_delete(): table not initialized!\n");
18161,14 → 18167,12
return;
}
 
uint32_t code = hash_getcode(s) % t->size;
hashitem_t *cur = t->items[code];
code = hash_getcode(s) % t->size;
cur = t->items[code];
 
if (!cur)
return;
 
hashitem_t *prev = NULL;
 
do
{
if (Bstrcmp(s, cur->string) == 0)
18182,7 → 18186,7
 
Bfree(cur);
 
break;
return;
}
prev = cur;
}
18191,6 → 18195,8
 
intptr_t hash_find(const hashtable_t *t, const char *s)
{
hashitem_t *cur;
 
if (t->items == NULL)
{
initprintf("hash_find(): table not initialized!\n");
18197,11 → 18203,8
return -1;
}
 
hashitem_t *cur = t->items[hash_getcode(s) % t->size];
if ((cur = t->items[hash_getcode(s) % t->size]) == NULL) return -1;
 
if (!cur)
return -1;
 
do
if (Bstrcmp(s, cur->string) == 0)
return cur->key;
18212,6 → 18215,7
 
intptr_t hash_findcase(const hashtable_t *t, const char *s)
{
hashitem_t *cur;
 
if (t->items == NULL)
{
18219,11 → 18223,8
return -1;
}
 
hashitem_t *cur = t->items[hash_getcode(s) % t->size];
if ((cur=t->items[hash_getcode(s)%t->size]) == NULL) return -1;
 
if (!cur)
return -1;
 
do
if (Bstrcasecmp(s, cur->string) == 0)
return cur->key;