Skip to content

Commit

Permalink
Fix black model create->model
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Jan 28, 2024
1 parent e9a8354 commit 7cfc698
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5860,7 +5860,7 @@ void Bsp::create_node_box(const vec3& min, const vec3& max, BSPMODEL* targetMode
face.nEdges = 4;
face.nPlaneSide = i % 2 == 0; // even-numbered planes are inverted
face.iTextureInfo = (startTexinfo + i);
face.nLightmapOffset = -1; // TODO: Lighting
face.nLightmapOffset = 0; // TODO: Lighting
memset(face.nStyles, 255, MAX_LIGHTMAPS);
}

Expand Down Expand Up @@ -6047,7 +6047,7 @@ void Bsp::create_nodes(Solid& solid, BSPMODEL* targetModel)
face.nEdges = (int)solid.faces[i].verts.size();
face.nPlaneSide = solid.faces[i].planeSide;
face.iTextureInfo = solid.faces[i].iTextureInfo;
face.nLightmapOffset = -1; // TODO: Lighting
face.nLightmapOffset = 0; // TODO: Lighting
memset(face.nStyles, 255, MAX_LIGHTMAPS);
surfedgeOffset += face.nEdges;
}
Expand Down
5 changes: 4 additions & 1 deletion src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,7 @@ void Gui::drawMenuBar()

CreateBspModelCommand* command = new CreateBspModelCommand("Create Model", app->getSelectedMapId(), newEnt, snapSize, true);
rend->pushUndoCommand(command);

map->save_undo_lightmaps();
delete newEnt;

newEnt = map->ents[map->ents.size() - 1];
Expand All @@ -3193,6 +3193,7 @@ void Gui::drawMenuBar()
map->faces[model.iFirstFace + i].nStyles[0] = 0;
}
}
map->resize_all_lightmaps();
}

if (ImGui::MenuItem(get_localized_string(LANG_0591).c_str(), 0, false, !app->isLoading && map))
Expand All @@ -3213,6 +3214,7 @@ void Gui::drawMenuBar()

CreateBspModelCommand* command = new CreateBspModelCommand("Create Model", app->getSelectedMapId(), newEnt, snapSize, false);
rend->pushUndoCommand(command);
map->save_undo_lightmaps();

delete newEnt;

Expand All @@ -3225,6 +3227,7 @@ void Gui::drawMenuBar()
map->faces[model.iFirstFace + i].nStyles[0] = 0;
}
}
map->resize_all_lightmaps();
}

if (ImGui::MenuItem(get_localized_string(LANG_0590).c_str(), 0, false, !app->isLoading && map))
Expand Down

0 comments on commit 7cfc698

Please sign in to comment.