cinera_handmade.network/cmuratori/hero/code/code486.hmml

41 lines
5.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Adding Multiple Alignment Points" vod_platform=youtube id=UVwFh2pvS2I annotator=Miblo]
[0:03][Recap and set the stage for the day][:speech]
[0:45][Thoughts on augmenting artwork with information not intrinsic to the artwork itself, e.g. positional relationships of different assets][:"asset system" :run]
[9:29][Authoritative vs non-authoritative resources][:"asset system" :run]
[12:05][Storing metadata in a separate file as a secondary authoritative resource][:"asset system" :run]
[17:35][Text vs binary format][:"asset system" :speech]
[18:56][Set up to manually write a text file augmentation and work backwards through the code making this all happen][:"asset system" :speech]
[20:54][View character_cat_gray_tabby.png in Windows Photo Viewer, and discover why the alpha handling is broken][:admin :art]
[23:02][Check out character_cat_gray_tabby.png, the hats and character_template.png in preparation for writing our augmentation][:admin :art]
[25:09][Spec out a text file augmentation in character_cat_gray_tabby.txt][:"asset system" :speech]
[36:56][Consider how to represent these augmentations in the .hha files][:"asset system" :speech]
[41:50][Augment hha_bitmap with the new data from our text file augmentation, introducing hha_align_point][:"asset system"]
[1:01:37][Enable PrintContents() to handle our new hha_align_point, introducing GetPPercent() and GetSize()][:"asset system"]
[1:08:35][Introduce AlignPointNameFromType() and related code for PrintContents() to decode alignment points][:"asset system"]
[1:17:50][Enable FormatStringList() to handle length-strings, with a note on JAI's support for defining our own format specifiers with type-checking][:language]
[1:23:46][Finish enabling PrintContents() to handle alignment points, using fprintf()][:"asset system"]
[1:25:08][Make ReadHHA_V0() handle our new hha_bitmap structure][:"asset system"]
[1:30:57][Introduce SetAlignPoint() and related code for encoding alignment points][:"asset system"]
[1:39:26][Set up LoadBitmap() to handle our new alignment points][:"asset system"]
[1:41:00][Enable WriteImageToHHA() to write out default alignment points][:"asset system"]
[1:43:06][Bump HHA_VERSION to 2, and rename ReadHHA_V1() to ReadHHA_V2()][:"asset system"]
[1:45:03][Try to view a newly unsupported v1 .hha file, and scrap backwards compatibility until we have shipped and people start trading .hha files][:admin :"asset system"]
[1:45:58][Rewrite intro_art_v2.hha and check it out in TabView to see that the alignment is a little off][:admin :"asset system"]
[1:48:25][Finish implementing SetAlignPoint() and GetType()][:"asset system"]
[1:50:04][Rewrite intro_art_v2.hha and check it out in TabView to see that the alignment is better, but unfortunately never exactly 1.0f][:admin :"asset system" :mathematics]
[1:51:18][Enable GetSize() to produce 1.0f][:mathematics]
[1:55:25][Rewrite intro_art_v2.hha and check it out in TabView to see that the alignment now reaches 1.0f][:admin :"asset system" :mathematics]
[1:56:20][Make SetAlignPoint() round the alignment percentages, in an effort to produce 0.5f][:"asset system" :mathematics]
[1:58:13][Rewrite intro_art_v2.hha and check it out in TabView to see that the alignment still doesn't come out at 0.5f][:admin :"asset system" :mathematics]
[1:58:38][Make SetAlignPoint() and GetPPercent() use the even-numbered U16Max 1 in their computations][:"asset system" :mathematics]
[2:00:20][Rewrite intro_art_v2.hha and check it out in TabView to see that the alignment may now come out at 0.5f][:admin :"asset system" :mathematics]
[2:00:52][:Run the game successfully with these new v2 .hha files][:"asset system"]
[2:03:04][Q&A][:speech]
[2:04:11][@Rounin][Q: Now the 85.0 is wrong again. Since 85 isn't a factor of 65534][:mathematics]
[2:04:46][@somebody_took_my_name][Q: Could you use U16MAX + 1 and a size modifier of 128?][:mathematics]
[2:05:21][@kleril][Q: Colour seems like it would make a nice addition to the bitmap parenting system: a ghost wearing a hat should have a hat with a lower alpha value, right?][:"asset system"]
[2:06:06][@longboolean][Q: Last week you were mulling over whether or not to separate the head from the body in the sprite sheets. Since then has this idea become more solidified? Also, do you plan on giving some of the faces more articulate animation? An example I thought of at the start of the stream today was blinking eyes on the cats or other characters, perhaps as overlays of eyelids with versions for each head angle. A separate face spritesheet might be nice, more space for such things][:"asset system"]
[2:06:44][@garryjohanson][Q: Totally random question, very off-topic: Do you like that the C++ preprocessor has no special syntax for invoking a macro? Are there merits to that in your mind, or not? Would you prefer a special syntax for invoking macros?][:language]
[2:09:01][Close it up, with a note about switching the :"debug system" leftright camera movement to be more congruent with updown][:speech]
[/video]