aboutsummaryrefslogtreecommitdiff
path: root/src/client/tile.cpp
Commit message (Expand)AuthorAge
* Code modernization: subfolders (#6283)Loïc Blot2017-08-19
* Modernize client code (#6250)Loïc Blot2017-08-15
* Isolate irrlicht references and use a singleton (#6041)Loïc Blot2017-06-26
* Remove threads.h and replace its definitions with their C++11 equivalents (#5...ShadowNinja2017-06-11
* Use C++11 mutexes only (remove compat code) (#5922)Loïc Blot2017-06-06
* C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)Loïc Blot2017-06-04
* Do not create dummy normalmaps (#4180)you2017-05-19
* Remove an unused variable in Android BuildLoic Blot2017-04-17
* Android progressbar fix (#5601)Loïc Blot2017-04-16
* Hardware coloring for itemstacksDániel Juhász2017-04-08
* Tile.cpp: Fix MSVC build broken by 072bbbaSmallJoker2017-03-24
* Some performance optimizations (#5424)Loïc Blot2017-03-22
* Prevent SIGFPE on entity tile loading issue. (#5178)Auke Kok2017-02-05
* Add multiply texture modifiersapier2017-01-30
* Add hardware node coloring. Includes:Dániel Juhász2017-01-23
* Added "[sheet" to the texture special commands.Luke Puchner-Hardman2017-01-02
* Irrlicht 1.9 supportsfan52016-12-26
* Add an [invert:<mode> texture modifierThomas--S2016-09-15
* Allow escaping of texture names when passed as an argument to a modifiersfan52016-09-14
* Add an [opacity:<r> texture modifier. Makes the base image transparent accord...Thomas--S2016-08-12
* Add [resize texture modifier Resizes the texture to the given dimensions.SmallJoker2016-05-09
* tile.cpp: Automatically upscale lower resolution textureSmallJoker2016-04-25
* Re-add and disable blit_with_interpolate_overlaykwolekr2016-04-07
* Fix compiler warnings from "Add an option to colorize to respect the destinat...Samuel Sieb2016-04-06
* Add an option to colorize to respect the destination alphaSamuel Sieb2016-04-03
* Clean up StrfndShadowNinja2016-03-19
* Refactor thread utility interfacekwolekr2015-10-16
* Change i++ to ++iDavid Jones2015-08-25
* Clean up threadingShadowNinja2015-08-23
* Remove use of engine sent texture tiling flags - theyre no longer neededRealBadAngel2015-08-20
* src/client/tile.cpp: Fix reference countingBřetislav Štec2015-08-02
* Add wielded (and CAOs) shaderRealBadAngel2015-07-21
* Fix relief mapping issuesRealBadAngel2015-07-16
* Add minimap featureRealBadAngel2015-06-27
* Fix fast leaves with texture_clean_transparent enabled.Aaron Suen2015-04-26
* Move globals from main.cpp to more sane locationsCraig Robbins2015-04-01
* Clean scaling pre-filter for formspec/HUD.Aaron Suen2015-04-01
* Move texture_min_size even further down the pipe. Now, textures are JIT-upsca...Aaron Suen2015-03-31
* Fix for sun/moon tonemaps: don't upscale 1px images.Aaron Suen2015-03-23
* Fix composite textures with texture_min_size. Moved upscaling of textures to ...Aaron Suen2015-03-22
* Configurable automatic texture scaling and filtering at load time.Aaron Suen2015-03-20
* For usages of assert() that are meant to persist in Release builds (when NDEB...Craig Robbins2015-03-07
* Replace std::list to std::vector into tile.cpp (m_texture_trash) and move til...Loic Blot2015-03-05
lua_Number LoadNumber(LoadState* S) { lua_Number x; LoadVar(S,x); return x; } static TString* LoadString(LoadState* S) { size_t size; LoadVar(S,size); if (size==0) return NULL; else { char* s=luaZ_openspace(S->L,S->b,size); LoadBlock(S,s,size); return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ } } static void LoadCode(LoadState* S, Proto* f) { int n=LoadInt(S); f->code=luaM_newvector(S->L,n,Instruction); f->sizecode=n; LoadVector(S,f->code,n,sizeof(Instruction)); } static Proto* LoadFunction(LoadState* S, TString* p); static void LoadConstants(LoadState* S, Proto* f) { int i,n; n=LoadInt(S); f->k=luaM_newvector(S->L,n,TValue); f->sizek=n; for (i=0; i<n; i++) setnilvalue(&f->k[i]); for (i=0; i<n; i++) { TValue* o=&f->k[i]; int t=LoadChar(S); switch (t) { case LUA_TNIL: setnilvalue(o); break; case LUA_TBOOLEAN: setbvalue(o,LoadChar(S)!=0); break; case LUA_TNUMBER: setnvalue(o,LoadNumber(S)); break; case LUA_TSTRING: setsvalue2n(S->L,o,LoadString(S)); break; default: error(S,"bad constant"); break; } } n=LoadInt(S); f->p=luaM_newvector(S->L,n,Proto*); f->sizep=n; for (i=0; i<n; i++) f->p[i]=NULL; for (i=0; i<n; i++) f->p[i]=LoadFunction(S,f->source); } static void LoadDebug(LoadState* S, Proto* f) { int i,n; n=LoadInt(S); f->lineinfo=luaM_newvector(S->L,n,int); f->sizelineinfo=n; LoadVector(S,f->lineinfo,n,sizeof(int)); n=LoadInt(S); f->locvars=luaM_newvector(S->L,n,LocVar); f->sizelocvars=n; for (i=0; i<n; i++) f->locvars[i].varname=NULL; for (i=0; i<n; i++) { f->locvars[i].varname=LoadString(S); f->locvars[i].startpc=LoadInt(S); f->locvars[i].endpc=LoadInt(S); } n=LoadInt(S); f->upvalues=luaM_newvector(S->L,n,TString*); f->sizeupvalues=n; for (i=0; i<n; i++) f->upvalues[i]=NULL; for (i=0; i<n; i++) f->upvalues[i]=LoadString(S); } static Proto* LoadFunction(LoadState* S, TString* p) { Proto* f; if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep"); f=luaF_newproto(S->L); setptvalue2s(S->L,S->L->top,f); incr_top(S->L); f->source=LoadString(S); if (f->source==NULL) f->source=p; f->linedefined=LoadInt(S); f->lastlinedefined=LoadInt(S); f->nups=LoadByte(S); f->numparams=LoadByte(S); f->is_vararg=LoadByte(S); f->maxstacksize=LoadByte(S); LoadCode(S,f); LoadConstants(S,f); LoadDebug(S,f); IF (!luaG_checkcode(f), "bad code"); S->L->top--; S->L->nCcalls--; return f; } static void LoadHeader(LoadState* S) { char h[LUAC_HEADERSIZE]; char s[LUAC_HEADERSIZE]; luaU_header(h); LoadBlock(S,s,LUAC_HEADERSIZE); IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header"); } /* ** load precompiled chunk */ Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) { LoadState S; if (*name=='@' || *name=='=') S.name=name+1; else if (*name==LUA_SIGNATURE[0]) S.name="binary string"; else S.name=name; S.L=L; S.Z=Z; S.b=buff; LoadHeader(&S); return LoadFunction(&S,luaS_newliteral(L,"=?")); } /* * make header */ void luaU_header (char* h) { int x=1; memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); h+=sizeof(LUA_SIGNATURE)-1; *h++=(char)LUAC_VERSION; *h++=(char)LUAC_FORMAT; *h++=(char)*(char*)&x; /* endianness */ *h++=(char)sizeof(int); *h++=(char)sizeof(size_t); *h++=(char)sizeof(Instruction); *h++=(char)sizeof(lua_Number); *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */ }