Skip to content

Commit 1281fdb

Browse files
test other platforms, zero on my laptop
1 parent c43ffd8 commit 1281fdb

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"description": "The length of rewind history stored, in capture frame count.",
5757
"type": "int",
5858
"min": 20,
59-
"max": 400,
59+
"max": 500,
6060
"default": {
6161
"android": 140,
6262
"ios": 140,

src/settings.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <Geode/loader/SettingV3.hpp>
2+
#include <Geode/cocos/platform/win32/CCGL.h>
23
#include "hooks/GJBaseGameLayer.hpp"
34

45
// shouldnt be necessary but i bet some people will be changing their mod settings
@@ -18,4 +19,27 @@
1819
fields->m_resolutionMultiplier = geode::Mod::get()->getSettingValue<double>("resolution-multiplier");
1920
}
2021
});
21-
};
22+
23+
24+
// populate defaults by getting amount of system vram
25+
bool hasSetRecommended = geode::Mod::get()->getSavedValue<bool>("has-set-recommended", false);
26+
if (hasSetRecommended) return;
27+
28+
geode::Mod::get()->setSavedValue<bool>("has-set-recommended", true);
29+
30+
// https://stackoverflow.com/a/5695427
31+
// some pretty sketchy glgetinteger calls
32+
auto values = new int[4]();
33+
glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, values);
34+
glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, values);
35+
36+
if (values[0] == 0) {
37+
geode::log::info("No data returned from vram checks :( ({}, {}, {}, {})", values[0], values[1], values[2], values[3]);
38+
delete[] values;
39+
return;
40+
}
41+
42+
geode::log::info("Video memory checks returned {}", values[0]);
43+
44+
delete[] values;
45+
}

0 commit comments

Comments
 (0)