[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netPanzer-CVS] netpanzer ./ChangeLog src/Lib/cMouse.cpp src/Li...
From: |
Matthias Braun |
Subject: |
[netPanzer-CVS] netpanzer ./ChangeLog src/Lib/cMouse.cpp src/Li... |
Date: |
Fri, 03 Oct 2003 10:45:24 -0400 |
CVSROOT: /cvsroot/netpanzer
Module name: netpanzer
Branch:
Changes by: Matthias Braun <address@hidden> 03/10/03 10:45:21
Modified files:
. : ChangeLog
src/Lib : cMouse.cpp cMouse.hpp
src/Lib/2D : Surface.cpp Surface.hpp
src/Lib/Particles: Particle2D.cpp ParticleSystem2D.cpp
SnowParticleSystem2D.cpp
src/Lib/View : CheckBox.cpp Choice.cpp Desktop.cpp Desktop.hpp
ScrollBar.cpp View.cpp View.hpp cButton.cpp
cInputField.cpp
src/NetPanzer/Classes: TileEngine.cpp WorldInputCmdProcessor.cpp
src/NetPanzer/Classes/Units: Humvee.cpp Vehicle.cpp
src/NetPanzer/Classes/Weapons: BulletWeapon.cpp MissleWeapon.cpp
ShellWeapon.cpp Weapon.cpp
src/NetPanzer/Interfaces: ConsoleInterface.cpp GameConfig.cpp
GameConfig.hpp GameManager.cpp
GameManager.hpp MapInterface.cpp
MapInterface.hpp MouseInterface.cpp
src/NetPanzer/Views/Game: AreYouSureExitView.cpp
AreYouSureResignView.cpp ChatView.cpp
GameInfoView.cpp GameTemplateView.cpp
GameToolbarView.cpp GameView.cpp
HelpScrollView.cpp LobbyView.cpp
MiniMapOptionsView.cpp MiniMapView.cpp
ProgressView.cpp RankView.cpp
ResignView.cpp
VehicleSelectionView.cpp
WinnerMesgView.cpp
src/NetPanzer/Views/MainMenu: MainMenuView.cpp
MenuTemplateView.cpp
OptionsTemplateView.cpp
OrderingView.cpp SkirmishView.cpp
SpecialButtonView.cpp
src/NetPanzer/Views/MainMenu/Multi: FlagSelectionView.cpp
GetSessionHostView.cpp
HostJoinTemplateView.cpp
HostJoinTemplateView.hpp
HostOptionsView.cpp
PlayerNameView.cpp
UnitColorView.cpp
src/NetPanzer/Views/MainMenu/Options: ControlsView.cpp
VisualsView.cpp
src/UILib : UIDraw.hpp
src/UILib/SDL : SDLDraw.cpp SDLDraw.hpp
Removed files:
src/Lib/2D : FontSystem2D.cpp
src/NetPanzer/Core: loadPics.cpp loadPics.hpp
src/NetPanzer/Structs: KeyActionEnum.hpp
src/NetPanzer/Views/Game: ControlPaletteView.cpp
ControlPaletteView.hpp ControlView.cpp
ControlView.hpp MiniRankView.cpp
MiniRankView.hpp
src/NetPanzer/Views/MainMenu/Multi:
DirectPlayErrorExceptionView.cpp
DirectPlayErrorExceptionView.hpp
Log message:
-did refactoring work on the surface/DDHardSurface interfaces.
DDHardSurface is
now called ScreenSurface, and is used in 99% of all cases where we need
to
access video memory.
-screen is defined in ScreenSurface.hpp now. Consequently no code in
the Lib
subdir has the ability to know details about the screen which makes the
separation alot cleaner.
-Removed some unused code
Patches:
Index: netpanzer/ChangeLog
diff -u netpanzer/ChangeLog:1.5 netpanzer/ChangeLog:1.6
--- netpanzer/ChangeLog:1.5 Wed Sep 24 13:43:20 2003
+++ netpanzer/ChangeLog Fri Oct 3 10:44:55 2003
@@ -1,3 +1,12 @@
+02-Oct-2003 by Matthias Braun
+-did refactoring work on the surface/DDHardSurface interfaces. DDHardSurface is
+ now called ScreenSurface, and is used in 99% of all cases where we need to
+ access video memory.
+-screen is defined in ScreenSurface.hpp now. Consequently no code in the Lib
+ subdir has the ability to know details about the screen which makes the
+ separation alot cleaner.
+-Removed some unused code
+
24-Sep-2003 by Matthias Braun
-converted lots of code to use physfs (not completely done yet)
-removed the automake system
Index: netpanzer/src/Lib/2D/Surface.cpp
diff -u netpanzer/src/Lib/2D/Surface.cpp:1.30
netpanzer/src/Lib/2D/Surface.cpp:1.31
--- netpanzer/src/Lib/2D/Surface.cpp:1.30 Wed Sep 24 13:43:21 2003
+++ netpanzer/src/Lib/2D/Surface.cpp Fri Oct 3 10:44:58 2003
@@ -157,9 +157,6 @@
#pragma pack()
#endif
-bool Surface::screenLocked = true;
-
-Surface screen;
Surface ascii8x8;
Surface ascii5x5;
@@ -511,7 +508,6 @@
//---------------------------------------------------------------------------
void Surface::blt(const Surface &dest, iXY min) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
assert(this != 0);
@@ -603,7 +599,6 @@
//---------------------------------------------------------------------------
void Surface::bltTrans(const Surface &dest, iXY min) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
assert(this != 0);
@@ -699,7 +694,6 @@
//---------------------------------------------------------------------------
void Surface::bltTransColor(const Surface &dest, iXY min, const BYTE &color)
const
{
- assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
assert(this != 0);
@@ -792,7 +786,6 @@
//---------------------------------------------------------------------------
void Surface::drawHLine(int x1, int y, int x2, const PIX &color) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -827,7 +820,6 @@
//---------------------------------------------------------------------------
void Surface::drawVLine(int x, int y1, int y2, const PIX &color) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -875,7 +867,6 @@
//---------------------------------------------------------------------------
void Surface::fill(const PIX &color) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -901,7 +892,6 @@
//---------------------------------------------------------------------------
void Surface::fillRect(iRect bounds, const PIX &color) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -941,7 +931,6 @@
//---------------------------------------------------------------------------
void Surface::drawRect(iRect bounds, const PIX &color) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -973,7 +962,6 @@
//---------------------------------------------------------------------------
void Surface::drawLine(int x1, int y1, int x2, int y2, const PIX &color) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -1157,39 +1145,6 @@
}
} // end ROTATE
-// shade
-//---------------------------------------------------------------------------
-// Purpose: Shades every other pixel which gies the surface a mesh look. The
-// default shade color is BLACK. It can be specified otherwise.
-//---------------------------------------------------------------------------
-void Surface::shade(iRect bounds, PIX color /* = cBLACK */) const
-{
- assert(screenLocked);
- assert(getDoesExist());
- assert(this != 0);
-
- assert(bounds.min >= 0);
- assert(bounds.max <= pix);
-
- //for(int x = bounds.min.x; x < bounds.max.x; x += 2)
- // for(int y = bounds.min.y; y < bounds.max.y; y++)
- // {
- // if (y & 2 == 0) mem[y * screen.pix.x + x + 1] = color;
- // else mem[y * screen.pix.x + x] = color;
- // }
- int x, y, which;
- for (y = bounds.min.y; y < bounds.max.y; y++) {
- which = (y % 2);
- for (x = bounds.min.x; x < bounds.max.x; x += 2) {
- if (which)
- mem[y * screen.pix.x + x + 1] = color;
- else
- mem[y * screen.pix.x + x] = color;
- }
- }
-
-} // end Surface::shade
-
// scale
//---------------------------------------------------------------------------
// Purpose: Scales all the frames of the surface from the current size to the
@@ -1517,7 +1472,6 @@
//---------------------------------------------------------------------------
void Surface::drawButtonBorder(iRect bounds, PIX topLeftColor, PIX
bottomRightColor) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -1544,7 +1498,6 @@
//---------------------------------------------------------------------------
void Surface::blendIn(const Surface &source, iXY min, ColorTable &colorTable)
const
{
- assert(screenLocked);
assert(getDoesExist());
assert(source.getDoesExist());
assert(this != 0);
@@ -1618,7 +1571,6 @@
//---------------------------------------------------------------------------
void Surface::bltBlendScale(const Surface &source, const iRect &destRect,
ColorTable &colorTable) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(source.getDoesExist());
assert(this != 0);
@@ -1708,7 +1660,6 @@
void Surface::bltLookup(const iRect &destRect, const PIX table[]) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
@@ -1747,7 +1698,6 @@
//---------------------------------------------------------------------------
void Surface::bltScale(const Surface &source, const iRect &destRect) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(source.getDoesExist());
assert(this != 0);
@@ -1839,7 +1789,6 @@
//---------------------------------------------------------------------------
void Surface::blendRect(iRect bounds, ColorTable &colorTable) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(this != 0);
assert(Palette::brightness256.getColorCount() == 256);
@@ -2060,7 +2009,6 @@
// bltBrightness
void Surface::bltBrightness(const Surface &dest, const iXY &pos, const float
&percent)
{
- assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
assert(this != 0);
@@ -2394,8 +2342,6 @@
void Surface::bltAdd(const Surface &dest, iXY min) const
{
-
- assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
assert(this != 0);
@@ -2659,6 +2605,16 @@
} // Surface::initFont
+int Surface::getFontHeight()
+{
+ return ascii8x8.getPixY();
+}
+
+int Surface::getTextLength(const char* text)
+{
+ return ascii8x8.getPixX() * strlen(text);
+}
+
// bltChar8x8
//---------------------------------------------------------------------------
// Purpose: Blits the specied rom character to the screen at the specified
@@ -2666,8 +2622,6 @@
//---------------------------------------------------------------------------
void Surface::bltChar8x8(const iXY &pos, const char &character, const PIX
&color) const
{
- assert(screenLocked);
-
#ifdef _DEBUG
if (character > ascii8x8.getFrameCount()) {
assert(false);
@@ -2683,8 +2637,6 @@
//---------------------------------------------------------------------------
void Surface::bltChar5x5(const iXY &pos, const char &character, const PIX
&color) const
{
- assert(screenLocked);
-
#ifdef _DEBUG
if (character > ascii5x5.getFrameCount()) {
assert(false);
@@ -2704,8 +2656,6 @@
//---------------------------------------------------------------------------
void Surface::bltString(const iXY &pos, const char *string, const BYTE &color)
const
{
- assert(screenLocked);
-
for (int index = 0; string[index] != 0; index++) {
// Don't attempt blank spaces.
if (string[index] == 32) {
@@ -2725,8 +2675,6 @@
//---------------------------------------------------------------------------
void Surface::bltString5x5(const iXY &pos, const char *string, const BYTE
&color) const
{
- assert(screenLocked);
-
for (int index = 0; string[index] != 0; index++) {
bltChar5x5(iXY(pos.x + (index * 5), pos.y), string[index], color);
}
@@ -2737,8 +2685,6 @@
//---------------------------------------------------------------------------
void Surface::bltStringShadowed(const iXY &pos, char const *string, const BYTE
&textColor, const BYTE &shadowColor) const
{
- assert(screenLocked);
-
for (int index = 0; string[index] != 0; index++) {
bltChar8x8(pos.x + (index << 3) + 1, pos.y + 1, string[index],
shadowColor);
bltChar8x8(pos.x + (index << 3), pos.y, string[index],
textColor);
@@ -2746,18 +2692,6 @@
} // end Surface::bltStringShadowed
-// bltStringSafe
-//---------------------------------------------------------------------------
-// Purpose: Blit a string of text and makes sure to lock and unlock the DDraw
-// buffer. This should be used when you are wanting to display some
-// text outside the make renderloop. Does not handle wrapping.
-//---------------------------------------------------------------------------
-void Surface::bltStringSafe(const iXY &pos, const char *string, PIX color)
const
-{
- assert(screenLocked);
-
-} // end Surface::bltStringSafe
-
// bltStringCenter
//---------------------------------------------------------------------------
// Purpose: Blits a string of text and centers it horizontally and vertically
@@ -2765,11 +2699,9 @@
//---------------------------------------------------------------------------
void Surface::bltStringCenter(const char *string, PIX color) const
{
- assert(screenLocked);
-
iXY pos;
- pos.x = (getPix().x - (strlen(string) * CHAR_XPIX)) / 2;
- pos.y = (getPix().y - CHAR_YPIX) / 2;
+ pos.x = (getPix().x - (strlen(string) * ascii8x8.getPixX())) / 2;
+ pos.y = (getPix().y - getFontHeight()) / 2;
bltString(pos, string, color);
@@ -2782,11 +2714,9 @@
//---------------------------------------------------------------------------
void Surface::bltStringShadowedCenter(const char *string, PIX foreground, PIX
background) const
{
- assert(screenLocked);
-
iXY pos;
- pos.x = (getPix().x - (strlen(string) * CHAR_XPIX)) / 2;
- pos.y = (getPix().y - CHAR_YPIX) / 2;
+ pos.x = (getPix().x - (strlen(string) * ascii8x8.getPixX())) / 2;
+ pos.y = (getPix().y - getFontHeight()) / 2;
bltStringShadowed(pos, string, foreground, background);
@@ -2798,11 +2728,9 @@
//---------------------------------------------------------------------------
void Surface::bltStringCenteredAtPoint(const iXY &pos, const char *string,
const PIX &color) const
{
- assert(screenLocked);
-
iXY destPos;
- destPos.x = pos.x - (strlen(string) * CHAR_XPIX) / 2;
- destPos.y = pos.y - CHAR_YPIX / 2;
+ destPos.x = pos.x - (strlen(string) * ascii8x8.getPixX()) / 2;
+ destPos.y = pos.y - getFontHeight() / 2;
for (int i = 0; string[i] != 0; i++) {
bltChar8x8(destPos.x + (i << 3), destPos.y, string[i], color);
@@ -2815,13 +2743,11 @@
//---------------------------------------------------------------------------
void Surface::bltStringCenteredInRect(const iRect &rect, const char *string,
const PIX &color) const
{
- assert(screenLocked);
-
int length = strlen(string);
iXY destPos;
- destPos.x = rect.min.x + (rect.getSizeX() - (length * CHAR_XPIX)) / 2;
- destPos.y = rect.min.y + (rect.getSizeY() - CHAR_YPIX) / 2;
+ destPos.x = rect.min.x + (rect.getSizeX() - (length * ascii8x8.getPixX()))
/ 2;
+ destPos.y = rect.min.y + (rect.getSizeY() - getFontHeight()) / 2;
for (int i = 0; string[i] != 0; i++) {
bltChar8x8(destPos.x + (i << 3), destPos.y, string[i], color);
@@ -2833,8 +2759,6 @@
//---------------------------------------------------------------------------
void Surface::bltStringVGradient(const iXY &pos, const char *string,
ColorTable &colorTable) const
{
- assert(screenLocked);
-
for (int index = 0; string[index] != 0; index++) {
bltChar8x8VGradient(iXY(pos.x + (index << 3), pos.y), string[index],
colorTable);
}
@@ -2844,7 +2768,6 @@
void Surface::bltChar8x8VGradient(const iXY &pos, const char &character,
ColorTable &colorTable) const
{
- assert(screenLocked);
#ifdef _DEBUG
if (character > ascii8x8.getFrameCount()) {
assert(false);
@@ -2857,7 +2780,6 @@
//---------------------------------------------------------------------------
void Surface::bltTransVGradient(const Surface &dest, iXY min, ColorTable
&colorTable) const
{
- assert(screenLocked);
assert(getDoesExist());
assert(dest.getDoesExist());
assert(this != 0);
@@ -2949,24 +2871,6 @@
}
}
-// lock
-//---------------------------------------------------------------------------
-void Surface::lock(PIX *memBuf)
-{
- screenLocked = true;
- frame0 = mem = memBuf;
- doesExist = true;
-} // end Surface::lock
-
-// unlock
-//---------------------------------------------------------------------------
-void Surface::unlock()
-{
- screenLocked = true;
- frame0 = mem = 0;
- doesExist = false;
-} // end Surface::unlock
-
// create
//---------------------------------------------------------------------------
void Surface::create(iXY nPix ,int nStride, int nFrameCount)
@@ -3107,7 +3011,7 @@
// Remove any spaces.
while (string[length] == ' ') {
- pos.x += CHAR_XPIX;
+ pos.x += ascii8x8.getPixX();
length++;
}
@@ -3128,7 +3032,7 @@
strBuf[strBufLength] = '\0';
- if ((int) (pos.x + strlen(strBuf) * CHAR_XPIX) > rect.max.x) {
+ if ((int) (pos.x + strlen(strBuf) * ascii8x8.getPixX()) > rect.max.x) {
pos.x = rect.min.x;
pos.y += gapSpace;
}
@@ -3139,7 +3043,7 @@
return;
}
- pos.x += strlen(strBuf) * CHAR_XPIX;
+ pos.x += strlen(strBuf) * ascii8x8.getPixX();
length += strBufLength;
}
Index: netpanzer/src/Lib/2D/Surface.hpp
diff -u netpanzer/src/Lib/2D/Surface.hpp:1.13
netpanzer/src/Lib/2D/Surface.hpp:1.14
--- netpanzer/src/Lib/2D/Surface.hpp:1.13 Tue Sep 23 21:26:18 2003
+++ netpanzer/src/Lib/2D/Surface.hpp Fri Oct 3 10:44:59 2003
@@ -33,20 +33,6 @@
void initFont();
/////////////////////////////////////////////////////////////////////////////
-// Defines.
-/////////////////////////////////////////////////////////////////////////////
-
-#define CHAR_XPIX (ascii8x8.getPixX())
-#define CHAR_YPIX (ascii8x8.getPixY())
-
-#define SCREEN_XPIX (screen.getPixX())
-#define SCREEN_YPIX (screen.getPixY())
-#define SCREEN_PIX (screen.getPix())
-#define SCREEN_CENTER (screen.getCenter())
-#define SCREEN_XCENTER (screen.getCenterX())
-#define SCREEN_YCENTER (screen.getCenterY())
-
-/////////////////////////////////////////////////////////////////////////////
// structs
/////////////////////////////////////////////////////////////////////////////
@@ -126,12 +112,7 @@
int wipeCount; // Used for font wiping.
- static bool screenLocked;
-
public:
- void lock(PIX *memBuf);
- void unlock();
-
// Accessor functions.
inline float getFPS() const
{
@@ -382,12 +363,6 @@
void horizontalWave3DAll(int numWaves, float percent);
void horizontalWave3D(int numWaves, float percent, int offset);
- void shade(iRect bounds, const PIX color) const;
- inline void shade(PIX color) const
- {
- shade(iRect(0, 0, pix.x, pix.y), color);
- }
-
void blendIn(const Surface &source, iXY min, ColorTable &colorTable) const;
inline void blendIn(const Surface &source, ColorTable &colorTable) const
{
@@ -563,14 +538,6 @@
bltStringShadowed(iXY(x, y), string, textColor, shadowColor);
}
- // Blit a string of text and makes sure to lock and unlock the DDraw
buffer. This should
- // be used when you are wanting to display some text outside the make
renderloop.
- void bltStringSafe(const iXY &pos, const char *string, PIX color) const;
- inline void bltStringSafe(int x, int y, const char *string, PIX color)
const
- {
- bltStringSafe(iXY(x, y), string, color);
- }
-
// Blits a string of text and centers it horizontally and vertically on
the screen.
void bltStringCenter(const char *string, PIX color) const;
@@ -599,11 +566,8 @@
void drawLookupBorder(const PIX table[]) const;
-}
-; // end Surface
-
-extern Surface screen;
-extern Surface ascii8x8;
-extern Surface ascii5x5;
+ static int getFontHeight();
+ static int getTextLength(const char* text);
+}; // end Surface
#endif // __Surface_HPP__
Index: netpanzer/src/Lib/Particles/Particle2D.cpp
diff -u netpanzer/src/Lib/Particles/Particle2D.cpp:1.7
netpanzer/src/Lib/Particles/Particle2D.cpp:1.8
--- netpanzer/src/Lib/Particles/Particle2D.cpp:1.7 Tue Sep 16 16:16:09 2003
+++ netpanzer/src/Lib/Particles/Particle2D.cpp Fri Oct 3 10:44:59 2003
@@ -322,6 +322,10 @@
int speedUpDistance;
+ // XXX hacked around
+ int SCREEN_XPIX = 1024;
+ int SCREEN_YPIX = 768;
+
if ((SCREEN_XPIX == 640) && (SCREEN_YPIX == 480)) {
speedUpDistance = 480;
} else if ((SCREEN_XPIX == 800) && (SCREEN_YPIX == 600)) {
Index: netpanzer/src/Lib/Particles/ParticleSystem2D.cpp
diff -u netpanzer/src/Lib/Particles/ParticleSystem2D.cpp:1.5
netpanzer/src/Lib/Particles/ParticleSystem2D.cpp:1.6
--- netpanzer/src/Lib/Particles/ParticleSystem2D.cpp:1.5 Tue Sep 16
16:16:09 2003
+++ netpanzer/src/Lib/Particles/ParticleSystem2D.cpp Fri Oct 3 10:45:00 2003
@@ -15,8 +15,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#include <config.h>
+
#include <assert.h>
#include "ParticleSystem2D.hpp"
#include "TimerInterface.hpp"
Index: netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp
diff -u netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp:1.8
netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp:1.9
--- netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp:1.8 Mon Sep 22
18:43:39 2003
+++ netpanzer/src/Lib/Particles/SnowParticleSystem2D.cpp Fri Oct 3
10:45:00 2003
@@ -55,7 +55,7 @@
assert(snowParticles != 0);
for (unsigned num = 0; num < SNOW_PARTICLE_COUNT; num++) {
- snowParticles[num].init(fXYZ(rand() % SCREEN_XPIX, 0, rand() %
SCREEN_YPIX), 2 + rand() % 5);
+ snowParticles[num].init(fXYZ(rand() % 1024, 0, rand() % 768), 2 +
rand() % 5);
}
} // end SnowParticleSystem2D::init
@@ -85,5 +85,5 @@
{
//for (unsigned num = 0; num < NUM_SNOW_PARTICLES; num++)
// snowParticles[num].draw(dest);
-
} // end SnowParticleSystem2D::draw
+
Index: netpanzer/src/Lib/View/CheckBox.cpp
diff -u netpanzer/src/Lib/View/CheckBox.cpp:1.5
netpanzer/src/Lib/View/CheckBox.cpp:1.6
--- netpanzer/src/Lib/View/CheckBox.cpp:1.5 Tue Sep 16 16:16:10 2003
+++ netpanzer/src/Lib/View/CheckBox.cpp Fri Oct 3 10:45:00 2003
@@ -82,8 +82,8 @@
iXY pos;
//pos.x = min.x - strlen((const char *) label) * CHAR_XPIX - CHAR_XPIX;
- pos.x = min.x + size.x + CHAR_XPIX;
- pos.y = min.y + (size.y - CHAR_YPIX) / 2;
+ pos.x = min.x + size.x + 8;
+ pos.y = min.y + (size.y - Surface::getFontHeight()) / 2;
dest.bltString(pos, (const char *) label, Color::white);
Index: netpanzer/src/Lib/View/Choice.cpp
diff -u netpanzer/src/Lib/View/Choice.cpp:1.7
netpanzer/src/Lib/View/Choice.cpp:1.8
--- netpanzer/src/Lib/View/Choice.cpp:1.7 Thu Sep 18 13:44:17 2003
+++ netpanzer/src/Lib/View/Choice.cpp Fri Oct 3 10:45:00 2003
@@ -43,7 +43,7 @@
int borderSpace = borderSize * 2;
- size.x = std::max(int(strlen(item) * CHAR_XPIX + borderSpace), size.y);
+ size.x = std::max((Surface::getTextLength(item) + borderSpace), size.y);
size.y = ChoiceItemHeight;
}
@@ -186,7 +186,7 @@
//pos.x = min.x - strlen((const char *) label) * CHAR_XPIX - CHAR_XPIX;
pos.x = min.x;
- pos.y = min.y - CHAR_YPIX - 4;
+ pos.y = min.y - Surface::getFontHeight() - 4;
// Draw the name of the choice.
dest.bltStringShadowed(min.x, pos.y + adjustedY, (const char *) name,
Color::white, Color::black);
@@ -237,9 +237,8 @@
choiceList[choiceList.getCount() - 1] = item;
int borderSpace = borderSize * 2;
- int length = strlen((const char *) item);
- size.x = std::max(int(length * CHAR_XPIX + borderSpace), size.y);
+ size.x = std::max(Surface::getTextLength(item) + borderSpace, size.y);
size.x = std::max(minWidth, size.x);
} // end Choice::add
Index: netpanzer/src/Lib/View/Desktop.cpp
diff -u netpanzer/src/Lib/View/Desktop.cpp:1.12
netpanzer/src/Lib/View/Desktop.cpp:1.13
--- netpanzer/src/Lib/View/Desktop.cpp:1.12 Sat Sep 20 13:52:46 2003
+++ netpanzer/src/Lib/View/Desktop.cpp Fri Oct 3 10:45:01 2003
@@ -20,7 +20,6 @@
#include <algorithm>
#include "Desktop.hpp"
#include "KeyboardInterface.hpp"
-#include "loadPics.hpp"
#include "TimerInterface.hpp"
#include "MouseInterface.hpp"
@@ -293,11 +292,11 @@
//--------------------------------------------------------------------------
// Purpose:
//--------------------------------------------------------------------------
-void Desktop::draw()
+void Desktop::draw(Surface& surface)
{
std::vector<View*>::reverse_iterator i;
for(i = views.rbegin(); i != views.rend(); i++) {
- (*i)->draw();
+ (*i)->draw(surface);
}
} // end draw
@@ -381,14 +380,15 @@
// checkViewPositions
//--------------------------------------------------------------------------
-// Purpose: Makes sure all the view are on the screen.
+// Purpose: Makes sure all the views are on the screen.
//--------------------------------------------------------------------------
-void Desktop::checkViewPositions()
+void Desktop::checkViewPositions(iXY viewarea)
{
std::vector<View*>::iterator i;
for(i = views.begin(); i != views.end(); i++) {
View* view = *i;
- view->moveTo(view->min);
+
+ view->checkArea(viewarea);
}
} // end Desktop::checkViewPositions
@@ -396,12 +396,12 @@
//--------------------------------------------------------------------------
// Purpose: Makes sure all the view are on the position.
//--------------------------------------------------------------------------
-void Desktop::checkResolution(iXY lastResolution)
+void Desktop::checkResolution(iXY oldResolution, iXY newResolution)
{
std::vector<View*>::iterator i;
for(i = views.begin(); i != views.end(); i++) {
View* view = *i;
- view->checkResolution(lastResolution);
+ view->checkResolution(oldResolution, newResolution);
}
} // end Desktop::checkResolution
@@ -629,7 +629,7 @@
clientArea.bltString(200, yOffset, strBuf, Color::white);
- yOffset += CHAR_YPIX;
+ yOffset += Surface::getFontHeight();
}
View::doDraw(viewArea, clientArea);
Index: netpanzer/src/Lib/View/Desktop.hpp
diff -u netpanzer/src/Lib/View/Desktop.hpp:1.6
netpanzer/src/Lib/View/Desktop.hpp:1.7
--- netpanzer/src/Lib/View/Desktop.hpp:1.6 Sat Sep 20 13:52:46 2003
+++ netpanzer/src/Lib/View/Desktop.hpp Fri Oct 3 10:45:01 2003
@@ -22,10 +22,11 @@
#include <vector>
#include "LibTypes.hpp"
-#include "Surface.hpp"
#include "View.hpp"
#include "cTimeStamp.hpp"
+class Surface;
+
class Desktop
{
private: // Variables
@@ -83,7 +84,7 @@
static void toggleVisibilityNoDoAnything(const char *viewName);
static void setVisibilityNoDoAnything(const char *viewName, int isVisible);
static void add(View *view, bool autoActivate = true);
- static void draw();
+ static void draw(Surface& surface);
static iXY getMouseActionOffset ()
{
@@ -153,8 +154,8 @@
return 0;
}
- static void checkViewPositions();
- static void checkResolution(iXY lastResolution);
+ static void checkViewPositions(iXY viewarea);
+ static void checkResolution(iXY oldResolution, iXY newResolution);
static const View *getFocus()
{
Index: netpanzer/src/Lib/View/ScrollBar.cpp
diff -u netpanzer/src/Lib/View/ScrollBar.cpp:1.5
netpanzer/src/Lib/View/ScrollBar.cpp:1.6
--- netpanzer/src/Lib/View/ScrollBar.cpp:1.5 Mon Sep 22 09:53:49 2003
+++ netpanzer/src/Lib/View/ScrollBar.cpp Fri Oct 3 10:45:01 2003
@@ -15,12 +15,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
-
#include <config.h>
-#include "ScrollBar.hpp"
+#include "ScrollBar.hpp"
// ScrollBar
//---------------------------------------------------------------------------
@@ -150,7 +147,7 @@
surface.setTo(dest, r);
//surface.fill(Color::gray128);
- surface.shade(Color::white);
+ //surface.shade(Color::white);
//surface.drawButtonBorder(Color::gray192, Color::gray64);
if (orientation == VERTICAL) {
@@ -233,7 +230,7 @@
} else {
//surface.fill(background);
- surface.shade(Color::red);
+ //surface.shade(Color::red);
}
} // end ScrollBar::draw
Index: netpanzer/src/Lib/View/View.cpp
diff -u netpanzer/src/Lib/View/View.cpp:1.16
netpanzer/src/Lib/View/View.cpp:1.17
--- netpanzer/src/Lib/View/View.cpp:1.16 Tue Sep 23 19:43:18 2003
+++ netpanzer/src/Lib/View/View.cpp Fri Oct 3 10:45:02 2003
@@ -22,7 +22,6 @@
#include "MouseInterface.hpp"
#include "KeyboardInterface.hpp"
#include "fXY.hpp"
-#include "loadPics.hpp"
#include "ViewGlobals.hpp"
#include "Exception.hpp"
#include "InputEvent.hpp"
@@ -72,6 +71,7 @@
// View
//---------------------------------------------------------------------------
View::View()
+ : currentscreen(0)
{
reset();
loadPics();
@@ -151,8 +151,6 @@
setAlwaysOnBottom(false);
//setScrollBar(false);
- setAllowAutoResize(false);
-
} // end reset
// drawBorder
@@ -394,14 +392,15 @@
// draw
//---------------------------------------------------------------------------
-void View::draw()
+void View::draw(Surface& surface)
{
assert(this != 0);
if (!getVisible())
return;
- doDraw(getViewArea(), getClientArea());
+ currentscreen = &surface; // hack
+ doDraw(getViewArea(surface), getClientArea(surface));
} // end draw
// activate
@@ -476,8 +475,6 @@
drawTitle(viewArea);
drawBorder(viewArea);
}
-
- //drawToolTip(clientArea);
} // end View::doDraw
// doActivate
@@ -622,70 +619,14 @@
// getViewArea
//---------------------------------------------------------------------------
-// Purpose: Sets the specified surface to the dimensions of the view.
-//---------------------------------------------------------------------------
-void View::getViewArea(Surface &dest)
-{
- assert(this != 0);
-
- iRect rect(min, max);
-
- //iRect rect;
- //checkSnapToEdges(min, max, rect.min, rect.max);
- //dest.setTo(screen, rect);
-
- dest.setTo(screen, rect);
-
-} // end getViewArea
-
-// checkSnapToEdges
-//---------------------------------------------------------------------------
-// Purpose: Checks to see if the edges of the window is close enough to the
-// set snap-to tolerance and if so, new values are returned for
-// the view position.
-//---------------------------------------------------------------------------
-void View::checkSnapToEdges(const iXY &min, const iXY &max, iXY &newMin, iXY
&newMax)
-{
- const int SNAP_TOLERANCE = 20;
-
- newMin = min;
- newMax = max;
-
- iXY size(newMax - newMin);
-
- // Snap To Screen edges!
- if (min.x < SNAP_TOLERANCE) {
- newMin.x = 0;
- newMax.x = size.x;
- } else if (max.x > SCREEN_XPIX - SNAP_TOLERANCE) {
- newMin.x = SCREEN_XPIX - 1 - size.x;
- newMax.x = SCREEN_XPIX - 1;
- }
-
- if (min.y < SNAP_TOLERANCE) {
- newMin.y = 0;
- newMax.y = size.y;
- } else if (max.y > SCREEN_YPIX - SNAP_TOLERANCE) {
- newMin.y = SCREEN_YPIX - 1 - size.y;
- newMax.y = SCREEN_YPIX - 1;
- }
-
-} // end View::checkSnapToEdges
-
-// getViewArea
-//---------------------------------------------------------------------------
// Purpose: Returns a Surface of the view's dimensions.
//---------------------------------------------------------------------------
-Surface View::getViewArea()
+Surface View::getViewArea(Surface& dest)
{
assert(this != 0);
iRect rect(min, max);
- //iRect rect;
- //checkSnapToEdges(min, max, rect.min, rect.max);
-
- return Surface(screen, rect.min, rect.max, false);
-
+ return Surface(dest, rect.min, rect.max, false);
} // end View::getViewArea
// getViewRect
@@ -698,6 +639,7 @@
} // end getViewRect
+#if 0
// getClientArea
//---------------------------------------------------------------------------
// Purpose: Sets the destination surface to the specified coodinates within
@@ -717,17 +659,17 @@
} else {
getViewArea(dest);
}
-
} // end View::getClientArea
+#endif
// getClientArea
//---------------------------------------------------------------------------
// Purpose:
//---------------------------------------------------------------------------
-Surface View::getClientArea()
+Surface View::getClientArea(Surface& dest)
{
if (getBordered()) {
- return Surface( getViewArea(),
+ return Surface( getViewArea(dest),
iXY(borderSize,
borderSize + moveAreaHeight),
iXY(getSizeX() - borderSize,
@@ -735,8 +677,7 @@
false);
}
- return getViewArea();
-
+ return getViewArea(dest);
} // end View::getClientArea
// getClientRect
@@ -756,17 +697,6 @@
} // end View::getClientRect
-// getMouseCursor
-//---------------------------------------------------------------------------
-// Purpose: Tells you the current state of the mouse cursor.
-//---------------------------------------------------------------------------
-Surface *View::getMouseCursor(const iXY & /* pos */)
-{
- // Draw the mouse pointer last
- return &mouseArrow;
-
-} // end View::getMouseCursor
-
// mouseMove
//---------------------------------------------------------------------------
// Purpse: Changes the current highlighted button and checks for mouseEnter
@@ -1370,7 +1300,7 @@
// Draw the status text.
if (statusText != 0) {
- int pos = (DEFAULT_STATUS_BAR_HEIGHT - CHAR_YPIX) >> 1;
+ int pos = (DEFAULT_STATUS_BAR_HEIGHT - Surface::getFontHeight()) >> 1;
s.bltString(pos, pos, statusText, Color::black);
}
@@ -1430,95 +1360,32 @@
buttons[pressedButton].topSurface.setFrame(0);
} // drawPressedButton
-// DRAW TOOL TIP
-//---------------------------------------------------------------------------
-// Purpose: Draws the tooltip of the button the mouse is currently over.
-//---------------------------------------------------------------------------
-void View::drawToolTip(const Surface &dest)
-{
- assert(this != 0);
-
- iRect rect;
- rect.min.x = 0;
- rect.min.y = getClientRect().max.y - moveAreaHeight + 2;
- rect.max.x = getClientRect().getSizeX()+1;
- rect.max.y = getClientRect().max.y+1;
- int xOffset = 5;
-
- if (highlightedButton < 0) {
- if (statusText != 0) {
- iRect tRect(rect.min.x, rect.min.y, rect.max.x, rect.max.y);
- dest.fillRect(tRect, Color::black);
- dest.drawButtonBorder(tRect, Color::gray32, Color::gray64);
- dest.bltString(rect.min.x+xOffset+1, rect.min.y+2, statusText,
Color::black);
- dest.bltString(rect.min.x+xOffset, rect.min.y+1, statusText,
Color::white);
- }
- return;
- } else {
- if (strlen(buttons[highlightedButton].getToolTip()) == 0) {
- return;
- }
-
- int length = strlen(buttons[highlightedButton].getToolTip()) *
CHAR_XPIX;
-
- // min is this window's min derived from iRect.
- iRect r(buttons[highlightedButton].getBounds());
- iRect r2(r.min.x + min.x, r.max.y + min.y, r.min.x + length + 4 +
min.x, r.max.y + CHAR_YPIX + 4 + min.y);
-
- // Keep the tooltip on the screen as best as possible.
- if (r2.max.x > SCREEN_XPIX) {
- int xOffset = r2.max.x - SCREEN_XPIX;
- r2.min.x -= xOffset;
- r2.max.x -= xOffset;
- }
-
- dest.fillRect(r2, Color::black);
- dest.drawButtonBorder(r2, Color::white, Color::gray64);
- dest.bltString(r2.min.x + 2, r2.min.y + 2,
buttons[highlightedButton].getToolTip(), Color::white);
- //dest.bltString(rect.min.x+xOffset, rect.min.y+1,
buttons[highlightedButton].getToolTip(), Color::white);
- }
-} // end drawToolTip
-
-// drawToolTip
-//---------------------------------------------------------------------------
-// Purpose: Draws the tooltip of the button the mouse is currently over.
-//---------------------------------------------------------------------------
-void View::drawToolTip(const Surface &dest, const char *toolTip)
-{
- if (strlen(toolTip) == 0) {
- return;
- }
-
- dest.bltString(4, 1, toolTip, 0);
- dest.bltString(3, 0, toolTip, Color::white);
-} // end drawToolTip
-
-// centerAbsolute
-//---------------------------------------------------------------------------
-// Purpose: Centers the window horizontally and vertically on the screen.
-//---------------------------------------------------------------------------
-void View::centerAbsolute()
-{
- iXY oldSize = getSize();
-
- min.x = (SCREEN_XPIX - oldSize.x) >> 1;
- min.y = (SCREEN_YPIX - oldSize.y) >> 1;
- max.x = min.x + oldSize.x;
- max.y = min.y + oldSize.y;
-} // end centerAbsolute
-
// checkResolution
//---------------------------------------------------------------------------
// Purpose: Check position after resolution change
//---------------------------------------------------------------------------
-void View::checkResolution(iXY lastResolution)
+void View::checkResolution(iXY oldResolution, iXY newResolution)
{
- iXY oldSize = getSize();
- min.x += (SCREEN_XPIX - lastResolution.x) >> 1;
- min.y += (SCREEN_YPIX - lastResolution.y) >> 1;
- max = min + oldSize;
+ iXY size = getSize();
+
+ min.x += (newResolution.x - oldResolution.x)/2;
+ min.y += (newResolution.y - oldResolution.y)/2;
+ max = min + size;
} // end checkResolution
+void View::checkArea(iXY viewarea)
+{
+ if(min.x < 0)
+ moveTo(0, min.y);
+ if(min.y < 0)
+ moveTo(min.x, 0);
+
+ if(max.x > viewarea.x)
+ moveTo(viewarea.x - getSize().x, min.y);
+ if(max.y > viewarea.y)
+ moveTo(min.x, viewarea.y - getSize().y);
+}
+
// RESIZE CLIENT AREA
//---------------------------------------------------------------------------
// Purpose: Resize the client area of the window. The window area will be
@@ -1537,22 +1404,6 @@
destSize.x += xExtra;
destSize.y += yExtra;
- // Make sure the window will fit on the screen in the specified size.
- if (destSize.x > SCREEN_XPIX) {
- throw Exception("ERROR: Trying to size the client area larger than the
screen width.");
- }
- if (destSize.y > SCREEN_YPIX) {
- throw Exception("ERROR: Trying to size the client area larger than the
screen height.");
- }
-
- // Move the window accordingly to accomodate for the resize.
- if (min.x + destSize.x > SCREEN_XPIX) {
- min.x += (SCREEN_XPIX - min.x + destSize.x);
- }
- if (min.y + destSize.y > SCREEN_YPIX) {
- min.y += (SCREEN_YPIX - min.y + destSize.y);
- }
-
resize(destSize);
} // end View::resizeClientArea
@@ -1564,21 +1415,7 @@
{
iXY destSize(size);
- if (destSize.x <= RESIZE_XMINSIZE) {
- destSize.x = RESIZE_XMINSIZE;
- }
- else if (destSize.x > SCREEN_XPIX - min.x) {
- destSize.x = SCREEN_XPIX - min.x;
- }
-
- if (destSize.y <= RESIZE_YMINSIZE) {
- destSize.y = RESIZE_YMINSIZE;
- } else if (destSize.y > SCREEN_YPIX - min.y) {
- destSize.y = SCREEN_YPIX - min.y;
- }
-
max = min + destSize;
-
} // end View::resize
// setPressedButton
@@ -1591,7 +1428,6 @@
prevPressedButton = pressedButton;
pressedButton = button;
-
} // end setPressedButton
// setHighlightedButton
@@ -1604,29 +1440,8 @@
prevHighlightedButton = highlightedButton;
highlightedButton = button;
-
} // end setHighlightedButton
-// checkViewSize
-//---------------------------------------------------------------------------
-// Purpose: If the window's dimension is too big or too small, then resize
-// the window accordingly.
-//---------------------------------------------------------------------------
-void View::checkViewSize(iXY &pix)
-{
- if (pix.x > SCREEN_XPIX) {
- pix.x = SCREEN_XPIX;
- } else if (pix.x <= RESIZE_XMINSIZE) {
- pix.x = RESIZE_XMINSIZE;
- }
- if (pix.y > SCREEN_YPIX) {
- pix.y = SCREEN_YPIX;
- } else if (pix.y <= RESIZE_YMINSIZE) {
- pix.y = RESIZE_YMINSIZE;
- }
-
-} // end View::checkViewSize
-
// moveTo
//---------------------------------------------------------------------------
// Purpose: Move the window to the specified position, while making sure the
@@ -1634,66 +1449,9 @@
//---------------------------------------------------------------------------
void View::moveTo(iXY destMin)
{
- if (getAllowAutoResize()) {
- if (getSizeX() > SCREEN_XPIX) {
- fXY difference;
-
- difference.x = getSizeX() - SCREEN_XPIX;
-
- float xRatio = float(difference.x) / float(getSizeX());
-
- resize(int(getSizeX() - difference.x),
- int(float(getSizeY()) * xRatio));
-
- } else if (getSizeY() > SCREEN_YPIX) {
- fXY difference;
-
- difference.y = getSizeY() - SCREEN_YPIX;
-
- float yRatio = float(difference.y) / float(getSizeY());
-
- resize(int(float(getSizeY()) * yRatio),
- int(getSizeY() - difference.y));
- }
- }
-
- // Used until I rewrite this to keep the view in the size of the screen.
- int flagFuckMax = 1;
-
- // Keep the windows within the bounds of the screen
- if (destMin.x > SCREEN_XPIX - getSizeX()) {
- destMin.x = SCREEN_XPIX - getSizeX();
- }
- if (destMin.x < 0) {
- destMin.x = 0;
- if (destMin.x + getSizeX() - 1 >= SCREEN_XPIX) {
- flagFuckMax = 0;
- max.x = SCREEN_XPIX - 1;
- //throw Exception("ERROR: The window is too large for the
screen.");
- }
-
- }
-
- if (destMin.y > SCREEN_YPIX - getSizeY()) {
- destMin.y = SCREEN_YPIX - getSizeY();
- }
- if (destMin.y < 0) {
- destMin.y = 0;
- if (destMin.y + getSizeY() - 1 >= SCREEN_YPIX) {
- flagFuckMax = 0;
- max.y = SCREEN_YPIX - 1;
-
- //throw Exception("ERROR: The window is too large for the
screen.");
- }
-
- }
-
- if (flagFuckMax) {
- max += destMin - min;
- }
-
- min = destMin;
-
+ iXY size = getSize();
+ min = destMin;
+ max = min + size;
} // end moveTo
// toggleView
@@ -1714,16 +1472,6 @@
if (newStatus == true) status |= STATUS_ALLOW_RESIZE;
else status &= ~STATUS_ALLOW_RESIZE;
} // end setAllowResize
-
-// setAllowAutoResize
-//---------------------------------------------------------------------------
-// Purpose: Allows this view to be resized or not.
-//---------------------------------------------------------------------------
-void View::setAllowAutoResize(const bool &newStatus)
-{
- if (newStatus == true) status |= STATUS_ALLOW_AUTO_RESIZE;
- else status &= ~STATUS_ALLOW_AUTO_RESIZE;
-} // end setAllowAutoResize
// setDisplayStatusBar
//---------------------------------------------------------------------------
Index: netpanzer/src/Lib/View/View.hpp
diff -u netpanzer/src/Lib/View/View.hpp:1.7 netpanzer/src/Lib/View/View.hpp:1.8
--- netpanzer/src/Lib/View/View.hpp:1.7 Tue Sep 23 19:43:18 2003
+++ netpanzer/src/Lib/View/View.hpp Fri Oct 3 10:45:02 2003
@@ -104,10 +104,9 @@
protected:
virtual void actionPerformed(mMouseEvent me)
{}
- void getViewArea(Surface &dest);
- Surface getViewArea();
- virtual void getClientArea(Surface &dest);
- virtual Surface getClientArea();
+ Surface getViewArea(Surface& dest);
+ //virtual void getClientArea(Surface& dest);
+ virtual Surface getClientArea(Surface& dest);
int pressedButton;
int prevPressedButton;
@@ -150,7 +149,6 @@
enum { STATUS_BORDERED = (1U << 5) };
enum { STATUS_DISPLAY_STATUS_BAR = (1U << 6) };
enum { STATUS_SCROLL_BAR = (1U << 7) };
- enum { STATUS_ALLOW_AUTO_RESIZE = (1U << 8) };
// Mouse actions
enum { MA_RESIZE_TOP = (1U << 0) };
@@ -184,7 +182,6 @@
void setAllowMove (const bool &newStatus);
void setActive (const bool &newStatus);
//void setScrollBar (const bool &newStatus);
- void setAllowAutoResize (const bool &newStatus);
// Scroll bar functions.
@@ -221,28 +218,23 @@
void setSubTitle(const char *subTitle);
void drawTitle(const Surface &windowArea);
- // ToolTip Functions.
- void drawToolTip (const Surface &dest);
- void drawToolTip (const Surface &dest, const char *toolTip);
-
// Input Field Functions
void addInputField(const iXY &pos, cInputFieldString *string, const char
*excludedCharacters, const bool &isSelected);
int findInputFieldContaining(const iXY &pos);
void drawInputFields(const Surface &clientArea);
/////////////////////////////////
- void draw();
+ void draw(Surface& drawon);
void showStatus(const char *string);
void drawStatus(const Surface &dest);
- void centerAbsolute();
- void checkResolution(iXY lastResolution);
+ void checkResolution(iXY oldResolution, iXY newResolution);
+ void checkArea(iXY viewarea);
void toggleView();
iXY getScreenToClientPos(const iXY &pos);
iXY getScreenToViewPos(const iXY &pos);
/////////////////////////////////
// These options can be modified on a per View type basis
- virtual Surface *getMouseCursor(const iXY &p);
virtual void drawButtons(const Surface &windowArea);
virtual void drawBorder(const Surface &windowArea);
virtual void doDraw(const Surface &windowArea, const Surface &clientArea);
@@ -264,10 +256,6 @@
//virtual void keyUp();
void scrollBarMove(const iXY &prevpos, const iXY &newpos);
- //void drawToolTip();
-
- void checkViewSize(iXY &pix);
-
void resize(const iXY &size);
inline void resize(const int &x, const int &y)
{
@@ -282,12 +270,12 @@
virtual void processEvents();
- void checkSnapToEdges(const iXY &min, const iXY &max, iXY &newMin, iXY
&newMax);
-
int moveAreaHeight;
int borderSize;
int snapToTolerance;
+ Surface* currentscreen; // HACK
+
public:
// Hack city, should be protected???????
void setAlwaysOnBottom(const bool &newStatus);
@@ -367,10 +355,6 @@
inline int getScrollBar() const
{
return status & STATUS_SCROLL_BAR;
- }
- inline int getAllowAutoResize() const
- {
- return status & STATUS_ALLOW_AUTO_RESIZE;
}
virtual int getMouseActions(const iXY &p) const;
Index: netpanzer/src/Lib/View/cButton.cpp
diff -u netpanzer/src/Lib/View/cButton.cpp:1.8
netpanzer/src/Lib/View/cButton.cpp:1.9
--- netpanzer/src/Lib/View/cButton.cpp:1.8 Tue Sep 23 21:26:19 2003
+++ netpanzer/src/Lib/View/cButton.cpp Fri Oct 3 10:45:02 2003
@@ -57,12 +57,12 @@
const unsigned GAP_SPACE = 6;
- int ySize = CHAR_YPIX+GAP_SPACE;
+ int ySize = Surface::getFontHeight() + GAP_SPACE;
tempTopSurface.create(iXY(xSize, ySize), xSize, 3);
// Find out the horizontal offset to put the button name on the button.
int xOffset;
- if (nName != 0) xOffset = (xSize-(strlen(nName)*CHAR_XPIX))/2;
+ if (nName != 0) xOffset = (xSize-(Surface::getTextLength(nName)))/2;
else xOffset = xSize/2;
// Make the unselected button
Index: netpanzer/src/Lib/View/cInputField.cpp
diff -u netpanzer/src/Lib/View/cInputField.cpp:1.10
netpanzer/src/Lib/View/cInputField.cpp:1.11
--- netpanzer/src/Lib/View/cInputField.cpp:1.10 Mon Sep 22 09:53:49 2003
+++ netpanzer/src/Lib/View/cInputField.cpp Fri Oct 3 10:45:03 2003
@@ -95,8 +95,9 @@
this->maxCharCount = string->maxCharCount;
iXY size;
- size.x = maxCharCount * CHAR_XPIX + 8;
- size.y = CHAR_YPIX + 4;
+ // XXX (8 is hardcoded here...)
+ size.x = maxCharCount * 8 + 8;
+ size.y = Surface::getFontHeight() + 4;
bounds.max = bounds.min + size;
@@ -244,9 +245,11 @@
}
} else {
if (cursorPos >= maxCharCount) {
- inputFieldSurface.bltString(((cursorPos - 1) * CHAR_XPIX) + 4, 2,
"_", Color::red);
+ // XXX hardcoded CHAR_PIXX (8)
+ inputFieldSurface.bltString(((cursorPos - 1) * 8) + 4, 2, "_",
Color::red);
} else {
- inputFieldSurface.bltString(cursorPos * CHAR_XPIX + 4, 2, "_",
Color::red);
+ // XXX hardcoded CHAR_PIXX(8)
+ inputFieldSurface.bltString(cursorPos * 8 + 4, 2, "_", Color::red);
}
}
Index: netpanzer/src/Lib/cMouse.cpp
diff -u netpanzer/src/Lib/cMouse.cpp:1.4 netpanzer/src/Lib/cMouse.cpp:1.5
--- netpanzer/src/Lib/cMouse.cpp:1.4 Tue Sep 16 16:16:09 2003
+++ netpanzer/src/Lib/cMouse.cpp Fri Oct 3 10:44:57 2003
@@ -59,5 +59,5 @@
assert(pointer != 0);
cMouse::pointer = pointer;
-
} // end setPointer
+
Index: netpanzer/src/Lib/cMouse.hpp
diff -u netpanzer/src/Lib/cMouse.hpp:1.6 netpanzer/src/Lib/cMouse.hpp:1.7
--- netpanzer/src/Lib/cMouse.hpp:1.6 Tue Sep 16 16:16:09 2003
+++ netpanzer/src/Lib/cMouse.hpp Fri Oct 3 10:44:57 2003
@@ -65,7 +65,6 @@
return getScreenPos().y;
}
-
static inline void setButtonMask( unsigned char mask )
{
button_mask = button_mask | mask;
Index: netpanzer/src/NetPanzer/Classes/TileEngine.cpp
diff -u netpanzer/src/NetPanzer/Classes/TileEngine.cpp:1.9
netpanzer/src/NetPanzer/Classes/TileEngine.cpp:1.10
--- netpanzer/src/NetPanzer/Classes/TileEngine.cpp:1.9 Tue Sep 23 10:23:02 2003
+++ netpanzer/src/NetPanzer/Classes/TileEngine.cpp Fri Oct 3 10:45:03 2003
@@ -19,7 +19,7 @@
#include "TileEngine.hpp"
#include "blitters.hpp"
-#include "DDHardSurface.hpp"
+#include "ScreenSurface.hpp"
#include "UILib/UIDraw.hpp"
void TileEngine::blitWorld()
@@ -53,7 +53,7 @@
tile_size = tile_set.getTileXsize();
- main_camera->getViewStart(Screen->getWidth(), Screen->getHeight(),
+ main_camera->getViewStart(screen->getPixX(), screen->getPixY(),
&world_x, &world_y);
pointXYtoMapXY( world_x, world_y, &map_x, &map_y );
@@ -63,7 +63,7 @@
main_map.getRawMapBuffer( &map_buffer );
- double_buffer = (unsigned char*) FRAME_BUFFER.mem;
+ double_buffer = screen->mem;
/*
x_offset = (world_x % tile_size );
@@ -76,27 +76,27 @@
x_left_offset = (world_x % tile_size);
x_left_length = (tile_size - x_left_offset);
- complete_columns = (Screen->getWidth() - x_left_length) / tile_size;
+ complete_columns = (screen->getPixX() - x_left_length) / tile_size;
x_right_offset = 0;
- x_right_length = (Screen->getWidth() - x_left_length) % tile_size;
+ x_right_length = (screen->getPixX() - x_left_length) % tile_size;
if ( x_right_length > 0 )
x_right_end_flag = true;
y_top_offset = (world_y % tile_size);
y_top_length = (tile_size - y_top_offset);
- complete_rows = (Screen->getHeight() - y_top_length) / tile_size;
+ complete_rows = (screen->getPixY() - y_top_length) / tile_size;
y_bottom_offset = 0;
- y_bottom_length = (Screen->getHeight() - y_top_length) % tile_size;
+ y_bottom_length = (screen->getPixY() - y_top_length) % tile_size;
if ( y_bottom_length > 0 )
y_bottom_end_flag = true;
world_row = map_buffer + (map_y * map_width) + map_x;
// XXX
- next_tile_row_offset = Screen->getWidth() * (tile_size - 1);
+ next_tile_row_offset = screen->getPixX() * (tile_size - 1);
next_map_row_offset = map_width - complete_columns - 1;
@@ -139,11 +139,11 @@
blit_partial_xy(tile_offset, buffer_offset, y_top_length,
x_right_length);
}
- buffer_offset += ( Screen->getWidth() * (y_top_length-1)) +
x_right_length;
+ buffer_offset += (screen->getPixX() * (y_top_length-1)) +
x_right_length;
world_row = world_row + next_map_row_offset;
} else {
- buffer_offset += (Screen->getWidth() * (y_top_length-1));
+ buffer_offset += (screen->getPixX() * (y_top_length-1));
world_row = world_row + next_map_row_offset;
}
@@ -225,11 +225,11 @@
blit_partial_xy( tile_offset, buffer_offset, y_bottom_length,
x_right_length );
}
- buffer_offset += (Screen->getWidth() * (y_bottom_length-1)) +
x_right_length;
+ buffer_offset += (screen->getPixX() * (y_bottom_length-1)) +
x_right_length;
world_row = world_row + next_map_row_offset;
} else {
- buffer_offset += (Screen->getWidth() * (y_bottom_length-1));
+ buffer_offset += (screen->getPixX() * (y_bottom_length-1));
world_row = world_row + next_map_row_offset;
}
Index: netpanzer/src/NetPanzer/Classes/Units/Humvee.cpp
diff -u netpanzer/src/NetPanzer/Classes/Units/Humvee.cpp:1.6
netpanzer/src/NetPanzer/Classes/Units/Humvee.cpp:1.7
--- netpanzer/src/NetPanzer/Classes/Units/Humvee.cpp:1.6 Tue Sep 16
16:16:11 2003
+++ netpanzer/src/NetPanzer/Classes/Units/Humvee.cpp Fri Oct 3 10:45:04 2003
@@ -26,9 +26,6 @@
#include "UnitGlobals.hpp"
-// NOTE: Temp unit new sprites put in
-#include "DDHardSurface.hpp"
-
void Humvee::setUnitProperties( void )
{
UnitProfile *profile;
Index: netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp
diff -u netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp:1.9
netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp:1.10
--- netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp:1.9 Mon Sep 22
09:53:51 2003
+++ netpanzer/src/NetPanzer/Classes/Units/Vehicle.cpp Fri Oct 3 10:45:05 2003
@@ -27,7 +27,6 @@
#include "Sound.hpp"
// NOTE: Temp unit new sprites put in
-#include "DDHardSurface.hpp"
#include "GameConfig.hpp"
#include "codewiz.hpp"
Index: netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp:1.9
netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp:1.10
--- netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp:1.9 Mon Sep
22 09:53:51 2003
+++ netpanzer/src/NetPanzer/Classes/Weapons/BulletWeapon.cpp Fri Oct 3
10:45:05 2003
@@ -22,7 +22,6 @@
#include "UnitInterface.hpp"
#include "NetworkState.hpp"
#include "WorldViewInterface.hpp"
-#include "DDHardSurface.hpp"
#include "Sound.hpp"
#include "ParticleInterface.hpp"
#include "WeaponGlobals.hpp"
Index: netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp:1.9
netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp:1.10
--- netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp:1.9 Mon Sep
22 09:53:51 2003
+++ netpanzer/src/NetPanzer/Classes/Weapons/MissleWeapon.cpp Fri Oct 3
10:45:05 2003
@@ -22,7 +22,6 @@
#include "UnitInterface.hpp"
#include "NetworkState.hpp"
#include "WorldViewInterface.hpp"
-#include "DDHardSurface.hpp"
#include "Sound.hpp"
#include "ParticleInterface.hpp"
#include "WeaponGlobals.hpp"
Index: netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp:1.9
netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp:1.10
--- netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp:1.9 Mon Sep 22
09:53:51 2003
+++ netpanzer/src/NetPanzer/Classes/Weapons/ShellWeapon.cpp Fri Oct 3
10:45:06 2003
@@ -22,7 +22,6 @@
#include "UnitInterface.hpp"
#include "NetworkState.hpp"
#include "WorldViewInterface.hpp"
-#include "DDHardSurface.hpp"
#include "Sound.hpp"
#include "Particle2D.hpp"
#include "WeaponGlobals.hpp"
Index: netpanzer/src/NetPanzer/Classes/Weapons/Weapon.cpp
diff -u netpanzer/src/NetPanzer/Classes/Weapons/Weapon.cpp:1.12
netpanzer/src/NetPanzer/Classes/Weapons/Weapon.cpp:1.13
--- netpanzer/src/NetPanzer/Classes/Weapons/Weapon.cpp:1.12 Tue Sep 23
21:26:19 2003
+++ netpanzer/src/NetPanzer/Classes/Weapons/Weapon.cpp Fri Oct 3 10:45:06 2003
@@ -25,7 +25,7 @@
// NOTE: Temp until new sprites put in
#include "WorldViewInterface.hpp"
-#include "DDHardSurface.hpp"
+#include "ScreenSurface.hpp"
#include "Exception.hpp"
#include "Sound.hpp"
@@ -214,9 +214,7 @@
WorldViewInterface::getViewWindow(&world_win );
if ( shell.isVisible( world_win ) == true ) {
- //FRAME_BUFFER.lock();
- shell.blit( &FRAME_BUFFER, world_win );
- //FRAME_BUFFER.unlock();
+ shell.blit(screen, world_win );
}
}
Index: netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp
diff -u netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp:1.18
netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp:1.19
--- netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp:1.18 Mon Sep
22 18:21:46 2003
+++ netpanzer/src/NetPanzer/Classes/WorldInputCmdProcessor.cpp Fri Oct 3
10:45:04 2003
@@ -28,7 +28,6 @@
#include "PlayerInterface.hpp"
#include "ChatInterface.hpp"
-#include "DDHardSurface.hpp"
#include "UnitMessageTypes.hpp"
#include "TerminalNetMesg.hpp"
#include "PlayerNetMessage.hpp"
@@ -36,6 +35,7 @@
#include "NetMessageEncoder.hpp"
#include "PlacementMatrix.hpp"
#include "Sound.hpp"
+#include "ScreenSurface.hpp"
#include "GameConfig.hpp"
@@ -124,7 +124,7 @@
long scroll_increment;
float scroll_rate;
- screen_size = FRAME_BUFFER.getPix();
+ screen_size = screen->getPix();
time_slice = TimerInterface::getTimeSlice();
scroll_rate = GameConfig::getScrollRate();
@@ -968,19 +968,19 @@
WorldViewInterface::worldXYtoClientXY( world_win, box_press,
&client_pos );
if ( client_pos.x < mouse_pos.x ) {
- FRAME_BUFFER.drawHLine( client_pos.x, client_pos.y, mouse_pos.x,
252 );
- FRAME_BUFFER.drawHLine( client_pos.x, mouse_pos.y, mouse_pos.x,
252 );
+ screen->drawHLine( client_pos.x, client_pos.y, mouse_pos.x, 252 );
+ screen->drawHLine( client_pos.x, mouse_pos.y, mouse_pos.x, 252 );
} else {
- FRAME_BUFFER.drawHLine( mouse_pos.x, client_pos.y, client_pos.x,
252 );
- FRAME_BUFFER.drawHLine( mouse_pos.x, mouse_pos.y, client_pos.x,
252 );
+ screen->drawHLine( mouse_pos.x, client_pos.y, client_pos.x, 252 );
+ screen->drawHLine( mouse_pos.x, mouse_pos.y, client_pos.x, 252 );
}
if ( client_pos.y < mouse_pos.y ) {
- FRAME_BUFFER.drawVLine( client_pos.x, client_pos.y, mouse_pos.y,
252 );
- FRAME_BUFFER.drawVLine( mouse_pos.x, client_pos.y, mouse_pos.y,
252 );
+ screen->drawVLine( client_pos.x, client_pos.y, mouse_pos.y, 252 );
+ screen->drawVLine( mouse_pos.x, client_pos.y, mouse_pos.y, 252 );
} else {
- FRAME_BUFFER.drawVLine( client_pos.x, mouse_pos.y, client_pos.y,
252 );
- FRAME_BUFFER.drawVLine( mouse_pos.x, mouse_pos.y, client_pos.y,
252 );
+ screen->drawVLine( client_pos.x, mouse_pos.y, client_pos.y, 252 );
+ screen->drawVLine( mouse_pos.x, mouse_pos.y, client_pos.y, 252 );
}
}
Index: netpanzer/src/NetPanzer/Interfaces/ConsoleInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/ConsoleInterface.cpp:1.12
netpanzer/src/NetPanzer/Interfaces/ConsoleInterface.cpp:1.13
--- netpanzer/src/NetPanzer/Interfaces/ConsoleInterface.cpp:1.12 Tue Sep
23 21:26:19 2003
+++ netpanzer/src/NetPanzer/Interfaces/ConsoleInterface.cpp Fri Oct 3
10:45:09 2003
@@ -81,6 +81,7 @@
bounds.min.y = 5;
bounds.max = pix - 5;
+ int CHAR_XPIX = 8; // XXX hardcoded
max_char_per_line = (bounds.max.x - bounds.min.x) / CHAR_XPIX;
}
@@ -262,6 +263,7 @@
surface.bltStringShadowed(current_line, inputPrompt,
GameConfig::getConsoleTextColor(), Color::black );
+ int CHAR_XPIX = 8; // XXX hardcoded
input_offset.x = current_line.x + ( (long) strlen( inputPrompt ) ) *
CHAR_XPIX;
input_offset.y = current_line.y;
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.10
netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.11
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp:1.10 Tue Sep 23
11:38:27 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.cpp Fri Oct 3 10:45:09 2003
@@ -51,7 +51,7 @@
float GameConfig::wind_speed;
unsigned int GameConfig::respawn_type = _game_config_respawn_type_round_robin;
-char GameConfig::game_map_name[256];
+std::string GameConfig::game_map_name;
// ** Visuals Configuration **
unsigned int GameConfig::screen_resolution = 0;
@@ -205,12 +205,3 @@
xmlStore.save(configfile.c_str());
}
-void GameConfig::setGameMapName( char *map_name )
-{
- strcpy( game_map_name, map_name );
-}
-
-char * GameConfig::getGameMapName( void )
-{
- return( game_map_name );
-}
Index: netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.9
netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.10
--- netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp:1.9 Sat Sep 20
18:40:15 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameConfig.hpp Fri Oct 3 10:45:09 2003
@@ -164,7 +164,7 @@
static int attackNotificationTime;
static bool blendSmoke;
- static char game_map_name[256];
+ static std::string game_map_name;
// ** Visuals Configuration **
static unsigned int screen_resolution;
@@ -645,8 +645,10 @@
return( wind_speed );
}
- static void setGameMapName( char *map_name );
- static char * getGameMapName( void );
+ static void setGameMapName(const std::string& mapname)
+ { game_map_name = mapname; }
+ static const std::string& getGameMapName()
+ { return game_map_name; }
// ** Visuals Configuration Methods **
static inline float getScrollRate( void )
Index: netpanzer/src/NetPanzer/Interfaces/GameManager.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.55
netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.56
--- netpanzer/src/NetPanzer/Interfaces/GameManager.cpp:1.55 Tue Sep 23
21:26:19 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameManager.cpp Fri Oct 3 10:45:10 2003
@@ -43,8 +43,7 @@
#include "Log.hpp"
#include "MouseInterface.hpp"
#include "KeyboardInterface.hpp"
-#include "KeyActionEnum.hpp"
-#include "DDHardSurface.hpp"
+#include "ScreenSurface.hpp"
#include "GameConfig.hpp"
#include "TileInterface.hpp"
#include "TileEngine.hpp"
@@ -87,7 +86,6 @@
#include "WinnerMesgView.hpp"
#include "RankView.hpp"
#include "VehicleSelectionView.hpp"
-#include "ControlPaletteView.hpp"
#include "MiniMapView.hpp"
#include "OptionsTemplateView.hpp"
#include "OrderingView.hpp"
@@ -125,7 +123,6 @@
#include "ParticleInterface.hpp"
#include "Physics.hpp"
#include "TimerInterface.hpp"
-#include "FontSystem2D.hpp"
#include "Math.hpp"
#include "Bot.hpp"
@@ -155,7 +152,6 @@
Screen = new SDLDraw();
setVideoMode();
- loadPalette("wads/netp.act");
}
void GameManager::shutdownVideoSubSystem()
@@ -201,9 +197,8 @@
{
LOG(("Initializing Game Viewing System"));
- // Use this when needing to create colorfilters.
loadPalette("wads/netp.act");
-
+
initFont();
loadPics();
@@ -227,11 +222,11 @@
progressView.init();
Desktop::add(&progressView);
+ loadPalette("wads/netpmenu.act");
+
//chatView.init();
//Desktop::add(&chatView);
- loadPalette( "wads/netpmenu.act" );
-
Desktop::add(new MapSelectionView());
Desktop::add(new MainMenuView());
Desktop::add(new JoinView());
@@ -257,13 +252,16 @@
Desktop::setVisibilityAllWindows(false);
Desktop::setVisibility("MainView", true);
+
+ Desktop::checkResolution(iXY(640,480), iXY(screen->getPix()));
+ Desktop::checkViewPositions(screen->getPix());
}
// ******************************************************************
void GameManager::setVideoMode()
{
- iXY lastResolution(SCREEN_XPIX, SCREEN_YPIX);
iXY mode_res;
+ iXY old_res = screen ? screen->getPix() : iXY(0,0) ;
bool fullscreen = GameConfig::getFullscreen();
int mode;
@@ -275,7 +273,7 @@
case 3: mode_res = iXY(1280, 1024); break;
}
- if(Screen->isDisplayModeAvailable( mode_res.x, mode_res.y, 8 )) {
+ if(Screen->isDisplayModeAvailable(mode_res.x, mode_res.y, 8,
fullscreen)) {
GameConfig::setScreenResolution(mode);
break;
}
@@ -283,35 +281,32 @@
if(mode<0)
throw Exception("couldn't find a usable video mode");
- if (!Screen->setVideoMode(mode_res.x,
- mode_res.y, 8, fullscreen))
- throw Exception("failed to set video mode.");
+ Screen->setVideoMode(mode_res.x, mode_res.y, 8, fullscreen);
WorldViewInterface::setCameraSize( mode_res.x, mode_res.y );
- FRAME_BUFFER.create(mode_res.x, mode_res.y, mode_res.x, 1 );
- screen.createNoAlloc(mode_res);
+ delete screen;
+ screen = new ScreenSurface(Screen, mode_res.x, mode_res.y, 8);
gameView.setSize(mode_res);
- Desktop::checkResolution(lastResolution);
- Desktop::checkViewPositions();
+ Desktop::checkResolution(old_res, mode_res);
+ Desktop::checkViewPositions(mode_res);
//ConsoleInterface::setToSurfaceSize( mode_res );
// reset palette
- Palette pal;
- Screen->setPalette(pal.color);
+ Screen->setPalette(Palette::color);
}
// ******************************************************************
void GameManager::drawTextCenteredOnScreen(const char *string, PIX color)
{
- FRAME_BUFFER.lock();
- screen.lock(FRAME_BUFFER.mem);
- screen.fill(0);
- screen.bltStringCenter(string, color);
- FRAME_BUFFER.unlock();
- screen.unlock();
- Screen->copyDoubleBufferandFlip();
+ screen->lock();
+
+ screen->fill(0);
+ screen->bltStringCenter(string, color);
+
+ screen->unlock();
+ screen->copyToVideoFlip();
}
// ******************************************************************
@@ -319,10 +314,7 @@
void GameManager::loadPalette(char *palette_path)
{
Palette::init(palette_path);
-
- Palette pal;
-
- Screen->setPalette(pal.color);
+ Screen->setPalette(Palette::color);
}
// ******************************************************************
@@ -656,7 +648,7 @@
}
// ******************************************************************
-bool GameManager::startGameMapLoad( char *map_file_path, unsigned long
partitions, int *result_code )
+bool GameManager::startGameMapLoad(const char *map_file_path, unsigned long
partitions, int *result_code )
{
int check_return_code;
check_return_code = MapsManager::checkMapValidity( map_file_path );
@@ -714,7 +706,7 @@
// ******************************************************************
-void GameManager::dedicatedLoadGameMap( char *map_name )
+void GameManager::dedicatedLoadGameMap(const char *map_name )
{
strcpy( map_path, "maps/" );
strcat( map_path, map_name );
@@ -1181,44 +1173,41 @@
iXY pos(0, 140);
{
- FRAME_BUFFER.lock();
+ screen->lock();
- screen.lock(FRAME_BUFFER.mem);
- hostLoadSurface.blt(screen);
+ hostLoadSurface.blt(*screen);
char strBuf[256];
sprintf(strBuf, "SPAWNING HOST");
pos.x = 179;
pos.y = 153;
- screen.bltString(pos, strBuf, Color::white);
+ screen->bltString(pos, strBuf, Color::white);
pos.y += yOffset;
pos.y += yOffset;
sprintf(strBuf, "Load Game Map...................%s", (curNum > 1) ?
"DONE" : "");
pos.y += yOffset;
- screen.bltString(pos, strBuf, Color::white);
+ screen->bltString(pos, strBuf, Color::white);
sprintf(strBuf, "Initialize Game Logic...........%s", (curNum > 2) ?
"DONE" : "");
pos.y += yOffset;
- screen.bltString(pos, strBuf, Color::white);
+ screen->bltString(pos, strBuf, Color::white);
sprintf(strBuf, "Initializing Connection Type....%s", (curNum > 3) ?
"DONE" : "");
pos.y += yOffset;
- screen.bltString(pos, strBuf, Color::white);
+ screen->bltString(pos, strBuf, Color::white);
sprintf(strBuf, "Allocating Server...............%s", (curNum > 4) ?
"DONE" : "");
pos.y += yOffset;
- screen.bltString(pos, strBuf, Color::white);
+ screen->bltString(pos, strBuf, Color::white);
sprintf(strBuf, "Spawning Player.................%s", (curNum > 5) ?
"DONE" : "");
pos.y += yOffset;
- screen.bltString(pos, strBuf, Color::white);
+ screen->bltString(pos, strBuf, Color::white);
- FRAME_BUFFER.unlock();
- screen.unlock();
-
- Screen->copyDoubleBufferandFlip();
+ screen->unlock();
+ screen->copyToVideoFlip();
}
}
@@ -1274,10 +1263,10 @@
progressView.scrollAndUpdateDirect( "Loading Game Data ..." );
- MapsManager::setCycleStartMap( GameConfig::getGameMapName() );
+ MapsManager::setCycleStartMap( GameConfig::getGameMapName().c_str() );
int result_code;
- startGameMapLoad( GameConfig::getGameMapName(), 20, &result_code );
+ startGameMapLoad(GameConfig::getGameMapName().c_str(), 20, &result_code);
if( result_code == _mapload_result_no_wad_file ) {
progressView.scrollAndUpdateDirect( "MAP TILE SET NOT FOUND!" );
@@ -1405,7 +1394,7 @@
MapsManager::getCurrentMap( input_str );
GameConfig::setGameMapName( input_str );
- printf( "Map Name <%s> : ", GameConfig::getGameMapName() );
+ printf( "Map Name <%s> : ", GameConfig::getGameMapName().c_str() );
fflush(stdout);
readString(input_str, 256, stdin);
if ( strlen(input_str) > 0 ) {
@@ -1502,8 +1491,8 @@
}
- MapsManager::setCycleStartMap( GameConfig::getGameMapName() );
- dedicatedLoadGameMap( GameConfig::getGameMapName() );
+ MapsManager::setCycleStartMap( GameConfig::getGameMapName().c_str() );
+ dedicatedLoadGameMap( GameConfig::getGameMapName().c_str() );
reinitializeGameLogic();
@@ -1562,8 +1551,6 @@
if (once) {
once = false;
Desktop::setVisibility("MainView", true);
- // XXX hack, original resolution was 640x480
- Desktop::checkResolution(iXY(640, 480));
}
TimerInterface::start();
@@ -1598,7 +1585,6 @@
ParticleSystem2D::simAll();
Particle2D::simAll();
- FontSystem2D::simAll();
//evaluateGameRules();
GameControlRulesDaemon::updateGameControlFlow();
@@ -1617,37 +1603,32 @@
// ******************************************************************
void GameManager::graphicsLoop()
{
- FRAME_BUFFER.lock();
- screen.lock(FRAME_BUFFER.mem);
-
- Desktop::draw();
+ screen->lock();
- FontSystem2D::drawAll();
+ Desktop::draw(*screen);
char strBuf[256];
if (display_frame_rate_flag == true) {
sprintf(strBuf, "%3.1f : %3.1f" , TimerInterface::getFPS(),
TimerInterface::getFPSAvg());
- screen.bltString5x5(iXY(2, 2), strBuf, Color::white);
+ screen->bltString5x5(iXY(2, 2), strBuf, Color::white);
}
if (display_network_info_flag == true) {
sprintf(strBuf, "|| %.4f : %.4f || %.4f : %.4f ||" ,
NetworkState::packets_sent_per_sec, NetworkState::bytes_sent_per_sec,
NetworkState::packets_received_per_sec,
NetworkState::bytes_received_per_sec );
- screen.bltString5x5(iXY(60, 2), strBuf, Color::white);
+ screen->bltString5x5(iXY(60, 2), strBuf, Color::white);
}
if (Desktop::getVisible("GameView")) {
- ConsoleInterface::update( FRAME_BUFFER );
+ ConsoleInterface::update(*screen);
}
- mouse.draw(screen);
+ mouse.draw(*screen);
MouseInterface::updateCursor();
- FRAME_BUFFER.unlock();
- screen.unlock();
-
- Screen->copyDoubleBufferandFlip();
+ screen->unlock();
+ screen->copyToVideoFlip();
}
// ******************************************************************
Index: netpanzer/src/NetPanzer/Interfaces/GameManager.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/GameManager.hpp:1.12
netpanzer/src/NetPanzer/Interfaces/GameManager.hpp:1.13
--- netpanzer/src/NetPanzer/Interfaces/GameManager.hpp:1.12 Fri Sep 19
20:05:29 2003
+++ netpanzer/src/NetPanzer/Interfaces/GameManager.hpp Fri Oct 3 10:45:10 2003
@@ -106,11 +106,11 @@
static void setupKeyboardBindings();
- static bool startGameMapLoad( char *map_file_path, unsigned long
partitions, int *result_code );
+ static bool startGameMapLoad(const char *map_file_path, unsigned long
partitions, int *result_code );
static bool gameMapLoad( int *percent_complete );
static void finishGameMapLoad();
- static void dedicatedLoadGameMap( char *map_file_path );
+ static void dedicatedLoadGameMap(const char *map_file_path );
static bool loadGameData();
Index: netpanzer/src/NetPanzer/Interfaces/MapInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/MapInterface.cpp:1.9
netpanzer/src/NetPanzer/Interfaces/MapInterface.cpp:1.10
--- netpanzer/src/NetPanzer/Interfaces/MapInterface.cpp:1.9 Tue Sep 23
21:26:19 2003
+++ netpanzer/src/NetPanzer/Interfaces/MapInterface.cpp Fri Oct 3 10:45:10 2003
@@ -94,7 +94,6 @@
strcpy( path, file_path );
strcat( path, ".npm" );
- main_map.loadMapFile( path );
tile_set.loadTileSetInfo( "./wads/wad.tls" );
generateMappingTable();
@@ -181,56 +180,6 @@
{
unsigned short tile_val;
char move_val;
-
- /*
- if ( (map_loc.x >= 0) && (map_loc.x < main_map.getXsize() )
- && (map_loc.y >= 0) && (map_loc.y < main_map.getYsize() )
- )
- {
-
- tile_val = main_map.mapValue( (unsigned short) map_loc.x, (unsigned
short) map_loc.y ) ;
-
- if ( ( (tile_val >= 816) && (tile_val <= 820) ) ||
- ( (tile_val >= 829) && (tile_val <= 833) ) || (tile_val ==
840) ||
- ( (tile_val >= 843) && (tile_val <= 844) ) ||
- ( (tile_val >= 860) && (tile_val <= 861) ) ||
- ( (tile_val >= 872) && (tile_val <= 873) ) ||
- ( (tile_val >= 883) && (tile_val <= 885) )
-
- )
- {
- return( 1 );
- }
- else
- if ( ( (tile_val >= 10) && (tile_val <= 26)) ||
- ( (tile_val >= 30) && (tile_val <= 49))
- )
- {
- return( 0xFF );
- }
- else
- if ( ( (tile_val >= 2231) && (tile_val <= 2232 ) ) ||
- ( (tile_val >= 2246) && (tile_val <= 2247 ) ) ||
- ( (tile_val >= 2262) && (tile_val <= 2263 ) ) ||
- ( (tile_val >= 2277) && (tile_val <= 2278 ) ) ||
- ( (tile_val >= 2292) && (tile_val <= 2293 ) ) ||
- (tile_val == 2215)
- )
- {
- return( 2 );
- }
- else
- if ( tile_val > 317 )
- return( 0xFF );
-
- return( 1 );
- }
- else
- {
- return( 0xFF );
- }
- */
- //*****************************************************************
if ( (map_loc.x >= 0) && (map_loc.x < main_map.getXsize() )
&& (map_loc.y >= 0) && (map_loc.y < main_map.getYsize() )
Index: netpanzer/src/NetPanzer/Interfaces/MapInterface.hpp
diff -u netpanzer/src/NetPanzer/Interfaces/MapInterface.hpp:1.6
netpanzer/src/NetPanzer/Interfaces/MapInterface.hpp:1.7
--- netpanzer/src/NetPanzer/Interfaces/MapInterface.hpp:1.6 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Interfaces/MapInterface.hpp Fri Oct 3 10:45:10 2003
@@ -25,6 +25,12 @@
#include "Surface.hpp"
+class MapLoadCallback
+{
+public:
+ virtual void MapLoadProgress(float percent);
+};
+
class MapInterface : protected TileInterface
{
protected:
@@ -176,8 +182,9 @@
protected:
static void finishMapLoad();
+
public:
- static bool startMapLoad( const char *file_path, bool load_tiles, unsigned
long partitions );
+ static bool startMapLoad(const char *file_path, bool load_tiles, unsigned
long partitions);
static bool loadMap( int *percent_complete );
static inline bool isMapLoaded()
Index: netpanzer/src/NetPanzer/Interfaces/MouseInterface.cpp
diff -u netpanzer/src/NetPanzer/Interfaces/MouseInterface.cpp:1.15
netpanzer/src/NetPanzer/Interfaces/MouseInterface.cpp:1.16
--- netpanzer/src/NetPanzer/Interfaces/MouseInterface.cpp:1.15 Tue Sep 23
21:26:19 2003
+++ netpanzer/src/NetPanzer/Interfaces/MouseInterface.cpp Fri Oct 3
10:45:10 2003
@@ -80,6 +80,8 @@
}
}
FileSystem::freeList(cursorfiles);
+
+ setCursor("default.bmp");
}
void MouseInterface::shutdown()
Index: netpanzer/src/NetPanzer/Views/Game/AreYouSureExitView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/AreYouSureExitView.cpp:1.5
netpanzer/src/NetPanzer/Views/Game/AreYouSureExitView.cpp:1.6
--- netpanzer/src/NetPanzer/Views/Game/AreYouSureExitView.cpp:1.5 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/AreYouSureExitView.cpp Fri Oct 3
10:45:11 2003
@@ -20,6 +20,7 @@
#include "AreYouSureExitView.hpp"
#include "Desktop.hpp"
#include "Palette.hpp"
+#include "ScreenSurface.hpp"
#include "GameManager.hpp"
//---------------------------------------------------------------------------
@@ -57,11 +58,11 @@
setAllowResize(false);
setDisplayStatusBar(false);
- moveTo(0, 0);
- resize(SCREEN_PIX);
+ resize(screen->getPix());
+ moveTo(0,0);
int x = (getClientRect().getSize().x - (141 * 2 + 20)) / 2;
- int y = SCREEN_YCENTER + 30;
+ int y = screen->getPixY()/2 + 30;
addSpecialButton( iXY(x, y),
"YES",
bYES);
@@ -77,9 +78,7 @@
//---------------------------------------------------------------------------
void AreYouSureExitView::doDraw(const Surface &viewArea, const Surface
&clientArea)
{
- iXY pos(0, 0);
- iXY size(SCREEN_PIX);
- iRect r(pos, pos + size);
+ iRect r(min, max);
viewArea.bltLookup(r, Palette::darkGray256.getColorArray());
//viewArea.drawButtonBorder(r, Color::lightGreen, Color::darkGreen);
@@ -87,7 +86,6 @@
viewArea.bltStringCenter("Are you sure you wish to exit netPanzer?",
Color::white);
View::doDraw(viewArea, clientArea);
-
} // end AreYouSureExitView::doDraw
// doActivate
Index: netpanzer/src/NetPanzer/Views/Game/AreYouSureResignView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/AreYouSureResignView.cpp:1.12
netpanzer/src/NetPanzer/Views/Game/AreYouSureResignView.cpp:1.13
--- netpanzer/src/NetPanzer/Views/Game/AreYouSureResignView.cpp:1.12 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/AreYouSureResignView.cpp Fri Oct 3
10:45:12 2003
@@ -19,13 +19,13 @@
#include "AreYouSureResignView.hpp"
#include "Desktop.hpp"
-#include "DDHardSurface.hpp"
#include "GameManager.hpp"
#include "ParticleSystem2D.hpp"
#include "Particle2D.hpp"
#include "MenuTemplateView.hpp"
#include "Sound.hpp"
#include "SoundView.hpp"
+#include "ScreenSurface.hpp"
#include "ControlsView.hpp"
#include "VisualsView.hpp"
#include "Palette.hpp"
@@ -115,7 +115,6 @@
setSearchName("AreYouSureResignView");
setTitle("Resign");
setSubTitle("");
-
} // end AreYouSureResignView::AreYouSureResignView
// init
@@ -128,11 +127,11 @@
setAllowResize(false);
setDisplayStatusBar(false);
- moveTo(0, 0);
- resize(SCREEN_PIX);
+ resize(screen->getPix());
+ moveTo(0,0);
int x = (getClientRect().getSize().x - (141 * 2 + 20)) / 2;
- int y = SCREEN_YCENTER + 30;
+ int y = getClientRect().getSize().y/2 + 30;
addSpecialButton( iXY(x, y),
"YES",
bYES);
@@ -148,9 +147,7 @@
//---------------------------------------------------------------------------
void AreYouSureResignView::doDraw(const Surface &viewArea, const Surface
&clientArea)
{
- iXY pos(0, 0);
- iXY size(SCREEN_PIX);
- iRect r(pos, pos + size);
+ iRect r(min, max);
viewArea.bltLookup(r, Palette::darkGray256.getColorArray());
//viewArea.drawButtonBorder(r, Color::lightGreen, Color::darkGreen);
@@ -158,14 +155,14 @@
viewArea.bltStringCenter("Are you sure you wish to Resign?", Color::white);
View::doDraw(viewArea, clientArea);
-
} // end AreYouSureResignView::doDraw
// doActivate
//---------------------------------------------------------------------------
void AreYouSureResignView::doActivate()
{
+ printf("DoActivate\n");
init();
Desktop::setActiveView(this);
-
} // end AreYouSureResignView::doActivate
+
Index: netpanzer/src/NetPanzer/Views/Game/ChatView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/ChatView.cpp:1.7
netpanzer/src/NetPanzer/Views/Game/ChatView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/Game/ChatView.cpp:1.7 Tue Sep 23 19:43:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/ChatView.cpp Fri Oct 3 10:45:12 2003
@@ -52,8 +52,6 @@
moveTo(0, 0);
resize(400, 200);
- centerAbsolute();
-
int x = 0;
int y = 0;
//int buttonXSize = 60;
Index: netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.9
netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.10
--- netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp:1.9 Tue Sep 23
19:43:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameInfoView.cpp Fri Oct 3 10:45:14 2003
@@ -27,6 +27,7 @@
#include "PlayerInterface.hpp"
#include "NetworkState.hpp"
#include "String.hpp"
+#include "ScreenSurface.hpp"
static int getPlayerFrags()
{
@@ -80,8 +81,7 @@
resizeClientArea(iXY(140, 2 * 2 + 12 * 5 + 8));
// Start it in the top-left corner.
- moveTo(iXY(10000, 0));
-
+ moveTo(screen->getPixX() - getSize().x, 0);
} // end GameInfoView::GameInfoView
// doDraw
@@ -165,10 +165,6 @@
pos.y += 12;
View::doDraw(viewArea, clientArea);
-
- // Make sure the view stays in the screen when the view is resized.
- //resizeClientArea(gameInfoRect.getSize());
- //moveTo(min);
} // end GameInfoView::doDraw
// checkGameInfoRect
@@ -177,7 +173,7 @@
//---------------------------------------------------------------------------
void GameInfoView::checkGameInfoRect(String string)
{
- int length = (strlen(string) * CHAR_XPIX + 2);
+ int length = Surface::getTextLength(string) + 2;
if (length > gameInfoRect.getSizeX()) {
gameInfoRect.max.x = gameInfoRect.min.x + length;
Index: netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp:1.6
netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp:1.7
--- netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp:1.6 Tue Sep 16
16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameTemplateView.cpp Fri Oct 3
10:45:14 2003
@@ -21,6 +21,7 @@
#include "Desktop.hpp"
#include "GameViewGlobals.hpp"
#include "KeyboardInterface.hpp"
+#include "ScreenSurface.hpp"
#include "WorldInputCmdProcessor.hpp"
@@ -50,6 +51,7 @@
}
moveTo(min + newPos - prevPos);
+ checkArea(screen->getPix());
}
// doActivate
Index: netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp:1.5
netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp:1.6
--- netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp:1.5 Tue Sep 23
19:43:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameToolbarView.cpp Fri Oct 3
10:45:14 2003
@@ -16,6 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <config.h>
+
#include "GameToolbarView.hpp"
#include "GameViewGlobals.hpp"
#include "Desktop.hpp"
@@ -24,7 +25,7 @@
#include "PlayerInterface.hpp"
#include "WorldInputCmdProcessor.hpp"
#include "MiniMapView.hpp"
-
+#include "ScreenSurface.hpp"
static void bToggleMiniMap()
{
@@ -224,8 +225,7 @@
resizeClientArea(iXY(117, pos.y));
// Start it in the bottom-left corner.
- moveTo(iXY(10000, 10000));
-
+ moveTo(screen->getPix() - getSize());
} // end GameToolbarView::GameToolbarView
// doDraw
Index: netpanzer/src/NetPanzer/Views/Game/GameView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/GameView.cpp:1.8
netpanzer/src/NetPanzer/Views/Game/GameView.cpp:1.9
--- netpanzer/src/NetPanzer/Views/Game/GameView.cpp:1.8 Thu Sep 18 13:44:18 2003
+++ netpanzer/src/NetPanzer/Views/Game/GameView.cpp Fri Oct 3 10:45:14 2003
@@ -26,14 +26,12 @@
#include "ObjectiveInterface.hpp"
#include "WorldInputCmdProcessor.hpp"
#include "WorldViewInterface.hpp"
-#include "DDHardSurface.hpp"
+#include "ScreenSurface.hpp"
#include "ConsoleInterface.hpp"
#include "Particle2D.hpp"
#include "ParticleSystem2D.hpp"
#include "cMouse.hpp"
#include "ViewGlobals.hpp"
-#include "FontSystem2D.hpp"
-#include "MiniRankView.hpp"
#include "ParticleInterface.hpp"
#include "PackedSurface.hpp"
#include "VehicleSelectionView.hpp"
@@ -70,7 +68,7 @@
setVisible(false);
moveTo(iXY(0, 0));
- resize(iXY(SCREEN_XPIX, SCREEN_YPIX));
+ resize(iXY(screen->getPixX(), screen->getPixY()));
} // end GameView::init
@@ -80,7 +78,7 @@
{
// Added for debugging, accesible through LibView.
if (gDrawSolidBackground) {
- screen.fill(250);
+ screen->fill(250);
} else {
TileEngine::blitWorld();
}
@@ -104,14 +102,14 @@
ObjectiveInterface::offloadGraphics( SPRITE_SORTER );
PowerUpInterface::offloadGraphics( SPRITE_SORTER );
- SPRITE_SORTER.blitLists( &FRAME_BUFFER );
+ SPRITE_SORTER.blitLists(screen);
VehicleSelectionView::drawMiniProductionStatus(screen);
COMMAND_PROCESSOR.updateControls();
// Make sure the console info is the last thing drawn.
- ConsoleInterface::update( FRAME_BUFFER );
+ ConsoleInterface::update(*screen);
} // end GameView::doDraw
Index: netpanzer/src/NetPanzer/Views/Game/HelpScrollView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/HelpScrollView.cpp:1.10
netpanzer/src/NetPanzer/Views/Game/HelpScrollView.cpp:1.11
--- netpanzer/src/NetPanzer/Views/Game/HelpScrollView.cpp:1.10 Sun Sep 21
14:29:32 2003
+++ netpanzer/src/NetPanzer/Views/Game/HelpScrollView.cpp Fri Oct 3
10:45:14 2003
@@ -112,6 +112,7 @@
insert(" Alt + '-' Decrease brightness");
insert(" Alt + '=' Increase brightness");
+ int CHAR_YPIX = Surface::getFontHeight();
maxViewableItems = (getClientRect().getSizeY() - (TEXT_GAP_SPACE +
CHAR_YPIX)) / (TEXT_GAP_SPACE + CHAR_YPIX) - 1;
topViewableItem = 0;
@@ -142,7 +143,7 @@
iXY pos;
pos.x = 4;
- pos.y = clientArea.getPixY() - CHAR_YPIX;
+ pos.y = clientArea.getPixY() - Surface::getFontHeight();
clientArea.bltString(pos, "Note: Use the right mouse button to accomplish
fast mouse clicking.", Color::white);
@@ -171,7 +172,7 @@
//
int curIndex = 0;
for (int i = topViewableItem; i < topViewableItem + maxViewableItems; i++)
{
- dest.bltString(1, 6 + curIndex * (TEXT_GAP_SPACE + CHAR_YPIX),
text[i], color);
+ dest.bltString(1, 6 + curIndex * (TEXT_GAP_SPACE +
Surface::getFontHeight()), text[i], color);
curIndex++;
}
//}
Index: netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.12
netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.13
--- netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp:1.12 Tue Sep 23
21:26:19 2003
+++ netpanzer/src/NetPanzer/Views/Game/LobbyView.cpp Fri Oct 3 10:45:15 2003
@@ -20,11 +20,8 @@
#include "Exception.hpp"
#include "LobbyView.hpp"
#include "Desktop.hpp"
-#include "UIDraw.hpp"
-#include "DDHardSurface.hpp"
#include "GameManager.hpp"
-
LobbyView lobbyView;
static void bAbort()
@@ -90,10 +87,10 @@
void LobbyView::update(const char *text)
{
//int yOffset = background.getPix().y-CHAR_YPIX - 1;
- int yOffset = CHAR_YPIX * currentline;
+ int yOffset = Surface::getFontHeight() * currentline;
// Clear the area for the text and draw the new text.
- background.fillRect(0, yOffset, background.getPix().x, yOffset +
CHAR_YPIX, Color::black);
+ background.fillRect(0, yOffset, background.getPix().x, yOffset +
Surface::getFontHeight(), Color::black);
background.bltString(0, yOffset, text, Color::white);
} // end LobbyView::update
@@ -105,12 +102,12 @@
//---------------------------------------------------------------------------
void LobbyView::scroll()
{
- if(currentline * CHAR_YPIX > background.getPix().y - CHAR_YPIX) {
+ if(currentline * Surface::getFontHeight() > background.getPix().y -
Surface::getFontHeight()) {
Surface tempSurface;
tempSurface.copy(background);
// Move the current text up by the height of the app font.
- tempSurface.blt(background, CHAR_YPIX, 0);
+ tempSurface.blt(background, Surface::getFontHeight(), 0);
} else {
currentline++;
}
Index: netpanzer/src/NetPanzer/Views/Game/MiniMapOptionsView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/MiniMapOptionsView.cpp:1.4
netpanzer/src/NetPanzer/Views/Game/MiniMapOptionsView.cpp:1.5
--- netpanzer/src/NetPanzer/Views/Game/MiniMapOptionsView.cpp:1.4 Tue Sep
16 16:16:12 2003
+++ netpanzer/src/NetPanzer/Views/Game/MiniMapOptionsView.cpp Fri Oct 3
10:45:15 2003
@@ -15,9 +15,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
#include <config.h>
+
#include "MiniMapOptionsView.hpp"
#include "GameViewGlobals.hpp"
#include "GameConfig.hpp"
@@ -279,7 +278,6 @@
setAllowResize(false);
moveTo(iXY(0, 0));
resize(iXY(400, 320));
- centerAbsolute();
//yourUnits.add("White");
//yourUnits.add("Black");
Index: netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.11
netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.12
--- netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp:1.11 Mon Sep 22
09:53:53 2003
+++ netpanzer/src/NetPanzer/Views/Game/MiniMapView.cpp Fri Oct 3 10:45:15 2003
@@ -23,7 +23,6 @@
#include "MiniMapInterface.hpp"
#include "KeyboardInterface.hpp"
#include "cMouse.hpp"
-#include "loadPics.hpp"
#include "WorldInputCmdProcessor.hpp"
@@ -54,21 +53,20 @@
add(CLOSE_VIEW_BUTTON);
add(MINMAX_VIEW_BUTTON);
+ resize(100, 100);
} // end MiniMapView::MiniMapView
// init
//---------------------------------------------------------------------------
void MiniMapView::init()
{
- moveTo(iXY(0, 0));
-
Surface *miniMap;
miniMap = MiniMapInterface::getMiniMap();
//iXY size = miniMap->getPix();
iXY size(196, 196);
-
resize(size);
+ moveTo(iXY(0, 0));
mapDrawType = MAP_SOLID;
@@ -89,7 +87,6 @@
selectionAnchorDownPos.zero();
selectionAnchorCurPos.zero();
-
} // end MiniMapView::init
// doDraw
@@ -330,6 +327,8 @@
destSize = maxMapSize;
}
+ // XXX
+#if 0
// Check the validity of the X dimension.
if ((min.x + destSize.x) >= SCREEN_XPIX) {
int xOffset = min.x + destSize.x - SCREEN_XPIX;
@@ -357,6 +356,7 @@
moveTo(min.x, destYPos);
}
}
+#endif
// Resize the x dimension.
if (destSize.x > getViewRect().getSize().x) {
Index: netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp:1.12
netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp:1.13
--- netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp:1.12 Tue Sep 23
21:26:19 2003
+++ netpanzer/src/NetPanzer/Views/Game/ProgressView.cpp Fri Oct 3 10:45:15 2003
@@ -20,14 +20,11 @@
#include "ProgressView.hpp"
#include "Exception.hpp"
#include "Desktop.hpp"
-#include "UIDraw.hpp"
-#include "DDHardSurface.hpp"
+#include "ScreenSurface.hpp"
#include "GameManager.hpp"
-
ProgressView progressView;
-
// ProgressView
//---------------------------------------------------------------------------
ProgressView::ProgressView() : View()
@@ -50,7 +47,6 @@
background.create(628 - 179, 302 - 153, 628 - 179, 1);
background.fill(0);
- moveTo(0, 0);
resize(640, 480);
} // end ProgressView::init
@@ -69,7 +65,6 @@
background.blt(clientArea, 179, 153);
View::doDraw(viewArea, clientArea);
-
} // end ProgressView::doDraw
// update
@@ -79,36 +74,35 @@
//---------------------------------------------------------------------------
void ProgressView::update(const char *text)
{
+ int CHAR_YPIX = Surface::getFontHeight();
int yOffset = background.getPix().y-CHAR_YPIX - 1;
// Clear the area for the text and draw the new text.
background.fillRect(0, yOffset, background.getPix().x, yOffset +
CHAR_YPIX, Color::black);
background.bltString(0, background.getPix().y - CHAR_YPIX - 1, text,
Color::white);
-
} // end ProgressView::update
void ProgressView::updateDirect(const char *text)
{
- FRAME_BUFFER.lock();
- screen.lock(FRAME_BUFFER.mem);
+ screen->lock();
if (!backgroundSurface.getDoesExist()) {
loadBackgroundSurface();
}
- backgroundSurface.blt(screen);
+ backgroundSurface.blt(*screen, min);
+ int CHAR_YPIX = Surface::getFontHeight();
int yOffset = background.getPix().y-CHAR_YPIX - 1;
// Clear the area for the text and draw the new text.
background.fillRect(0, yOffset, background.getPix().x, yOffset +
CHAR_YPIX, Color::black);
background.bltString(0, background.getPix().y - CHAR_YPIX - 1, text,
Color::white);
- background.blt(screen, 179, 153);
+ background.blt(*screen, min + iXY(179, 153));
- FRAME_BUFFER.unlock();
- screen.unlock();
- Screen->copyDoubleBufferandFlip();
+ screen->unlock();
+ screen->copyToVideoFlip();
}
// scroll
@@ -122,42 +116,37 @@
tempSurface.copy(background);
// Move the current text up by the height of the app font.
- tempSurface.blt(background, 0, -CHAR_YPIX - 1);
-
+ tempSurface.blt(background, 0, - Surface::getFontHeight() - 1);
} // end ProgressView::scroll
void ProgressView::scrollDirect()
{
Surface tempSurface;
- FRAME_BUFFER.lock();
- screen.lock(FRAME_BUFFER.mem);
+ screen->lock();
if (!backgroundSurface.getDoesExist()) {
loadBackgroundSurface();
}
- backgroundSurface.blt(screen);
+ backgroundSurface.blt(*screen, min);
tempSurface.copy(background);
// Move the current text up by the height of the app font.
- tempSurface.blt(background, 0, -CHAR_YPIX - 1);
+ tempSurface.blt(background, 0, - Surface::getFontHeight() - 1);
- background.blt(screen, 179, 153);
-
- FRAME_BUFFER.unlock();
- screen.unlock();
- Screen->copyDoubleBufferandFlip();
+ background.blt(*screen, min + iXY(179, 153));
+ screen->unlock();
+ screen->copyToVideoFlip();
} // end ProgressView::scrollDirect
void ProgressView::scrollAndUpdateDirect(const char *text)
{
Surface tempSurface;
- FRAME_BUFFER.lock();
- screen.lock(FRAME_BUFFER.mem);
+ screen->lock();
if (!backgroundSurface.getDoesExist()) {
loadBackgroundSurface();
@@ -168,20 +157,19 @@
tempSurface.copy(background);
// Move the current text up by the height of the app font.
- tempSurface.blt(background, 0, -CHAR_YPIX - 1);
+ tempSurface.blt(background, 0, - Surface::getFontHeight() - 1);
- int yOffset = background.getPix().y-CHAR_YPIX - 1;
+ int yOffset = background.getPix().y- Surface::getFontHeight() - 1;
// Clear the area for the text and draw the new text.
- background.fillRect(0, yOffset, background.getPix().x, yOffset +
CHAR_YPIX, Color::black);
- background.bltString(0, background.getPix().y - CHAR_YPIX - 1, text,
Color::white);
+ background.fillRect(0, yOffset, background.getPix().x, yOffset +
+ Surface::getFontHeight(), Color::black);
+ background.bltString(0, background.getPix().y - Surface::getFontHeight() -
1, text, Color::white);
background.blt(screen, 179, 153);
- FRAME_BUFFER.unlock();
- screen.unlock();
- Screen->copyDoubleBufferandFlip();
-
+ screen->unlock();
+ screen->copyToVideoFlip();
} // end ProgressView::scrollDirect
@@ -193,8 +181,6 @@
void ProgressView::open()
{
if ( Desktop::getView("ProgressView")->getVisible() == false ) {
- //GameManager::setVideoMode(iXY(640, 480), false);
-
GameManager::drawTextCenteredOnScreen("Sec...", Color::white);
GameManager::loadPalette("wads/netpmenu.act");
@@ -204,7 +190,6 @@
}
}
-
//---------------------------------------------------------------------------
void ProgressView::close()
{
@@ -212,9 +197,6 @@
reset();
GameManager::drawTextCenteredOnScreen("Sec...", Color::white);
- //GameManager::restorePreviousVideoMode();
- Desktop::checkViewPositions();
-
GameManager::loadPalette("wads/netp.act");
backgroundSurface.free();
@@ -230,9 +212,6 @@
backgroundSurface.free();
GameManager::drawTextCenteredOnScreen("Sec...", Color::white);
- //GameManager::restorePreviousVideoMode();
- Desktop::checkViewPositions();
-
// Set the palette to the game palette.
GameManager::loadPalette("wads/netp.act");
@@ -243,7 +222,6 @@
Desktop::setVisibility("GameInfoView", true);
Desktop::setVisibility("MiniMapView", true);
Desktop::setVisibility("GameView", true);
-
} // end ProgressView::toggleGameView
// toggleMainMenu
@@ -254,7 +232,6 @@
backgroundSurface.free();
Desktop::setVisibilityAllWindows(false);
Desktop::setVisibility("MainView", true);
-
} // end ProgressView::toggleMainMenu
// doActivate
@@ -262,14 +239,11 @@
void ProgressView::doActivate()
{
Desktop::setActiveView(this);
-
} // end VehicleSelectionView::doActivate
// loadBackgroundSurface
//---------------------------------------------------------------------------
void ProgressView::loadBackgroundSurface()
{
- String string = "pics/backgrounds/menus/menu/til/loadingMB.til";
-
- backgroundSurface.loadTIL(string);
+ backgroundSurface.loadTIL("pics/backgrounds/menus/menu/til/loadingMB.til");
} // end MenuTemplateView::loadBackgroundSurface
Index: netpanzer/src/NetPanzer/Views/Game/RankView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.6
netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.7
--- netpanzer/src/NetPanzer/Views/Game/RankView.cpp:1.6 Mon Sep 22 09:53:53 2003
+++ netpanzer/src/NetPanzer/Views/Game/RankView.cpp Fri Oct 3 10:45:15 2003
@@ -35,7 +35,6 @@
setAllowResize(false);
moveTo(iXY(0, 0));
resize(iXY(450, 200));
- centerAbsolute();
const unsigned MAX_NAME_CHARS = 20;
const unsigned MAX_FLAG_CHARS = 5;
@@ -43,6 +42,9 @@
const unsigned MAX_LOSSES_CHARS = 7;
const unsigned MAX_POINTS_CHARS = 7;
+ // hardcoded for now
+ int CHAR_XPIX = 8;
+
//addLabel(iXY nPos, char *nLabel, BYTE color);
unsigned xOffset = 0;
unsigned yOffset = 16;
@@ -134,6 +136,7 @@
//}
for (int i = 0; i < numPlayers; i++) {
+ int CHAR_YPIX = Surface::getFontHeight();
offset.x = 2;
flagOffset.x = offset.x + 160;
offset.y = 40 + i * (CHAR_YPIX + (UNIT_FLAGS_SURFACE.getPixY() -
CHAR_YPIX) );
Index: netpanzer/src/NetPanzer/Views/Game/ResignView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/ResignView.cpp:1.5
netpanzer/src/NetPanzer/Views/Game/ResignView.cpp:1.6
--- netpanzer/src/NetPanzer/Views/Game/ResignView.cpp:1.5 Tue Sep 16
16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/Game/ResignView.cpp Fri Oct 3 10:45:15 2003
@@ -64,8 +64,7 @@
setAllowResize(false);
setDisplayStatusBar(false);
- moveTo(0, 0);
- resize(SCREEN_PIX);
+ resize(iXY(480, 80));
iXY buttonSize(150, 15);
//int BUTTON_COUNT = 2;
@@ -73,7 +72,7 @@
int y;
int yOffset = buttonSize.y * 2;
- y = SCREEN_YCENTER - 30;
+ y = 0;
addButtonCenterText(iXY(x, y), buttonSize.x, "Resign", "Returns to the
MainView.", bResign);
y += yOffset;
addButtonCenterText(iXY(x, y), buttonSize.x, "Exit netPanzer", "Exits to
Windows.", bExitNetPanzer);
@@ -86,15 +85,12 @@
//---------------------------------------------------------------------------
void ResignView::doDraw(const Surface &viewArea, const Surface &clientArea)
{
- iXY pos(0, 0);
- iXY size(SCREEN_PIX);
- iRect r(pos, pos + size);
+ iRect r(0, 0, currentscreen->getPixX(), currentscreen->getPixY());
- viewArea.bltLookup(r, Palette::darkGray256.getColorArray());
- viewArea.drawButtonBorder(r, Color::lightGreen, Color::darkGreen);
+ currentscreen->bltLookup(r, Palette::darkGray256.getColorArray());
+ currentscreen->drawButtonBorder(r, Color::lightGreen, Color::darkGreen);
View::doDraw(viewArea, clientArea);
-
} // end ResignView::doDraw
// doActivate
Index: netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp:1.12
netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp:1.13
--- netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp:1.12 Tue Sep
23 21:26:19 2003
+++ netpanzer/src/NetPanzer/Views/Game/VehicleSelectionView.cpp Fri Oct 3
10:45:15 2003
@@ -30,6 +30,7 @@
#include "WorldViewInterface.hpp"
#include "ObjectiveInterface.hpp"
#include "UnitProfileInterface.hpp"
+#include "ScreenSurface.hpp"
#include "Math.hpp"
#include "ObjectiveInterface.hpp"
#include "UnitTypes.hpp"
@@ -293,6 +294,9 @@
add(&buttonPower);
pos.y += yOffset;
+ // XXX hardcoded for now
+ int CHAR_XPIX = 8;
+
pos.x = 0;
addLabel(pos + 2, "Production:", Color::white);
productionUnitPos.x = (strlen("Current Unit:") + 1) * CHAR_XPIX + 2;
@@ -400,8 +404,6 @@
buttonOk.setBounds(iRect(pos, pos + iXY(100, 15)));
add(&buttonOk);
- centerAbsolute();
-
unitImages.create(48, 48, 48, _MAX_UNIT_TYPES);
Surface tempSurface;
@@ -496,7 +498,7 @@
iRect r(objectivePos - objectiveOutlineSize, objectivePos +
objectiveOutlineSize);
//bltBlendRect(screen, r);
- screen.fillRect(r, Color::white);
+ screen->fillRect(r, Color::white);
//int xOffset =
(strlen(WorldInputCmdProcessor::getSelectedObjectiveName()) * CHAR_XPIX) / 2;
@@ -522,8 +524,8 @@
r = iRect(cornerPos - oos, cornerPos + oos);
}
- screen.drawLine(cornerPos, b, Color::white);
- screen.fillRect(r, Color::white);
+ screen->drawLine(cornerPos, b, Color::white);
+ screen->fillRect(r, Color::white);
//screen.bltLookup(r, Palette::darkGray256.getColorArray());
//screen.drawButtonBorder(r, Color::white, Color::gray96);
@@ -677,7 +679,7 @@
outpostStatus =
ObjectiveInterface::getOutpostStatus(objectiveID);
- assert(screen.getDoesExist());
+ assert(screen->getDoesExist());
miniProductionRect.min = objectiveScreenPos;
miniProductionRect.max.x = 0;
@@ -773,7 +775,7 @@
objectiveScreenPos.x -= 0;
objectiveScreenPos.y -= 0;
- assert(screen.getDoesExist());
+ assert(screen->getDoesExist());
miniProductionRect.min = objectiveScreenPos;
miniProductionRect.max.x = 0;
@@ -817,7 +819,7 @@
//---------------------------------------------------------------------------
void VehicleSelectionView::checkMiniProductionRect(String string)
{
- int length = (strlen(string) * CHAR_XPIX + 54);
+ int length = Surface::getTextLength(string) + 54;
if (length > miniProductionRect.getSizeX()) {
miniProductionRect.max.x = miniProductionRect.min.x + length;
@@ -926,7 +928,7 @@
void VehicleSelectionView::drawBar(const Surface &dest, const iXY &pos, int
length, float percent)
{
- iXY size(int(float(length) * percent), CHAR_YPIX);
+ iXY size(int(float(length) * percent), Surface::getFontHeight());
dest.fillRect(iRect(pos.x, pos.y, pos.x + size.x, pos.y + size.y),
Color::red);
}
Index: netpanzer/src/NetPanzer/Views/Game/WinnerMesgView.cpp
diff -u netpanzer/src/NetPanzer/Views/Game/WinnerMesgView.cpp:1.11
netpanzer/src/NetPanzer/Views/Game/WinnerMesgView.cpp:1.12
--- netpanzer/src/NetPanzer/Views/Game/WinnerMesgView.cpp:1.11 Tue Sep 16
16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/Game/WinnerMesgView.cpp Fri Oct 3
10:45:16 2003
@@ -22,7 +22,6 @@
#include "Desktop.hpp"
#include "Stats.hpp"
#include "Sound.hpp"
-#include "DDHardSurface.hpp"
#include "ParticleSystem2D.hpp"
#include "Particle2D.hpp"
#include "GameManager.hpp"
@@ -156,6 +155,10 @@
x = 2;
y = 12;
+
+ // XXX hardcoded for now...
+ int CHAR_XPIX = 8;
+
addLabel(iXY(x, y), "Name", Color::red);
x += MAX_NAME_CHARS * CHAR_XPIX;
addLabel(iXY(x, y), "Flag", Color::red);
@@ -183,8 +186,6 @@
//---------------------------------------------------------------------------
void WinnerMesgView::doDraw(const Surface &viewArea, const Surface &clientArea)
{
- centerAbsolute();
-
bltViewBackground(viewArea);
char strBuf[256];
@@ -213,7 +214,7 @@
for (int i = 0; i < numPlayers; i++) {
offset.x = 2;
- offset.y = 32 + i * (CHAR_YPIX + ITEM_GAP_SPACE / 2);
+ offset.y = 32 + i * (Surface::getFontHeight() + ITEM_GAP_SPACE / 2);
Stats::GetPlayerStats(playerFlagName,
&playerKills,
@@ -248,6 +249,9 @@
} // ** switch
+ // XXX hardcoded for now
+ int CHAR_XPIX = 8;
+
// Add player flag name.
sprintf(strBuf, "%-30s", playerName);
clientArea.bltString(offset.x, offset.y, strBuf, color);
Index: netpanzer/src/NetPanzer/Views/MainMenu/MainMenuView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/MainMenuView.cpp:1.9
netpanzer/src/NetPanzer/Views/MainMenu/MainMenuView.cpp:1.10
--- netpanzer/src/NetPanzer/Views/MainMenu/MainMenuView.cpp:1.9 Sun Sep 21
14:29:33 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/MainMenuView.cpp Fri Oct 3
10:45:16 2003
@@ -19,8 +19,6 @@
#include "MainMenuView.hpp"
#include "Desktop.hpp"
-#include "DDHardSurface.hpp"
-#include "FontSystem2D.hpp"
#include "GameManager.hpp"
#include "GameViewGlobals.hpp"
Index: netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp:1.16
netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp:1.17
--- netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp:1.16 Tue Sep
23 21:26:19 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/MenuTemplateView.cpp Fri Oct 3
10:45:16 2003
@@ -25,15 +25,13 @@
#include "Sound.hpp"
#include "cMouse.hpp"
#include "ViewGlobals.hpp"
-#include "DDHardSurface.hpp"
-#include "FontSystem2D.hpp"
#include "RadarPingParticle2D.hpp"
+#include "ScreenSurface.hpp"
#include "Particle2D.hpp"
#include "ParticleSystem2D.hpp"
#include "PackedSurface.hpp"
#include "UtilInterface.hpp"
#include "GameManager.hpp"
-#include "UILib/UIDraw.hpp"
#include "Exception.hpp"
#include "GameViewGlobals.hpp"
@@ -223,9 +221,9 @@
} else {
// When in mainmenu, make background dark and draw menu image
- if(Screen->getWidth() > 640 ||
- Screen->getHeight() > 480)
- screen.fillRect(0, 0, Screen->getWidth(), Screen->getHeight(),
+ if(screen->getPixX() > 640 ||
+ screen->getPixY() > 480)
+ screen->fillRect(0, 0, screen->getPixX(), screen->getPixY(),
Color::black);
// Set the following to get does exist.
@@ -314,7 +312,6 @@
//---------------------------------------------------------------------------
void MenuTemplateView::doDeactivate()
{
- FontSystem2D::removeAll();
} // end doDeactivate
//---------------------------------------------------------------------------
@@ -325,6 +322,5 @@
//---------------------------------------------------------------------------
void MenuTemplateView::processEvents()
{
- centerAbsolute();
} // end MenuTemplateView::processEvents
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.12
netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.13
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp:1.12
Tue Sep 16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/FlagSelectionView.cpp Fri Oct
3 10:45:18 2003
@@ -106,7 +106,8 @@
char strBuf[256];
sprintf(strBuf, "Current:");
- clientArea.bltStringShadowed(BORDER_SPACE, BORDER_SPACE +
(playerFlag.getPixY() - CHAR_YPIX) / 2, strBuf, windowTextColor,
windowTextColorShadow);
+ int CHAR_XPIX = 8; // XXX hardcoded
+ clientArea.bltStringShadowed(BORDER_SPACE, BORDER_SPACE +
(playerFlag.getPixY() - Surface::getFontHeight()) / 2, strBuf, windowTextColor,
windowTextColorShadow);
playerFlag.setFrame(playerFlagSelected);
playerFlag.blt(clientArea, BORDER_SPACE + strlen(strBuf) * CHAR_XPIX +
BORDER_SPACE, BORDER_SPACE);
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp:1.7
netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp:1.7
Mon Sep 22 09:53:54 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/GetSessionHostView.cpp Fri Oct
3 10:45:18 2003
@@ -69,7 +69,7 @@
//add(scrollBar);
- maxViewableItems = getClientRect().getSizeY() / (TEXT_GAP_SPACE +
CHAR_YPIX) - 1;
+ maxViewableItems = getClientRect().getSizeY() / (TEXT_GAP_SPACE +
Surface::getFontHeight()) - 1;
topViewableItem = 0;
//iXY size(20, 20);
@@ -127,7 +127,7 @@
int curIndex = 0;
int color;
- Surface tempSurface( getClientRect().getSizeX() - 2, (TEXT_GAP_SPACE +
CHAR_YPIX), getClientRect().getSizeX() - 2, 1 );
+ Surface tempSurface( getClientRect().getSizeX() - 2, (TEXT_GAP_SPACE +
Surface::getFontHeight()), getClientRect().getSizeX() - 2, 1 );
tempSurface.fill(Color::darkGreen);
sprintf( host_info_str, "%-24s %-24s %-12s %10s", "Host",
@@ -156,7 +156,7 @@
color = Color::green;
}
- dest.bltString(4, 6 + curIndex * (TEXT_GAP_SPACE + CHAR_YPIX),
host_info_str, color);
+ dest.bltString(4, 6 + curIndex * (TEXT_GAP_SPACE +
Surface::getFontHeight()), host_info_str, color);
curIndex++;
}
@@ -290,9 +290,9 @@
iXY tempPos;
tempPos.x = 4;
- tempPos.y = 6 + curIndex * (TEXT_GAP_SPACE + CHAR_YPIX) +
(TEXT_GAP_SPACE + CHAR_YPIX);
+ tempPos.y = 6 + curIndex * (TEXT_GAP_SPACE + Surface::getFontHeight())
+ (TEXT_GAP_SPACE + Surface::getFontHeight());
- iRect r(tempPos.x, tempPos.y, tempPos.x + length, tempPos.y +
TEXT_GAP_SPACE + CHAR_YPIX);
+ iRect r(tempPos.x, tempPos.y, tempPos.x + length, tempPos.y +
TEXT_GAP_SPACE + Surface::getFontHeight());
if (r.contains(pos)) {
highlightedItem = i;
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp
diff -u
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp:1.12
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp:1.13
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp:1.12
Tue Sep 23 21:26:19 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.cpp
Fri Oct 3 10:45:18 2003
@@ -23,8 +23,6 @@
#include "HostJoinTemplateView.hpp"
#include "GameConfig.hpp"
#include "GameManager.hpp"
-#include "DDHardSurface.hpp"
-#include "FontSystem2D.hpp"
#include "HostView.hpp"
#include "Exception.hpp"
#include "MapSelectionView.hpp"
@@ -123,9 +121,6 @@
MenuTemplateView::backgroundSurface.free();
//MenuTemplateView::titleSurface.free();
- // Make sure no views were left in weird places from a previous game.
- Desktop::checkViewPositions();
-
GameManager::launchNetPanzerGame();
}
/*
@@ -461,7 +456,7 @@
int x = pos.x;
sprintf(strBuf, "Player Name");
- dest.bltString(x, pos.y + (playerColor.getPix().y - CHAR_YPIX) / 2,
strBuf, Color::white);
+ dest.bltString(x, pos.y + (playerColor.getPix().y -
Surface::getFontHeight()) / 2, strBuf, Color::white);
//x = 236;
//playerColor.blt(clientArea, x, pos.y);
@@ -471,7 +466,7 @@
x = 342;
sprintf(strBuf, "Status");
- dest.bltString(x, pos.y + (playerColor.getPix().y - CHAR_YPIX) / 2,
strBuf, Color::white);
+ dest.bltString(x, pos.y + (playerColor.getPix().y -
Surface::getFontHeight()) / 2, strBuf, Color::white);
} // end drawPlayerInfo
@@ -499,53 +494,6 @@
sprintf(currentMultiView, searchName);
} // end doActivate
-
-void HostJoinTemplateView::drawMapInfo(const Surface &dest, const iXY &pos)
-{
- // Draw the dimmed background.
- iXY size(300, 115);
- iRect mapBorder(pos.x, pos.y, SCREEN_XPIX - 30, pos.y + size.y);
- dest.bltLookup(mapBorder, Palette::darkGray256.getColorArray());
- dest.drawButtonBorder(mapBorder, Color::lightGreen, Color::darkGreen);
-
- // Draw the text.
- char strBuf[256];
- const PIX color = Color::lightGreen;
- int x = 340;
- int y = pos.y + 10;
-
- const int yOffset = 15;
-
- sprintf(strBuf, "MAP INFORMATION");
- //dest.bltString(x, y, strBuf, color);
- dest.bltStringVGradient(x, y, strBuf, Palette::gradientWhite2Green);
- y += yOffset;
-
- sprintf(strBuf, " Name");
- dest.bltString(x, y, strBuf, color);
- y += yOffset;
-
- sprintf(strBuf, " Size");
- dest.bltString(x, y, strBuf, color);
- y += yOffset;
- /*
- sprintf(strBuf, " Bases");
- dest.bltString(x, y, strBuf, color);
- y += yOffset;
-
- sprintf(strBuf, " Factories");
- dest.bltString(x, y, strBuf, color);
- y += yOffset;
-
- sprintf(strBuf, " Spawn Locations");
- dest.bltString(x, y, strBuf, color);
- y += yOffset;
-
- sprintf(strBuf, " Temperment");
- dest.bltString(x, y, strBuf, color);
- y += yOffset;
- */
-} // end HostView::drawMapInfo
// loadBackgroundSurface
//---------------------------------------------------------------------------
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.hpp
diff -u
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.hpp:1.2
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.hpp:1.3
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.hpp:1.2
Tue Sep 16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostJoinTemplateView.hpp
Fri Oct 3 10:45:18 2003
@@ -43,7 +43,6 @@
void drawVehicleInfo(const Surface &dest, const iXY &pos);
void drawFlagInfo(const Surface &dest, const iXY &pos);
void drawPlayerInfo(const Surface &dest, const iXY &pos);
- void drawMapInfo(const Surface &dest, const iXY &pos);
void drawNameInfo(const Surface &clientArea, const iXY &pos);
virtual void loadBackgroundSurface();
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp:1.6
netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp:1.7
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp:1.6
Tue Sep 23 19:43:18 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/HostOptionsView.cpp Fri Oct
3 10:45:18 2003
@@ -268,7 +268,7 @@
iXY pos;
pos.x = 4;
- pos.y = clientArea.getPixY() - CHAR_YPIX;
+ pos.y = clientArea.getPixY() - Surface::getFontHeight();
clientArea.bltString(pos, "Note: Use the right mouse button to accomplish
fast mouse clicking.", Color::white);
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/PlayerNameView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/PlayerNameView.cpp:1.4
netpanzer/src/NetPanzer/Views/MainMenu/Multi/PlayerNameView.cpp:1.5
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/PlayerNameView.cpp:1.4 Tue Sep
16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/PlayerNameView.cpp Fri Oct
3 10:45:18 2003
@@ -39,7 +39,8 @@
// The plus 8 for x and 4 for y are what I put in input field. Add
function to find out,
// inpit field dimension.
- resizeClientArea(INPUT_FIELD_CHARACTERS * CHAR_XPIX + 8 + BORDER_SPACE *
2, CHAR_YPIX + 4 + BORDER_SPACE * 2);
+ int CHAR_XPIX = 8; // XXX hardcoded :-/
+ resizeClientArea(INPUT_FIELD_CHARACTERS * CHAR_XPIX + 8 + BORDER_SPACE *
2, Surface::getFontHeight() + 4 + BORDER_SPACE * 2);
init();
Index: netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp:1.8
netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp:1.9
--- netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp:1.8 Mon Sep
22 09:53:54 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Multi/UnitColorView.cpp Fri Oct
3 10:45:18 2003
@@ -132,7 +132,7 @@
char strBuf[256];
sprintf(strBuf, "%1.3f of %1.3f", grayPercent, maxPercent);
- clientArea.bltString(2, fuckingSurface.getPixY() - CHAR_YPIX - 1, strBuf,
Color::white);
+ clientArea.bltString(2, fuckingSurface.getPixY() -
Surface::getFontHeight() - 1, strBuf, Color::white);
View::doDraw(viewArea, clientArea);
Index: netpanzer/src/NetPanzer/Views/MainMenu/Options/ControlsView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Options/ControlsView.cpp:1.7
netpanzer/src/NetPanzer/Views/MainMenu/Options/ControlsView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/MainMenu/Options/ControlsView.cpp:1.7 Tue Sep
16 16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Options/ControlsView.cpp Fri Oct
3 10:45:19 2003
@@ -15,41 +15,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
#include <config.h>
+
#include "ControlsView.hpp"
#include "Desktop.hpp"
-#include "DDHardSurface.hpp"
#include "GameConfig.hpp"
#include "GameViewGlobals.hpp"
-
-
-//static char screenSurfacePathTIL[] = "pics/backgrounds/menus/optionmb.til";
-
-// never used
-#if 0
-static void bSetupJoystick()
-{
- JoystickInterface::setupJoystick();
-}
-
-static const char *getJoystickState()
-{
- return GameConfig::getJoystickStateString();
-}
-
-static void bSetJoystickStateOn()
-{
- GameConfig::setJoystickState(true);
-}
-
-static void bSetJoystickStateOff()
-{
- GameConfig::setJoystickState(false);
-}
-#endif
-
// ControlsView
//---------------------------------------------------------------------------
Index: netpanzer/src/NetPanzer/Views/MainMenu/Options/VisualsView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/Options/VisualsView.cpp:1.9
netpanzer/src/NetPanzer/Views/MainMenu/Options/VisualsView.cpp:1.10
--- netpanzer/src/NetPanzer/Views/MainMenu/Options/VisualsView.cpp:1.9 Tue Sep
23 15:18:54 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/Options/VisualsView.cpp Fri Oct
3 10:45:19 2003
@@ -44,7 +44,7 @@
// Settings
//----------------------------------------------------------------------
- int minWidth = 19 * CHAR_XPIX;
+ int minWidth = 19 * 8;
x = xTextStart + 10;
y = 100;
Index: netpanzer/src/NetPanzer/Views/MainMenu/OptionsTemplateView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/OptionsTemplateView.cpp:1.8
netpanzer/src/NetPanzer/Views/MainMenu/OptionsTemplateView.cpp:1.9
--- netpanzer/src/NetPanzer/Views/MainMenu/OptionsTemplateView.cpp:1.8 Tue Sep
23 19:43:18 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/OptionsTemplateView.cpp Fri Oct
3 10:45:17 2003
@@ -19,7 +19,6 @@
#include "OptionsTemplateView.hpp"
#include "Desktop.hpp"
-#include "DDHardSurface.hpp"
#include "GameViewGlobals.hpp"
static void bInterface()
Index: netpanzer/src/NetPanzer/Views/MainMenu/OrderingView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/OrderingView.cpp:1.6
netpanzer/src/NetPanzer/Views/MainMenu/OrderingView.cpp:1.7
--- netpanzer/src/NetPanzer/Views/MainMenu/OrderingView.cpp:1.6 Tue Sep 16
16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/OrderingView.cpp Fri Oct 3
10:45:17 2003
@@ -15,17 +15,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
#include <config.h>
+
#include "OrderingView.hpp"
#include "Desktop.hpp"
-#include "DDHardSurface.hpp"
#include "GameViewGlobals.hpp"
-
-
-// static char screenSurfacePathTIL[] = "pics/backgrounds/menus/ordermb.til";
-
// OrderingView
//---------------------------------------------------------------------------
Index: netpanzer/src/NetPanzer/Views/MainMenu/SkirmishView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/SkirmishView.cpp:1.5
netpanzer/src/NetPanzer/Views/MainMenu/SkirmishView.cpp:1.6
--- netpanzer/src/NetPanzer/Views/MainMenu/SkirmishView.cpp:1.5 Tue Sep 16
16:16:13 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/SkirmishView.cpp Fri Oct 3
10:45:17 2003
@@ -15,14 +15,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-
#include <config.h>
+
#include "SkirmishView.hpp"
#include "Desktop.hpp"
-#include "DDHardSurface.hpp"
#include "GameViewGlobals.hpp"
-
// SkirmishView
//---------------------------------------------------------------------------
Index: netpanzer/src/NetPanzer/Views/MainMenu/SpecialButtonView.cpp
diff -u netpanzer/src/NetPanzer/Views/MainMenu/SpecialButtonView.cpp:1.7
netpanzer/src/NetPanzer/Views/MainMenu/SpecialButtonView.cpp:1.8
--- netpanzer/src/NetPanzer/Views/MainMenu/SpecialButtonView.cpp:1.7 Tue Sep
23 21:26:19 2003
+++ netpanzer/src/NetPanzer/Views/MainMenu/SpecialButtonView.cpp Fri Oct
3 10:45:17 2003
@@ -133,6 +133,4 @@
//--------------------------------------------------------------------------
void SpecialButtonView::doActivate()
{
- centerAbsolute();
-
} // end SpecialButtonView::doActivate
Index: netpanzer/src/UILib/SDL/SDLDraw.cpp
diff -u netpanzer/src/UILib/SDL/SDLDraw.cpp:1.14
netpanzer/src/UILib/SDL/SDLDraw.cpp:1.15
--- netpanzer/src/UILib/SDL/SDLDraw.cpp:1.14 Tue Sep 16 16:16:13 2003
+++ netpanzer/src/UILib/SDL/SDLDraw.cpp Fri Oct 3 10:45:20 2003
@@ -16,13 +16,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <config.h>
+#include "Exception.hpp"
#include "SDLDraw.hpp"
SDLDraw::SDLDraw()
: FrontBuffer(0)
{
SDL_InitSubSystem(SDL_INIT_VIDEO);
- // XXX SDL contains a bug, that makes it loose the unicode state :-/
+ // XXX unfortunately SDL initializes the keyboard again :-/
SDL_EnableUNICODE(1);
}
@@ -31,14 +32,15 @@
SDL_QuitSubSystem(SDL_INIT_VIDEO);
}
-bool SDLDraw::setVideoMode(DWORD width, DWORD height, DWORD bpp, bool
fullscreen)
+void SDLDraw::setVideoMode(int width, int height, int bpp, bool fullscreen)
{
Uint32 flags = 0;
flags |= fullscreen ? SDL_FULLSCREEN : 0;
flags |= SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE;
FrontBuffer = SDL_SetVideoMode(width, height, bpp, flags);
- if(FrontBuffer==NULL)
- return false;
+ if(!FrontBuffer)
+ throw Exception("Couldn't set display mode (%dx%d:%d, %d)",
+ width, height, bpp, flags);
curWidth = width;
curHeight = height;
@@ -47,51 +49,40 @@
// let's scare the mouse :)
SDL_ShowCursor(SDL_DISABLE);
// and set a window title
- SDL_WM_SetCaption("NetPanzer - Linux Port", 0);
-
- return true;
+ SDL_WM_SetCaption("NetPanzer", 0);
}
-bool SDLDraw::isDisplayModeAvailable(int width, int height, int bpp)
+bool SDLDraw::isDisplayModeAvailable(int width, int height, int bpp,
+ bool fullscreen)
{
- if(SDL_VideoModeOK(width, height, bpp, 0 /*SDL_FULLSCREEN | SDL_DOUBLEBUF
| SDL_HWSURFACE*/))
- return true;
+ Uint32 flags = fullscreen ? SDL_FULLSCREEN : 0;
+ flags |= SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWPALETTE;
- return false;
+ return SDL_VideoModeOK(width, height, bpp, flags);
}
-bool SDLDraw::lockDoubleBuffer(BYTE **DoubleBuffer)
+void SDLDraw::lockDoubleBuffer(unsigned char **DoubleBuffer)
{
- if(SDL_LockSurface(FrontBuffer)<0)
- return false;
+ if(SDL_MUSTLOCK(FrontBuffer) && !SDL_LockSurface(FrontBuffer))
+ throw Exception("Couldn't lock display buffer");
*DoubleBuffer = (unsigned char *)FrontBuffer->pixels;
-
- return true;
}
-bool SDLDraw::unlockDoubleBuffer()
+void SDLDraw::unlockDoubleBuffer()
{
- SDL_LockSurface(FrontBuffer);
- return true;
+ if(SDL_MUSTLOCK(FrontBuffer))
+ SDL_UnlockSurface(FrontBuffer);
}
-bool SDLDraw::createFrameBuffer(DWORD width, DWORD height, DWORD bpp)
-{
- return true;
-}
-
-void SDLDraw::setGDIStatus(bool enable)
-{}
-
-void SDLDraw::restoreAll()
-{}
-
-bool SDLDraw::copyDoubleBufferandFlip()
+void SDLDraw::copyDoubleBufferandFlip()
{
- if(SDL_Flip(FrontBuffer)==0)
- return true;
- return false;
+ if(FrontBuffer->flags & SDL_DOUBLEBUF) {
+ if (!SDL_Flip(FrontBuffer))
+ throw Exception("Error while swapping double buffer");
+ } else {
+ SDL_UpdateRect(FrontBuffer, 0, 0, 0, 0);
+ }
}
void SDLDraw::setPalette(RGBColor *color)
Index: netpanzer/src/UILib/SDL/SDLDraw.hpp
diff -u netpanzer/src/UILib/SDL/SDLDraw.hpp:1.6
netpanzer/src/UILib/SDL/SDLDraw.hpp:1.7
--- netpanzer/src/UILib/SDL/SDLDraw.hpp:1.6 Tue Sep 16 16:16:13 2003
+++ netpanzer/src/UILib/SDL/SDLDraw.hpp Fri Oct 3 10:45:21 2003
@@ -20,7 +20,6 @@
#include <SDL.h>
-#include "RGBColor.hpp"
#include "UIDraw.hpp"
// DirectDraw class declarations
@@ -34,17 +33,14 @@
SDLDraw();
virtual ~SDLDraw();
- bool setVideoMode(DWORD width, DWORD height, DWORD bpp, bool fullscreen);
- bool isDisplayModeAvailable(int width, int height, int bpp);
- bool lockDoubleBuffer(BYTE **DoubleBuffer);
- bool unlockDoubleBuffer();
- bool createFrameBuffer(DWORD width, DWORD height, DWORD bpp);
- void setGDIStatus(bool enable);
- void restoreAll();
- bool copyDoubleBufferandFlip();
+ void setVideoMode(int width, int height, int bpp, bool fullscreen);
+ bool isDisplayModeAvailable(int width, int height, int bpp, bool
fullscreen);
+ void lockDoubleBuffer(unsigned char **DoubleBuffer);
+ void unlockDoubleBuffer();
+ void copyDoubleBufferandFlip();
void setPalette(RGBColor *color);
- virtual bool isFullScreen() const;
+ bool isFullScreen() const;
}
; // end DirectDraw
Index: netpanzer/src/UILib/UIDraw.hpp
diff -u netpanzer/src/UILib/UIDraw.hpp:1.11 netpanzer/src/UILib/UIDraw.hpp:1.12
--- netpanzer/src/UILib/UIDraw.hpp:1.11 Tue Sep 16 16:16:13 2003
+++ netpanzer/src/UILib/UIDraw.hpp Fri Oct 3 10:45:20 2003
@@ -32,14 +32,13 @@
virtual ~UIDraw()
{ }
- virtual bool setVideoMode(DWORD width, DWORD height, DWORD bpp, bool
fullscreen) = 0;
- virtual bool isDisplayModeAvailable(int width, int height, int bpp) = 0;
- virtual bool lockDoubleBuffer(unsigned char **DoubleBuffer) = 0;
- virtual bool unlockDoubleBuffer() = 0;
- virtual bool createFrameBuffer(DWORD width, DWORD height, DWORD bpp) = 0;
- virtual void setGDIStatus(bool enable) = 0;
- virtual void restoreAll()=0;
- virtual bool copyDoubleBufferandFlip()=0;
+ virtual void setVideoMode(int width, int height, int bpp,
+ bool fullscreen) = 0;
+ virtual bool isDisplayModeAvailable(int width, int height, int bpp,
+ bool fullscreen) = 0;
+ virtual void lockDoubleBuffer(unsigned char **DoubleBuffer) = 0;
+ virtual void unlockDoubleBuffer() = 0;
+ virtual void copyDoubleBufferandFlip()=0;
virtual void setPalette(RGBColor *color)=0;
virtual bool isFullScreen() const = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [netPanzer-CVS] netpanzer ./ChangeLog src/Lib/cMouse.cpp src/Li...,
Matthias Braun <=