| 926 | void SelectObject(int objnum); |
| 927 | |
| 928 | void CTextureGrWnd::OnLButtonDown(UINT nFlags, CPoint point) { |
| 929 | TexGrStartOpenGL(); |
| 930 | |
| 931 | ResetPostrenderList(); |
| 932 | |
| 933 | if (Editor_view_mode == VM_ROOM) { |
| 934 | TSearch_found_type = -1; |
| 935 | TSearch_seg = -1; |
| 936 | TSearch_on = 1; |
| 937 | TSearch_x = point.x; |
| 938 | TSearch_y = point.y; |
| 939 | |
| 940 | TGWRenderMine(&Viewer_object->pos, &Viewer_object->orient, D3_DEFAULT_ZOOM, Viewer_object->roomnum); |
| 941 | |
| 942 | TSearch_on = 0; |
| 943 | |
| 944 | if (TSearch_found_type == TSEARCH_FOUND_MINE) { |
| 945 | Current_faces[TSearch_seg - FIRST_PALETTE_ROOM] = TSearch_face; |
| 946 | EditorStatus("Face %d selected.", TSearch_face); |
| 947 | State_changed = 1; |
| 948 | return; |
| 949 | } |
| 950 | } else if (Editor_view_mode == VM_TERRAIN) { |
| 951 | TSearch_found_type = -1; |
| 952 | TSearch_seg = -1; |
| 953 | TSearch_on = 1; |
| 954 | TSearch_x = point.x; |
| 955 | TSearch_y = point.y; |
| 956 | |
| 957 | StartEditorFrame(m_grViewport, &Viewer_object->pos, &Viewer_object->orient, D3_DEFAULT_ZOOM); |
| 958 | RenderTerrain(0); |
| 959 | PostRender(Viewer_object->roomnum); |
| 960 | EndEditorFrame(); |
| 961 | TSearch_on = 0; |
| 962 | if (TSearch_found_type != -1) { |
| 963 | |
| 964 | // Check for objects |
| 965 | if (TSearch_found_type == TSEARCH_FOUND_OBJECT) { |
| 966 | // Found an object |
| 967 | mprintf(0, "Found an object! objnum=%d\n", TSearch_seg); |
| 968 | SelectObject(TSearch_seg); |
| 969 | // start object moving if mouse down in an object. |
| 970 | ObjMoveManager.Start(this, m_grViewport->width(), m_grViewport->height(), &m_ViewPos, &m_ViewMatrix, point.x, |
| 971 | point.y); |
| 972 | } |
| 973 | |
| 974 | if (TSearch_found_type == TSEARCH_FOUND_SKY_DOME) { |
| 975 | if (nFlags & MK_SHIFT) { |
| 976 | Terrain_sky.dome_texture = D3EditState.texdlg_texture; |
| 977 | |
| 978 | World_changed = 1; |
| 979 | TV_changed = 1; |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | // Check for satellite |
| 984 | if (TSearch_found_type == TSEARCH_FOUND_SATELLITE) { |
| 985 | if (nFlags & MK_SHIFT) { |
nothing calls this directly
no test coverage detected