Revisions
-
Byteandahalf revised this gist
Aug 4, 2015 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,24 +8,24 @@ class TickingTexture { // this is the complete struct // void** vtable; // this seems like it determines the area of the atlas to be animated TextureUVCoordinateSet atlasTemplate; int framecount; // number of frames in the animation unsigned char *pixels; // All pixels in the image, 4 uchars for each (RGBA) int pixelCount; // disassembled this constructor for street cred TickingTexture(TextureUVCoordinateSet &texture, int size) { // I'm calling it 'size' for now - it's passed as 1 for WaterTexture and LavaTexture, 2 for WaterSideTexture, and 36 for FireTexture // seems like the number of frames or something similar, but the fire image has 32 frames and not 36. this->framecount = size; // 1024 could be the size in bytes of one 16x16 image, as 16*16*4 (for RGBA) = 1024 // but why is the size parameter squared? pixelCount = size * size * 1024; // arraySize *bytes* are allocated pixels = new char[pixelCount]; // and cleared memset(pixels, 0, pixelCount); } virtual ~TickingTexture(); -
mackthehobbit revised this gist
Aug 4, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class TickingTexture { TextureUVCoordinateSet texture; int size; char *someArray; int arraySize; // disassembled this constructor for street cred @@ -23,7 +23,7 @@ class TickingTexture { // but why is the size parameter squared? arraySize = size * size * 1024; // arraySize *bytes* are allocated someArray = new char[arraySize]; // and cleared memset(array, 0, arraySize); } -
mackthehobbit created this gist
Aug 4, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ #pragma once #include "TextureUVCoordinateSet.h" class TickingTexture { public: // this is the complete struct // void** vtable; // this seems like it determines the area of the atlas to be animated TextureUVCoordinateSet texture; int size; int *someArray; int arraySize; // disassembled this constructor for street cred TickingTexture(TextureUVCoordinateSet &texture, int size) { // I'm calling it 'size' for now - it's passed as 1 for WaterTexture and LavaTexture, 2 for WaterSideTexture, and 36 for FireTexture // seems like the number of frames or something similar, but the fire image has 32 frames and not 36. this->size = size; // 1024 could be the size in bytes of one 16x16 image, as 16*16*4 (for RGBA) = 1024 // but why is the size parameter squared? arraySize = size * size * 1024; // arraySize *bytes* are allocated someArray = new int[arraySize / 4]; // and cleared memset(array, 0, arraySize); } virtual ~TickingTexture(); virtual void tick() = 0; virtual void bindTextures(Textures* textures); };