Vogtinator / crafti

3D Minecraft for TI Nspire calcs
Other
78 stars 14 forks source link

Lever/Switch, texture questions #22

Closed ThatHackerDudeFromCyberspace closed 2 years ago

ThatHackerDudeFromCyberspace commented 2 years ago

I'm working on adding additional blocks and in order to do this I had to modify the terrain.png, in the long term it will no longer be 16x16 and follow something more like TU69's terrain.png, but with a modified layout to be more consistent with the existing terrain.png

But anyway, while working on that, I realised that the switchrenderer.cpp references the texture at terrain_atlas[10][15] I was basically just wondering what this texture is and why it is used, thanks.

Also, just wondering, other than modifying the terrain.cpp file, would anything else need to be changed to support terrain.pngs with a larger size (in terms of rows and columns)?

and also, does Crafti natively support terrain.pngs with textures which aren't 32x32 resolution?

Thank you in advance

Vogtinator commented 2 years ago

But anyway, while working on that, I realised that the switchrenderer.cpp references the texture at terrain_atlas[10][15] I was basically just wondering what this texture is and why it is used, thanks.

The terrainInit function copies the switch (from [0][6]) to that tile and applies a red tint to indicate the power state.

Also, just wondering, other than modifying the terrain.cpp file, would anything else need to be changed to support terrain.pngs with a larger size (in terms of rows and columns)?

Other than terrain_atlas itself and the various references to the count of tiles (mostly limited to terrain.cpp) it should work fine.

and also, does Crafti natively support terrain.pngs with textures which aren't 32x32 resolution?

Yes. You can already load terrain.png files as crafti.ppm.tns with any (square) resolution. The performance decreases though.

ThatHackerDudeFromCyberspace commented 2 years ago

Ok, that makes sense, thanks!