mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix for intel pickbestsize
This commit is contained in:
parent
c3e20f1a70
commit
e95e5795e5
@ -2202,11 +2202,12 @@ bool wdxGraphicsWindow::search_for_device(LPDIRECT3D8 pD3D8,DXDeviceInfo *pDevIn
|
|||||||
|
|
||||||
bool bCouldntFindValidZBuf;
|
bool bCouldntFindValidZBuf;
|
||||||
if(!_dxgsg->scrn.bIsLowVidMemCard) {
|
if(!_dxgsg->scrn.bIsLowVidMemCard) {
|
||||||
if(dx_pick_best_screenres) {
|
|
||||||
if((_dxgsg->scrn.MaxAvailVidMem == UNKNOWN_VIDMEM_SIZE) || is_badvidmem_card(&_dxgsg->scrn.DXDeviceID)) {
|
bool bUseDefaultSize=dx_pick_best_screenres&&
|
||||||
wdxdisplay_cat.info() << "pick_best_screenres: defaulted 800x600 based on no reliable vidmem size\n";
|
((_dxgsg->scrn.MaxAvailVidMem == UNKNOWN_VIDMEM_SIZE) ||
|
||||||
dwRenderWidth=800; dwRenderHeight=600;
|
is_badvidmem_card(&_dxgsg->scrn.DXDeviceID));
|
||||||
} else {
|
|
||||||
|
if(dx_pick_best_screenres && !bUseDefaultSize) {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT memlimit;
|
UINT memlimit;
|
||||||
DWORD scrnX,scrnY;
|
DWORD scrnX,scrnY;
|
||||||
@ -2248,13 +2249,18 @@ bool wdxGraphicsWindow::search_for_device(LPDIRECT3D8 pD3D8,DXDeviceInfo *pDevIn
|
|||||||
// otherwise just go with whatever was specified (we probably shouldve marked this card as lowmem if it gets to end of loop w/o breaking
|
// otherwise just go with whatever was specified (we probably shouldve marked this card as lowmem if it gets to end of loop w/o breaking
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
if(pixFmt==D3DFMT_UNKNOWN) {
|
||||||
|
|
||||||
|
if(bUseDefaultSize) {
|
||||||
|
wdxdisplay_cat.info() << "pick_best_screenres: defaulted 800x600 based on no reliable vidmem size\n";
|
||||||
|
dwRenderWidth=800; dwRenderHeight=600;
|
||||||
|
}
|
||||||
|
|
||||||
search_for_valid_displaymode(dwRenderWidth,dwRenderHeight,bNeedZBuffer,bWantStencil,
|
search_for_valid_displaymode(dwRenderWidth,dwRenderHeight,bNeedZBuffer,bWantStencil,
|
||||||
&_dxgsg->scrn.SupportedScreenDepthsMask,
|
&_dxgsg->scrn.SupportedScreenDepthsMask,
|
||||||
&bCouldntFindValidZBuf,
|
&bCouldntFindValidZBuf,
|
||||||
&pixFmt);
|
&pixFmt);
|
||||||
|
|
||||||
|
|
||||||
// note I'm not saving refresh rate, will just use adapter default at given res for now
|
// note I'm not saving refresh rate, will just use adapter default at given res for now
|
||||||
|
|
||||||
if(pixFmt==D3DFMT_UNKNOWN) {
|
if(pixFmt==D3DFMT_UNKNOWN) {
|
||||||
@ -2954,6 +2960,19 @@ get_depth_bitwidth(void) {
|
|||||||
// return ddsd.ddpfPixelFormat.dwRGBBitCount;
|
// return ddsd.ddpfPixelFormat.dwRGBBitCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wdxGraphicsWindow::
|
||||||
|
get_framebuffer_format(PixelBuffer::Type &fb_type, PixelBuffer::Format &fb_format) {
|
||||||
|
assert(_dxgsg!=NULL);
|
||||||
|
|
||||||
|
fb_type = PixelBuffer::T_unsigned_byte;
|
||||||
|
// this is sortof incorrect, since for F_rgb5 it's really 5 bits per channel
|
||||||
|
//would have to change a lot of texture stuff to make this correct though
|
||||||
|
|
||||||
|
if(IS_16BPP_DISPLAY_FORMAT(_dxgsg->scrn.PresParams.BackBufferFormat))
|
||||||
|
fb_format = PixelBuffer::F_rgb5;
|
||||||
|
else fb_format = PixelBuffer::F_rgb;
|
||||||
|
}
|
||||||
|
|
||||||
// Global system parameters we want to modify during our run
|
// Global system parameters we want to modify during our run
|
||||||
static int iMouseTrails;
|
static int iMouseTrails;
|
||||||
static bool bCursorShadowOn,bMouseVanish;
|
static bool bCursorShadowOn,bMouseVanish;
|
||||||
|
@ -90,6 +90,7 @@ public:
|
|||||||
virtual bool resize(unsigned int xsize,unsigned int ysize);
|
virtual bool resize(unsigned int xsize,unsigned int ysize);
|
||||||
virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);
|
virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);
|
||||||
virtual int get_depth_bitwidth(void);
|
virtual int get_depth_bitwidth(void);
|
||||||
|
virtual void get_framebuffer_format(PixelBuffer::Type &fb_type, PixelBuffer::Format &fb_format);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ButtonHandle lookup_key(WPARAM wparam) const;
|
ButtonHandle lookup_key(WPARAM wparam) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user