[video output=day252 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Allowing Debug Value Edits" vod_platform=youtube id=OsJJizXWN_A annotator=Miblo] [1:32][Recap and set the stage for the day] [3:07][Consider how to proceed in making the debug values editable] [4:23][handmade_debug_interface.h: Introduce DEBUGEditEvent in DEBUG_VALUE which allows setting the Event to a new value] [8:22][handmade_debug_interface.h: Introduce DEBUGValueGetEventData in DEBUG_VALUE and create function prototypes of it for all the types we need] [10:58][4coder: Hit a bug while doing replace-in-region from v4 to rectangle2] [14:34][4coder: Hit a bug loading the same buffer twice] [16:45][handmade_debug_interface.h: Reintroduce DEBUGValueGetEventData in DEBUG_VALUE, compile, receive compile errors as expected, and rewrite those DEBUGValueGetEventData function prototypes] [20:36][Note that the Entity->Type cannot be converted because it is an enum] [22:21][handmade_debug_interface.h: Make DEBUGValueGetEventData take an Ignored value] [25:18][handmade_debug_interface.h: Introduce DEBUGEditEventData in DEBUG_VALUE and DEBUG_B32 to update the Event if needed] [26:57][handmade_debug.cpp: Consider making GetElementFromEvent write the pointer to the debug element] [30:02][handmade_debug.cpp: Implement DEBUGEditEventData] [41:16][handmade_debug.cpp: Remove DEBUGEditEventData and simplify the system so all it needs to do is check if the two pointers for the GUIDs match][quote 412] [55:54]["It's a little pointer-chasey"][quote 413] [56:15][Run the game and note that the values cannot be edited but that we are in good shape] [57:19][handmade_debug.cpp: Copy in the *Event DEBUGEndInteract and introduce the notion of OriginalGUID] [1:02:11]["Whoops, that function doesn't exist in 4coder yet, you can't call it, Casey!"][quote 414] [1:02:21][handmade_debug.cpp: Make GetElementFromEvent store the OriginalGUID] [1:05:02][Debugger: Set a breakpoint in DEBUGEndInteract and see that we do hit it] [1:07:43][Debugger: Investigate why the OriginalGUID is not being preserved upon editing the debug element] [1:09:03][Moment of realisation: GetElementFromEvent will itself overwrite the GUID] [1:09:52][handmade_debug.cpp: Set OriginalGUID in CollateDebugRecords] [1:11:04][Debugger: Break into DEBUGEndInteract and find that GetElementFromEvent doesn't know the original value] [1:13:13][handmade_debug.cpp: Stop rewriting the GUID in StoreEvent] [1:13:43][Run the game and see that we can actually edit these values okay now] [1:14:17][handmade.cpp: Change DEBUG_VALUE to DEBUG_B32 where appropriate] [1:14:54][Run the game and see that some of our textures have failed to load, but that all our boolean values are now editable] [1:15:52][Trigger the particle system][quote 415] [1:16:24][win32_handmade.cpp: Switch the rendering type] [1:18:21][handmade_debug.cpp: Ensure that we clear out the debug EditEvent when we start debugging] [1:20:53][build.bat: Turn on -O2 and try switching between the two renderers] [1:22:20][handmade_world_mode.cpp: Provide the ability to toggle the GroundChunks] [1:25:56][handmade.cpp: Put GroundChunksOn in the menu] [1:26:19][Run the game and toggle the GroundChunks] [1:27:19][Close this down][:speech] [/video]