aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-10-26 15:42:49 +0000
committerTorbjörn Andersson2003-10-26 15:42:49 +0000
commit7c4cc25cec714073d947e6451b4bf76cd53624ef (patch)
tree79a4c235fb9b62e0f49e069d87645f99022b2859 /sword2/driver
parent2a139049d621479da4898fcb22c742c52d17eac3 (diff)
downloadscummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.tar.gz
scummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.tar.bz2
scummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.zip
Enable the debug console. Actually, what I've done is to adapt the debug
console from the SCUMM engine. I decided that would be easier than to clean up the original console code. Unfortunately there's a bunch of code that I just copied - a pretty lousy form of code-reusal. It'd be nice if the console could be made part of the Engine class, or something like that. Most of the debug commands seem to be working. Some aren't relevant for ScummVM, and some are a bit obscure so I'm not quite sure what they're supposed to be doing. svn-id: r10978
Diffstat (limited to 'sword2/driver')
-rw-r--r--sword2/driver/_console.cpp151
-rw-r--r--sword2/driver/_console.h29
-rw-r--r--sword2/driver/d_draw.h5
-rw-r--r--sword2/driver/render.cpp2
4 files changed, 2 insertions, 185 deletions
diff --git a/sword2/driver/_console.cpp b/sword2/driver/_console.cpp
deleted file mode 100644
index bf711febe1..0000000000
--- a/sword2/driver/_console.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Copyright (C) 1994-2003 Revolution Software Ltd
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Header$
- */
-
-//=============================================================================
-//
-// Filename : console.c
-// Created : 19th September 1996
-// By : P.R.Porter
-//
-// Summary : This module holds the code which controls and displays
-// the console/debugging window.
-//
-// Functions
-// ---------
-//
-// --------------------------------------------------------------------------
-//
-// int32 OpenConsole(void)
-//
-// Displays the console window and directs keyboard input to it.
-//
-// --------------------------------------------------------------------------
-//
-// int32 CloseConsole(void)
-//
-// Removes the console from the display.
-//
-//=============================================================================
-
-#include "stdafx.h"
-#include "bs2/driver/driver96.h"
-#include "bs2/driver/d_draw.h"
-
-namespace Sword2 {
-
-uint8 consoleStatus = 0; // 1 - console display
-//static uint16 consoley = 0;
-//static uint32 consoleSize;
-static uint8 *consoleSprite = NULL;
-
-
-
-// --------------------------------------------------------------------------
-// Called before the screens are flipped, so that the console can be drawn
-// over the screen if necessary.
-// --------------------------------------------------------------------------
-void DisplayConsole(void)
-
-{
- warning("stub DisplayConsole");
-/*
- uint8 *src, *dst;
- uint8 i;
-// DDSURFACEDESC ddDescription;
-// HRESULT hr;
-
-
- if (consoleStatus)
- {
-
- ddDescription.dwSize = sizeof(ddDescription);
-
- hr = IDirectDrawSurface_Lock(lpBackBuffer, NULL, &ddDescription, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL);
- if (hr != DD_OK)
- {
- hr = IDirectDrawSurface_Lock(lpBackBuffer, NULL, &ddDescription, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT, NULL);
- }
-
- if (hr == DD_OK)
- {
-
- dst = (uint8 *) ddDescription.lpSurface + (screenDeep - consoley) * ddDescription.lPitch;
- src = (uint8 *) consoleSprite;
-
- for (i=0; i<consoley; i++)
- {
- memcpy(dst, src, screenWide);
- src += screenWide;
- dst += ddDescription.lPitch;
- }
- IDirectDrawSurface_Unlock(lpBackBuffer, ddDescription.lpSurface);
- }
- }
- */
-}
-
-
-
-
-int32 OpenConsole(void)
-
-{
- warning("stub OpenConsole");
-/*
- if (consoleStatus)
- return RDERR_ALREADYOPEN;
-
- if (consoleSprite == NULL)
- {
- consoley = screenDeep >> 2;
- consoleSize = screenWide * consoley;
- consoleSprite = (uint8 *) malloc(consoleSize);
- }
-
- if (consoleSprite == NULL)
- return RDERR_OUTOFMEMORY;
-
- memset(consoleSprite, 0, consoleSize);
-*/
- consoleStatus = 1;
-
- return RD_OK;
-
-}
-
-
-
-
-int32 CloseConsole(void)
-
-{
-
- if (!consoleStatus)
- return RDERR_ALREADYCLOSED;
-
- free(consoleSprite);
- consoleSprite = NULL;
-
- consoleStatus = 0;
-
- return RD_OK;
-
-}
-
-} // End of namespace Sword2
diff --git a/sword2/driver/_console.h b/sword2/driver/_console.h
deleted file mode 100644
index a327cd95c1..0000000000
--- a/sword2/driver/_console.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 1994-2003 Revolution Software Ltd
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Header$
- */
-
-#ifndef DRIVER_CONSOLE_H
-#define DRIVER_CONSOLE_H
-
-namespace Sword2 {
-
-extern void DisplayConsole(void);
-
-} // End of namespace Sword2
-
-#endif
diff --git a/sword2/driver/d_draw.h b/sword2/driver/d_draw.h
index 4d0c1d71e2..17e79c8631 100644
--- a/sword2/driver/d_draw.h
+++ b/sword2/driver/d_draw.h
@@ -153,7 +153,6 @@ private:
void clearIconArea(int menu, int pocket, Common::Rect *r);
void decompressMouse(uint8 *decomp, uint8 *comp, int width, int height, int pitch, int xOff = 0, int yOff = 0);
- void drawMouse(void);
uint8 getMatch(uint8 r, uint8 g, uint8 b);
void fadeServer(void);
@@ -214,6 +213,8 @@ public:
int32 setLuggageAnim(uint8 *la, int32 size);
int32 animateMouse(void);
+ void drawMouse(void);
+
void resetRenderEngine(void);
void setScrollTarget(int16 sx, int16 sy);
@@ -225,10 +226,8 @@ public:
int32 initialiseBackgroundLayer(_parallax *p);
void closeBackgroundLayer(void);
-#ifdef _SWORD2_DEBUG
void plotPoint(uint16 x, uint16 y, uint8 colour);
void drawLine(int16 x1, int16 y1, int16 x2, int16 y2, uint8 colour);
-#endif
int32 createSurface(_spriteInfo *s, uint8 **surface);
void drawSurface(_spriteInfo *s, uint8 *surface, Common::Rect *clipRect = NULL);
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp
index a8e13fd45a..e0cc9fc7df 100644
--- a/sword2/driver/render.cpp
+++ b/sword2/driver/render.cpp
@@ -328,7 +328,6 @@ void Display::stretchImage(byte *dst, uint16 dstPitch, uint16 dstWidth, uint16 d
}
}
-#ifdef _SWORD2_DEBUG
/**
* Plots a point relative to the top left corner of the screen. This is only
* used for debugging.
@@ -513,7 +512,6 @@ void Display::drawLine(int16 x0, int16 y0, int16 x1, int16 y1, uint8 colour) {
}
}
}
-#endif
/**
* This function tells the driver the size of the background screen for the