Doubt this one is a bug, its probably me. I have written a peice of code for a dialog box that should let me edit the vertices of a plane, i know it will -always- be a plane so it just works on 4 verts (i presume a plane is 4 verts, 1 for each corner?)
however, whenever i open the box it always reads in the current vertex data as 0, 0, 0 for each vert and it doesnt do anything when i try and set it. not a sausage.
Heres the function, anyone got any clues why?
BOOL CALLBACK VertexEditProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) {
switch (message) {
case WM_INITDIALOG:
dbLockVertexDataForMesh(Map[SelectedX][SelectedY].ObjID);
SetDlgItemText(hwndDlg, IDC_EDV1X, dbStr(dbGetVertexDataPositionX(1)));
SetDlgItemText(hwndDlg, IDC_EDV1Y, dbStr(dbGetVertexDataPositionY(1)));
SetDlgItemText(hwndDlg, IDC_EDV1Z, dbStr(dbGetVertexDataPositionZ(1)));
SetDlgItemText(hwndDlg, IDC_EDV2X, dbStr(dbGetVertexDataPositionX(2)));
SetDlgItemText(hwndDlg, IDC_EDV2Y, dbStr(dbGetVertexDataPositionY(2)));
SetDlgItemText(hwndDlg, IDC_EDV2Z, dbStr(dbGetVertexDataPositionZ(2)));
SetDlgItemText(hwndDlg, IDC_EDV3X, dbStr(dbGetVertexDataPositionX(3)));
SetDlgItemText(hwndDlg, IDC_EDV3Y, dbStr(dbGetVertexDataPositionY(3)));
SetDlgItemText(hwndDlg, IDC_EDV3Z, dbStr(dbGetVertexDataPositionZ(3)));
SetDlgItemText(hwndDlg, IDC_EDV4X, dbStr(dbGetVertexDataPositionX(4)));
SetDlgItemText(hwndDlg, IDC_EDV4Y, dbStr(dbGetVertexDataPositionY(4)));
SetDlgItemText(hwndDlg, IDC_EDV4Z, dbStr(dbGetVertexDataPositionZ(4)));
dbUnlockVertexData();
break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
dbLockVertexDataForMesh(Map[SelectedX][SelectedY].ObjID);
dbSetVertexDataPosition(1, GetDlgItemInt(hwndDlg, IDC_EDV1X, false, true), GetDlgItemInt(hwndDlg, IDC_EDV1Y, false, true), GetDlgItemInt(hwndDlg, IDC_EDV1Z, false, true));
dbSetVertexDataPosition(2, GetDlgItemInt(hwndDlg, IDC_EDV2X, false, true), GetDlgItemInt(hwndDlg, IDC_EDV2Y, false, true), GetDlgItemInt(hwndDlg, IDC_EDV2Z, false, true));
dbSetVertexDataPosition(3, GetDlgItemInt(hwndDlg, IDC_EDV3X, false, true), GetDlgItemInt(hwndDlg, IDC_EDV3Y, false, true), GetDlgItemInt(hwndDlg, IDC_EDV3Z, false, true));
dbSetVertexDataPosition(4, GetDlgItemInt(hwndDlg, IDC_EDV4X, false, true), GetDlgItemInt(hwndDlg, IDC_EDV4Y, false, true), GetDlgItemInt(hwndDlg, IDC_EDV4Z, false, true));
dbUnlockVertexData();
EndDialog(hwndDlg, wParam);
return true;
break;
case IDCANCEL:
EndDialog(hwndDlg, wParam);
return true;
break;
default:
return true;
}
}
return false;
}
[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol