Made map cursor blink a compile time option.
This commit is contained in:
+13
-4
@@ -21,6 +21,8 @@
|
|||||||
#define CURSOR_BLINK_INTERVAL 1000 // milliseconds
|
#define CURSOR_BLINK_INTERVAL 1000 // milliseconds
|
||||||
#define CURSOR_HEIGHT 2 // pixels
|
#define CURSOR_HEIGHT 2 // pixels
|
||||||
|
|
||||||
|
#define CUSOR_BLINK FALSE // Set to true for a cursor that blinks
|
||||||
|
|
||||||
extern short glyph2tile[];
|
extern short glyph2tile[];
|
||||||
|
|
||||||
#define TILEBMP_X(ntile) \
|
#define TILEBMP_X(ntile) \
|
||||||
@@ -57,7 +59,7 @@ typedef struct mswin_nethack_map_window {
|
|||||||
double monitorScale; /* from 96dpi to monitor dpi*/
|
double monitorScale; /* from 96dpi to monitor dpi*/
|
||||||
|
|
||||||
boolean cursorOn;
|
boolean cursorOn;
|
||||||
int yFrontCursor; /* height of cursor inback buffer in pixels */
|
int yCursor; /* height of cursor inback buffer in pixels */
|
||||||
|
|
||||||
int backWidth; /* back buffer width */
|
int backWidth; /* back buffer width */
|
||||||
int backHeight; /* back buffer height */
|
int backHeight; /* back buffer height */
|
||||||
@@ -129,8 +131,10 @@ mswin_init_map_window()
|
|||||||
|
|
||||||
mswin_apply_window_style(hWnd);
|
mswin_apply_window_style(hWnd);
|
||||||
|
|
||||||
|
#if CURSOR_BLINK
|
||||||
/* set cursor blink timer */
|
/* set cursor blink timer */
|
||||||
SetTimer(hWnd, 0, CURSOR_BLINK_INTERVAL, NULL);
|
SetTimer(hWnd, 0, CURSOR_BLINK_INTERVAL, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
return hWnd;
|
return hWnd;
|
||||||
}
|
}
|
||||||
@@ -278,7 +282,11 @@ mswin_map_stretch(HWND hWnd, LPSIZE map_size, BOOL redraw)
|
|||||||
data->yFrontTile = (int) ((double) data->yBackTile * data->frontScale);
|
data->yFrontTile = (int) ((double) data->yBackTile * data->frontScale);
|
||||||
|
|
||||||
/* calcuate ASCII cursor height */
|
/* calcuate ASCII cursor height */
|
||||||
data->yFrontCursor = (int) ((double) CURSOR_HEIGHT * data->backScale);
|
#if CURSOR_BLINK
|
||||||
|
data->yCursor = (int) ((double) CURSOR_HEIGHT * data->backScale);
|
||||||
|
#else
|
||||||
|
data->yCursor = data->yBackTile;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* set map origin point */
|
/* set map origin point */
|
||||||
data->map_orig.x =
|
data->map_orig.x =
|
||||||
@@ -701,6 +709,7 @@ onCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
|||||||
data->hWnd = hWnd;
|
data->hWnd = hWnd;
|
||||||
|
|
||||||
data->bAsciiMode = FALSE;
|
data->bAsciiMode = FALSE;
|
||||||
|
data->cursorOn = TRUE;
|
||||||
|
|
||||||
data->xFrontTile = GetNHApp()->mapTile_X;
|
data->xFrontTile = GetNHApp()->mapTile_X;
|
||||||
data->yFrontTile = GetNHApp()->mapTile_Y;
|
data->yFrontTile = GetNHApp()->mapTile_Y;
|
||||||
@@ -885,9 +894,9 @@ paintGlyph(PNHMapWindow data, int i, int j, RECT * rect)
|
|||||||
|
|
||||||
if (i == data->xCur && j == data->yCur && data->cursorOn)
|
if (i == data->xCur && j == data->yCur && data->cursorOn)
|
||||||
PatBlt(data->backBufferDC,
|
PatBlt(data->backBufferDC,
|
||||||
rect->left, rect->bottom - data->yFrontCursor,
|
rect->left, rect->bottom - data->yCursor,
|
||||||
rect->right - rect->left,
|
rect->right - rect->left,
|
||||||
data->yFrontCursor,
|
data->yCursor,
|
||||||
DSTINVERT);
|
DSTINVERT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user