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

62 lines
6.0 KiB
Plaintext

[video output=day492 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Adding More Editor Interactions" vod_platform=youtube id=F5fgotKYqQU annotator=Miblo]
[0:01][Recap and set the stage for the day continuing with our asset editing :UI][:"asset system" :speech]
[1:22][:Run the game to show our asset editing :UI and consider positioning and styling it, and aggregate continuous interactions (e.g. drags)][:"asset system"]
[8:00][Set up to enable the :"undo / redo" system to aggregate continuous interactions, introducing the notion of an InProgressSentinel in the in_game_editor][:"asset system" :ui]
[15:22][Implement EditableBoolean(), with a few words on functional decomposition][:"asset system" :language :ui]
[19:32][:Run the game to see that our boolean button doesn't toggle][:"asset system" :language :ui]
[19:36][Augment dev_ui_layout with EditOccurred and dev_ui_edit_block with PrevEditOccurred, for EndEditBlock() and BeginEndBlock() to set][:"asset system" :ui]
[23:30][:Run the game to find that our boolean button toggles][:"asset system" :ui]
[24:22][Implement EditableType(), introducing a version of Button() that takes an additional Classifier][:"asset system" :ui]
[30:09][:Run the game to see our editable type button][:"asset system" :ui]
[30:36][Make EditableType() print out the value][:"asset system" :ui]
[31:32][:Run the game to find that our editable type button does not cycle through the types][:"asset system" :ui]
[32:17][Enable AssetEditor() to wrap the values of the editable type button][:"asset system" :ui]
[36:15][Break in to EditableType() and watch what happens upon clicking the button][:"asset system" :run :ui]
[37:04][Fix EditableType() to correctly increment and decrement the Value][:"asset system" :ui]
[37:51][:Run the game to find that that doesn't fix our problem][:"asset system" :ui]
[39:01][Change ToExecute and NextToExecute in dev_ui to be of the type dev_ui_interaction, and propagate this change][:"asset system" :ui]
[40:25][:Run the game to find that our EditableType button works fine][:"asset system" :ui]
[41:27][Enable EditableSize() and EditablePxy() to print out the Value][:"asset system" :ui]
[43:13][Check out the Size and Percent values in our :UI][:"asset system" :run]
[43:28][Enable EditableSize to draw a special widget with BasicTextElement()][:"asset system" :ui]
[45:43][Check out the Size button widget in our :UI][:"asset system" :run]
[45:53][Give the Size widget some border][:"asset system" :ui]
[46:40][Check out the bordered Size widget in our :UI][:"asset system" :run]
[47:11][Enable EditablePxy() to draw a widget like the Size button, and this function and EditableSize() to handle draggable interactions][:"asset system" :ui]
[56:26][Try dragging our Percent widget, without success][:"asset system" :run :ui]
[56:59][Peruse the code for the possible cause of our dragging bug][:"asset system" :research :ui]
[58:59][Step in to EditablePxy() to see what's happening][:"asset system" :run :ui]
[59:35][Make EditableBoolean(), EditableType(), EditableSize(), EditablePxy() to all set EditOccured to true][:"asset system" :ui]
[1:00:18][Try dragging our Percent and Size widgets, successfully][:"asset system" :run :ui]
[1:01:16][Make EditablePxy() clamp the values to the passed in Min and Max][:"asset system" :ui]
[1:02:04][Try out our clamped Percent widget, and demonstrate the need for edit aggregation][:"asset system" :run :ui :"undo / redo"]
[1:03:44][Introduce GetOrCreateEditInProgress() to aggregate edits, replacing AllocateEditorEdit()][:"asset system" :ui :"undo / redo"]
[1:15:23][Enable EditorInteract() to handle the notion of EndInteraction][:"asset system" :ui :"undo / redo"]
[1:20:13][:Run the game and crash in EditorInteract()][:"asset system" :ui :"undo / redo"]
[1:20:26][Fix InitializeEditor() to initialise the InProgresSentinel][:"asset system" :ui :"undo / redo"]
[1:21:02][Try out our aggregated undo, and consider prettying it up][:"asset system" :run :ui :"undo / redo"]
[1:22:31][Consider how to handle coexistence of the debug and developer :UI][:"asset system" :"debug system"]
[1:24:06][Investigate the :font baseline issue]
[1:27:10][Change TextOp() to factor in the AscenderHeight to the glyph's offset][:font]
[1:31:48][Check out the :font drawing in our :UI][:run]
[1:32:11][Refresh our memories on our :font encoding][:research]
[1:36:46][Check out testfonts_v2.hha in TabView][:admin :font]
[1:40:05][The :mathematics of the :font alignment percentage][:blackboard]
[1:48:42][Make SetAlignPoint() and GetPPercent() clamp alignment percentages to the range -2 to 2][:font]
[1:50:34][:Run the game and get nutso stuff on the :font alignment][:ui]
[1:50:42][Regenerate our .hha files to get our newly aligned fonts][:admin :"asset system" :font]
[1:52:17][:Run the game to find that our :font baselines are now correct][:ui]
[1:53:08][Q&A][:speech]
[1:53:38][@jojomunki][Q: What does ## mean? I looked it up but I don't think I understand what its use is. Is it supposed to link different variables into one variable?][:language]
[1:57:36][@skinpop][Q: I've been trying to implement the walk system from your recent talk.[ref
site="Casey's Blog"
page="Killing the Walk Monster"
url=https://caseymuratori.com/blog_0032] In the talk you make the point that "shrinking" the walk edge is trivial. I've made it that far in my own code but I haven't been able to figure how to do the shrinking without testing all edges against all segments of the walk edge. That approach doesn't scale well. So I was wondering if you could say a few words about how you did it - assuming you had another approach. I am using a half-edge structure for the manifold][:geometry :movement]
[1:58:54][Efficiently shrinking the walk edge as per the walk system from The Witness][:blackboard :geometry :movement]
[2:01:07][@centhusiast][Q: Do you know how to rotate a :font? Do you use stb_truetype.h[ref
site=GitHub
page="nothings / stb / stb_truetype.h"
url=https://github.com/nothings/stb/blob/master/stb_truetype.h] for font rendering?][:library]
[2:05:37][Wrap it up][:speech]
[/video]