2011-03-13 20:22:05 +01:00
|
|
|
/* Copyright (C) 2011 Wildfire Games.
|
2009-04-18 19:00:33 +02:00
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#ifndef INCLUDED_OBJECTENTRY
|
|
|
|
#define INCLUDED_OBJECTENTRY
|
2004-05-30 02:46:58 +02:00
|
|
|
|
2011-03-13 20:22:05 +01:00
|
|
|
class CModelAbstract;
|
2004-05-30 02:46:58 +02:00
|
|
|
class CSkeletonAnim;
|
2006-04-24 00:22:18 +02:00
|
|
|
class CObjectBase;
|
2007-01-13 23:44:42 +01:00
|
|
|
class CObjectManager;
|
2005-05-10 09:13:25 +02:00
|
|
|
struct SPropPoint;
|
2004-05-30 02:46:58 +02:00
|
|
|
|
2005-06-20 17:14:36 +02:00
|
|
|
#include <map>
|
2006-11-12 05:02:36 +01:00
|
|
|
#include <set>
|
2004-05-30 02:46:58 +02:00
|
|
|
#include <vector>
|
2006-11-18 19:15:31 +01:00
|
|
|
|
2009-11-03 22:46:35 +01:00
|
|
|
#include "lib/file/vfs/vfs_path.h"
|
2006-06-02 04:10:27 +02:00
|
|
|
#include "ps/CStr.h"
|
|
|
|
#include "ps/Overlay.h"
|
2004-05-30 02:46:58 +02:00
|
|
|
|
|
|
|
class CObjectEntry
|
|
|
|
{
|
|
|
|
public:
|
2006-09-22 19:43:00 +02:00
|
|
|
CObjectEntry(CObjectBase* base);
|
2004-05-30 02:46:58 +02:00
|
|
|
~CObjectEntry();
|
|
|
|
|
2006-05-31 07:27:02 +02:00
|
|
|
// Construct this actor, using the specified variation selections
|
2007-01-08 02:56:46 +01:00
|
|
|
bool BuildVariation(const std::vector<std::set<CStr> >& selections,
|
|
|
|
const std::vector<u8>& variationKey, CObjectManager& objectManager);
|
2004-05-30 02:46:58 +02:00
|
|
|
|
2005-04-03 07:02:00 +02:00
|
|
|
// Base actor. Contains all the things that don't change between
|
2005-03-22 18:09:36 +01:00
|
|
|
// different variations of the actor.
|
|
|
|
CObjectBase* m_Base;
|
2005-03-19 12:55:27 +01:00
|
|
|
|
2009-11-03 22:46:35 +01:00
|
|
|
VfsPath m_TextureName;
|
2004-05-30 02:46:58 +02:00
|
|
|
// model name
|
2009-11-03 22:46:35 +01:00
|
|
|
VfsPath m_ModelName;
|
2005-04-07 06:29:07 +02:00
|
|
|
// colour (used when doing alpha-channel colouring, but not doing player-colour)
|
|
|
|
CColor m_Color;
|
2005-05-21 03:40:32 +02:00
|
|
|
// (probable TODO: make colour a per-model thing, rather than per-objectEntry,
|
|
|
|
// so we can have lots of colour variations without wasting memory on
|
|
|
|
// lots of objectEntries)
|
2004-11-11 08:09:32 +01:00
|
|
|
|
2011-03-23 14:36:20 +01:00
|
|
|
std::wstring m_ProjectileModelName;
|
2010-04-17 13:34:40 +02:00
|
|
|
|
2005-05-21 03:40:32 +02:00
|
|
|
// Returns a randomly-chosen animation matching the given name.
|
|
|
|
// If none is found, returns NULL.
|
2010-06-05 02:49:14 +02:00
|
|
|
CSkeletonAnim* GetRandomAnimation(const CStr& animationName) const;
|
|
|
|
|
|
|
|
// Returns all the animations matching the given name.
|
|
|
|
std::vector<CSkeletonAnim*> GetAnimations(const CStr& animationName) const;
|
2005-05-21 03:40:32 +02:00
|
|
|
|
2004-05-30 02:46:58 +02:00
|
|
|
// corresponding model
|
2011-03-13 20:22:05 +01:00
|
|
|
CModelAbstract* m_Model;
|
2005-05-21 03:40:32 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef std::multimap<CStr, CSkeletonAnim*> SkeletonAnimMap;
|
|
|
|
SkeletonAnimMap m_Animations;
|
|
|
|
// TODO: something more memory-efficient than storing loads of similar strings for each unit?
|
2004-05-30 02:46:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|