removed old code
This commit is contained in:
parent
e3390bd2a2
commit
072969ce81
71
src/core.c
71
src/core.c
|
|
@ -5898,75 +5898,4 @@ static int FindNearestConnectorMode(const drmModeConnector *connector, uint widt
|
|||
return nearestIndex;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int FindConnectorMode(bool findExactly, bool allowInterlaced) {
|
||||
TRACELOG(LOG_TRACE, "searching connector mode, should find exactly matching: %s, selecting an interlaced mode is allowed: %s",
|
||||
findExactly ? "yes" : "no", allowInterlaced ? "yes" : "no");
|
||||
|
||||
if (!CORE.Window.connector) return -1;
|
||||
|
||||
// If InitWindow should use the current mode find it in the connector's mode list
|
||||
if ((CORE.Window.screen.width <= 0) || (CORE.Window.screen.height <= 0))
|
||||
{
|
||||
TRACELOG(LOG_TRACE, "selecting DRM connector mode for current used mode");
|
||||
|
||||
// safe bitwise comparison of two modes
|
||||
#define BINCMP(a, b) memcmp((a), (b), (sizeof(a) < sizeof(b)) ? sizeof(a) : sizeof(b))
|
||||
|
||||
for (int i = CORE.Window.connector->count_modes - 1; i >= 0; i--)
|
||||
{
|
||||
TRACELOG(LOG_TRACE, "mode %d %ux%u@%u %s", i, CORE.Window.connector->modes[i].hdisplay, CORE.Window.connector->modes[i].vdisplay,
|
||||
CORE.Window.connector->modes[i].vrefresh, (CORE.Window.connector->modes[i].flags & DRM_MODE_FLAG_INTERLACE) ? "interlaced" : "progressive");
|
||||
|
||||
if (0 == BINCMP(&CORE.Window.crtc->mode, &CORE.Window.connector->modes[i]))
|
||||
{
|
||||
TRACELOG(LOG_TRACE, "above mode selected");
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
||||
#undef BINCMP
|
||||
}
|
||||
else
|
||||
{
|
||||
const double fps = (CORE.Time.target > 0) ? (1.0 / CORE.Time.target) : 60;
|
||||
|
||||
TRACELOG(LOG_TRACE, "selecting for %ux%u@%f", CORE.Window.screen.width, CORE.Window.screen.height, fps);
|
||||
|
||||
// Get closest video mode to desired CORE.Window.screen.width/CORE.Window.screen.height
|
||||
for (int i = CORE.Window.connector->count_modes - 1; i >= 0; i--)
|
||||
{
|
||||
TRACELOG(LOG_TRACE, "mode %d %ux%u@%u %s", i, CORE.Window.connector->modes[i].hdisplay, CORE.Window.connector->modes[i].vdisplay,
|
||||
CORE.Window.connector->modes[i].vrefresh, (CORE.Window.connector->modes[i].flags & DRM_MODE_FLAG_INTERLACE) ? "interlaced" : "progressive");
|
||||
|
||||
if (CORE.Window.connector->modes[i].flags & DRM_MODE_FLAG_INTERLACE)
|
||||
{
|
||||
TRACELOG(LOG_TRACE, "interlaced mode");
|
||||
if (!allowInterlaced)
|
||||
{
|
||||
TRACELOG(LOG_TRACE, "but shouldn't choose an interlaced mode");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else TRACELOG(LOG_TRACE, "progressive mode");
|
||||
|
||||
const bool found = (findExactly)
|
||||
? (CORE.Window.connector->modes[i].hdisplay == CORE.Window.screen.width) &&
|
||||
(CORE.Window.connector->modes[i].vdisplay == CORE.Window.screen.height) &&
|
||||
(CORE.Window.connector->modes[i].vrefresh == fps)
|
||||
: (CORE.Window.connector->modes[i].hdisplay >= CORE.Window.screen.width) &&
|
||||
(CORE.Window.connector->modes[i].vdisplay >= CORE.Window.screen.height) &&
|
||||
(CORE.Window.connector->modes[i].vrefresh >= fps);
|
||||
if (found)
|
||||
{
|
||||
TRACELOG(LOG_TRACE, "above mode selected");
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user