SoftMipmapU32F3Ptr LoadMipmap(std::string tex_full_path) { SoftSurfaceU32F3Ptr surface = std::make_shared<SoftSurfaceU32F3>(); int texw = 0, texh = 0; void* bits = LoadTexture(tex_full_path, true, texw, texh); surface->reset(texw, texh, (uint32_t*)bits, Swap02); ResFree(bits); return CreateSoftMipmap(surface); }
static void ParseFileSaveData(HWND hwnd, BOOL changed) { LV_ITEM item; HWND hwndLV = GetDlgItem(hwnd, IDC_FILELIST); int i; for (i = 0;; i++) { PROJECTITEM *pj = NULL; DWINFO *ptr = NULL; struct saveData *sd = NULL; item.iItem = i; item.iSubItem = 0; item.mask = LVIF_PARAM; if (!ListView_GetItem(hwndLV, &item)) break; sd = (struct saveData *)item.lParam; if (sd->asProject) pj = sd->data; else ptr = sd->data; if (changed) { if (ListView_GetCheckState(hwndLV, i)) { if (ptr) { LoadFile(ptr->self, ptr, TRUE); } else if (pj->type == PJ_FILE) { DWINFO *ptr = GetFileInfo(pj->realName); if (ptr) LoadFile(ptr->self, ptr, TRUE); } else { ResReload(pj); } } } else { if (pj && !pj->resData || !pj) { if (!ptr) ptr = GetFileInfo(pj->realName); if (ptr) { if (ListView_GetCheckState(hwndLV, i)) SendMessage(ptr->self, WM_COMMAND, IDM_SAVE, 0); else { TagLinesAdjust(ptr->dwName, TAGM_DISCARDFILE); } } } else { if (ListView_GetCheckState(hwndLV, i)) ResSave(pj->realName, pj->resData); else ResFree(pj, FALSE); } } free(sd); } }