about summary refs log tree commit diff stats
path: root/Source/RandomizerCore.cpp
diff options
context:
space:
mode:
authorjbzdarkid <jbzdarkid@gmail.com>2018-10-28 20:51:35 -0700
committerjbzdarkid <jbzdarkid@gmail.com>2018-10-28 20:51:35 -0700
commit5f99f9e87ef23f342e89bab029cc4fc8c5ad6663 (patch)
tree992ec1c10f001a365f4fb943a50ca6a5fc436648 /Source/RandomizerCore.cpp
parent8b88d76b96cd0c2a4dcd9c777c651b204214c63b (diff)
downloadwitness-tutorializer-5f99f9e87ef23f342e89bab029cc4fc8c5ad6663.tar.gz
witness-tutorializer-5f99f9e87ef23f342e89bab029cc4fc8c5ad6663.tar.bz2
witness-tutorializer-5f99f9e87ef23f342e89bab029cc4fc8c5ad6663.zip
Better UI + tried audio logs
Diffstat (limited to 'Source/RandomizerCore.cpp')
-rw-r--r--Source/RandomizerCore.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/RandomizerCore.cpp b/Source/RandomizerCore.cpp index 04bdd11..11802f5 100644 --- a/Source/RandomizerCore.cpp +++ b/Source/RandomizerCore.cpp
@@ -27,6 +27,9 @@ void RandomizerCore::SwapPanels(int panel1, int panel2, int flags) {
27 if (flags & SWAP_TARGETS) { 27 if (flags & SWAP_TARGETS) {
28 offsets[TARGET] = sizeof(int); 28 offsets[TARGET] = sizeof(int);
29 } 29 }
30 if (flags & SWAP_AUDIO_NAMES) {
31 offsets[AUDIO_LOG_NAME] = sizeof(void*);
32 }
30 if (flags & SWAP_LINES) { 33 if (flags & SWAP_LINES) {
31 offsets[PATH_COLOR] = 16; 34 offsets[PATH_COLOR] = 16;
32 offsets[REFLECTION_PATH_COLOR] = 16; 35 offsets[REFLECTION_PATH_COLOR] = 16;
@@ -109,3 +112,14 @@ void RandomizerCore::ReassignTargets(const std::vector<int>& panels, const std::
109 WritePanelData<int>(panels[order[i]], TARGET, {panelTarget}); 112 WritePanelData<int>(panels[order[i]], TARGET, {panelTarget});
110 } 113 }
111} 114}
115
116void RandomizerCore::ReassignNames(const std::vector<int>& panels, const std::vector<int>& order) {
117 std::vector<int64_t> names;
118 for (const int panel : panels) {
119 names.push_back(ReadPanelData<int64_t>(panel, AUDIO_LOG_NAME, 1)[0]);
120 }
121
122 for (int i=0; i<panels.size(); i++) {
123 WritePanelData<int64_t>(panels[i], AUDIO_LOG_NAME, {names[order[i]]});
124 }
125}