diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 88b9a7282..611170e78 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -13362,11 +13362,9 @@ int32_t setrendermode(int32_t renderer) { int32_t i; - if (!polymer_init()) - renderer = 3; - // potentially deferred MD3 postprocessing for (i=0; imdnum==3 && ((md3model_t *)models[i])->head.surfs[0].geometry == NULL) { static int32_t warned=0; @@ -13378,8 +13376,18 @@ int32_t setrendermode(int32_t renderer) warned = 1; } - md3postload_polymer((md3model_t *)models[i]); + if (!md3postload_polymer((md3model_t *)models[i])) + OSD_Printf("INTERNAL ERROR: mdmodel %d failed postprocessing!\n", i); + + if (((md3model_t *)models[i])->head.surfs[0].geometry == NULL) + OSD_Printf("INTERNAL ERROR: wtf?\n"); } +// else +// OSD_Printf("mdmodel %d already postprocessed.\n", i); + } + + if (!polymer_init()) + renderer = 3; } # else else renderer = 3; diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 8362ea521..fbd066817 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -1337,6 +1337,7 @@ static md3model_t *md3load(int32_t fil) klseek(fil,m->head.ofssurfs,SEEK_SET); i = m->head.numsurfs*sizeof(md3surf_t); m->head.surfs = (md3surf_t *)Bmalloc(i); if (!m->head.surfs) { if (m->head.tags) Bfree(m->head.tags); Bfree(m->head.frames); Bfree(m); return(0); } + m->head.surfs[0].geometry = NULL; // for deferred polymer model postprocessing (else: crashes) #if B_BIG_ENDIAN != 0 { diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 57c223ac0..acf7968b6 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -3092,28 +3092,38 @@ static int32_t m32gettile(int32_t idInitialTile) // iTile = clamp(iTile, 0, min(MAXTILES-1, localartlookupnum+nDisplayedTiles-1)); - // 'S' KEYPRESS: search for named tile if (PRESSED_KEYSC(S)) { - static char laststr[MAXTILES] = ""; + static char laststr[25] = ""; const char *searchstr = getstring_simple("Search for tile name: ", laststr, MAXTILES-1); + static char buf[2][25]; if (searchstr && searchstr[0]) { int32_t i, i0, slen=Bstrlen(searchstr)-1; - Bstrcpy(laststr, searchstr); + Bstrncpy(laststr, searchstr, 25); + laststr[24] = 0; i0 = localartlookup[iTile]; + Bmemcpy(buf[0], laststr, 25); + Bstrupr(buf[0]); + for (i=(i0+1)%MAXTILES; i!=i0; i=(i+1)%MAXTILES) - if ((searchstr[0]=='^' && !Bstrncmp(names[i], searchstr+1, slen)) || - (searchstr[0]!='^' && strstr(names[i], searchstr))) + { + Bmemcpy(buf[1], names[i], 25); + buf[1][24]=0; + Bstrupr(buf[1]); + + if ((searchstr[0]=='^' && !Bstrncmp(buf[1], buf[0]+1, slen)) || + (searchstr[0]!='^' && strstr(buf[1], buf[0]))) { SelectAllTiles(i); iTile = i; break; } + } } }