mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-26 16:07:31 +01:00
Fix glHint parameter, type size and add more null checks (#130)
This commit is contained in:
parent
f0766c845f
commit
d733e03430
@ -26,7 +26,7 @@ namespace scene
|
||||
|
||||
//! Constructor
|
||||
CB3DMeshFileLoader::CB3DMeshFileLoader(scene::ISceneManager* smgr)
|
||||
: AnimatedMesh(0), B3DFile(0), NormalsInFile(false),
|
||||
: AnimatedMesh(0), B3DFile(0), VerticesStart(0), NormalsInFile(false),
|
||||
HasVertexColors(false), ShowWarning(true)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
@ -74,7 +74,7 @@ CGUIFileOpenDialog::CGUIFileOpenDialog(const wchar_t* title,
|
||||
L"", skin ? skin->getDefaultText(EGDT_WINDOW_CLOSE) : L"Close");
|
||||
CloseButton->setSubElement(true);
|
||||
CloseButton->setTabStop(false);
|
||||
if (sprites)
|
||||
if (sprites && skin)
|
||||
{
|
||||
CloseButton->setSpriteBank(sprites);
|
||||
CloseButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_CLOSE), color);
|
||||
|
@ -40,7 +40,7 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, png_bytep data, png_size_t l
|
||||
|
||||
// changed by zola {
|
||||
io::IReadFile* file=(io::IReadFile*)png_get_io_ptr(png_ptr);
|
||||
check=(png_size_t) file->read((void*)data,(u32)length);
|
||||
check=(png_size_t) file->read((void*)data, length);
|
||||
// }
|
||||
|
||||
if (check != length)
|
||||
|
@ -46,7 +46,7 @@ void PNGAPI user_write_data_fcn(png_structp png_ptr, png_bytep data, png_size_t
|
||||
png_size_t check;
|
||||
|
||||
io::IWriteFile* file=(io::IWriteFile*)png_get_io_ptr(png_ptr);
|
||||
check=(png_size_t) file->write((const void*)data,(u32)length);
|
||||
check=(png_size_t) file->write((const void*)data, length);
|
||||
|
||||
if (check != length)
|
||||
png_error(png_ptr, "Write Error");
|
||||
|
@ -2615,7 +2615,7 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
|
||||
if ((material.AntiAliasing & EAAM_QUALITY) == EAAM_QUALITY)
|
||||
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);
|
||||
else
|
||||
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);
|
||||
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_FASTEST);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -3805,10 +3805,10 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE
|
||||
glPixelStorei(GL_PACK_INVERT_MESA, GL_FALSE);
|
||||
else
|
||||
#endif
|
||||
if (pixels)
|
||||
if (pixels && newImage)
|
||||
{
|
||||
// opengl images are horizontally flipped, so we have to fix that here.
|
||||
const s32 pitch=newImage->getPitch();
|
||||
const s32 pitch = newImage->getPitch();
|
||||
u8* p2 = pixels + (ScreenSize.Height - 1) * pitch;
|
||||
u8* tmpBuffer = new u8[pitch];
|
||||
for (u32 i=0; i < ScreenSize.Height; i += 2)
|
||||
|
@ -46,13 +46,12 @@ bool CWGLManager::initialize(const SIrrlichtCreationParameters& params, const SE
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = lhInstance;
|
||||
wcex.hIcon = NULL;
|
||||
wcex.hIcon = 0;
|
||||
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = 0;
|
||||
wcex.lpszClassName = ClassName;
|
||||
wcex.hIconSm = 0;
|
||||
wcex.hIcon = 0;
|
||||
RegisterClassEx(&wcex);
|
||||
|
||||
RECT clientSize;
|
||||
|
@ -12,13 +12,12 @@ namespace io
|
||||
|
||||
|
||||
CWriteFile::CWriteFile(const io::path& fileName, bool append)
|
||||
: FileSize(0)
|
||||
: FileSize(0), Filename(fileName)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CWriteFile");
|
||||
#endif
|
||||
|
||||
Filename = fileName;
|
||||
openFile(append);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user