summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--console.c6
-rw-r--r--console.h2
-rw-r--r--engine_gui.c2
-rw-r--r--misc_gui.c4
-rw-r--r--sound.c2
-rw-r--r--viewport.c2
-rw-r--r--window.c18
7 files changed, 16 insertions, 20 deletions
diff --git a/console.c b/console.c
index 093a575ae..44fd77822 100644
--- a/console.c
+++ b/console.c
@@ -152,7 +152,7 @@ static void IConsoleWndProc(Window *w, WindowEvent *e)
break;
case WKC_CTRL | WKC_RETURN:
_iconsole_mode = (_iconsole_mode == ICONSOLE_FULL) ? ICONSOLE_OPENED : ICONSOLE_FULL;
- IConsoleResize(w);
+ IConsoleResize();
MarkWholeScreenDirty();
break;
case (WKC_CTRL | 'V'):
@@ -283,10 +283,8 @@ void IConsoleFree(void)
CloseConsoleLogIfActive();
}
-void IConsoleResize(Window *w)
+void IConsoleResize(void)
{
- assert(_iconsole_win == w);
-
switch (_iconsole_mode) {
case ICONSOLE_OPENED:
_iconsole_win->height = _screen.height / 3;
diff --git a/console.h b/console.h
index 0c74a14bd..db0093266 100644
--- a/console.h
+++ b/console.h
@@ -118,7 +118,7 @@ VARDEF IConsoleModes _iconsole_mode;
void IConsoleInit(void);
void IConsoleFree(void);
void IConsoleClearBuffer(void);
-void IConsoleResize(Window *w);
+void IConsoleResize(void);
void IConsoleSwitch(void);
void IConsoleClose(void);
void IConsoleOpen(void);
diff --git a/engine_gui.c b/engine_gui.c
index 30c294b1e..31f175cf1 100644
--- a/engine_gui.c
+++ b/engine_gui.c
@@ -115,7 +115,7 @@ static const WindowDesc _engine_preview_desc = {
void ShowEnginePreviewWindow(EngineID engine)
{
- Window *w = AllocateWindowDescFront(&_engine_preview_desc, engine);
+ AllocateWindowDescFront(&_engine_preview_desc, engine);
}
static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw)
diff --git a/misc_gui.c b/misc_gui.c
index 0a6b19ccc..3d721ca29 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -1852,10 +1852,8 @@ static const WindowDesc _cheats_desc = {
void ShowCheatWindow(void)
{
- Window *w;
-
DeleteWindowById(WC_CHEATS, 0);
- w = AllocateWindowDesc(&_cheats_desc);
+ AllocateWindowDesc(&_cheats_desc);
}
/** Resize the widgets in a window
diff --git a/sound.c b/sound.c
index e1719e08a..7e78b07dd 100644
--- a/sound.c
+++ b/sound.c
@@ -194,7 +194,7 @@ void SndCopyToPool(void)
static void SndPlayScreenCoordFx(SoundFx sound, int x, int y)
{
- const Window* const *wz;
+ Window* const *wz;
if (msf.effect_vol == 0) return;
diff --git a/viewport.c b/viewport.c
index e9ce5cdc7..8f50bdec8 100644
--- a/viewport.c
+++ b/viewport.c
@@ -183,7 +183,7 @@ void AssignWindowViewport(Window *w, int x, int y,
static Point _vp_move_offs;
-static void DoSetViewportPosition(const Window* const *wz, int left, int top, int width, int height)
+static void DoSetViewportPosition(Window* const *wz, int left, int top, int width, int height)
{
for (; wz != _last_z_window; wz++) {
diff --git a/window.c b/window.c
index 17d4c908f..30e11dcd7 100644
--- a/window.c
+++ b/window.c
@@ -222,7 +222,7 @@ void DrawOverlappedWindowForAll(int left, int top, int right, int bottom)
static void DrawOverlappedWindow(Window* const *wz, int left, int top, int right, int bottom)
{
- const Window* const *vz = wz;
+ Window* const *vz = wz;
int x;
while (++vz != _last_z_window) {
@@ -1058,7 +1058,7 @@ static bool HandleWindowDragging(void)
ny = y;
if (_patches.window_snap_radius != 0) {
- const Window* const *vz;
+ Window* const *vz;
int hsnap = _patches.window_snap_radius;
int vsnap = _patches.window_snap_radius;
@@ -1370,8 +1370,8 @@ static bool HandleViewportScroll(void)
static void MaybeBringWindowToFront(const Window *w)
{
- const Window* const *wz;
- const Window* const *uz;
+ Window* const *wz;
+ Window* const *uz;
if (w->window_class == WC_MAIN_WINDOW ||
IsVitalWindow(w) ||
@@ -1725,7 +1725,7 @@ int GetMenuItemIndex(const Window *w, int x, int y)
void InvalidateWindow(WindowClass cls, WindowNumber number)
{
- const Window* const *wz;
+ Window* const *wz;
FOR_ALL_WINDOWS(wz) {
const Window *w = *wz;
@@ -1745,7 +1745,7 @@ void InvalidateWidget(const Window *w, byte widget_index)
void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_index)
{
- const Window* const *wz;
+ Window* const *wz;
FOR_ALL_WINDOWS(wz) {
const Window *w = *wz;
@@ -1757,7 +1757,7 @@ void InvalidateWindowWidget(WindowClass cls, WindowNumber number, byte widget_in
void InvalidateWindowClasses(WindowClass cls)
{
- const Window* const *wz;
+ Window* const *wz;
FOR_ALL_WINDOWS(wz) {
if ((*wz)->window_class == cls) SetWindowDirty(*wz);
@@ -1917,8 +1917,8 @@ void RelocateAllWindows(int neww, int newh)
break;
case WC_CONSOLE:
- IConsoleResize(w);
- break;
+ IConsoleResize();
+ continue;
default:
left = w->left;