mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
no drawing until board inited; redraw after colors changed in new game creation
This commit is contained in:
parent
0a6a9de4cf
commit
15299090e9
1 changed files with 11 additions and 8 deletions
|
@ -110,6 +110,7 @@ static XP_Bool ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream,
|
||||||
static void RECTtoXPR( XP_Rect* dest, RECT* src );
|
static void RECTtoXPR( XP_Rect* dest, RECT* src );
|
||||||
static XP_Bool doNewGame( CEAppGlobals* globals, XP_Bool silent );
|
static XP_Bool doNewGame( CEAppGlobals* globals, XP_Bool silent );
|
||||||
static XP_Bool ceSaveCurGame( CEAppGlobals* globals, XP_Bool autoSave );
|
static XP_Bool ceSaveCurGame( CEAppGlobals* globals, XP_Bool autoSave );
|
||||||
|
static void updateForColors( CEAppGlobals* globals );
|
||||||
|
|
||||||
|
|
||||||
// Forward declarations of functions included in this code module:
|
// Forward declarations of functions included in this code module:
|
||||||
|
@ -905,6 +906,9 @@ doNewGame( CEAppGlobals* globals, XP_Bool silent )
|
||||||
if ( giState.prefsChanged ) {
|
if ( giState.prefsChanged ) {
|
||||||
loadCurPrefsFromState( &globals->appPrefs, &globals->gameInfo,
|
loadCurPrefsFromState( &globals->appPrefs, &globals->gameInfo,
|
||||||
&giState.prefsPrefs );
|
&giState.prefsPrefs );
|
||||||
|
if ( giState.colorsChanged ) {
|
||||||
|
updateForColors( globals );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ceInitAndStartBoard( globals, XP_TRUE, NULL );
|
ceInitAndStartBoard( globals, XP_TRUE, NULL );
|
||||||
changed = XP_TRUE;
|
changed = XP_TRUE;
|
||||||
|
@ -992,11 +996,9 @@ ceDoPrefsDlg( CEAppGlobals* globals )
|
||||||
|
|
||||||
(void)cePositionBoard( globals );
|
(void)cePositionBoard( globals );
|
||||||
|
|
||||||
#ifdef XWFEATURE_CE_EDITCOLORS
|
|
||||||
if ( state.colorsChanged ) {
|
if ( state.colorsChanged ) {
|
||||||
updateForColors( globals );
|
updateForColors( globals );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/* need to reflect vars set in state into globals, and update/inval
|
/* need to reflect vars set in state into globals, and update/inval
|
||||||
as appropriate. */
|
as appropriate. */
|
||||||
}
|
}
|
||||||
|
@ -1325,13 +1327,14 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
if ( !!globals && GetUpdateRect( hWnd, &rt, FALSE ) ) {
|
if ( !!globals && GetUpdateRect( hWnd, &rt, FALSE ) ) {
|
||||||
XP_Rect rect;
|
XP_Rect rect;
|
||||||
|
|
||||||
/* When an obscuring window goes away, the update region needs
|
if ( !!globals->game.board ) {
|
||||||
to be redrawn. This allows invalidating it. */
|
/* When an obscuring window goes away, the update region
|
||||||
RECTtoXPR( &rect, &rt );
|
needs to be redrawn. This allows invalidating it. */
|
||||||
board_invalRect( globals->game.board, &rect );
|
RECTtoXPR( &rect, &rt );
|
||||||
|
board_invalRect( globals->game.board, &rect );
|
||||||
drawInsidePaint( hWnd, globals );
|
|
||||||
|
|
||||||
|
drawInsidePaint( hWnd, globals );
|
||||||
|
}
|
||||||
if ( !ValidateRect( hWnd, &rt ) ) {
|
if ( !ValidateRect( hWnd, &rt ) ) {
|
||||||
logLastError( "WM_PAINT:ValidateRect" );
|
logLastError( "WM_PAINT:ValidateRect" );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue