[video output=day482 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Associating Tags with PNGs" vod_platform=youtube id=FHqgQaUksok annotator=Miblo]
[0:00][Recap and set the stage for the day improving our :"asset system"][:speech]
[2:14][:Run the game with the determination to texture our world][:"asset system"]
[3:43][Set up to associate asset file contents with tags][:"asset system" :speech]
[10:36][Introduce ProcessSingleTileImport() performing functionality pulled out of ProcessTiledImport() into WriteImageToHHA() and DownsampleToFits()][:"asset system"]
[37:52][Change ProcessMultiTileImport() to include the border when extracting a tile, and introduce import_source_info][:"asset system"]
[50:47][:Run the game and crash in ProcessMultiTileImport()][:"asset system"]
[51:57][Step in to ProcessMultiTileImport() and inspect the TileImage][:"asset system" :run]
[53:01][Fix ProcessMultiTileImport() to loop over the TileImage][:"asset system"]
[53:20][:Run the game to see that it's close to working][:"asset system"]
[54:03][Investigate the possibility that we have an offset problem][:"asset system"]
[59:52][Introduce GetDownsampleCountForFit() and introduce Downsample() that takes a DownsampleCount, to make sure all tiles get downsampled the same amount][:"asset system"]
[1:07:54][:Run the game to see that it still works as before][:"asset system"]
[1:08:09][Set up CheckForArtChanges() to import orphanage wall textures][:"asset system"]
[1:20:31][Introduce ParsePieces() and ProcessPlateImport()][:"asset system" :parsing]
[1:33:11][Specify that an asset's filename determines its tags][:"asset system"]
[1:44:35][Introduce BeginTags() and EndTags() for ParsePieces() to call][:"asset system" :parsing]
[1:53:39][Make ParsePieces() perform multiple :parsing passes, each pulling out particular pieces of information, and introduce PopToken()][:"asset system" :hat :programming]
[2:01:26][Implement BeginTags(), introducing TagIDFrom()][:"asset system" :hat :parsing :programming]
[2:06:43][][:"asset system" :hat :speech][quote 635]
[2:06:49][Add a Tag_None asset_tag_id, and continue implementing BeginTags()][:"asset system" :hat :parsing :programming]
[2:13:24][Introduce AddTag() and fix up compile errors][:"asset system" :hat :parsing :programming]
[2:17:29][Implement AddTag()][:"asset system" :hat :parsing :programming]
[2:27:40][Step through ParsePieces() to see what happens][:"asset system" :hat :parsing :run]
[2:31:50][Step through EndTags() into PopToken() to discover that our bug occurs in the final item][:"asset system" :hat :parsing :run]
[2:33:20][Fix PopToken() to correctly parse out the full set][:"asset system" :hat :parsing :programming]
[2:35:10][Step through EndTags() and into the game with the skeleton hand mostly imported][:"asset system" :hat :parsing :run]
[2:36:25][Fix AddTag() to correctly increment the TagCount and prevent tags from overwriting each other][:"asset system" :hat :parsing :programming]
[2:38:59][:Run the game to see all facing directions of our skeleton hand imported correctly][:"asset system" :hat :parsing]
[2:39:47][Try making UpdateAndRenderEntities() set the glove's MatchVector and WeightVector to 1 and 0.5 respectively, to see that it doesn't fix up our scaling issue][:"asset system" :"entity system" :hat :programming :run]
[2:41:39][Enable ParsePieces() to parse (wall) block textures][:"asset system" :hat :parsing :programming]
[2:43:15][:Run the game to see that we may not have imported the block texture][:"asset system" :hat :parsing]
[2:43:46][Step through ParsePieces() to see what it does with the block textures][:"asset system" :hat :parsing :run]
[2:44:53][Make UpdateAndRenderEntities() pass the BitmapID to PushCube(), updating PushCube() itself to handle bitmaps][:"asset system" :"entity system" :hat :programming]
[2:47:17][:Run the game to see no wall textures][:"asset system" :"entity system" :hat]
[2:48:37][Try to break in to UpdateAndRenderEntities(), and find that our block texture has not been correctly categorised][:"asset system" :"entity system" :hat :rant :run]
[2:52:23][Fix ParsePieces() to set the import type for a block][:"asset system" :hat :parsing :programming]
[2:52:48][:Run the game and see textured walls][:"asset system" :hat]
[2:53:57][Rename the non-orphanage block textures out of the equation][:admin :"asset system" :hat]
[2:54:46][:Run the game to see our orphanage texture, possibly upside-down][:"asset system" :hat]
[2:55:10][Change GenerateRoom() to hard set the Color to all 1s][:"asset system" :hat :programming]
[2:55:32][:Run the game to see deep blue textures][:"asset system" :hat]
[2:59:00][Take a cursory look at ProcessMultiTileImport() for what could be wrong][:"asset system" :hat :programming]
[3:00:29][Call it][:hat :speech]
[/video]
