Remove some deprecated Qt2 stuff.

TQArray vs TQMemArray.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
pull/1/head
gregory guy 2 years ago
parent a451e44f4a
commit a212e6154c
No known key found for this signature in database
GPG Key ID: 3BCCA0F7AB4536F4
  1. 4
      CMakeLists.txt
  2. 2
      kpacman/bitfont.cpp
  3. 8
      kpacman/board.cpp
  4. 4
      kpacman/board.h
  5. 6
      kpacman/kpacman.h
  6. 2
      kpacman/kpacmanview.cpp
  7. 8
      kpacman/painter.cpp
  8. 8
      kpacman/painter.h
  9. 6
      kpacman/referee.cpp
  10. 40
      kpacman/referee.h
  11. 2
      kpacman/score.cpp
  12. 2
      kpacman/status.cpp
  13. 6
      kpacman/status.h

@ -57,9 +57,9 @@ option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
include( ConfigureChecks.cmake )
###### global compiler settings (Qt2 stuff: TQArray vs TQMemArray -- qmemarray.h)
###### global compiler settings
add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST -UTQT_NO_COMPAT )
add_definitions( -DHAVE_CONFIG_H -UTQT_NO_ASCII_CAST )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )

@ -26,7 +26,7 @@ TQPixmap Bitfont::text(TQString str, TQColor fg, TQColor bg)
TQPixmap FG(str.length()*fontWidth, fontHeight);
TQBitmap MASK(str.length()*fontWidth, fontHeight, TRUE);
const uchar *s = (const uchar *) str.data();
const uchar *s = (const uchar *) str.local8Bit().data();
for (uint i = 0; i < str.length(); i++) {
if (font.width() == font.height())
bitBlt(&MASK, i*fontWidth, 0, &font,

@ -11,7 +11,7 @@
#include "board.h"
#include "bitmaps.h"
Board::Board(int size) : TQArray<int> (size)
Board::Board(int size) : TQMemArray<int> (size)
{
sz = size; // set size of board
@ -58,7 +58,7 @@ void Board::init(Image image, TQString levelName)
"or could not be opened for reading.");
msg.replace(TQRegExp("@LEVELNAME@"), levelName);
// TQMessageBox::information(0, i18n("Initialization Error"), msg);
printf("%s\n", msg.data());
printf("%s\n", msg.local8Bit());
} else {
map.fill(' ', BoardHeight*BoardWidth);
int height = 0;
@ -75,7 +75,7 @@ void Board::init(Image image, TQString levelName)
map.replace(height*BoardWidth,
(line.length() > BoardWidth) ? BoardWidth : line.length(),
line.data());
line.local8Bit());
height++;
}
@ -93,7 +93,7 @@ void Board::init(Image image, TQString levelName)
break;
case Level : setup(demo_bits);
break;
case File : setup((uchar *) map.data());
case File : setup((uchar *) map.local8Bit().data());
break;
default : break;
}

@ -1,7 +1,7 @@
#ifndef BOARD_H
#define BOARD_H
#include <tqarray.h>
#include <tqmemarray.h>
#include <tqstring.h>
#include <tqptrlist.h>
#include <tqrect.h>
@ -37,7 +37,7 @@ enum Image { None, Intro, Demo, Level, File };
#define pacmanBit 0x0040
#define monsterBit 0x0100
class Board : public TQArray<int>
class Board : public TQMemArray<int>
{
public:
Board (int size);

@ -173,10 +173,10 @@ class KpacmanApp : public TDEMainWindow
TQPtrList<TDEPopupMenu> *schemesPopup; // submenus for selecting scheme
// ID's of the menuitem(s) for finding/selecting scheme by id
TQArray<int> modeID;
TQArray<int> schemeID;
TQMemArray<int> modeID;
TQMemArray<int> schemeID;
TQArray<int> schemeMode; // mode(group) of the schemes, -1 if no group
TQMemArray<int> schemeMode; // mode(group) of the schemes, -1 if no group
bool highscoresChecked; // highscores display active
bool focusedPause; // Pause caused by focusEvents

@ -120,7 +120,7 @@ void KpacmanView::confScheme()
"or is of an unknown format.");
msg.replace(TQRegExp("@FONTNAME@"), fontName);
// TQMessageBox::critical(this, i18n("Initialization Error"), msg);
printf("%s\n", msg.data());
printf("%s\n", msg.local8Bit());
}
}

@ -70,7 +70,7 @@ TQPtrList<TQPixmap> *Painter::loadPixmap(TQWidget *parent, TQString pixmapName,
"or is of an unknown format.");
msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName);
// TQMessageBox::critical(parent, i18n("Initialization Error"), msg);
printf("%s\n", msg.data());
printf("%s\n", msg.local8Bit());
return 0;
}
@ -668,7 +668,7 @@ TQString Painter::decodeHexOctString(TQString s)
return s;
}
void Painter::fillScoreString(TQStrList &list, TQArray<int> &values)
void Painter::fillScoreString(TQStrList &list, TQMemArray<int> &values)
{
if( !list.isEmpty())
list.clear();
@ -692,11 +692,11 @@ void Painter::fillScoreString(TQStrList &list, TQArray<int> &values)
s.insert(0, char (values[i] / 1000 + 0x10));
}
list.append(s.data());
list.append(s.local8Bit());
}
}
void Painter::fillArray(TQArray<int> &array, TQString values, int max)
void Painter::fillArray(TQMemArray<int> &array, TQString values, int max)
{
array.resize(max);
int last = 0;

@ -53,8 +53,8 @@ public:
protected:
TQString decodeHexOctString(TQString str);
void fillScoreString(TQStrList &, TQArray<int> &);
void fillArray(TQArray<int> &, TQString, int);
void fillScoreString(TQStrList &, TQMemArray<int> &);
void fillArray(TQMemArray<int> &, TQString, int);
void fillStrList(TQStrList &, TQString, int);
void fillPixmapName(TQStrList &);
@ -75,9 +75,9 @@ private:
int BlockWidth;
int BlockHeight;
TQArray<int> fruitScore;
TQMemArray<int> fruitScore;
TQStrList fruitScoreString;
TQArray<int> monsterScore;
TQMemArray<int> monsterScore;
TQStrList monsterScoreString;
TQString pixmapDirectory;

@ -424,7 +424,7 @@ void Referee::initKeys()
RightKey = TDEAccel::stringToKey(right);
}
void Referee::fillArray(TQArray<int> &array, TQString values, int max)
void Referee::fillArray(TQMemArray<int> &array, TQString values, int max)
{
if (max < 0)
max = values.contains(',')+1;
@ -901,10 +901,10 @@ void Referee::introPaint(int t)
case 12 : repaint(pix->draw(38, 28, RoomPix, i18n("\"CLYDE\""), ORANGE, TQColor(), AlignLeft), FALSE);
break;
case 13 : pts.sprintf("%d", pointScore);
repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, TQColor(), AlignRight), FALSE);
repaint(pix->draw(28, 44, RoomPix, pts.local8Bit(), WHITE, TQColor(), AlignRight), FALSE);
repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE);
pts.sprintf("%d", energizerScore);
repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, TQColor(), AlignRight), FALSE);
repaint(pix->draw(28, 48, RoomPix, pts.local8Bit(), WHITE, TQColor(), AlignRight), FALSE);
repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE);
break;
case 14 : // "@ 1980 MIDWAY MFG.CO."

@ -80,7 +80,7 @@ protected:
void focusOutEvent(TQFocusEvent *);
void focusInEvent(TQFocusEvent *);
void fillArray(TQArray<int> &, TQString, int);
void fillArray(TQMemArray<int> &, TQString, int);
void fillStrList(TQStrList &, TQString, int);
void fillMapName();
@ -102,22 +102,22 @@ private:
TQString mapDirectory;
TQStrList mapName;
TQArray<int> speed;
TQArray<int> monsterIQ;
TQArray<int> fruitIQ;
TQArray<int> fruitIndex;
TQArray<int> pacmanTicks;
TQArray<int> remTicks;
TQArray<int> dangerousTicks;
TQArray<int> harmlessTicks;
TQArray<int> harmlessDurTicks;
TQArray<int> harmlessWarnTicks;
TQArray<int> arrestTicks;
TQArray<int> arrestDurTicks;
TQArray<int> fruitTicks;
TQArray<int> fruitAppearsTicks;
TQArray<int> fruitDurTicks;
TQArray<int> fruitScoreDurTicks;
TQMemArray<int> speed;
TQMemArray<int> monsterIQ;
TQMemArray<int> fruitIQ;
TQMemArray<int> fruitIndex;
TQMemArray<int> pacmanTicks;
TQMemArray<int> remTicks;
TQMemArray<int> dangerousTicks;
TQMemArray<int> harmlessTicks;
TQMemArray<int> harmlessDurTicks;
TQMemArray<int> harmlessWarnTicks;
TQMemArray<int> arrestTicks;
TQMemArray<int> arrestDurTicks;
TQMemArray<int> fruitTicks;
TQMemArray<int> fruitAppearsTicks;
TQMemArray<int> fruitDurTicks;
TQMemArray<int> fruitScoreDurTicks;
int monsterScoreDurMS;
int playerDurMS;
@ -135,9 +135,9 @@ private:
int pointScore;
int energizerScore;
TQArray<int> fruitScore;
TQArray<int> monsterScore;
TQArray<int> extraLifeScore;
TQMemArray<int> fruitScore;
TQMemArray<int> monsterScore;
TQMemArray<int> extraLifeScore;
int extraLifeScoreIndex;
int nextExtraLifeScore;

@ -128,7 +128,7 @@ void Score::paintEvent( TQPaintEvent *e)
for (int i = 0; i < 10; i++) {
s.sprintf("%2d%9d %-3.3s %-8.8s",
i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(),
formatDate(hallOfFame[i].moment.date()).data());
formatDate(hallOfFame[i].moment.date()).utf8());
if (rect(1, (11+i)*1.25, s).intersects(e->rect())) {
TQPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK);
bitBlt(this, x(1), y((11+i)*1.25), &pix);

@ -136,7 +136,7 @@ TQString Status::decodeHexOctString(TQString s)
return s;
}
void Status::fillArray(TQArray<int> &array, TQString values, int max)
void Status::fillArray(TQMemArray<int> &array, TQString values, int max)
{
array.resize(max);
int last = 0;

@ -11,7 +11,7 @@
#include <tqwidget.h>
#include <tqpixmap.h>
#include <tqstring.h>
#include <tqarray.h>
#include <tqmemarray.h>
#include <tqptrlist.h>
#include <tqstrlist.h>
#include <tqregexp.h>
@ -35,7 +35,7 @@ protected:
TQString decodeHexOctString(TQString str);
void fillArray(TQArray<int> &, TQString, int);
void fillArray(TQMemArray<int> &, TQString, int);
void fillStrList(TQStrList &, TQString, int);
void fillPixmapName(TQStrList &);
@ -46,7 +46,7 @@ protected:
void initPixmaps();
private:
TQArray<int> levelPos;
TQMemArray<int> levelPos;
int actualLifes;
int actualLevel;

Loading…
Cancel
Save