Skip to content

Commit fc63c57

Browse files
Add screenshot command! Fix settings!
1 parent b91b542 commit fc63c57

File tree

12 files changed

+343
-83
lines changed

12 files changed

+343
-83
lines changed

src/cli/CommandLine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CommandLine::CommandLine(int argc, char* argv[])
3636
options.push_back(arg);
3737
}
3838

39-
if ((i == 1 || i == 2) && starts_with(larg,"help") || starts_with(larg,"/?") || starts_with(larg,"--help") || starts_with(larg,"-help") || starts_with(larg,"-h"))
39+
if ((i == 1 || i == 2) && starts_with(larg,"help") || starts_with(larg,"/?") || starts_with(larg,"--help") || starts_with(larg, "-help") || starts_with(larg, "/help"))
4040
{
4141
askingForHelp = true;
4242
}

src/editor/BspRenderer.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@ void BspRenderer::render(bool modelVertsDraw, int clipnodeHull)
29942994

29952995

29962996

2997-
if (g_app->pickMode == PICK_FACE_LEAF && !ortho_overview)
2997+
if (g_app->pickMode == PICK_FACE_LEAF && !ortho_overview && !make_screenshot)
29982998
{
29992999
glDepthMask(GL_FALSE);
30003000
glDepthFunc(GL_ALWAYS);
@@ -3026,7 +3026,7 @@ void BspRenderer::drawModelClipnodes(int modelIdx, bool highlight, int hullIdx)
30263026
hullIdx = getBestClipnodeHull(modelIdx);
30273027
}
30283028

3029-
if (hullIdx <= -1 || hullIdx > 3 || ortho_overview)
3029+
if (hullIdx <= -1 || hullIdx > 3 || ortho_overview || make_screenshot)
30303030
{
30313031
return; // nothing can be drawn
30323032
}
@@ -3102,7 +3102,7 @@ void BspRenderer::drawModel(RenderEnt* ent, int pass, bool highlight, bool edges
31023102
if (pass == REND_PASS_COLORSHADER)
31033103
{
31043104
RenderModel* rend_mdl = renderModels[modelIdx];
3105-
if (rend_mdl->wireframeBuffer && !ortho_overview)
3105+
if (rend_mdl->wireframeBuffer && !ortho_overview && !make_screenshot)
31063106
{
31073107
if (ent && ent->isDuplicateModel)
31083108
rend_mdl->wireframeBuffer->frameId--;
@@ -3187,7 +3187,7 @@ void BspRenderer::drawModel(RenderEnt* ent, int pass, bool highlight, bool edges
31873187
{
31883188
if (rgroup.special)
31893189
{
3190-
if (ortho_overview)
3190+
if (ortho_overview | make_screenshot)
31913191
continue;
31923192

31933193
if (modelIdx == 0 && !(g_render_flags & RENDER_SPECIAL))
@@ -3273,7 +3273,7 @@ void BspRenderer::drawModel(RenderEnt* ent, int pass, bool highlight, bool edges
32733273
}
32743274

32753275

3276-
if (g_app->pickMode != PICK_OBJECT && highlight && !ortho_overview)
3276+
if (g_app->pickMode != PICK_OBJECT && highlight && !ortho_overview && !make_screenshot)
32773277
{
32783278
if (ent)
32793279
{
@@ -3285,7 +3285,7 @@ void BspRenderer::drawModel(RenderEnt* ent, int pass, bool highlight, bool edges
32853285
}
32863286
else
32873287
{
3288-
if (highlight && !ortho_overview)
3288+
if (highlight && !ortho_overview && !make_screenshot)
32893289
{
32903290
if (ent)
32913291
{
@@ -3329,7 +3329,7 @@ void BspRenderer::drawPointEntities(std::vector<int> highlightEnts, int pass)
33293329
if (mapEnt->hide)
33303330
continue;
33313331

3332-
if (ortho_overview)
3332+
if (ortho_overview || make_screenshot)
33333333
{
33343334
if (!starts_with(mapEnt->classname, "cycler_") &&
33353335
!starts_with(mapEnt->classname, "func_"))
@@ -3338,7 +3338,7 @@ void BspRenderer::drawPointEntities(std::vector<int> highlightEnts, int pass)
33383338
}
33393339
}
33403340

3341-
if (g_app->pickInfo.IsSelectedEnt(i) && !ortho_overview)
3341+
if (g_app->pickInfo.IsSelectedEnt(i) && !ortho_overview && !make_screenshot)
33423342
{
33433343
if (g_render_flags & RENDER_SELECTED_AT_TOP)
33443344
glDepthFunc(GL_ALWAYS);
@@ -3359,7 +3359,7 @@ void BspRenderer::drawPointEntities(std::vector<int> highlightEnts, int pass)
33593359
renderEnts[i].spr->DrawSprite();
33603360
}
33613361
}
3362-
else if (pass == REND_PASS_COLORSHADER && !ortho_overview)
3362+
else if (pass == REND_PASS_COLORSHADER && !ortho_overview && !make_screenshot)
33633363
{
33643364
g_app->matmodel = renderEnts[i].modelMat4x4_calc_angles;
33653365
g_app->colorShader->updateMatrixes();
@@ -3380,7 +3380,7 @@ void BspRenderer::drawPointEntities(std::vector<int> highlightEnts, int pass)
33803380
}
33813381
else
33823382
{
3383-
if (pass == REND_PASS_COLORSHADER && !ortho_overview)
3383+
if (pass == REND_PASS_COLORSHADER && !ortho_overview && !make_screenshot)
33843384
{
33853385
g_app->matmodel = renderEnts[i].modelMat4x4_calc_angles;
33863386
g_app->colorShader->updateMatrixes();
@@ -3434,7 +3434,7 @@ void BspRenderer::drawPointEntities(std::vector<int> highlightEnts, int pass)
34343434
}
34353435
else
34363436
{
3437-
if (pass == REND_PASS_COLORSHADER && !ortho_overview)
3437+
if (pass == REND_PASS_COLORSHADER && !ortho_overview && !make_screenshot)
34383438
{
34393439
g_app->matmodel = renderEnts[i].modelMat4x4_calc_angles;
34403440
g_app->colorShader->updateMatrixes();

src/editor/Gui.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7011,7 +7011,8 @@ void Gui::drawOverviewWidget()
70117011
ImGui::DragInt("Height###3", &ortho_tga_h, 1.0f, 256, 4096);
70127012
ImGui::PopItemWidth();
70137013

7014-
if (ImGui::Button("Save .tga")) {
7014+
if (ImGui::Button("Save .tga"))
7015+
{
70157016
ortho_save_tga = true;
70167017
imgFormat = ".tga";
70177018
}
@@ -9908,7 +9909,8 @@ void Gui::drawSettings()
99089909
g_settings.selected_lang = langForSelect;
99099910
g_settings.palette_name = palForSelect;
99109911
set_localize_lang(g_settings.selected_lang);
9911-
9912+
9913+
g_settings.saveSettings();
99129914
if (!app->reloading)
99139915
{
99149916
app->reloading = true;

0 commit comments

Comments
 (0)