mirror of
https://github.com/electronicarts/CnC_Renegade.git
synced 2025-12-15 15:11:39 -05:00
Initial commit of Command & Conquer Renegade source code.
This commit is contained in:
BIN
Code/wwtranslatedb/Debug/wwtranslatedb.pch
Normal file
BIN
Code/wwtranslatedb/Debug/wwtranslatedb.pch
Normal file
Binary file not shown.
269
Code/wwtranslatedb/stringtwiddler.cpp
Normal file
269
Code/wwtranslatedb/stringtwiddler.cpp
Normal file
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : wwtranslatedb *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/stringtwiddler.cpp $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 8/01/01 4:26p $*
|
||||
* *
|
||||
* $Revision:: 3 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#include "stringtwiddler.h"
|
||||
|
||||
#include "chunkio.h"
|
||||
#include "persistfactory.h"
|
||||
#include "translatedbids.h"
|
||||
#include "translatedb.h"
|
||||
#include "tdbcategories.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Persist factory
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
SimplePersistFactoryClass<StringTwiddlerClass, CHUNKID_STRING_TWIDDLER> _StringTwiddlerPersistFactory;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Constants
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
enum
|
||||
{
|
||||
CHUNKID_VARIABLES = 0x07310319,
|
||||
CHUNKID_BASE_CLASS,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
VARID_STRING_ID = 0x01,
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// StringTwiddlerClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
StringTwiddlerClass::StringTwiddlerClass (void)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// StringTwiddlerClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
StringTwiddlerClass::StringTwiddlerClass (const StringTwiddlerClass &src) :
|
||||
TDBObjClass (src)
|
||||
{
|
||||
(*this) = src;
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ~StringTwiddlerClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
StringTwiddlerClass::~StringTwiddlerClass (void)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// operator=
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
const StringTwiddlerClass &
|
||||
StringTwiddlerClass::operator= (const StringTwiddlerClass &src)
|
||||
{
|
||||
TDBObjClass::operator= (src);
|
||||
StringList = src.StringList;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get_Factory
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
const PersistFactoryClass &
|
||||
StringTwiddlerClass::Get_Factory (void) const
|
||||
{
|
||||
return _StringTwiddlerPersistFactory;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Save
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
bool
|
||||
StringTwiddlerClass::Save (ChunkSaveClass &csave)
|
||||
{
|
||||
csave.Begin_Chunk (CHUNKID_BASE_CLASS);
|
||||
TDBObjClass::Save (csave);
|
||||
csave.End_Chunk ();
|
||||
|
||||
csave.Begin_Chunk (CHUNKID_VARIABLES);
|
||||
|
||||
//
|
||||
// Write each string ID to its own microchunk
|
||||
//
|
||||
for (int index = 0; index < StringList.Count (); index ++) {
|
||||
int string_id = StringList[index];
|
||||
WRITE_MICRO_CHUNK (csave, VARID_STRING_ID, string_id);
|
||||
}
|
||||
|
||||
csave.End_Chunk ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Load
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
bool
|
||||
StringTwiddlerClass::Load (ChunkLoadClass &cload)
|
||||
{
|
||||
while (cload.Open_Chunk ()) {
|
||||
switch (cload.Cur_Chunk_ID ()) {
|
||||
|
||||
case CHUNKID_BASE_CLASS:
|
||||
TDBObjClass::Load (cload);
|
||||
break;
|
||||
|
||||
case CHUNKID_VARIABLES:
|
||||
Load_Variables (cload);
|
||||
break;
|
||||
}
|
||||
|
||||
cload.Close_Chunk ();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Load_Variables
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
StringTwiddlerClass::Load_Variables (ChunkLoadClass &cload)
|
||||
{
|
||||
while (cload.Open_Micro_Chunk ()) {
|
||||
switch (cload.Cur_Micro_Chunk_ID ()) {
|
||||
|
||||
case VARID_STRING_ID:
|
||||
{
|
||||
//
|
||||
// Read the data from the chunk
|
||||
//
|
||||
int string_id = 0;
|
||||
LOAD_MICRO_CHUNK (cload, string_id);
|
||||
|
||||
//
|
||||
// Store this string ID in our list if its valid
|
||||
//
|
||||
if (string_id != 0) {
|
||||
StringList.Add (string_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
cload.Close_Micro_Chunk ();
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get_String
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
const WideStringClass &
|
||||
StringTwiddlerClass::Get_String (uint32 lang_id)
|
||||
{
|
||||
//
|
||||
// Copy the contents of one of the string objects
|
||||
// into our internal data
|
||||
//
|
||||
Randomize (lang_id);
|
||||
|
||||
return TDBObjClass::Get_String (lang_id);
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Randomize
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
StringTwiddlerClass::Randomize (int lang_id)
|
||||
{
|
||||
//
|
||||
// Are there any entries in our twiddler list?
|
||||
//
|
||||
int count = StringList.Count ();
|
||||
if (count > 0) {
|
||||
|
||||
//
|
||||
// Randomly pick a string from our list
|
||||
//
|
||||
int index = (rand () % count);
|
||||
TDBObjClass *object = TranslateDBClass::Find_Object (StringList[index]);
|
||||
if (object != NULL && object->As_StringTwiddlerClass () == NULL) {
|
||||
|
||||
//
|
||||
// Copy the string contents into ourselves
|
||||
//
|
||||
Set_String (lang_id, object->Get_String ());
|
||||
EnglishString = object->Get_English_String ();
|
||||
SoundID = object->Get_Sound_ID ();
|
||||
AnimationName = object->Get_Animation_Name ();
|
||||
}
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
136
Code/wwtranslatedb/stringtwiddler.h
Normal file
136
Code/wwtranslatedb/stringtwiddler.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : wwtranslatedb *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/stringtwiddler.h $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 8/01/01 3:54p $*
|
||||
* *
|
||||
* $Revision:: 3 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef __STRING_TWIDDLER_H
|
||||
#define __STRING_TWIDDLER_H
|
||||
|
||||
#include "translateobj.h"
|
||||
#include "translatedb.h"
|
||||
#include "vector.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Forward declarations
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// StringTwiddlerClass
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class StringTwiddlerClass : public TDBObjClass
|
||||
{
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public constructors/destructors
|
||||
//////////////////////////////////////////////////////////////
|
||||
StringTwiddlerClass (void);
|
||||
StringTwiddlerClass (const StringTwiddlerClass &src);
|
||||
virtual ~StringTwiddlerClass (void);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public operators
|
||||
//////////////////////////////////////////////////////////////
|
||||
const StringTwiddlerClass & operator= (const StringTwiddlerClass &src);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// RTTI
|
||||
//
|
||||
StringTwiddlerClass * As_StringTwiddlerClass (void) { return this; }
|
||||
|
||||
//
|
||||
// From PersistClass
|
||||
//
|
||||
const PersistFactoryClass &Get_Factory (void) const;
|
||||
bool Save (ChunkSaveClass &csave);
|
||||
bool Load (ChunkLoadClass &cload);
|
||||
|
||||
//
|
||||
// Copy methods
|
||||
//
|
||||
TDBObjClass * Clone (void) const { return new StringTwiddlerClass (*this); }
|
||||
|
||||
//
|
||||
// Inherited
|
||||
//
|
||||
const WideStringClass & Get_String (uint32 lang_id);
|
||||
const StringClass & Get_English_String (void) { Randomize (); return TDBObjClass::Get_English_String (); }
|
||||
const StringClass & Get_ID_Desc (void) { Randomize (); return TDBObjClass::Get_ID_Desc (); }
|
||||
uint32 Get_Sound_ID (void) { Randomize (); return TDBObjClass::Get_Sound_ID (); }
|
||||
const StringClass & Get_Animation_Name (void) { Randomize (); return TDBObjClass::Get_Animation_Name (); }
|
||||
uint32 Get_Category_ID (void) { Randomize (); return TDBObjClass::Get_Category_ID (); }
|
||||
|
||||
//
|
||||
// String list access
|
||||
//
|
||||
void Add_String (int string_id) { StringList.Add (string_id); }
|
||||
void Reset_String_List (void) { StringList.Delete_All (); }
|
||||
int Get_String_Count (void) const { return StringList.Count (); }
|
||||
int Get_String (int index) const { return StringList[index]; }
|
||||
TDBObjClass * Lookup_String (int index);
|
||||
|
||||
protected:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Protected methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
void Save_Variables (ChunkSaveClass &csave);
|
||||
void Load_Variables (ChunkLoadClass &cload);
|
||||
|
||||
void Randomize (int lang_id = TranslateDBClass::LANGID_ENGLISH);
|
||||
|
||||
private:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Private member data
|
||||
//////////////////////////////////////////////////////////////
|
||||
DynamicVectorClass<int> StringList;
|
||||
};
|
||||
|
||||
|
||||
#endif //__STRING_TWIDDLER_H
|
||||
|
||||
58
Code/wwtranslatedb/tdbcategories.h
Normal file
58
Code/wwtranslatedb/tdbcategories.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : wwtranslatedb *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/tdbcategories.h $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 11/22/00 10:53a $*
|
||||
* *
|
||||
* $Revision:: 2 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef __TDB_CATEGORIES_H
|
||||
#define __TDB_CATEGORIES_H
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
CATEGORY_DEFAULT = 0,
|
||||
|
||||
} TDB_CATEGORIES;
|
||||
|
||||
|
||||
#endif //__TDB_CATEGORIES_H
|
||||
212
Code/wwtranslatedb/tdbcategory.cpp
Normal file
212
Code/wwtranslatedb/tdbcategory.cpp
Normal file
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : wwtranslatedb *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/tdbcategory.cpp $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 11/22/00 10:53a $*
|
||||
* *
|
||||
* $Revision:: 2 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#include "tdbcategory.h"
|
||||
|
||||
#include "chunkio.h"
|
||||
#include "persistfactory.h"
|
||||
#include "translatedbids.h"
|
||||
#include "tdbcategories.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Persist factory
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
SimplePersistFactoryClass<TDBCategoryClass, CHUNKID_TDBCATEGORY> _TDBCategoryPersistFactory;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Constants
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
enum
|
||||
{
|
||||
CHUNKID_VARIABLES = 0x11221022,
|
||||
CHUNKID_BASE_CLASS,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
VARID_ID = 0x01,
|
||||
VARID_NAME,
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TDBCategoryClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
TDBCategoryClass::TDBCategoryClass (void) :
|
||||
ID (CATEGORY_DEFAULT)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TDBCategoryClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
TDBCategoryClass::TDBCategoryClass (const TDBCategoryClass &src) :
|
||||
ID (CATEGORY_DEFAULT)
|
||||
{
|
||||
(*this) = src;
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ~TDBCategoryClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
TDBCategoryClass::~TDBCategoryClass (void)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// operator=
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
const TDBCategoryClass &
|
||||
TDBCategoryClass::operator= (const TDBCategoryClass &src)
|
||||
{
|
||||
ID = src.ID;
|
||||
Name = src.Name;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get_Factory
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
const PersistFactoryClass &
|
||||
TDBCategoryClass::Get_Factory (void) const
|
||||
{
|
||||
return _TDBCategoryPersistFactory;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Save
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
bool
|
||||
TDBCategoryClass::Save (ChunkSaveClass &csave)
|
||||
{
|
||||
csave.Begin_Chunk (CHUNKID_BASE_CLASS);
|
||||
PersistClass::Save (csave);
|
||||
csave.End_Chunk ();
|
||||
|
||||
csave.Begin_Chunk (CHUNKID_VARIABLES);
|
||||
Save_Variables (csave);
|
||||
csave.End_Chunk ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Load
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
bool
|
||||
TDBCategoryClass::Load (ChunkLoadClass &cload)
|
||||
{
|
||||
while (cload.Open_Chunk ()) {
|
||||
switch (cload.Cur_Chunk_ID ()) {
|
||||
|
||||
case CHUNKID_BASE_CLASS:
|
||||
PersistClass::Load (cload);
|
||||
break;
|
||||
|
||||
case CHUNKID_VARIABLES:
|
||||
Load_Variables (cload);
|
||||
break;
|
||||
}
|
||||
|
||||
cload.Close_Chunk ();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Save_Variables
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBCategoryClass::Save_Variables (ChunkSaveClass &csave)
|
||||
{
|
||||
//
|
||||
// Save each variable to its own micro chunk
|
||||
//
|
||||
WRITE_MICRO_CHUNK (csave, VARID_ID, ID);
|
||||
WRITE_MICRO_CHUNK_WWSTRING (csave, VARID_NAME, Name);
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Load_Variables
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBCategoryClass::Load_Variables (ChunkLoadClass &cload)
|
||||
{
|
||||
while (cload.Open_Micro_Chunk ()) {
|
||||
switch (cload.Cur_Micro_Chunk_ID ()) {
|
||||
|
||||
READ_MICRO_CHUNK (cload, VARID_ID, ID);
|
||||
READ_MICRO_CHUNK_WWSTRING (cload, VARID_NAME, Name);
|
||||
}
|
||||
|
||||
cload.Close_Micro_Chunk ();
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
124
Code/wwtranslatedb/tdbcategory.h
Normal file
124
Code/wwtranslatedb/tdbcategory.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : wwtranslatedb *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/tdbcategory.h $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 11/22/00 10:53a $*
|
||||
* *
|
||||
* $Revision:: 2 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef __TDB_CATEGORY_H
|
||||
#define __TDB_CATEGORY_H
|
||||
|
||||
#include "persist.h"
|
||||
#include "wwstring.h"
|
||||
#include "vector.h"
|
||||
#include "bittype.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Forward declarations
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class ChunkSaveClass;
|
||||
class ChunkLoadClass;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TDBCategoryClass
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class TDBCategoryClass : public PersistClass
|
||||
{
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public constructors/destructors
|
||||
//////////////////////////////////////////////////////////////
|
||||
TDBCategoryClass (void);
|
||||
TDBCategoryClass (const TDBCategoryClass &src);
|
||||
virtual ~TDBCategoryClass (void);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public operators
|
||||
//////////////////////////////////////////////////////////////
|
||||
const TDBCategoryClass &operator= (const TDBCategoryClass &src);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// From PersistClass
|
||||
//
|
||||
const PersistFactoryClass &Get_Factory (void) const;
|
||||
bool Save (ChunkSaveClass &csave);
|
||||
bool Load (ChunkLoadClass &cload);
|
||||
|
||||
//
|
||||
// Copy methods
|
||||
//
|
||||
TDBCategoryClass * Clone (void) const { return new TDBCategoryClass (*this); }
|
||||
|
||||
//
|
||||
// TDBCategoryClass specific
|
||||
//
|
||||
|
||||
const StringClass & Get_Name (void) const { return Name; }
|
||||
void Set_Name (const char *name) { Name = name; }
|
||||
|
||||
uint32 Get_ID (void) const { return ID; }
|
||||
void Set_ID (uint32 id) { ID = id; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Protected methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
void Save_Variables (ChunkSaveClass &csave);
|
||||
void Load_Variables (ChunkLoadClass &cload);
|
||||
|
||||
private:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Private member data
|
||||
//////////////////////////////////////////////////////////////
|
||||
StringClass Name;
|
||||
uint32 ID;
|
||||
};
|
||||
|
||||
|
||||
#endif //__TDB_CATEGORY_H
|
||||
1376
Code/wwtranslatedb/translatedb.cpp
Normal file
1376
Code/wwtranslatedb/translatedb.cpp
Normal file
File diff suppressed because it is too large
Load Diff
414
Code/wwtranslatedb/translatedb.h
Normal file
414
Code/wwtranslatedb/translatedb.h
Normal file
@@ -0,0 +1,414 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : LevelEdit *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/translatedb.h $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 11/12/01 11:43a $*
|
||||
* *
|
||||
* $Revision:: 23 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef __TRANSLATE_DB_H
|
||||
#define __TRANSLATE_DB_H
|
||||
|
||||
#include "saveloadsubsystem.h"
|
||||
#include "vector.h"
|
||||
#include "bittype.h"
|
||||
#include "translateobj.h"
|
||||
#include "tdbcategory.h"
|
||||
#include "hashtemplate.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Singleton instance
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
extern class TranslateDBClass _TheTranslateDB;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Typedefs
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
typedef DynamicVectorClass<TDBObjClass *> TDB_OBJ_LIST;
|
||||
typedef DynamicVectorClass<TDBCategoryClass *> TDB_CATEGORY_LIST;
|
||||
|
||||
extern const WCHAR * STRING_NOT_FOUND;
|
||||
extern const char * ENGLISH_STRING_NOT_FOUND;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Useful macros
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#define TRANSLATION TranslateDBClass::Get_String
|
||||
#define TRANSLATE TranslateDBClass::Get_String
|
||||
#define TRANSLATE_BY_DESC(desc) TranslateDBClass::Get_String (desc);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TranslateDBClass
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class TranslateDBClass : public SaveLoadSubSystemClass
|
||||
{
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public constants
|
||||
//////////////////////////////////////////////////////////////
|
||||
enum
|
||||
{
|
||||
LANGID_ENGLISH = 0,
|
||||
LANGID_FRENCH,
|
||||
LANGID_GERMAN,
|
||||
LANGID_SPANISH,
|
||||
LANGID_CHINESE,
|
||||
LANGID_JAPANESE,
|
||||
LANGID_KOREAN
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FILTER_DISABLED = 0,
|
||||
FILTER_IF_EQUAL,
|
||||
FILTER_IF_NOT_EQUAL,
|
||||
} FILTER_OPT;
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public constructors/destructors
|
||||
//////////////////////////////////////////////////////////////
|
||||
TranslateDBClass (void) { }
|
||||
virtual ~TranslateDBClass (void) { }
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// Initialization
|
||||
//
|
||||
static void Initialize (void);
|
||||
static void Shutdown (void);
|
||||
static uint32 Get_Version_Number (void);
|
||||
static void Update_Version (void);
|
||||
static bool Is_Loaded() {return (m_ObjectList.Count () > 0);}
|
||||
|
||||
|
||||
//
|
||||
// From SaveLoadSubSystemClass
|
||||
//
|
||||
virtual uint32 Chunk_ID (void) const;
|
||||
virtual const char * Name (void) const { return "TranslateDBClass"; }
|
||||
|
||||
//
|
||||
// C style header file support
|
||||
//
|
||||
static void Import_Strings (const char *filename);
|
||||
static void Import_C_Header (const char *filename);
|
||||
static void Export_C_Header (const char *filename);
|
||||
static void Export_Table (const char *filename);
|
||||
|
||||
//
|
||||
// Data access
|
||||
//
|
||||
static const WCHAR * Get_String (uint32 id);
|
||||
static const WCHAR * Get_String (const char *id_desc);
|
||||
static const char * Get_English_String (uint32 id);
|
||||
WWINLINE static TDBObjClass * Find_Object (uint32 id);
|
||||
WWINLINE static TDBObjClass * Find_Object (const char *id_desc);
|
||||
|
||||
|
||||
//
|
||||
// Content management
|
||||
//
|
||||
static bool Add_Object (TDBObjClass *new_obj);
|
||||
static bool Remove_Object (int index);
|
||||
static void Remove_All (void);
|
||||
|
||||
//
|
||||
// Enumeration
|
||||
//
|
||||
static int Get_Object_Count (void);
|
||||
static TDBObjClass * Get_Object (int index);
|
||||
static TDBObjClass * Get_First_Object (uint32 category_id);
|
||||
static TDBObjClass * Get_Next_Object (uint32 category_id, TDBObjClass *curr_obj);
|
||||
|
||||
//
|
||||
// Category support
|
||||
//
|
||||
static int Get_Category_Count (void);
|
||||
static TDBCategoryClass * Get_Category (int index);
|
||||
static TDBCategoryClass * Find_Category (uint32 id);
|
||||
static TDBCategoryClass * Find_Category (const char *name);
|
||||
static TDBCategoryClass * Add_Category (const char *name);
|
||||
static bool Add_Category (TDBCategoryClass *new_category, bool assign_id = true);
|
||||
static bool Remove_Category (int index);
|
||||
|
||||
//
|
||||
// Language support
|
||||
//
|
||||
static void Set_Current_Language (int lang_id) { m_LanguageID = lang_id; }
|
||||
static uint32 Get_Current_Language (void) { return m_LanguageID; }
|
||||
|
||||
//
|
||||
// Save/load options
|
||||
//
|
||||
static bool Is_Single_Language_Export_Enabled (void) { return IsSingleLanguageExport; }
|
||||
static void Enable_Single_Language_Export (bool onoff) { IsSingleLanguageExport = onoff; }
|
||||
|
||||
static void Set_Export_Filter (FILTER_OPT filter, uint32 category_id);
|
||||
|
||||
protected:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Protected methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// Save/load stuff
|
||||
//
|
||||
virtual bool Contains_Data(void) const;
|
||||
virtual bool Save (ChunkSaveClass &csave);
|
||||
virtual bool Load (ChunkLoadClass &cload);
|
||||
|
||||
bool Load_Variables (ChunkLoadClass &cload);
|
||||
bool Load_Objects (ChunkLoadClass &cload);
|
||||
bool Load_Categories (ChunkLoadClass &cload);
|
||||
|
||||
static void Validate_Data (void);
|
||||
|
||||
static void Free_Objects (void);
|
||||
static void Free_Categories (void);
|
||||
|
||||
//
|
||||
// ID managment
|
||||
//
|
||||
static uint32 Find_Unique_ID (void);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Protected data types
|
||||
//////////////////////////////////////////////////////////////
|
||||
enum
|
||||
{
|
||||
ID_MIN = 1000,
|
||||
ID_MAX = 999999
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Private member data
|
||||
//////////////////////////////////////////////////////////////
|
||||
static TDB_OBJ_LIST m_ObjectList;
|
||||
static HashTemplateClass<StringClass,TDBObjClass*> m_ObjectHash;
|
||||
static TDB_CATEGORY_LIST m_CategoryList;
|
||||
static uint32 m_VersionNumber;
|
||||
static uint32 m_LanguageID;
|
||||
static bool IsSingleLanguageExport;
|
||||
static uint32 CategoryExportFilter;
|
||||
static FILTER_OPT FilterType;
|
||||
static uint32 FilterCategoryID;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Get_String
|
||||
//////////////////////////////////////////////////////////////
|
||||
inline const WCHAR *
|
||||
TranslateDBClass::Get_String (uint32 id)
|
||||
{
|
||||
// ID of 0 (zero) is a special case NULL string.
|
||||
if (id == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const WCHAR *string = STRING_NOT_FOUND;
|
||||
|
||||
//
|
||||
// Check to make sure the database is loaded
|
||||
//
|
||||
WWASSERT (Is_Loaded());
|
||||
|
||||
//
|
||||
// Calculate which index this ID refers to
|
||||
//
|
||||
int index = (id - ID_MIN);
|
||||
|
||||
//
|
||||
// Check to see if the requested ID is in the range
|
||||
// of loaded string objects.
|
||||
//
|
||||
WWASSERT (index >= 0 && index < m_ObjectList.Count ());
|
||||
if (index >= 0 && index < m_ObjectList.Count ()) {
|
||||
|
||||
//
|
||||
// Get the translation object
|
||||
//
|
||||
TDBObjClass *trans_obj = m_ObjectList[index];
|
||||
WWASSERT (trans_obj != NULL);
|
||||
if (trans_obj != NULL) {
|
||||
|
||||
//
|
||||
// Get the string from the object and return it to the caller
|
||||
//
|
||||
string = trans_obj->Get_String ();
|
||||
}
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Get_String
|
||||
//////////////////////////////////////////////////////////////
|
||||
inline const WCHAR *
|
||||
TranslateDBClass::Get_String (const char *id_desc)
|
||||
{
|
||||
// NULL description is a special case NULL string.
|
||||
if (id_desc == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const WCHAR *string = STRING_NOT_FOUND;
|
||||
|
||||
//
|
||||
// Lookup the object based on its ID
|
||||
//
|
||||
TDBObjClass *translate_obj = Find_Object (id_desc);
|
||||
if (translate_obj != NULL) {
|
||||
|
||||
//
|
||||
// Get the string from the object and return it to the caller
|
||||
//
|
||||
string = translate_obj->Get_String ();
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Get_English_String
|
||||
//////////////////////////////////////////////////////////////
|
||||
inline const char *
|
||||
TranslateDBClass::Get_English_String (uint32 id)
|
||||
{
|
||||
// ID of 0 (zero) is a special case NULL string.
|
||||
if (id == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *string = ENGLISH_STRING_NOT_FOUND;
|
||||
|
||||
//
|
||||
// Check to make sure the database is loaded
|
||||
//
|
||||
WWASSERT (m_ObjectList.Count () > 0);
|
||||
|
||||
//
|
||||
// Calculate which index this ID refers to
|
||||
//
|
||||
int index = (id - ID_MIN);
|
||||
|
||||
//
|
||||
// Check to see if the requested ID is in the range
|
||||
// of loaded string objects.
|
||||
//
|
||||
WWASSERT (index >= 0 && index < m_ObjectList.Count ());
|
||||
if (index >= 0 && index < m_ObjectList.Count ()) {
|
||||
|
||||
//
|
||||
// Get the translation object
|
||||
//
|
||||
TDBObjClass *trans_obj = m_ObjectList[index];
|
||||
WWASSERT (trans_obj != NULL);
|
||||
if (trans_obj != NULL) {
|
||||
|
||||
//
|
||||
// Get the string from the object and return it to the caller
|
||||
//
|
||||
string = trans_obj->Get_English_String ();
|
||||
}
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Find_Object
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
WWINLINE TDBObjClass *
|
||||
TranslateDBClass::Find_Object (const char *id_desc)
|
||||
{
|
||||
StringClass lower_case_name(id_desc,true);
|
||||
_strlwr(lower_case_name.Peek_Buffer());
|
||||
return m_ObjectHash.Get(lower_case_name);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Find_Object
|
||||
//////////////////////////////////////////////////////////////
|
||||
WWINLINE TDBObjClass *
|
||||
TranslateDBClass::Find_Object (uint32 id)
|
||||
{
|
||||
TDBObjClass *object = NULL;
|
||||
|
||||
//
|
||||
// Calculate which index this ID refers to
|
||||
//
|
||||
int index = (id - ID_MIN);
|
||||
if (index >= 0 && index < m_ObjectList.Count ()) {
|
||||
|
||||
//
|
||||
// Get the translation object
|
||||
//
|
||||
object = m_ObjectList[index];
|
||||
|
||||
//
|
||||
// Make sure this is the object the caller requested
|
||||
//
|
||||
WWASSERT (object != NULL && object->Get_ID () == id);
|
||||
if (object != NULL && object->Get_ID () != id) {
|
||||
object = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
#endif //__TRANSLATE_DB_H
|
||||
|
||||
63
Code/wwtranslatedb/translatedbids.h
Normal file
63
Code/wwtranslatedb/translatedbids.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : LevelEdit *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/translatedbids.h $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 7/31/01 2:48p $*
|
||||
* *
|
||||
* $Revision:: 3 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef __TRANSLATE_DB_IDS_H
|
||||
#define __TRANSLATE_DB_IDS_H
|
||||
|
||||
#include "saveloadids.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// These are the chunk IDs that serve as 'globally-unique' persist identifiers for
|
||||
// all persist objects inside this library. These are used when building the
|
||||
// PersistFactoryClass's for PersistClass-derived objects.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
enum
|
||||
{
|
||||
CHUNKID_TRANSLATE_DB = CHUNKID_WWTRANSLATEDB_BEGIN,
|
||||
CHUNKID_TRANSLATE_OBJ,
|
||||
CHUNKID_TDBCATEGORY,
|
||||
CHUNKID_STRING_TWIDDLER,
|
||||
};
|
||||
|
||||
|
||||
#endif //__TRANSLATE_DB_IDS_H
|
||||
439
Code/wwtranslatedb/translateobj.cpp
Normal file
439
Code/wwtranslatedb/translateobj.cpp
Normal file
@@ -0,0 +1,439 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : wwtranslatedb *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/translateobj.cpp $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 9/13/01 9:04a $*
|
||||
* *
|
||||
* $Revision:: 9 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#include "translateobj.h"
|
||||
|
||||
#include "chunkio.h"
|
||||
#include "persistfactory.h"
|
||||
#include "translatedbids.h"
|
||||
#include "translatedb.h"
|
||||
#include "tdbcategories.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Persist factory
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
SimplePersistFactoryClass<TDBObjClass, CHUNKID_TRANSLATE_OBJ> _TranslateObjPersistFactory;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Constants
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
enum
|
||||
{
|
||||
CHUNKID_VARIABLES = 0x06141108,
|
||||
CHUNKID_BASE_CLASS,
|
||||
CHUNKID_ENGLISH_STRING,
|
||||
CHUNKID_TRANSLATED_STRING
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
VARID_ID = 0x01,
|
||||
VARID_ID_DESC,
|
||||
VARID_STRING,
|
||||
VARID_ENGLISH_STRING,
|
||||
VARID_SOUND_ID,
|
||||
VARID_ANIMATION_NAME,
|
||||
VARID_CATEGORY_ID
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TDBObjClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
TDBObjClass::TDBObjClass (void) :
|
||||
ID (0),
|
||||
SoundID (-1),
|
||||
CategoryID (CATEGORY_DEFAULT)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TDBObjClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
TDBObjClass::TDBObjClass (const TDBObjClass &src) :
|
||||
ID (0),
|
||||
SoundID (-1),
|
||||
CategoryID (CATEGORY_DEFAULT)
|
||||
{
|
||||
(*this) = src;
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ~TDBObjClass
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
TDBObjClass::~TDBObjClass (void)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// operator=
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
const TDBObjClass &
|
||||
TDBObjClass::operator= (const TDBObjClass &src)
|
||||
{
|
||||
TranslatedStrings = src.TranslatedStrings;
|
||||
EnglishString = src.EnglishString;
|
||||
IDDesc = src.IDDesc;
|
||||
ID = src.ID;
|
||||
SoundID = src.SoundID;
|
||||
AnimationName = src.AnimationName;
|
||||
CategoryID = src.CategoryID;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get_Factory
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
const PersistFactoryClass &
|
||||
TDBObjClass::Get_Factory (void) const
|
||||
{
|
||||
return _TranslateObjPersistFactory;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Save
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
bool
|
||||
TDBObjClass::Save (ChunkSaveClass &csave)
|
||||
{
|
||||
csave.Begin_Chunk (CHUNKID_BASE_CLASS);
|
||||
PersistClass::Save (csave);
|
||||
csave.End_Chunk ();
|
||||
|
||||
csave.Begin_Chunk (CHUNKID_VARIABLES);
|
||||
Save_Variables (csave);
|
||||
csave.End_Chunk ();
|
||||
|
||||
//
|
||||
// Write the english string to its own chunk
|
||||
//
|
||||
WRITE_WWSTRING_CHUNK (csave, CHUNKID_ENGLISH_STRING, EnglishString);
|
||||
|
||||
//
|
||||
// Are we saving all the translations or just the current one?
|
||||
//
|
||||
if (TranslateDBClass::Is_Single_Language_Export_Enabled ()) {
|
||||
|
||||
//
|
||||
// If we don't have the requested language, save the english
|
||||
//
|
||||
int lang_id = TranslateDBClass::Get_Current_Language ();
|
||||
if (lang_id >= TranslatedStrings.Count ()) {
|
||||
lang_id = TranslateDBClass::LANGID_ENGLISH;
|
||||
}
|
||||
|
||||
//
|
||||
// Save the string
|
||||
//
|
||||
const WideStringClass &string = TranslatedStrings[lang_id];
|
||||
WRITE_WIDESTRING_CHUNK (csave, CHUNKID_TRANSLATED_STRING, string);
|
||||
|
||||
} else {
|
||||
|
||||
//
|
||||
// Write each translated string to its own chunk
|
||||
//
|
||||
for (int index = 0; index < TranslatedStrings.Count (); index ++) {
|
||||
const WideStringClass &string = TranslatedStrings[index];
|
||||
WRITE_WIDESTRING_CHUNK(csave, CHUNKID_TRANSLATED_STRING, string);;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Load
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
bool
|
||||
TDBObjClass::Load (ChunkLoadClass &cload)
|
||||
{
|
||||
while (cload.Open_Chunk ()) {
|
||||
switch (cload.Cur_Chunk_ID ()) {
|
||||
|
||||
READ_WWSTRING_CHUNK (cload, CHUNKID_ENGLISH_STRING, EnglishString);
|
||||
|
||||
case CHUNKID_TRANSLATED_STRING:
|
||||
{
|
||||
//
|
||||
// Load the translated string from its chunk
|
||||
//
|
||||
WideStringClass string;
|
||||
cload.Read (string.Get_Buffer((cload.Cur_Chunk_Length () + 1) / 2), cload.Cur_Chunk_Length ());
|
||||
|
||||
//
|
||||
// Add the translated string to our list
|
||||
//
|
||||
TranslatedStrings.Add (string);
|
||||
}
|
||||
break;
|
||||
|
||||
case CHUNKID_BASE_CLASS:
|
||||
PersistClass::Load (cload);
|
||||
break;
|
||||
|
||||
case CHUNKID_VARIABLES:
|
||||
Load_Variables (cload);
|
||||
break;
|
||||
}
|
||||
|
||||
cload.Close_Chunk ();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Save_Variables
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBObjClass::Save_Variables (ChunkSaveClass &csave)
|
||||
{
|
||||
//
|
||||
// Save each variable to its own micro chunk
|
||||
//
|
||||
WRITE_MICRO_CHUNK (csave, VARID_ID, ID);
|
||||
WRITE_MICRO_CHUNK (csave, VARID_SOUND_ID, SoundID);
|
||||
WRITE_MICRO_CHUNK (csave, VARID_CATEGORY_ID, CategoryID);
|
||||
WRITE_MICRO_CHUNK_WWSTRING (csave, VARID_ID_DESC, IDDesc);
|
||||
WRITE_MICRO_CHUNK_WWSTRING (csave, VARID_ANIMATION_NAME, AnimationName);
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Load_Variables
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBObjClass::Load_Variables (ChunkLoadClass &cload)
|
||||
{
|
||||
while (cload.Open_Micro_Chunk ()) {
|
||||
switch (cload.Cur_Micro_Chunk_ID ()) {
|
||||
READ_MICRO_CHUNK (cload, VARID_ID, ID);
|
||||
READ_MICRO_CHUNK (cload, VARID_SOUND_ID, SoundID);
|
||||
READ_MICRO_CHUNK (cload, VARID_CATEGORY_ID, CategoryID);
|
||||
READ_MICRO_CHUNK_WWSTRING (cload, VARID_ID_DESC, IDDesc);
|
||||
READ_MICRO_CHUNK_WWSTRING (cload, VARID_ENGLISH_STRING, EnglishString);
|
||||
READ_MICRO_CHUNK_WWSTRING (cload, VARID_ANIMATION_NAME, AnimationName);
|
||||
|
||||
case VARID_STRING:
|
||||
{
|
||||
//
|
||||
// Load the translated string from its chunk
|
||||
//
|
||||
WideStringClass string;
|
||||
cload.Read (string.Get_Buffer((cload.Cur_Micro_Chunk_Length () + 1) / 2), cload.Cur_Micro_Chunk_Length ());
|
||||
|
||||
//
|
||||
// Add the translated string to our list
|
||||
//
|
||||
TranslatedStrings.Add (string);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
cload.Close_Micro_Chunk ();
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set_English_String
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBObjClass::Set_English_String (const TCHAR *string)
|
||||
{
|
||||
EnglishString = string;
|
||||
|
||||
//
|
||||
// Grow the translated string array out large enough so
|
||||
// we can index into the english string
|
||||
//
|
||||
while (TranslatedStrings.Count () <= TranslateDBClass::LANGID_ENGLISH) {
|
||||
TranslatedStrings.Add (WideStringClass (L""));
|
||||
}
|
||||
|
||||
TranslatedStrings[TranslateDBClass::LANGID_ENGLISH].Convert_From (string);
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set_ID
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBObjClass::Set_ID (uint32 id)
|
||||
{
|
||||
ID = id;
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set_ID_Desc
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBObjClass::Set_ID_Desc (const TCHAR *desc)
|
||||
{
|
||||
IDDesc = desc;
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get_String
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
const WideStringClass &
|
||||
TDBObjClass::Get_String (void)
|
||||
{
|
||||
//
|
||||
// Lookup the translated string based on the current language
|
||||
//
|
||||
return Get_String (TranslateDBClass::Get_Current_Language ());
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Get_String
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
const WideStringClass &
|
||||
TDBObjClass::Get_String (uint32 lang_id)
|
||||
{
|
||||
//
|
||||
// Default to english on error
|
||||
//
|
||||
if (lang_id >= (uint32)TranslatedStrings.Count ()) {
|
||||
lang_id = TranslateDBClass::LANGID_ENGLISH;
|
||||
}
|
||||
|
||||
return TranslatedStrings[lang_id];
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Set_String
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
void
|
||||
TDBObjClass::Set_String (uint32 lang_id, const WCHAR *string)
|
||||
{
|
||||
//
|
||||
// Grow the translated strings array until we have enough
|
||||
// to cover the requested language
|
||||
//
|
||||
while ((uint32)TranslatedStrings.Count () <= lang_id) {
|
||||
TranslatedStrings.Add (WideStringClass (L""));
|
||||
}
|
||||
|
||||
//
|
||||
// Set the string
|
||||
//
|
||||
TranslatedStrings[lang_id] = string;
|
||||
|
||||
//
|
||||
// Keep a copy of the english string (if necessary)
|
||||
//
|
||||
if (lang_id == TranslateDBClass::LANGID_ENGLISH) {
|
||||
TranslatedStrings[lang_id].Convert_To (EnglishString);
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Contains_Translation
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////
|
||||
bool
|
||||
TDBObjClass::Contains_Translation (uint32 lang_id)
|
||||
{
|
||||
bool retval = false;
|
||||
|
||||
//
|
||||
// Simply check to see if the string contains any data
|
||||
//
|
||||
if (TranslatedStrings.Count () > (int)lang_id) {
|
||||
retval = (TranslatedStrings[lang_id].Get_Length () > 0);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
149
Code/wwtranslatedb/translateobj.h
Normal file
149
Code/wwtranslatedb/translateobj.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
** Command & Conquer Renegade(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***********************************************************************************************
|
||||
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
|
||||
***********************************************************************************************
|
||||
* *
|
||||
* Project Name : wwtranslatedb *
|
||||
* *
|
||||
* $Archive:: /Commando/Code/wwtranslatedb/translateobj.h $*
|
||||
* *
|
||||
* Author:: Patrick Smith *
|
||||
* *
|
||||
* $Modtime:: 9/10/01 8:43a $*
|
||||
* *
|
||||
* $Revision:: 8 $*
|
||||
* *
|
||||
*---------------------------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifndef __TRANSLATE_OBJ_H
|
||||
#define __TRANSLATE_OBJ_H
|
||||
|
||||
#include "persist.h"
|
||||
#include "bittype.h"
|
||||
#include "wwstring.h"
|
||||
#include "widestring.h"
|
||||
#include "vector.h"
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Forward declarations
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class ChunkSaveClass;
|
||||
class ChunkLoadClass;
|
||||
class StringTwiddlerClass;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TDBObjClass
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class TDBObjClass : public PersistClass
|
||||
{
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public constructors/destructors
|
||||
//////////////////////////////////////////////////////////////
|
||||
TDBObjClass (void);
|
||||
TDBObjClass (const TDBObjClass &src);
|
||||
virtual ~TDBObjClass (void);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public operators
|
||||
//////////////////////////////////////////////////////////////
|
||||
const TDBObjClass & operator= (const TDBObjClass &src);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Public methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// RTTI
|
||||
//
|
||||
virtual StringTwiddlerClass * As_StringTwiddlerClass (void) { return NULL; }
|
||||
|
||||
//
|
||||
// From PersistClass
|
||||
//
|
||||
const PersistFactoryClass & Get_Factory (void) const;
|
||||
bool Save (ChunkSaveClass &csave);
|
||||
bool Load (ChunkLoadClass &cload);
|
||||
|
||||
//
|
||||
// Copy methods
|
||||
//
|
||||
virtual TDBObjClass * Clone (void) const { return new TDBObjClass (*this); }
|
||||
|
||||
//
|
||||
// TranslateObj specific
|
||||
//
|
||||
virtual const WideStringClass & Get_String (uint32 lang_id);
|
||||
virtual const WideStringClass & Get_String (void);
|
||||
virtual const StringClass & Get_English_String (void) { return EnglishString; }
|
||||
virtual uint32 Get_ID (void) { return ID; }
|
||||
virtual const StringClass & Get_ID_Desc (void) { return IDDesc; }
|
||||
virtual uint32 Get_Sound_ID (void) { return SoundID; }
|
||||
virtual const StringClass & Get_Animation_Name (void) { return AnimationName; }
|
||||
virtual uint32 Get_Category_ID (void) { return CategoryID; }
|
||||
|
||||
virtual void Set_String (uint32 lang_id, const WCHAR *string);
|
||||
virtual void Set_English_String (const TCHAR *string);
|
||||
virtual void Set_ID (uint32 id);
|
||||
virtual void Set_ID_Desc (const TCHAR *desc);
|
||||
virtual void Set_Animation_Name (const TCHAR *name) { AnimationName = name; }
|
||||
virtual void Set_Sound_ID (uint32 id) { SoundID = id; }
|
||||
virtual void Set_Category_ID (uint32 id) { CategoryID = id; }
|
||||
|
||||
//
|
||||
// Informational
|
||||
//
|
||||
virtual bool Contains_Translation (uint32 lang_id);
|
||||
|
||||
protected:
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Protected methods
|
||||
//////////////////////////////////////////////////////////////
|
||||
void Save_Variables (ChunkSaveClass &csave);
|
||||
void Load_Variables (ChunkLoadClass &cload);
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Protected member data
|
||||
//////////////////////////////////////////////////////////////
|
||||
StringClass EnglishString;
|
||||
StringClass IDDesc;
|
||||
uint32 ID;
|
||||
uint32 SoundID;
|
||||
uint32 CategoryID;
|
||||
StringClass AnimationName;
|
||||
DynamicVectorClass<WideStringClass> TranslatedStrings;
|
||||
};
|
||||
|
||||
|
||||
#endif //__TRANSLATE_OBJ_H
|
||||
|
||||
159
Code/wwtranslatedb/wwtranslatedb.dsp
Normal file
159
Code/wwtranslatedb/wwtranslatedb.dsp
Normal file
@@ -0,0 +1,159 @@
|
||||
# Microsoft Developer Studio Project File - Name="wwtranslatedb" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=wwtranslatedb - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wwtranslatedb.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wwtranslatedb.mak" CFG="wwtranslatedb - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "wwtranslatedb - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "wwtranslatedb - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "wwtranslatedb - Win32 Profile" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/Commando/Code/wwtranslatedb", VDMDAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "wwtranslatedb - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /Zi /O2 /Ob2 /I "..\wwsaveload" /I "..\wwlib" /I "..\wwdebug" /I "..\wwmath" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_WINDOWS" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\Libs\release\wwtranslatedb.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "wwtranslatedb - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "..\wwsaveload" /I "..\wwlib" /I "..\wwdebug" /I "..\wwmath" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_WINDOWS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\Libs\debug\wwtranslatedb.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "wwtranslatedb - Win32 Profile"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Profile"
|
||||
# PROP BASE Intermediate_Dir "Profile"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Profile"
|
||||
# PROP Intermediate_Dir "Profile"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /I "..\wwsaveload" /I "..\wwlib" /I "..\wwdebug" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /Zi /O2 /Op /Ob2 /I "..\wwsaveload" /I "..\wwlib" /I "..\wwdebug" /I "..\wwmath" /D "NDEBUG" /D "WWDEBUG" /D WINVER=0x400 /D "_WINDOWS" /D "WIN32" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"..\Libs\release\wwtranslatedb.lib"
|
||||
# ADD LIB32 /nologo /out:"..\Libs\profile\wwtranslatedb.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "wwtranslatedb - Win32 Release"
|
||||
# Name "wwtranslatedb - Win32 Debug"
|
||||
# Name "wwtranslatedb - Win32 Profile"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stringtwiddler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tdbcategory.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\translatedb.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\translateobj.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stringtwiddler.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tdbcategories.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tdbcategory.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\translatedb.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\translatedbids.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\translateobj.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
Reference in New Issue
Block a user