robustness
This commit is contained in:
parent
94f6beab75
commit
704a6bf653
|
|
@ -30,6 +30,7 @@ P3DOsxSplashWindow(P3DInstance *inst) :
|
|||
_image = NULL;
|
||||
_image_data = NULL;
|
||||
_install_progress = 0;
|
||||
_got_wparams = false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -49,6 +50,19 @@ P3DOsxSplashWindow::
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: P3DOsxSplashWindow::set_wparams
|
||||
// Access: Public, Virtual
|
||||
// Description: Changes the window parameters, e.g. to resize or
|
||||
// reposition the window; or sets the parameters for the
|
||||
// first time, creating the initial window.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void P3DOsxSplashWindow::
|
||||
set_wparams(const P3DWindowParams &wparams) {
|
||||
P3DSplashWindow::set_wparams(wparams);
|
||||
_got_wparams = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: P3DOsxSplashWindow::set_image_filename
|
||||
// Access: Public, Virtual
|
||||
|
|
@ -168,6 +182,10 @@ handle_event(P3D_event_data event) {
|
|||
////////////////////////////////////////////////////////////////////
|
||||
void P3DOsxSplashWindow::
|
||||
paint_window() {
|
||||
if (!_got_wparams) {
|
||||
return;
|
||||
}
|
||||
|
||||
GrafPtr out_port = _wparams.get_parent_window()._port;
|
||||
GrafPtr portSave = NULL;
|
||||
Boolean portChanged = QDSwapPort(out_port, &portSave);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public:
|
|||
P3DOsxSplashWindow(P3DInstance *inst);
|
||||
virtual ~P3DOsxSplashWindow();
|
||||
|
||||
virtual void set_wparams(const P3DWindowParams &wparams);
|
||||
virtual void set_image_filename(const string &image_filename,
|
||||
bool image_filename_temp);
|
||||
virtual void set_install_label(const string &install_label);
|
||||
|
|
@ -44,6 +45,7 @@ private:
|
|||
void paint_window();
|
||||
|
||||
private:
|
||||
bool _got_wparams;
|
||||
GWorldPtr _image;
|
||||
char *_image_data;
|
||||
int _image_height, _image_width;
|
||||
|
|
|
|||
Loading…
Reference in New Issue