rpms/chess/devel chess-ogre12+gcc41+fixes.patch, NONE, 1.1 chess.desktop, NONE, 1.1 chess.png, NONE, 1.1 chess.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
Hans de Goede (jwrdegoede)
fedora-extras-commits at redhat.com
Sun Jul 9 08:23:58 UTC 2006
Author: jwrdegoede
Update of /cvs/extras/rpms/chess/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22287/devel
Modified Files:
.cvsignore sources
Added Files:
chess-ogre12+gcc41+fixes.patch chess.desktop chess.png
chess.spec
Log Message:
auto-import chess-1.0-1 on branch devel from chess-1.0-1.src.rpm
chess-ogre12+gcc41+fixes.patch:
--- NEW FILE chess-ogre12+gcc41+fixes.patch ---
diff -urN chess.orig/Makefile chess/Makefile
--- chess.orig/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ chess/Makefile 2006-06-26 16:13:43.000000000 +0200
@@ -0,0 +1,46 @@
+PREFIX = /home/opt
+DATADIR = $(PREFIX)/share/$(TARGET)
+OPTFLAGS= -g -Wall -O2
+CFLAGS = $(OPTFLAGS) -Iinclude $(shell pkg-config --cflags OGRE) \
+ -I/usr/include/coldet
+CXXFLAGS= $(CFLAGS)
+LDFLAGS = $(shell pkg-config --libs OGRE) \
+ $(shell pkg-config --libs CEGUI-OGRE) -lcoldet -lboost_thread
+
+DEFINES = -DDATADIR=\"$(DATADIR)/\"
+OBJS = src/AISearchAgent.o src/AISearchAgentAlphabeta.o \
+ src/AISearchAgentMTDF.o src/AnimationBlender.o src/Application.o \
+ src/Board.o src/BoardEvaluator.o src/CPUvCPUState.o \
+ src/CaptureState.o src/Chess.o src/ChessApplication.o \
+ src/ChessState.o src/Collider.o src/CollisionEntity.o \
+ src/CollisionManager.o src/ColourState.o src/GameAI.o \
+ src/GameMenuState.o src/GameOGRE.o src/GameOverState.o \
+ src/GameState.o src/Hand.o src/HandState.o src/HelpState.o \
+ src/HistoryTable.o src/InputManager.o src/MainMenuState.o \
+ src/MenuState.o src/Move.o src/MoveListGenerator.o \
+ src/MovePieceState.o src/OptionState.o src/PickupState.o src/Piece.o \
+ src/Player.o src/PlayerAI.o src/PlayerHuman.o src/unixutils.o \
+ src/PromotionMenuState.o src/PromotionState.o src/PvCPUState.o \
+ src/PvPState.o src/RemoveState.o src/ReturnState.o src/State.o \
+ src/StateManager.o src/StaticState.o src/TranspositionTable.o
+TARGET = chess
+
+$(TARGET): $(OBJS)
+ $(CXX) $(LDFLAGS) -o $@ $^
+
+%.o: %.c
+ $(CC) $(CFLAGS) $(DEFINES) -o $@ -c $<
+
+%.o: %.cpp
+ $(CXX) $(CXXFLAGS) $(DEFINES) -o $@ -c $<
+
+install: $(TARGET)
+ rm -fr $(DATADIR)
+ mkdir -p $(PREFIX)/bin
+ mkdir -p $(DATADIR)
+ install -p -m 755 $(TARGET) $(PREFIX)/bin
+ cp -a media $(DATADIR)
+ install -p -m 644 resources.cfg plugins.cfg $(DATADIR)
+
+clean:
+ rm -f $(OBJS) $(TARGET) `find -name '*~'` *.log
diff -urN chess.orig/include/AISearchAgent.h chess/include/AISearchAgent.h
--- chess.orig/include/AISearchAgent.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/AISearchAgent.h 2006-06-19 16:35:44.000000000 +0200
@@ -111,4 +111,4 @@
int MoveCounter;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/AISearchAgentAlphabeta.h chess/include/AISearchAgentAlphabeta.h
--- chess.orig/include/AISearchAgentAlphabeta.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/AISearchAgentAlphabeta.h 2006-06-19 16:35:44.000000000 +0200
@@ -33,4 +33,4 @@
Move PickBestMove(Board& theBoard, bool& Continue);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/AISearchAgentMTDF.h chess/include/AISearchAgentMTDF.h
--- chess.orig/include/AISearchAgentMTDF.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/AISearchAgentMTDF.h 2006-06-19 16:35:44.000000000 +0200
@@ -57,4 +57,4 @@
Move UnrolledAlphabeta(Board& theBoard, int depth, int alpha, int beta, bool& Continue);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/AnimationBlender.h chess/include/AnimationBlender.h
--- chess.orig/include/AnimationBlender.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/AnimationBlender.h 2006-06-19 16:35:44.000000000 +0200
@@ -52,4 +52,4 @@
BlendingTransition mTransition;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Application.h chess/include/Application.h
--- chess.orig/include/Application.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/Application.h 2006-06-19 16:35:44.000000000 +0200
@@ -53,4 +53,4 @@
CEGUI::System *mGUISystem;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Board.h chess/include/Board.h
--- chess.orig/include/Board.h 2005-05-12 11:19:00.000000000 +0200
+++ chess/include/Board.h 2006-06-19 16:35:44.000000000 +0200
@@ -214,4 +214,4 @@
bool SetCurrentPlayer(int which);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/BoardEvaluator.h chess/include/BoardEvaluator.h
--- chess.orig/include/BoardEvaluator.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/BoardEvaluator.h 2006-06-19 16:35:44.000000000 +0200
@@ -89,4 +89,4 @@
static const int Grain = 3;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/CPUvCPUState.h chess/include/CPUvCPUState.h
--- chess.orig/include/CPUvCPUState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/CPUvCPUState.h 2006-06-19 16:35:44.000000000 +0200
@@ -27,4 +27,4 @@
virtual void initialize();
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/CaptureState.h chess/include/CaptureState.h
--- chess.orig/include/CaptureState.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/CaptureState.h 2006-06-19 16:35:44.000000000 +0200
@@ -36,4 +36,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/ChessApplication.h chess/include/ChessApplication.h
--- chess.orig/include/ChessApplication.h 2005-05-12 11:34:06.000000000 +0200
+++ chess/include/ChessApplication.h 2006-06-19 16:35:44.000000000 +0200
@@ -69,6 +69,7 @@
Entity *mBoard;
bool mShowDebugOverlay, mShowMessageOverlay;
int mScreenshotCounter;
+ bool mRootNodeAttached;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/ChessState.h chess/include/ChessState.h
--- chess.orig/include/ChessState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/ChessState.h 2006-06-19 16:35:44.000000000 +0200
@@ -41,4 +41,4 @@
ChessApplication* mApplication;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Collider.h chess/include/Collider.h
--- chess.orig/include/Collider.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/Collider.h 2006-06-19 16:35:44.000000000 +0200
@@ -26,4 +26,4 @@
bool collide(Ray* ray, CollisionEntity* entity);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/CollisionEntity.h chess/include/CollisionEntity.h
--- chess.orig/include/CollisionEntity.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/CollisionEntity.h 2006-06-19 16:35:44.000000000 +0200
@@ -35,4 +35,4 @@
Entity* mEntity;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/CollisionManager.h chess/include/CollisionManager.h
--- chess.orig/include/CollisionManager.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/CollisionManager.h 2006-06-19 16:35:44.000000000 +0200
@@ -37,4 +37,4 @@
Collider* mCollider;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Functions.h chess/include/Functions.h
--- chess.orig/include/Functions.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/Functions.h 2006-06-19 16:35:44.000000000 +0200
@@ -63,4 +63,4 @@
}
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/GameAI.h chess/include/GameAI.h
--- chess.orig/include/GameAI.h 2005-05-12 11:30:40.000000000 +0200
+++ chess/include/GameAI.h 2006-06-19 16:35:44.000000000 +0200
@@ -59,4 +59,4 @@
void AITurn(void);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/GameMenuState.h chess/include/GameMenuState.h
--- chess.orig/include/GameMenuState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/GameMenuState.h 2006-06-19 16:35:44.000000000 +0200
@@ -32,4 +32,4 @@
virtual void onSelected(MenuItemList::iterator item);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/GameOGRE.h chess/include/GameOGRE.h
--- chess.orig/include/GameOGRE.h 2005-05-11 17:27:46.000000000 +0200
+++ chess/include/GameOGRE.h 2006-06-19 16:35:44.000000000 +0200
@@ -48,4 +48,4 @@
bool mPaused;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/GameOverState.h chess/include/GameOverState.h
--- chess.orig/include/GameOverState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/GameOverState.h 2006-06-19 16:35:44.000000000 +0200
@@ -30,4 +30,4 @@
void DisplayResult(const String outcome, const String winner);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/GameState.h chess/include/GameState.h
--- chess.orig/include/GameState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/GameState.h 2006-06-19 16:35:44.000000000 +0200
@@ -54,4 +54,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Hand.h chess/include/Hand.h
--- chess.orig/include/Hand.h 2005-05-11 17:31:44.000000000 +0200
+++ chess/include/Hand.h 2006-06-19 16:35:44.000000000 +0200
@@ -66,4 +66,4 @@
ParticleSystem* mMagicWand;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/HandState.h chess/include/HandState.h
--- chess.orig/include/HandState.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/HandState.h 2006-06-19 16:35:44.000000000 +0200
@@ -112,4 +112,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/HelpState.h chess/include/HelpState.h
--- chess.orig/include/HelpState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/HelpState.h 2006-06-19 16:35:44.000000000 +0200
@@ -29,4 +29,4 @@
virtual void keyPressed(KeyEvent* e);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/HistoryTable.h chess/include/HistoryTable.h
--- chess.orig/include/HistoryTable.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/HistoryTable.h 2006-06-19 16:35:44.000000000 +0200
@@ -54,4 +54,4 @@
static HistoryTable theInstance;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/InputManager.h chess/include/InputManager.h
--- chess.orig/include/InputManager.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/InputManager.h 2006-06-19 16:35:44.000000000 +0200
@@ -41,4 +41,4 @@
Ogre::MovablePlane* mPlane;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/MainMenuState.h chess/include/MainMenuState.h
--- chess.orig/include/MainMenuState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/MainMenuState.h 2006-06-19 16:35:44.000000000 +0200
@@ -29,4 +29,4 @@
virtual void onSelected(MenuItemList::iterator item);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/MenuState.h chess/include/MenuState.h
--- chess.orig/include/MenuState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/MenuState.h 2006-06-19 16:35:44.000000000 +0200
@@ -44,4 +44,4 @@
virtual void onSelected(MenuItemList::iterator item) {};
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Move.h chess/include/Move.h
--- chess.orig/include/Move.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/Move.h 2006-06-19 16:35:44.000000000 +0200
@@ -84,4 +84,4 @@
bool Reset(void);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/MoveListGenerator.h chess/include/MoveListGenerator.h
--- chess.orig/include/MoveListGenerator.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/MoveListGenerator.h 2006-06-19 16:35:44.000000000 +0200
@@ -43,9 +43,12 @@
// look for a move from "source" to "dest" in the list
Move FindMoveForSquares(int source, int dest);
- // Find the next move in the list, if any
+ // Find the next move in the list
std::vector<Move>::iterator Next(void);
+ // Get the end of the list
+ std::vector<Move>::iterator End(void) { return Moves.end(); }
+
// Look at the board received as a parameter, and build a list of legal
// moves which can be derived from it. If there are no legal moves, or if
// one of the moves is a king capture (which means that the opponent's
@@ -99,4 +102,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/MovePieceState.h chess/include/MovePieceState.h
--- chess.orig/include/MovePieceState.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/MovePieceState.h 2006-06-19 16:35:44.000000000 +0200
@@ -35,4 +35,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/OptionState.h chess/include/OptionState.h
--- chess.orig/include/OptionState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/OptionState.h 2006-06-19 16:35:44.000000000 +0200
@@ -29,4 +29,4 @@
virtual void onSelected(MenuItemList::iterator item);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/PickupState.h chess/include/PickupState.h
--- chess.orig/include/PickupState.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/PickupState.h 2006-06-19 16:35:44.000000000 +0200
@@ -35,4 +35,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Piece.h chess/include/Piece.h
--- chess.orig/include/Piece.h 2005-05-11 17:29:32.000000000 +0200
+++ chess/include/Piece.h 2006-06-19 16:35:44.000000000 +0200
@@ -67,4 +67,4 @@
static Piece *mPieces[32];
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/Player.h chess/include/Player.h
--- chess.orig/include/Player.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/Player.h 2006-06-19 16:35:44.000000000 +0200
@@ -54,4 +54,4 @@
int Type;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/PlayerAI.h chess/include/PlayerAI.h
--- chess.orig/include/PlayerAI.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/PlayerAI.h 2006-06-19 16:35:44.000000000 +0200
@@ -39,4 +39,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/PlayerHuman.h chess/include/PlayerHuman.h
--- chess.orig/include/PlayerHuman.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/PlayerHuman.h 2006-06-19 16:35:44.000000000 +0200
@@ -41,4 +41,4 @@
std::vector<int> GetValidMoves(Board& theBoard, int sourcePosition);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/PromotionMenuState.h chess/include/PromotionMenuState.h
--- chess.orig/include/PromotionMenuState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/PromotionMenuState.h 2006-06-19 16:35:44.000000000 +0200
@@ -29,4 +29,4 @@
virtual void onSelected(MenuItemList::iterator item);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/PromotionState.h chess/include/PromotionState.h
--- chess.orig/include/PromotionState.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/PromotionState.h 2006-06-19 16:35:44.000000000 +0200
@@ -34,4 +34,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/PvCPUState.h chess/include/PvCPUState.h
--- chess.orig/include/PvCPUState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/PvCPUState.h 2006-06-19 16:35:44.000000000 +0200
@@ -28,4 +28,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/PvPState.h chess/include/PvPState.h
--- chess.orig/include/PvPState.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/PvPState.h 2006-06-19 16:35:44.000000000 +0200
@@ -28,4 +28,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/RemoveState.h chess/include/RemoveState.h
--- chess.orig/include/RemoveState.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/RemoveState.h 2006-06-19 16:35:44.000000000 +0200
@@ -35,4 +35,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/State.h chess/include/State.h
--- chess.orig/include/State.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/State.h 2006-06-19 16:35:44.000000000 +0200
@@ -57,4 +57,4 @@
virtual void mouseReleased(MouseEvent *e);
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/StateManager.h chess/include/StateManager.h
--- chess.orig/include/StateManager.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/StateManager.h 2006-06-19 16:35:44.000000000 +0200
@@ -74,4 +74,4 @@
Real mRepeatKeyDelay;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/StaticState.h chess/include/StaticState.h
--- chess.orig/include/StaticState.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/StaticState.h 2006-06-19 16:35:44.000000000 +0200
@@ -34,4 +34,4 @@
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/TranspositionEntry.h chess/include/TranspositionEntry.h
--- chess.orig/include/TranspositionEntry.h 2005-05-10 20:01:02.000000000 +0200
+++ chess/include/TranspositionEntry.h 2006-06-19 16:35:44.000000000 +0200
@@ -48,4 +48,4 @@
static const int NULL_ENTRY = -1;
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/TranspositionTable.h chess/include/TranspositionTable.h
--- chess.orig/include/TranspositionTable.h 2005-05-10 20:01:04.000000000 +0200
+++ chess/include/TranspositionTable.h 2006-06-19 16:35:44.000000000 +0200
@@ -50,4 +50,4 @@
TranspositionEntry Table[TABLE_SIZE];
};
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/stdafx.h chess/include/stdafx.h
--- chess.orig/include/stdafx.h 2005-05-10 20:01:06.000000000 +0200
+++ chess/include/stdafx.h 2006-06-19 16:35:44.000000000 +0200
@@ -30,7 +30,7 @@
#include <boost/bind.hpp>
#include <coldet.h>
-#include <Math3D.h>
+#include <math3d.h>
#include "OgreMemoryMacros.h"
@@ -47,4 +47,4 @@
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
-#endif
\ No newline at end of file
+#endif
diff -urN chess.orig/include/unixutils.h chess/include/unixutils.h
--- chess.orig/include/unixutils.h 1970-01-01 01:00:00.000000000 +0100
+++ chess/include/unixutils.h 2006-06-26 16:15:37.000000000 +0200
@@ -0,0 +1,17 @@
+#ifdef __unix__
+
+#include <unistd.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+char *get_homedir(void);
+int check_and_create_dir(const char *name);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -urN chess.orig/media/gui/tahoma-12.font chess/media/gui/tahoma-12.font
--- chess.orig/media/gui/tahoma-12.font 2005-01-30 00:09:08.000000000 +0100
+++ chess/media/gui/tahoma-12.font 2006-06-26 11:37:19.000000000 +0200
@@ -1,2 +1,2 @@
<?xml version="1.0" ?>
-<Font Name="Tahoma-12" Filename="tahoma.ttf" Type="Dynamic" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>
+<Font Name="Tahoma-12" Filename="/usr/share/fonts/bitstream-vera/Vera.ttf" Type="Dynamic" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>
Binary files chess.orig/media/gui/tahoma.ttf and chess/media/gui/tahoma.ttf differ
diff -urN chess.orig/media/materials/scripts/Chess.material chess/media/materials/scripts/Chess.material
--- chess.orig/media/materials/scripts/Chess.material 2005-05-12 11:01:40.000000000 +0200
+++ chess/media/materials/scripts/Chess.material 2006-06-26 14:52:53.000000000 +0200
@@ -115,7 +115,7 @@
specular 0.7 0.7 0.7 64
texture_unit
{
- texture Oak.png
+ texture oak.png
}
}
}
diff -urN chess.orig/plugins.cfg chess/plugins.cfg
--- chess.orig/plugins.cfg 1970-01-01 01:00:00.000000000 +0100
+++ chess/plugins.cfg 2006-06-26 16:29:24.000000000 +0200
@@ -0,0 +1,7 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=/usr/lib/OGRE
+
+Plugin=RenderSystem_GL.so
+Plugin=Plugin_ParticleFX.so
diff -urN chess.orig/resources.cfg chess/resources.cfg
--- chess.orig/resources.cfg 1970-01-01 01:00:00.000000000 +0100
+++ chess/resources.cfg 2006-06-26 16:29:54.000000000 +0200
@@ -0,0 +1,9 @@
+# Resource locations to be added to the default path
+[General]
+FileSystem=media
+FileSystem=media/fonts
+FileSystem=media/gui
+FileSystem=media/materials/scripts
+FileSystem=media/materials/textures
+FileSystem=media/models
+FileSystem=media/overlays
diff -urN chess.orig/src/AISearchAgent.cpp chess/src/AISearchAgent.cpp
--- chess.orig/src/AISearchAgent.cpp 2005-05-10 20:00:56.000000000 +0200
+++ chess/src/AISearchAgent.cpp 2006-06-26 10:33:56.000000000 +0200
@@ -117,7 +117,7 @@
int currentAlpha = alpha;
// Loop on the successors
- while ((testMove = movegen.Next()) != 0)
+ while ((testMove = movegen.Next()) != movegen.End())
{
// Compute a board position resulting from the current successor
@@ -177,7 +177,7 @@
// Case #2: min Node
bestSoFar = ALPHABETA_MAXVAL;
int currentBeta = beta;
- while ((testMove = movegen.Next()) != 0)
+ while ((testMove = movegen.Next()) != movegen.End())
{
newBoard.Clone(theBoard);
newBoard.ApplyMove(*testMove);
@@ -292,7 +292,7 @@
{
int currentAlpha = alpha;
// Loop on the successors
- while ((testMove = movegen.Next()) != 0)
+ while ((testMove = movegen.Next()) != movegen.End())
{
// Compute a board position resulting from the current successor
newBoard.Clone(theBoard);
@@ -347,7 +347,7 @@
} else {
// Case #2: min Node
int currentBeta = beta;
- while ((testMove = movegen.Next()) != 0)
+ while ((testMove = movegen.Next()) != movegen.End())
{
newBoard.Clone(theBoard);
newBoard.ApplyMove(*testMove);
@@ -388,4 +388,4 @@
mTransTable.StoreBoard(theBoard, bestSoFar, Move::EVALTYPE_ACCURATE, 0, MoveCounter);
return bestSoFar;
-}
\ No newline at end of file
+}
diff -urN chess.orig/src/AISearchAgentAlphabeta.cpp chess/src/AISearchAgentAlphabeta.cpp
--- chess.orig/src/AISearchAgentAlphabeta.cpp 2005-05-10 20:00:56.000000000 +0200
+++ chess/src/AISearchAgentAlphabeta.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -16,7 +16,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#include "stdafx.h"
-#include "AISearchAgentAlphaBeta.h"
+#include "AISearchAgentAlphabeta.h"
#include "Move.h"
#include "Board.h"
#include "HistoryTable.h"
@@ -54,7 +54,7 @@
// Loop on all pseudo-legal moves
std::vector<Move>::iterator testMove;
- while ((testMove = movegen.Next()) != 0)
+ while ((testMove = movegen.Next()) != movegen.End())
{
newBoard.Clone(theBoard);
newBoard.ApplyMove(*testMove);
@@ -97,7 +97,7 @@
theMove.MoveType = Move::MOVE_STALEMATE;
theMove.MovingPiece = Board::KING + theBoard.GetCurrentPlayer();
// Look at the moves
- while ((testMove = movegen.Next()) != 0)
+ while ((testMove = movegen.Next()) != movegen.End())
{
newBoard.Clone(theBoard);
newBoard.ApplyMove(*testMove);
diff -urN chess.orig/src/AISearchAgentMTDF.cpp chess/src/AISearchAgentMTDF.cpp
--- chess.orig/src/AISearchAgentMTDF.cpp 2005-05-10 20:00:56.000000000 +0200
+++ chess/src/AISearchAgentMTDF.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -136,7 +136,7 @@
// Loop on the successors
std::vector<Move>::iterator testMove;
- while ((testMove = movegen.Next()) != 0 && Continue)
+ while ((testMove = movegen.Next()) != movegen.End() && Continue)
{
// Compute a board position resulting from the current successor
newBoard.Clone(theBoard);
@@ -181,7 +181,7 @@
movegen.ResetIterator();
BestMov.MoveType = Move::MOVE_STALEMATE;
BestMov.MovingPiece = Board::KING + theBoard.GetCurrentPlayer();
- while ((testMove = movegen.Next()) != 0)
+ while ((testMove = movegen.Next()) != movegen.End())
{
newBoard.Clone(theBoard);
newBoard.ApplyMove(*testMove);
diff -urN chess.orig/src/AnimationBlender.cpp chess/src/AnimationBlender.cpp
--- chess.orig/src/AnimationBlender.cpp 2005-05-10 20:01:00.000000000 +0200
+++ chess/src/AnimationBlender.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -38,15 +38,14 @@
void AnimationBlender::init(const String &animation, const bool loop)
{
AnimationStateSet *set = mEntity->getAllAnimationStates();
- AnimationStateSet::iterator it = set->begin();
+ AnimationStateIterator it = set->getAnimationStateIterator();
- while(it != set->end())
+ while(it.hasMoreElements())
{
- AnimationState &anim = it->second;
- anim.setEnabled(false);
- anim.setWeight(0);
- anim.setTimePosition(0);
- ++it;
+ AnimationState *anim = it.getNext();
+ anim->setEnabled(false);
+ anim->setWeight(0);
+ anim->setTimePosition(0);
}
mSource = mEntity->getAnimationState( animation );
diff -urN chess.orig/src/Application.cpp chess/src/Application.cpp
--- chess.orig/src/Application.cpp 2005-05-10 20:01:00.000000000 +0200
+++ chess/src/Application.cpp 2006-06-26 15:14:28.000000000 +0200
@@ -30,6 +30,7 @@
delete mCollisionManager;
delete mGUISystem;
delete mGUIRenderer;
+ mRoot->destroySceneManager(mSceneManager);
delete mRoot;
}
@@ -90,7 +91,7 @@
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
// CEGUI setup
- mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, ST_EXTERIOR_CLOSE);
+ mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneManager);
mGUISystem = new CEGUI::System(mGUIRenderer);
mGUISystem->setMouseMoveScaling(1.25); // adjust the speed
@@ -131,11 +132,14 @@
bool Application::configure()
{
+ // Try to load existing configuration
+ if (mRoot->restoreConfig())
+ return true;
// Show configuration dialog
- return mRoot->showConfigDialog();
+ return mRoot->showConfigDialog();
}
void Application::chooseSceneManager()
{
- mSceneManager = mRoot->getSceneManager(ST_GENERIC);
+ mSceneManager = mRoot->createSceneManager(ST_GENERIC);
}
diff -urN chess.orig/src/Board.cpp chess/src/Board.cpp
--- chess.orig/src/Board.cpp 2005-05-12 12:00:56.000000000 +0200
+++ chess/src/Board.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -16,7 +16,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
#include "stdafx.h"
-#include "board.h"
+#include "Board.h"
#include "Move.h"
#include "Hand.h"
#include "HandState.h"
@@ -275,7 +275,7 @@
case (Move::MOVE_NORMAL):
// The simple case
if (ConfirmMove) {
- Hand::GetHand(side)->SetAction(HandState::ActionType::Move, theMove.SourceSquare, theMove.DestinationSquare);
+ Hand::GetHand(side)->SetAction(HandState::Move, theMove.SourceSquare, theMove.DestinationSquare);
}
RemovePiece( theMove.SourceSquare, theMove.MovingPiece );
AddPiece( theMove.DestinationSquare, theMove.MovingPiece );
@@ -283,7 +283,7 @@
case (Move::MOVE_CAPTURE_ORDINARY):
// Don't forget to remove the captured piece!
if (ConfirmMove) {
- Hand::GetHand(side)->SetAction(HandState::ActionType::Capture, theMove.SourceSquare, theMove.DestinationSquare);
+ Hand::GetHand(side)->SetAction(HandState::Capture, theMove.SourceSquare, theMove.DestinationSquare);
capture = true;
}
RemovePiece( theMove.SourceSquare, theMove.MovingPiece );
@@ -294,9 +294,9 @@
// move the hands
if (ConfirmMove) {
if ( ( theMove.MovingPiece % 2 ) == Player::SIDE_WHITE )
- Hand::GetHand(side)->SetAction(HandState::ActionType::EnPassant, theMove.SourceSquare, theMove.DestinationSquare);
+ Hand::GetHand(side)->SetAction(HandState::EnPassant, theMove.SourceSquare, theMove.DestinationSquare);
else
- Hand::GetHand(side)->SetAction(HandState::ActionType::EnPassant, theMove.SourceSquare, theMove.DestinationSquare);
+ Hand::GetHand(side)->SetAction(HandState::EnPassant, theMove.SourceSquare, theMove.DestinationSquare);
}
// Here, we can use our knowledge of the board to make a small
// optimization, since the pawn to be captured is always
@@ -312,7 +312,7 @@
case (Move::MOVE_CASTLING_QUEENSIDE):
// move the hands
if (ConfirmMove) {
- Hand::GetHand(side)->SetAction(HandState::ActionType::Castle, theMove.SourceSquare, theMove.DestinationSquare, theMove.SourceSquare - 4, theMove.SourceSquare - 1);
+ Hand::GetHand(side)->SetAction(HandState::Castle, theMove.SourceSquare, theMove.DestinationSquare, theMove.SourceSquare - 4, theMove.SourceSquare - 1);
}
// Again, we can compute the rook's source and destination squares
// because of our knowledge of the board's structure
@@ -333,7 +333,7 @@
break;
case (Move::MOVE_CASTLING_KINGSIDE):
if (ConfirmMove) {
- Hand::GetHand(side)->SetAction(HandState::ActionType::Castle, theMove.SourceSquare, theMove.DestinationSquare, theMove.SourceSquare + 3, theMove.SourceSquare + 1);
+ Hand::GetHand(side)->SetAction(HandState::Castle, theMove.SourceSquare, theMove.DestinationSquare, theMove.SourceSquare + 3, theMove.SourceSquare + 1);
}
// Again, we can compute the rook's source and destination squares
// because of our knowledge of the board's structure
@@ -381,9 +381,9 @@
if (ConfirmMove) {
// do the hand movement
if (capture)
- Hand::GetHand(side)->SetAction(HandState::ActionType::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Knight");
+ Hand::GetHand(side)->SetAction(HandState::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Knight");
else
- Hand::GetHand(side)->SetAction(HandState::ActionType::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Knight");
+ Hand::GetHand(side)->SetAction(HandState::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Knight");
}
RemovePiece( theMove.DestinationSquare, theMove.MovingPiece );
AddPiece( theMove.DestinationSquare, KNIGHT + color );
@@ -392,9 +392,9 @@
if (ConfirmMove) {
// do the hand movement
if (capture)
- Hand::GetHand(side)->SetAction(HandState::ActionType::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Bishop");
+ Hand::GetHand(side)->SetAction(HandState::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Bishop");
else
- Hand::GetHand(side)->SetAction(HandState::ActionType::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Bishop");
+ Hand::GetHand(side)->SetAction(HandState::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Bishop");
}
RemovePiece( theMove.DestinationSquare, theMove.MovingPiece );
AddPiece( theMove.DestinationSquare, BISHOP + color );
@@ -403,9 +403,9 @@
if (ConfirmMove) {
// do the hand movement
if (capture)
- Hand::GetHand(side)->SetAction(HandState::ActionType::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Rook");
+ Hand::GetHand(side)->SetAction(HandState::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Rook");
else
- Hand::GetHand(side)->SetAction(HandState::ActionType::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Rook");
+ Hand::GetHand(side)->SetAction(HandState::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Rook");
}
RemovePiece( theMove.DestinationSquare, theMove.MovingPiece );
AddPiece( theMove.DestinationSquare, ROOK + color );
@@ -414,9 +414,9 @@
if (ConfirmMove) {
// do the hand movement
if (capture)
- Hand::GetHand(side)->SetAction(HandState::ActionType::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Queen");
+ Hand::GetHand(side)->SetAction(HandState::Capture, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Queen");
else
- Hand::GetHand(side)->SetAction(HandState::ActionType::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Queen");
+ Hand::GetHand(side)->SetAction(HandState::Promotion, theMove.SourceSquare, theMove.DestinationSquare, -1, -1, "Queen");
}
RemovePiece( theMove.DestinationSquare, theMove.MovingPiece );
AddPiece( theMove.DestinationSquare, QUEEN + color );
@@ -670,7 +670,7 @@
{
MoveListGenerator move1, move2;
Board Successor;
- CheckStatus status = CheckStatus::Normal;
+ CheckStatus status = Normal;
bool wayOut = false ;
// first, compute the list of moves possible for the whole board at this time
@@ -679,7 +679,7 @@
// then, make sure that whatever move is made does not result in checkmate
std::vector<Move>::iterator testMove;
- while ((testMove = move1.Next()) != 0)
+ while ((testMove = move1.Next()) != move1.End())
{
// make sure that moving this piece does not leave the king in check
Successor.Clone(*this);
@@ -692,7 +692,7 @@
// unless, the move being made is by the king in which case we
// don't count attempting to move into check...
if ((*testMove).MovingPiece != Board::BLACK_KING && (*testMove).MovingPiece != Board::WHITE_KING)
- status = CheckStatus::Check;
+ status = Check;
}
// return the status
@@ -700,5 +700,5 @@
return status;
else
// none was found - checkmate
- return CheckStatus::Checkmate;
+ return Checkmate;
}
diff -urN chess.orig/src/CaptureState.cpp chess/src/CaptureState.cpp
--- chess.orig/src/CaptureState.cpp 2005-05-10 20:00:58.000000000 +0200
+++ chess/src/CaptureState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -24,7 +24,7 @@
void CaptureState::Initialise(void)
{
// record this state type
- mStateType = HandState::StateType::Take;
+ mStateType = HandState::Take;
// set how long it takes for this part of the move to complete
mStateDuration = 1;
@@ -71,22 +71,22 @@
anim->setInterpolationMode(Animation::IM_SPLINE);
// Create a track to animate the hand
- AnimationTrack* track = anim->createTrack(0, mHandNode);
+ NodeAnimationTrack* track = anim->createNodeTrack(0, mHandNode);
// Setup keyframes
- KeyFrame* key = track->createKeyFrame(0); // startposition
+ TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
key->setTranslate(mHandNode->getPosition());
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration * 0.4);
+ key = track->createNodeKeyFrame(mStateDuration * 0.4);
key->setTranslate(Vector3(mTargetPosition.x - (mMovementVector.x * 0.1), mTargetPosition.y + 35, mTargetPosition.z - (mMovementVector.z * 0.1)));
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration * 0.6);
+ key = track->createNodeKeyFrame(mStateDuration * 0.6);
key->setTranslate(Vector3(mTargetPosition.x, mTargetPosition.y + 25, mTargetPosition.z));
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration);
+ key = track->createNodeKeyFrame(mStateDuration);
key->setTranslate(Vector3(mTargetPosition.x - (mOffset.x * 0.78), mTargetPosition.y, mTargetPosition.z + (mOffset.z * 0.38))); // tweaked 'til it looks good
key->setRotation(mHandNode->getOrientation());
@@ -143,10 +143,10 @@
Second = false;
Third = false;
if (mPromoType == "")
- return HandState::StateType::Remove;
+ return HandState::Remove;
else
- return HandState::StateType::NewPiece;
+ return HandState::NewPiece;
}
else
- return HandState::StateType::Take;
-}
\ No newline at end of file
+ return HandState::Take;
+}
diff -urN chess.orig/src/Chess.cpp chess/src/Chess.cpp
--- chess.orig/src/Chess.cpp 2005-05-10 20:01:00.000000000 +0200
+++ chess/src/Chess.cpp 2006-06-26 16:22:20.000000000 +0200
@@ -17,6 +17,9 @@
#include "stdafx.h"
#include "ChessApplication.h"
+#ifdef __unix__
+#include "unixutils.h"
+#endif
// Application entry point
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
@@ -27,7 +30,42 @@
#else
int main(int argc, char *argv[])
#endif
-{
+{
+// SIGH, ogre wants to read plugins.cfg from the current dir and in general
+// read and write all kinda files from/to the currentdir, this is not how
+// things are done under UNIX, this works around this ogre "feature"
+#ifdef __unix__
+ char *home = get_homedir();
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s/.chess", home? home:".");
+ if (check_and_create_dir(buf))
+ return 1;
+
+ if (chdir(buf)) {
+ perror("error creating directory ~/.chess");
+ return 1;
+ }
+
+ unlink("media");
+ if (symlink(DATADIR "media", "media")) {
+ perror("error creating symlink ~/.chess/media");
+ return 1;
+ }
+
+ unlink("plugins.cfg");
+ if (symlink(DATADIR "plugins.cfg", "plugins.cfg")) {
+ perror("error creating symlink ~/.chess/plugins.cfg");
+ return 1;
+ }
+
+ unlink("resources.cfg");
+ if (symlink(DATADIR "resources.cfg", "resources.cfg")) {
+ perror("error creating symlink ~/.chess/resources.cfg");
+ return 1;
+ }
+#endif
+
ChessApplication application;
// try {
application.run();
@@ -39,4 +77,4 @@
// #endif
// }
return 0;
-}
\ No newline at end of file
+}
diff -urN chess.orig/src/ChessApplication.cpp chess/src/ChessApplication.cpp
--- chess.orig/src/ChessApplication.cpp 2005-05-12 11:40:02.000000000 +0200
+++ chess/src/ChessApplication.cpp 2006-06-26 14:54:37.000000000 +0200
@@ -104,8 +104,10 @@
void ChessApplication::createScene()
{
// Create root scene node
- mGameRoot = mSceneManager->getRootSceneNode()->createChildSceneNode();
-
+ mGameRoot = mSceneManager->getRootSceneNode()->createChildSceneNode();
+ mSceneManager->getRootSceneNode()->removeChild(mGameRoot);
+ mRootNodeAttached = false;
+
// load the board
mBoard = mSceneManager->createEntity("TheBoard", "Board.mesh");
mBoard->getSubEntity(1)->setMaterialName("Chess/BoardSideMat");
@@ -122,7 +124,7 @@
v->setBackgroundColour(ColourValue::Black);
MaterialPtr mat = MaterialManager::getSingleton().create("RttMat", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- TextureUnitState* t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("board.png");
+ TextureUnitState* t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("Board.png");
t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("RttTex");
// Blend with base texture
@@ -164,7 +166,7 @@
va->setBackgroundColour( ColourValue::Black );
MaterialPtr mata = MaterialManager::getSingleton().create("RttMata", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
- TextureUnitState* ta = mata->getTechnique(0)->getPass(0)->createTextureUnitState("ground.png");
+ TextureUnitState* ta = mata->getTechnique(0)->getPass(0)->createTextureUnitState("Ground.png");
ta = mata->getTechnique(0)->getPass(0)->createTextureUnitState("RttTexa");
mata->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);
@@ -324,11 +326,19 @@
void ChessApplication::AttachRootNode()
{
// Cleanup after rendering player viewport
- mSceneManager->getRootSceneNode()->addChild(mGameRoot);
+ if (!mRootNodeAttached)
+ {
+ mSceneManager->getRootSceneNode()->addChild(mGameRoot);
+ mRootNodeAttached = true;
+ }
}
void ChessApplication::DetachRootNode()
{
// Cleanup after rendering player viewport
- mSceneManager->getRootSceneNode()->removeChild(mGameRoot);
-}
\ No newline at end of file
+ if (mRootNodeAttached)
+ {
+ mSceneManager->getRootSceneNode()->removeChild(mGameRoot);
+ mRootNodeAttached = false;
+ }
+}
diff -urN chess.orig/src/ColourState.cpp chess/src/ColourState.cpp
--- chess.orig/src/ColourState.cpp 2005-05-10 20:01:00.000000000 +0200
+++ chess/src/ColourState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -24,7 +24,7 @@
// Singleton instance
template<> ColourState* Singleton<ColourState>::ms_Singleton = 0;
-ColourState::GameType ColourState::Players = ColourState::GameType::PvCPU;
+ColourState::GameType ColourState::Players = ColourState::PvCPU;
ColourState::ColourState()
{
@@ -46,7 +46,7 @@
// Pop the main menu state
StateManager::getSingleton().popState();
// set up the players
- if (ColourState::Players == ColourState::GameType::PvP) {
+ if (ColourState::Players == ColourState::PvP) {
mGameAI->SetPlayer(Player::SIDE_WHITE, Player::TYPE_HUMAN);
mGameAI->SetPlayer(Player::SIDE_BLACK, Player::TYPE_HUMAN);
} else {
diff -urN chess.orig/src/GameAI.cpp chess/src/GameAI.cpp
--- chess.orig/src/GameAI.cpp 2005-05-12 11:33:48.000000000 +0200
+++ chess/src/GameAI.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -119,8 +119,8 @@
}
// only start a move when both hands have finished moving
- if (Hand::GetHand(Player::SIDE_WHITE)->GetHandState()->GetStateType() == HandState::StateType::Static
- && Hand::GetHand(Player::SIDE_BLACK)->GetHandState()->GetStateType() == HandState::StateType::Static
+ if (Hand::GetHand(Player::SIDE_WHITE)->GetHandState()->GetStateType() == HandState::Static
+ && Hand::GetHand(Player::SIDE_BLACK)->GetHandState()->GetStateType() == HandState::Static
&& Players[GameBoard->GetCurrentPlayer()]->GetType() == Player::TYPE_AI
&& !IsThreadRunning)
{
@@ -209,15 +209,15 @@
switch (status)
{
- case Board::CheckStatus::Normal:
+ case Board::Normal:
// hide the check message
static_cast<ChessApplication*>(ChessApplication::getSingletonPtr())->setShowMessageOverlay(false);
break;
- case Board::CheckStatus::Check:
+ case Board::Check:
// display the check message
static_cast<ChessApplication*>(ChessApplication::getSingletonPtr())->setShowMessageOverlay(true);
break;
- case Board::CheckStatus::Checkmate:
+ case Board::Checkmate:
// display the winner screen
if (GameBoard->GetCurrentPlayer() == Player::SIDE_WHITE) {
GameOverState::getSingletonPtr()->DisplayResult("Checkmate!", "Black Wins!");
diff -urN chess.orig/src/Hand.cpp chess/src/Hand.cpp
--- chess.orig/src/Hand.cpp 2005-05-11 11:49:42.000000000 +0200
+++ chess/src/Hand.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -62,11 +62,11 @@
mEntity->setCastShadows(false);
// set up the particle effects
- mMagicWand = ParticleSystemManager::getSingletonPtr()->createSystem("MagicWand" + StringConverter::toString(mColour), "MagicWand");
+ mMagicWand = Application::getSingletonPtr()->getSceneManager()->createParticleSystem("MagicWand" + StringConverter::toString(mColour), "MagicWand");
mScenenode->attachObject(mMagicWand);
// set the hand into a waiting state
- SetAction(HandState::ActionType::Waiting);
+ SetAction(HandState::Waiting);
}
Hand::~Hand()
@@ -83,13 +83,13 @@
// destroy the particle system
if (mMagicWand) {
- ParticleSystemManager::getSingletonPtr()->destroySystem(mMagicWand);
+ Application::getSingletonPtr()->getSceneManager()->destroyParticleSystem(mMagicWand);
mMagicWand = 0;
}
// Destroy entity
if (mEntity) {
- mSceneManager->removeEntity(mEntity);
+ mSceneManager->destroyEntity(mEntity);
mEntity = 0;
}
}
@@ -132,15 +132,15 @@
// set the starting state for this action
switch (action)
{
- case HandState::ActionType::Waiting:
- SetState(HandState::StateType::Static);
+ case HandState::Waiting:
+ SetState(HandState::Static);
break;
- case HandState::ActionType::Move:
- case HandState::ActionType::Capture:
- case HandState::ActionType::Castle:
- case HandState::ActionType::EnPassant:
- case HandState::ActionType::Promotion:
- SetState(HandState::StateType::Pickup);
+ case HandState::Move:
+ case HandState::Capture:
+ case HandState::Castle:
+ case HandState::EnPassant:
+ case HandState::Promotion:
+ SetState(HandState::Pickup);
break;
}
}
@@ -151,26 +151,26 @@
// call the initialise routine for this state
switch (state)
{
- case HandState::StateType::Static:
+ case HandState::Static:
static_cast<StaticState*>(mHandState)->Initialise();
break;
- case HandState::StateType::Pickup:
+ case HandState::Pickup:
static_cast<PickupState*>(mHandState)->Initialise();
break;
- case HandState::StateType::MovePiece:
+ case HandState::MovePiece:
static_cast<MovePieceState*>(mHandState)->Initialise();
break;
- case HandState::StateType::Take:
+ case HandState::Take:
static_cast<CaptureState*>(mHandState)->Initialise();
break;
- case HandState::StateType::Remove:
+ case HandState::Remove:
static_cast<RemoveState*>(mHandState)->Initialise();
break;
- case HandState::StateType::SimpleReturn:
- case HandState::StateType::CaptureReturn:
+ case HandState::SimpleReturn:
+ case HandState::CaptureReturn:
static_cast<ReturnState*>(mHandState)->Initialise();
break;
- case HandState::StateType::NewPiece:
+ case HandState::NewPiece:
static_cast<PromotionState*>(mHandState)->Initialise();
break;
}
@@ -198,26 +198,26 @@
// call the relevant update routine
switch (currentState)
{
- case HandState::StateType::Static:
+ case HandState::Static:
nextState = static_cast<StaticState*>(mHands[i]->mHandState)->Update(dt);
break;
- case HandState::StateType::Pickup:
+ case HandState::Pickup:
nextState = static_cast<PickupState*>(mHands[i]->mHandState)->Update(dt);
break;
- case HandState::StateType::MovePiece:
+ case HandState::MovePiece:
nextState = static_cast<MovePieceState*>(mHands[i]->mHandState)->Update(dt);
break;
- case HandState::StateType::Take:
+ case HandState::Take:
nextState = static_cast<CaptureState*>(mHands[i]->mHandState)->Update(dt);
break;
- case HandState::StateType::Remove:
+ case HandState::Remove:
nextState = static_cast<RemoveState*>(mHands[i]->mHandState)->Update(dt);
break;
- case HandState::StateType::SimpleReturn:
- case HandState::StateType::CaptureReturn:
+ case HandState::SimpleReturn:
+ case HandState::CaptureReturn:
nextState = static_cast<ReturnState*>(mHands[i]->mHandState)->Update(dt);
break;
- case HandState::StateType::NewPiece:
+ case HandState::NewPiece:
nextState = static_cast<PromotionState*>(mHands[i]->mHandState)->Update(dt);
break;
}
diff -urN chess.orig/src/HandState.cpp chess/src/HandState.cpp
--- chess.orig/src/HandState.cpp 2005-05-11 17:31:06.000000000 +0200
+++ chess/src/HandState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -25,7 +25,7 @@
HandState::HandState(Hand* hand, const ActionType action, const int SourceSquare, const int DestinationSquare,
const int CastlingSource, const int CastlingDestination, const String PromoType)
: mHand(hand), mAnimationBlender(0), mMoveState(0), mTargetPosition(Vector3::ZERO),
- mStartingPosition(Vector3(140,-7.5,180)), mMovementVector(Vector3::ZERO), mActionType(action), mStateType(StateType::Static),
+ mStartingPosition(Vector3(140,-7.5,180)), mMovementVector(Vector3::ZERO), mActionType(action), mStateType(Static),
mSourceSquare(SourceSquare), mDestinationSquare(DestinationSquare), mStateDuration(0),
mMPSceneNode(0), mCPSceneNode(0), mMovingPiece(0), mCapturedPiece(0), mOffset(Vector3::ZERO),
mCastleFirst(false), mCastlingSource(CastlingSource), mCastlingDestination(CastlingDestination), mPromoType(PromoType), mEnPassantFirst(false)
@@ -40,7 +40,7 @@
mHandEntity = mHand->GetEntityPtr();
mMovingPiece = Piece::GetPiece(mSourceSquare);
- if (mActionType == ActionType::Capture)
+ if (mActionType == Capture)
mCapturedPiece = Piece::GetPiece(mDestinationSquare);
}
@@ -117,18 +117,18 @@
anim->setInterpolationMode(Animation::IM_SPLINE);
// Create a track to animate the hand
- AnimationTrack* track = anim->createTrack(0, mHandNode);
+ NodeAnimationTrack* track = anim->createNodeTrack(0, mHandNode);
// Setup keyframes
- KeyFrame* key = track->createKeyFrame(0); // startposition
+ TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
key->setTranslate(mHandNode->getPosition());
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration * 0.5);
+ key = track->createNodeKeyFrame(mStateDuration * 0.5);
key->setTranslate(Vector3(mTargetPosition.x - (mMovementVector.x * 0.5), mTargetPosition.y + 65, mTargetPosition.z - (mMovementVector.z * 0.5)));
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration);
+ key = track->createNodeKeyFrame(mStateDuration);
key->setTranslate(mTargetPosition);
key->setRotation(mHandNode->getOrientation());
}
@@ -156,7 +156,7 @@
if (mAnimationBlender != 0)
mAnimationBlender->addTime(dt);
- return StateType::Static;
+ return Static;
}
void HandState::GetNextRemoveSlot(Real& x, Real& z)
@@ -166,4 +166,4 @@
z = -70 + (20 * int(PiecesTaken / 3)) + (Math::RangeRandom(0, 8) - 4); // the random bit adds a bit of uneven-ness
while (PiecesTaken > 2) PiecesTaken -= 3;
x = 110 + (20 * PiecesTaken) + (Math::RangeRandom(0, 8) - 4);
-}
\ No newline at end of file
+}
diff -urN chess.orig/src/HistoryTable.cpp chess/src/HistoryTable.cpp
--- chess.orig/src/HistoryTable.cpp 2005-05-10 20:00:56.000000000 +0200
+++ chess/src/HistoryTable.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -35,19 +35,19 @@
return true;
}
-inline int HistoryComparator (const Move& mov1, const Move& mov2)
-{
- return (HistoryTable::GetInstance()->History[HistoryTable::GetInstance()->CurrentHistory][ mov1.SourceSquare ][ mov1.DestinationSquare ] <
- HistoryTable::GetInstance()->History[HistoryTable::GetInstance()->CurrentHistory][ mov2.SourceSquare ][ mov2.DestinationSquare ]) ? -1 :
- (HistoryTable::GetInstance()->History[HistoryTable::GetInstance()->CurrentHistory][ mov1.SourceSquare ][ mov1.DestinationSquare ] >
- HistoryTable::GetInstance()->History[HistoryTable::GetInstance()->CurrentHistory][ mov2.SourceSquare ][ mov2.DestinationSquare ]) ? 1 : 0;
-}
+struct HistoryComparator : public std::binary_function<Move, Move, bool> {
+ bool operator()(Move mov1, Move mov2)
+ {
+ return HistoryTable::GetInstance()->History[HistoryTable::GetInstance()->CurrentHistory][ mov1.SourceSquare ][ mov1.DestinationSquare ] <
+ HistoryTable::GetInstance()->History[HistoryTable::GetInstance()->CurrentHistory][ mov2.SourceSquare ][ mov2.DestinationSquare ];
+ }
+};
// Sort a list of moves
bool HistoryTable::SortMoveList(MoveListGenerator& theList, int movingPlayer)
{
CurrentHistory = movingPlayer;
- sort(theList.Moves.begin(), theList.Moves.end(), HistoryComparator);
+ sort(theList.Moves.begin(), theList.Moves.end(), HistoryComparator());
return true;
}
diff -urN chess.orig/src/InputManager.cpp chess/src/InputManager.cpp
--- chess.orig/src/InputManager.cpp 2005-05-11 17:30:00.000000000 +0200
+++ chess/src/InputManager.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -72,12 +72,12 @@
}
// get rid of the entities
if (mSelectionEntity) {
- mSceneManager->removeEntity(mSelectionEntity);
+ mSceneManager->destroyEntity(mSelectionEntity);
mSelectionEntity = 0;
}
if (mCurrentEntity) {
- mSceneManager->removeEntity(mCurrentEntity);
+ mSceneManager->destroyEntity(mCurrentEntity);
mCurrentEntity = 0;
}
}
diff -urN chess.orig/src/MoveListGenerator.cpp chess/src/MoveListGenerator.cpp
--- chess.orig/src/MoveListGenerator.cpp 2005-05-10 20:00:58.000000000 +0200
+++ chess/src/MoveListGenerator.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -43,7 +43,6 @@
{
Moves.clear();
MoveListGenerator::Initialize();
- MovesIt = 0;
ResetIterator();
}
@@ -65,7 +64,7 @@
if (MovesIt!=Moves.end()) {
return MovesIt++;
} else
- return 0;
+ return MovesIt;
}
// Look for a specific move in the list; if it is there, return true
@@ -75,7 +74,7 @@
{
ResetIterator();
std::vector<Move>::iterator testMove;
- while ((testMove = Next()) != 0)
+ while ((testMove = Next()) != End())
{
if (mov.Equals(*testMove))
return true;
@@ -136,11 +135,17 @@
bool MoveListGenerator::ComputeQuiescenceMoves(Board& theBoard, bool& Continue)
{
ComputeLegalMoves(theBoard, Continue);
- for (int i = (int)Moves.size() - 1; i >= 0; i--) {
- Move* mov = &Moves[i];
- if (((*mov).MoveType != Move::MOVE_CAPTURE_ORDINARY) &&
- ((*mov).MoveType != Move::MOVE_CAPTURE_EN_PASSANT))
- Moves.erase(mov);
+ std::vector<Move>::iterator it = Moves.begin();
+ while (it != Moves.end()) {
+ if (((*it).MoveType != Move::MOVE_CAPTURE_ORDINARY) &&
+ ((*it).MoveType != Move::MOVE_CAPTURE_EN_PASSANT))
+ {
+ it = Moves.erase(it);
+ }
+ else
+ {
+ it++;
+ }
}
ResetIterator();
return (Moves.size() > 0 && Continue);
diff -urN chess.orig/src/MovePieceState.cpp chess/src/MovePieceState.cpp
--- chess.orig/src/MovePieceState.cpp 2005-05-10 20:00:58.000000000 +0200
+++ chess/src/MovePieceState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -24,7 +24,7 @@
void MovePieceState::Initialise(void)
{
// record this state type
- mStateType = HandState::StateType::MovePiece;
+ mStateType = HandState::MovePiece;
// set how long it takes for this part of the move to complete
mStateDuration = 0.5;
@@ -41,7 +41,7 @@
void MovePieceState::CreateMovementTrack()
{
- if (mActionType == HandState::ActionType::EnPassant && mEnPassantFirst)
+ if (mActionType == HandState::EnPassant && mEnPassantFirst)
{
// get the world coordinates of where the piece is to be moved to
GetNextRemoveSlot(mTargetPosition.x, mTargetPosition.z);
@@ -81,18 +81,18 @@
anim->setInterpolationMode(Animation::IM_SPLINE);
// Create a track to animate the hand
- AnimationTrack* track = anim->createTrack(0, mHandNode);
+ NodeAnimationTrack* track = anim->createNodeTrack(0, mHandNode);
// Setup keyframes
- KeyFrame* key = track->createKeyFrame(0); // startposition
+ TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
key->setTranslate(mHandNode->getPosition());
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration * 0.5);
+ key = track->createNodeKeyFrame(mStateDuration * 0.5);
key->setTranslate(Vector3(mTargetPosition.x - (mMovementVector.x * 0.5), mTargetPosition.y + 25, mTargetPosition.z - (mMovementVector.z * 0.5)));
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration);
+ key = track->createNodeKeyFrame(mStateDuration);
key->setTranslate(mTargetPosition);
key->setRotation(mHandNode->getOrientation());
}
@@ -121,14 +121,14 @@
mMoveState = 0;
// go to the next state
- if (mActionType == HandState::ActionType::Castle && !mCastleFirst)
+ if (mActionType == HandState::Castle && !mCastleFirst)
{
// move to the castle
mCastleFirst = true;
// pick up the second piece
- return HandState::StateType::Pickup;
+ return HandState::Pickup;
}
- else if (mActionType == HandState::ActionType::EnPassant && !mEnPassantFirst)
+ else if (mActionType == HandState::EnPassant && !mEnPassantFirst)
{
mEnPassantFirst = true;
if (mHand->GetColour()) // black
@@ -136,14 +136,14 @@
else
mSourceSquare = mDestinationSquare + 8;
// pick up the second piece
- return HandState::StateType::Pickup;
+ return HandState::Pickup;
}
- else if (mActionType == HandState::ActionType::Promotion)
- return HandState::StateType::NewPiece;
+ else if (mActionType == HandState::Promotion)
+ return HandState::NewPiece;
else {
mCastleFirst = false;
mEnPassantFirst = false;
- return HandState::StateType::SimpleReturn;
+ return HandState::SimpleReturn;
}
}
else
diff -urN chess.orig/src/PickupState.cpp chess/src/PickupState.cpp
--- chess.orig/src/PickupState.cpp 2005-05-10 20:00:58.000000000 +0200
+++ chess/src/PickupState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -24,7 +24,7 @@
void PickupState::Initialise(void)
{
// record this state type
- mStateType = HandState::StateType::Pickup;
+ mStateType = HandState::Pickup;
// turn on particles
mHand->ToggleParticle(true);
@@ -34,13 +34,13 @@
// if we're castling, put the first piece back down
// and record the next piece
- if ((mActionType == HandState::ActionType::Castle && mCastleFirst) ||
- mActionType == HandState::ActionType::EnPassant && mEnPassantFirst)
+ if ((mActionType == HandState::Castle && mCastleFirst) ||
+ mActionType == HandState::EnPassant && mEnPassantFirst)
{
// update the piece structure to its new position
mMovingPiece->SetPosition(mDestinationSquare);
// if we're castling, now grab the rook
- if (mActionType == HandState::ActionType::Castle)
+ if (mActionType == HandState::Castle)
{
mSourceSquare = mCastlingSource;
mDestinationSquare = mCastlingDestination;
@@ -87,22 +87,22 @@
anim->setInterpolationMode(Animation::IM_SPLINE);
// Create a track to animate the hand
- AnimationTrack* track = anim->createTrack(0, mHandNode);
+ NodeAnimationTrack* track = anim->createNodeTrack(0, mHandNode);
// Setup keyframes
- KeyFrame* key = track->createKeyFrame(0); // startposition
+ TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
key->setTranslate(mHandNode->getPosition());
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration * 0.25);
+ key = track->createNodeKeyFrame(mStateDuration * 0.25);
key->setTranslate(Vector3(mTargetPosition.x - (mMovementVector.x * 0.85), mTargetPosition.y + 25, mTargetPosition.z - (mMovementVector.z * 0.85)));
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration * 0.75);
+ key = track->createNodeKeyFrame(mStateDuration * 0.75);
key->setTranslate(Vector3(mTargetPosition.x - (mMovementVector.x * 0.15), mTargetPosition.y + 35, mTargetPosition.z - (mMovementVector.z * 0.15)));
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration);
+ key = track->createNodeKeyFrame(mStateDuration);
key->setTranslate(mTargetPosition);
key->setRotation(mHandNode->getOrientation());
}
@@ -130,13 +130,13 @@
mSceneManager->destroyAnimation("HandTrack" + StringConverter::toString(mHand->GetColour()));
mMoveState = 0;
- if (mActionType == HandState::ActionType::Move ||
- mActionType == HandState::ActionType::Castle ||
- mActionType == HandState::ActionType::EnPassant ||
- mActionType == HandState::ActionType::Promotion)
- return HandState::StateType::MovePiece;
+ if (mActionType == HandState::Move ||
+ mActionType == HandState::Castle ||
+ mActionType == HandState::EnPassant ||
+ mActionType == HandState::Promotion)
+ return HandState::MovePiece;
else
- return HandState::StateType::Take;
+ return HandState::Take;
}
else
return mStateType;
diff -urN chess.orig/src/Piece.cpp chess/src/Piece.cpp
--- chess.orig/src/Piece.cpp 2005-05-11 17:27:12.000000000 +0200
+++ chess/src/Piece.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -86,7 +86,7 @@
// Destroy entity
if (mEntity)
- mSceneManager->removeEntity(mEntity);
+ mSceneManager->destroyEntity(mEntity);
}
// set up the pieces according to the board being passed in
@@ -117,44 +117,48 @@
if ( ( piece == Board::WHITE_KING ) && ( ( theBoard->ExtraKings[ Player::SIDE_WHITE ] & Board::SquareBits[ line * 8 + col ] ) != 0 ) )
piece = Board::EMPTY_SQUARE;
+ // This gets incremented by the constructor, compilers seem to differ in
+ // opinion wether the post or pre incremeted value should be used in
+ // the switch case below, this works around this.
+ int old_mPieceNumber=mPieceNumber;
// Create the piece
switch (piece)
{
case Board::BLACK_KING:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "King", (line * 8) + col, 0, "BK");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "King", (line * 8) + col, 0, "BK");
break;
case Board::BLACK_QUEEN:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Queen", (line * 8) + col, 0, "BQ");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Queen", (line * 8) + col, 0, "BQ");
break;
case Board::BLACK_BISHOP:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Bishop", (line * 8) + col, 90, "BB");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Bishop", (line * 8) + col, 90, "BB");
break;
case Board::BLACK_KNIGHT:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Knight", (line * 8) + col, 180, "BN");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Knight", (line * 8) + col, 180, "BN");
break;
case Board::BLACK_ROOK:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Rook", (line * 8) + col, 0, "BR");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Rook", (line * 8) + col, 0, "BR");
break;
case Board::BLACK_PAWN:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Pawn", (line * 8) + col, 0, "BP");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Pawn", (line * 8) + col, 0, "BP");
break;
case Board::WHITE_KING:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "King", (line * 8) + col, 0, "WK");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "King", (line * 8) + col, 0, "WK");
break;
case Board::WHITE_QUEEN:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Queen", (line * 8) + col, 0, "WQ");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Queen", (line * 8) + col, 0, "WQ");
break;
case Board::WHITE_BISHOP:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Bishop", (line * 8) + col, 90, "WB");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Bishop", (line * 8) + col, 90, "WB");
break;
case Board::WHITE_KNIGHT:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Knight", (line * 8) + col, 0, "WN");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Knight", (line * 8) + col, 0, "WN");
break;
case Board::WHITE_ROOK:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Rook", (line * 8) + col, 0, "WR");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Rook", (line * 8) + col, 0, "WR");
break;
case Board::WHITE_PAWN:
- mPieces[mPieceNumber-1] = new Piece((piece % 2), "Pawn", (line * 8) + col, 0, "WP");
+ mPieces[old_mPieceNumber] = new Piece((piece % 2), "Pawn", (line * 8) + col, 0, "WP");
break;
}
}
@@ -177,7 +181,7 @@
// detach and remove the old mesh
mScenenode->detachObject(mEntity);
- mSceneManager->removeEntity(mEntity);
+ mSceneManager->destroyEntity(mEntity);
// load and attach a new mesh
mEntity = mSceneManager->createEntity(name, type + ".mesh");
diff -urN chess.orig/src/PlayerHuman.cpp chess/src/PlayerHuman.cpp
--- chess.orig/src/PlayerHuman.cpp 2005-05-10 20:00:58.000000000 +0200
+++ chess/src/PlayerHuman.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -98,7 +98,7 @@
// then, go through and filter out a list of moves possible for the piece at this source position
std::vector<Move>::iterator testMove;
- while ((testMove = Pseudos.Next()) != 0)
+ while ((testMove = Pseudos.Next()) != Pseudos.End())
{
if (testMove->SourceSquare == sourcePosition)
{
diff -urN chess.orig/src/PromotionState.cpp chess/src/PromotionState.cpp
--- chess.orig/src/PromotionState.cpp 2005-05-10 20:00:58.000000000 +0200
+++ chess/src/PromotionState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -23,7 +23,7 @@
void PromotionState::Initialise(void)
{
// record this state type
- mStateType = HandState::StateType::NewPiece;
+ mStateType = HandState::NewPiece;
mStateDuration = 0;
// set the initial animation
@@ -50,12 +50,12 @@
// promote the piece
mMovingPiece->PromotePiece(mPromoType);
// go to the next state
- if (mActionType == HandState::ActionType::Move ||
- mActionType == HandState::ActionType::Castle ||
- mActionType == HandState::ActionType::Promotion ||
- mActionType == HandState::ActionType::EnPassant)
- return HandState::StateType::SimpleReturn;
+ if (mActionType == HandState::Move ||
+ mActionType == HandState::Castle ||
+ mActionType == HandState::Promotion ||
+ mActionType == HandState::EnPassant)
+ return HandState::SimpleReturn;
else
- return HandState::StateType::Remove;
+ return HandState::Remove;
}
\ No newline at end of file
diff -urN chess.orig/src/PvCPUState.cpp chess/src/PvCPUState.cpp
--- chess.orig/src/PvCPUState.cpp 2005-05-10 20:01:02.000000000 +0200
+++ chess/src/PvCPUState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -32,7 +32,7 @@
if (mGameAI!=0) mGameAI->EndGame();
mGameAI->InitializeGame();
// set the game type
- ColourState::Players = ColourState::GameType::PvCPU;
+ ColourState::Players = ColourState::PvCPU;
// change the colour menu options
OverlayManager* overlayManager = OverlayManager::getSingletonPtr();
overlayManager->getOverlayElement("ColourMenu/1P")->setCaption("1P");
diff -urN chess.orig/src/PvPState.cpp chess/src/PvPState.cpp
--- chess.orig/src/PvPState.cpp 2005-05-10 20:01:02.000000000 +0200
+++ chess/src/PvPState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -32,7 +32,7 @@
if (mGameAI!=0) mGameAI->EndGame();
mGameAI->InitializeGame();
// set the game type
- ColourState::Players = ColourState::GameType::PvP;
+ ColourState::Players = ColourState::PvP;
// change the colour menu options
OverlayManager* overlayManager = OverlayManager::getSingletonPtr();
overlayManager->getOverlayElement("ColourMenu/1P")->setCaption("1P");
diff -urN chess.orig/src/RemoveState.cpp chess/src/RemoveState.cpp
--- chess.orig/src/RemoveState.cpp 2005-05-10 20:00:58.000000000 +0200
+++ chess/src/RemoveState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -24,7 +24,7 @@
void RemoveState::Initialise(void)
{
// record this state type
- mStateType = HandState::StateType::Remove;
+ mStateType = HandState::Remove;
// set how long it takes for this part of the move to complete
mStateDuration = 1;
@@ -77,18 +77,18 @@
anim->setInterpolationMode(Animation::IM_SPLINE);
// Create a track to animate the hand
- AnimationTrack* track = anim->createTrack(0, mHandNode);
+ NodeAnimationTrack* track = anim->createNodeTrack(0, mHandNode);
// Setup keyframes
- KeyFrame* key = track->createKeyFrame(0); // startposition
+ TransformKeyFrame* key = track->createNodeKeyFrame(0); // startposition
key->setTranslate(mHandNode->getPosition());
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration * 0.5);
+ key = track->createNodeKeyFrame(mStateDuration * 0.5);
key->setTranslate(Vector3(mTargetPosition.x - (mMovementVector.x * 0.1), mTargetPosition.y + 25, mTargetPosition.z - (mMovementVector.z * 0.1)));
key->setRotation(mHandNode->getOrientation());
- key = track->createKeyFrame(mStateDuration);
+ key = track->createNodeKeyFrame(mStateDuration);
key->setTranslate(mTargetPosition);
key->setRotation(mHandNode->getOrientation());
}
@@ -111,8 +111,8 @@
{
mSceneManager->destroyAnimation("HandTrack" + StringConverter::toString(mHand->GetColour()));
mMoveState = 0;
- return HandState::StateType::CaptureReturn;
+ return HandState::CaptureReturn;
}
else
- return HandState::StateType::Remove;
+ return HandState::Remove;
}
\ No newline at end of file
diff -urN chess.orig/src/ReturnState.cpp chess/src/ReturnState.cpp
--- chess.orig/src/ReturnState.cpp 2005-05-12 11:30:32.000000000 +0200
+++ chess/src/ReturnState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -24,18 +24,18 @@
void ReturnState::Initialise(void)
{
- if (mActionType == HandState::ActionType::Move ||
- mActionType == HandState::ActionType::Castle ||
- mActionType == HandState::ActionType::EnPassant)
+ if (mActionType == HandState::Move ||
+ mActionType == HandState::Castle ||
+ mActionType == HandState::EnPassant)
{
// record this state type
- mStateType = HandState::StateType::SimpleReturn;
+ mStateType = HandState::SimpleReturn;
// detach the piece from the hand
DetachPiece(mMovingPiece, mMPSceneNode);
// update the piece structure to its new position
- if (mActionType == HandState::ActionType::EnPassant)
+ if (mActionType == HandState::EnPassant)
if (mHand->GetColour())
mMovingPiece->SetPosition(-1);
else
@@ -43,16 +43,16 @@
else
mMovingPiece->SetPosition(mDestinationSquare);
}
- else if(mActionType == HandState::ActionType::Capture)
+ else if(mActionType == HandState::Capture)
{
- mStateType = HandState::StateType::CaptureReturn;
+ mStateType = HandState::CaptureReturn;
// detach the piece from the hand
DetachPiece(mCapturedPiece, mCPSceneNode);
// update the piece structure to off the board
mCapturedPiece->SetPosition(-1);
}
else
- mStateType = HandState::StateType::SimpleReturn;
+ mStateType = HandState::SimpleReturn;
// set how long it takes for this part of the move to complete
mStateDuration = 1;
@@ -70,10 +70,10 @@
HandState::BaseStartAnimation();
// run the move animation
- if (mActionType == HandState::ActionType::Move ||
- mActionType == HandState::ActionType::Castle ||
- mActionType == HandState::ActionType::Promotion ||
- mActionType == HandState::ActionType::EnPassant)
+ if (mActionType == HandState::Move ||
+ mActionType == HandState::Castle ||
+ mActionType == HandState::Promotion ||
+ mActionType == HandState::EnPassant)
mAnimationBlender->blend("SimpleReturn", AnimationBlender::BlendWhileAnimating, mStateDuration * 0.1, false);
else
mAnimationBlender->blend("CaptureReturn", AnimationBlender::BlendWhileAnimating, mStateDuration * 0.1, false);
@@ -90,16 +90,16 @@
GameAI::getSingletonPtr()->GetCheckStatus();
// we've finished the action
- return HandState::StateType::Static;
+ return HandState::Static;
}
else
{
- if (mActionType == HandState::ActionType::Move ||
- mActionType == HandState::ActionType::Castle ||
- mActionType == HandState::ActionType::Promotion ||
- mActionType == HandState::ActionType::EnPassant)
- return HandState::StateType::SimpleReturn;
+ if (mActionType == HandState::Move ||
+ mActionType == HandState::Castle ||
+ mActionType == HandState::Promotion ||
+ mActionType == HandState::EnPassant)
+ return HandState::SimpleReturn;
else
- return HandState::StateType::CaptureReturn;
+ return HandState::CaptureReturn;
}
}
diff -urN chess.orig/src/StaticState.cpp chess/src/StaticState.cpp
--- chess.orig/src/StaticState.cpp 2005-05-11 17:19:28.000000000 +0200
+++ chess/src/StaticState.cpp 2006-06-19 16:35:44.000000000 +0200
@@ -24,7 +24,7 @@
void StaticState::Initialise(void)
{
// record this state type
- mStateType = HandState::StateType::Static;
+ mStateType = HandState::Static;
mPromoType = "";
// turn off particles
diff -urN chess.orig/src/unixutils.c chess/src/unixutils.c
--- chess.orig/src/unixutils.c 1970-01-01 01:00:00.000000000 +0100
+++ chess/src/unixutils.c 2006-06-26 16:09:50.000000000 +0200
@@ -0,0 +1,81 @@
+#ifdef __unix__
+#include <stdio.h>
+#include <pwd.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if defined(__DECC) && defined(VMS)
+#include <unixlib.h>
+static char *vms_to_unix_buffer = NULL;
+static int convert_vms_to_unix(char *vms_dir_name)
+{
+ vms_to_unix_buffer = vms_dir_name;
+}
+#endif
+
+char *get_homedir(void)
+{
+ struct passwd *pw;
+
+ if (!(pw = getpwuid(getuid())))
+ {
+ fprintf(stderr, "Who are you? Not found in passwd database!!\n");
+ return NULL;
+ }
+
+#if defined(__DECC) && defined(VMS)
+ /* Convert The OpenVMS Formatted "$HOME" Directory Path Into Unix
+ Format. */
+ decc$from_vms(pw->pw_dir, convert_vms_to_unix, 1);
+ return vms_to_unix_buffer;
+#else
+ return pw->pw_dir;
+#endif
+}
+//-----------------------------------------------------------------------------
+int check_and_create_dir(const char *name)
+{
+ struct stat stat_buffer;
+
+ if (stat(name, &stat_buffer))
+ {
+ /* error check if it doesn't exist or something else is wrong */
+ if (errno == ENOENT)
+ {
+ /* doesn't exist letts create it ;) */
+#ifdef BSD43
+ if (mkdir(name, 0775))
+#else
+ if (mkdir(name, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH))
+#endif
+ {
+ fprintf(stderr, "Error creating dir %s", name);
+ perror(" ");
+ return -1;
+ }
+ }
+ else
+ {
+ /* something else went wrong yell about it */
+ fprintf(stderr, "Error opening %s", name);
+ perror(" ");
+ return -1;
+ }
+ }
+ else
+ {
+ /* file exists check it's a dir otherwise yell about it */
+#ifdef BSD43
+ if (!(S_IFDIR & stat_buffer.st_mode))
+#else
+ if (!S_ISDIR(stat_buffer.st_mode))
+#endif
+ {
+ fprintf(stderr,"Error %s exists but isn't a dir\n", name);
+ return -1;
+ }
+ }
+ return 0;
+}
+#endif
--- NEW FILE chess.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=Chess
Comment=3D Chess Game
Exec=chess
Icon=chess.png
Terminal=false
StartupNotify=false
Type=Application
Categories=Application;Game;
--- NEW FILE chess.spec ---
Name: chess
Version: 1.0
Release: 1%{?dist}
Summary: 3D chess game
Group: Amusements/Games
License: GPL
URL: http://www.steviedisco.co.uk
# This file identical to: http://www.steviedisco.co.uk/files/chess_src.zip
# except that it has the MS copyrighted tahoma.ttf file removed.
Source0: chess_src.zip
Source1: chess.desktop
Source2: chess.png
Patch0: chess-ogre12+gcc41+fixes.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ogre-devel cegui-devel coldet-devel boost-devel
BuildRequires: desktop-file-utils
# This is used as Tahoma replacement
Requires: /usr/share/fonts/bitstream-vera/Vera.ttf
%description
Beautifull 3D rendered chess game using Ogre. Notice that this needs a
powerful 3D card to be playable on a radeon 92xx or intel 9xx integrated
graphics this is not playable!
%prep
%setup -q -c
%patch0 -p1 -z .fixes
sed -i 's/\r//' Readme.txt License/gpl.txt
# fixup plugins.cfg on 64 bit systems
sed -i 's!/usr/lib!%{_libdir}!' plugins.cfg
%build
make %{?_smp_mflags} PREFIX=%{_prefix} OPTFLAGS="$RPM_OPT_FLAGS -fsigned-char"
%install
rm -rf $RPM_BUILD_ROOT
make install PREFIX=$RPM_BUILD_ROOT%{_prefix}
# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
--add-category X-Fedora \
%{SOURCE1}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
install -p -m 644 %{SOURCE2} \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
%clean
rm -rf $RPM_BUILD_ROOT
%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
%files
%defattr(-,root,root,-)
%doc Readme.txt License/gpl.txt
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%changelog
* Mon Jun 26 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 1.0-1
- Initial Fedora Extras package
Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/chess/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 9 Jul 2006 08:20:56 -0000 1.1
+++ .cvsignore 9 Jul 2006 08:23:58 -0000 1.2
@@ -0,0 +1 @@
+chess_src.zip
Index: sources
===================================================================
RCS file: /cvs/extras/rpms/chess/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 9 Jul 2006 08:20:56 -0000 1.1
+++ sources 9 Jul 2006 08:23:58 -0000 1.2
@@ -0,0 +1 @@
+10f7c2429823b07902ebda3e4a22994f chess_src.zip
More information about the fedora-extras-commits
mailing list