MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DestroyWindow

Method DestroyWindow

editor/WaterProceduralDialog.cpp:85–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84static static_proc_element save_elements[8000];
85BOOL CWaterProceduralDialog::DestroyWindow() {
86 // TODO: Add your specialized code here and/or call the base class
87 CWnd::KillTimer(1);
88
89 int n = D3EditState.texdlg_texture;
90
91 int save_num = 0;
92
93 // Restore our static proc elements
94 save_num = GameTextures[n].procedural->num_static_elements;
95
96 if (save_num > 0)
97 memcpy(save_elements, GameTextures[n].procedural->static_proc_elements, save_num * sizeof(static_proc_element));
98
99 FreeStaticProceduralsForTexture(n);
100 Sleep(2000);
101
102 if (save_num > 0) {
103 AllocateStaticProceduralsForTexture(n, save_num);
104 memcpy(GameTextures[n].procedural->static_proc_elements, save_elements, save_num * sizeof(static_proc_element));
105 GameTextures[n].procedural->num_static_elements = save_num;
106 } else {
107 GameTextures[n].flags &= ~(TF_PROCEDURAL | TF_WATER_PROCEDURAL);
108 }
109
110 bm_FreeBitmap(m_window_bitmap);
111 m_TextureSurf.free();
112
113 return CDialog::DestroyWindow();
114}
115
116void CWaterProceduralDialog::PrintValue(int whichbox, uint8_t val) {
117 CEdit *ebox;

Callers

nothing calls this directly

Calls 5

bm_FreeBitmapFunction · 0.85
SleepFunction · 0.50
freeMethod · 0.45

Tested by

no test coverage detected