fix: update variable names to match hl

997fefbc11
This commit is contained in:
Virt 2025-05-06 10:57:22 +02:00
commit c84a0dc705
7 changed files with 26 additions and 26 deletions

View file

@ -10,7 +10,7 @@
bool isEnabled() {
static auto* const* PENABLED = (Hyprlang::INT* const*) getConfig(CONFIG_ENABLED);
return **PENABLED && g_pHyprRenderer->m_pMostHzMonitor && g_pDynamicCursors; // make sure the compositor is properly initialized
return **PENABLED && g_pHyprRenderer->m_mostHzMonitor && g_pDynamicCursors; // make sure the compositor is properly initialized
}
Hyprlang::CConfigValue toHyprlang(std::variant<std::string, float, int> value) {

View file

@ -33,8 +33,8 @@ void tickRaw(SP<CEventLoopTimer> self, void* data) {
if (isEnabled())
g_pDynamicCursors->onTick(g_pPointerManager.get());
const int TIMEOUT = g_pHyprRenderer->m_pMostHzMonitor && g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate > 0
? 1000.0 / g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate
const int TIMEOUT = g_pHyprRenderer->m_mostHzMonitor && g_pHyprRenderer->m_mostHzMonitor->m_refreshRate > 0
? 1000.0 / g_pHyprRenderer->m_mostHzMonitor->m_refreshRate
: 16;
self->updateTimeout(std::chrono::milliseconds(TIMEOUT));
}
@ -136,7 +136,7 @@ void CDynamicCursors::renderSoftware(CPointerManager* pointers, SP<CMonitor> pMo
data.stretchAngle = resultShown.stretch.angle;
data.stretchMagnitude = resultShown.stretch.magnitude;
g_pHyprRenderer->m_sRenderPass.add(makeShared<CCursorPassElement>(data));
g_pHyprRenderer->m_renderPass.add(makeShared<CCursorPassElement>(data));
if (pointers->m_currentCursorImage.surface)
pointers->m_currentCursorImage.surface->resource()->frame(now);
@ -245,7 +245,7 @@ SP<Aquamarine::IBuffer> CDynamicCursors::renderHardware(CPointerManager* pointer
CRegion damage = {0, 0, INT16_MAX, INT16_MAX};
g_pHyprRenderer->makeEGLCurrent();
g_pHyprOpenGL->m_RenderData.pMonitor = state->monitor;
g_pHyprOpenGL->m_renderData.pMonitor = state->monitor;
auto RBO = g_pHyprRenderer->getOrCreateRenderbuffer(buf, state->monitor->m_cursorSwapchain->currentOptions().format);
@ -272,7 +272,7 @@ SP<Aquamarine::IBuffer> CDynamicCursors::renderHardware(CPointerManager* pointer
g_pHyprOpenGL->end();
glFlush();
g_pHyprOpenGL->m_RenderData.pMonitor.reset();
g_pHyprOpenGL->m_renderData.pMonitor.reset();
g_pHyprRenderer->onRenderbufferDestroy(RBO.get());

View file

@ -15,7 +15,7 @@ SModeResult CModeStretch::update(Vector2D pos) {
auto limit = g_pShapeRuleHandler->getIntOr(CONFIG_STRETCH_LIMIT, **PLIMIT);
// create samples array
int max = std::max(1, (int)(g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0
int max = std::max(1, (int)(g_pHyprRenderer->m_mostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0
samples.resize(max, pos);
// capture current sample

View file

@ -15,7 +15,7 @@ SModeResult CModeTilt::update(Vector2D pos) {
auto limit = g_pShapeRuleHandler->getIntOr(CONFIG_TILT_LIMIT, **PLIMIT);
// create samples array
int max = std::max(1, (int)(g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0
int max = std::max(1, (int)(g_pHyprRenderer->m_mostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0
samples.resize(max, pos);
// capture current sample

View file

@ -44,7 +44,7 @@ double CShake::update(Vector2D pos) {
static auto* const* PIPC = (Hyprlang::INT* const*) getConfig(CONFIG_SHAKE_IPC);
int max = std::max(1, (int)(g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate)); // 1s worth of history, avoiding divide by 0
int max = std::max(1, (int)(g_pHyprRenderer->m_mostHzMonitor->m_refreshRate)); // 1s worth of history, avoiding divide by 0
samples.resize(max);
samples_distance.resize(max);
@ -73,7 +73,7 @@ double CShake::update(Vector2D pos) {
// if diagonal sufficiently large and over threshold
double amount = (trail / diagonal) - **PTHRESHOLD;
if (diagonal > 100 && amount > 0) {
float delta = 1.F / g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate;
float delta = 1.F / g_pHyprRenderer->m_mostHzMonitor->m_refreshRate;
float next = this->zoom->goal();

View file

@ -33,7 +33,7 @@ bool CCursorPassElement::needsPrecomputeBlur() {
}
std::optional<CBox> CCursorPassElement::boundingBox() {
return data.box.copy().scale(1.F / g_pHyprOpenGL->m_RenderData.pMonitor->m_scale).round();
return data.box.copy().scale(1.F / g_pHyprOpenGL->m_renderData.pMonitor->m_scale).round();
}
CRegion CCursorPassElement::opaqueRegion() {

View file

@ -61,17 +61,17 @@ void renderCursorTextureInternalWithDamage(SP<CTexture> tex, CBox* pBox, const C
return;
CBox newBox = *pBox;
g_pHyprOpenGL->m_RenderData.renderModif.applyToBox(newBox);
g_pHyprOpenGL->m_renderData.renderModif.applyToBox(newBox);
// get transform
const auto TRANSFORM = wlTransformToHyprutils(invertTransform(!g_pHyprOpenGL->m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : g_pHyprOpenGL->m_RenderData.pMonitor->m_transform));
Mat3x3 matrix = projectCursorBox(newBox, TRANSFORM, newBox.rot, g_pHyprOpenGL->m_RenderData.monitorProjection, hotspot, stretchAngle, stretch);
const auto TRANSFORM = wlTransformToHyprutils(invertTransform(!g_pHyprOpenGL->m_endFrame ? WL_OUTPUT_TRANSFORM_NORMAL : g_pHyprOpenGL->m_renderData.pMonitor->m_transform));
Mat3x3 matrix = projectCursorBox(newBox, TRANSFORM, newBox.rot, g_pHyprOpenGL->m_renderData.monitorProjection, hotspot, stretchAngle, stretch);
Mat3x3 glMatrix = g_pHyprOpenGL->m_RenderData.projection.copy().multiply(matrix);
Mat3x3 glMatrix = g_pHyprOpenGL->m_renderData.projection.copy().multiply(matrix);
CShader* shader = nullptr;
switch (tex->m_iType) {
switch (tex->m_type) {
case TEXTURE_RGBA: shader = &g_pHyprOpenGL->m_shaders->m_shRGBA; break;
case TEXTURE_RGBX: shader = &g_pHyprOpenGL->m_shaders->m_shRGBX; break;
case TEXTURE_EXTERNAL: shader = &g_pHyprOpenGL->m_shaders->m_shEXT; break;
@ -79,14 +79,14 @@ void renderCursorTextureInternalWithDamage(SP<CTexture> tex, CBox* pBox, const C
}
glActiveTexture(GL_TEXTURE0);
glBindTexture(tex->m_iTarget, tex->m_iTexID);
glBindTexture(tex->m_target, tex->m_texID);
if (g_pHyprOpenGL->m_RenderData.useNearestNeighbor || nearest) {
glTexParameteri(tex->m_iTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(tex->m_iTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
if (g_pHyprOpenGL->m_renderData.useNearestNeighbor || nearest) {
glTexParameteri(tex->m_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(tex->m_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
} else {
glTexParameteri(tex->m_iTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(tex->m_iTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(tex->m_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(tex->m_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
glUseProgram(shader->program);
@ -103,7 +103,7 @@ void renderCursorTextureInternalWithDamage(SP<CTexture> tex, CBox* pBox, const C
glUniform1i(shader->discardAlpha, 0);
CBox transformedBox = newBox;
transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_RenderData.pMonitor->m_transform)), g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.y);
transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_renderData.pMonitor->m_transform)), g_pHyprOpenGL->m_renderData.pMonitor->m_transformedSize.x, g_pHyprOpenGL->m_renderData.pMonitor->m_transformedSize.y);
const auto TOPLEFT = Vector2D(transformedBox.x, transformedBox.y);
const auto FULLSIZE = Vector2D(transformedBox.width, transformedBox.height);
@ -120,8 +120,8 @@ void renderCursorTextureInternalWithDamage(SP<CTexture> tex, CBox* pBox, const C
glEnableVertexAttribArray(shader->posAttrib);
glEnableVertexAttribArray(shader->texAttrib);
if (g_pHyprOpenGL->m_RenderData.clipBox.width != 0 && g_pHyprOpenGL->m_RenderData.clipBox.height != 0) {
CRegion damageClip{g_pHyprOpenGL->m_RenderData.clipBox.x, g_pHyprOpenGL->m_RenderData.clipBox.y, g_pHyprOpenGL->m_RenderData.clipBox.width, g_pHyprOpenGL->m_RenderData.clipBox.height};
if (g_pHyprOpenGL->m_renderData.clipBox.width != 0 && g_pHyprOpenGL->m_renderData.clipBox.height != 0) {
CRegion damageClip{g_pHyprOpenGL->m_renderData.clipBox.x, g_pHyprOpenGL->m_renderData.clipBox.y, g_pHyprOpenGL->m_renderData.clipBox.width, g_pHyprOpenGL->m_renderData.clipBox.height};
damageClip.intersect(damage);
if (!damageClip.empty()) {
@ -140,5 +140,5 @@ void renderCursorTextureInternalWithDamage(SP<CTexture> tex, CBox* pBox, const C
glDisableVertexAttribArray(shader->posAttrib);
glDisableVertexAttribArray(shader->texAttrib);
glBindTexture(tex->m_iTarget, 0);
glBindTexture(tex->m_target, 0);
}