Made ScEd compile more pleasantly

This was SVN commit r1700.
This commit is contained in:
Ykkrosh 2005-01-10 22:13:18 +00:00
parent 2ad77b16db
commit 75c714b8df
7 changed files with 27 additions and 1326 deletions

View File

@ -23,12 +23,15 @@
#include "scripting/JSCollection.h"
#include "scripting/JSInterface_BaseEntity.h"
#include "scripting/JSInterface_Vector3D.h"
#include "gui/scripting/JSInterface_IGUIObject.h"
#include "scripting/JSInterface_Selection.h"
#include "scripting/JSInterface_Camera.h"
#include "scripting/JSInterface_Console.h"
#include "scripting/JSConversions.h"
#ifndef NO_GUI
# include "gui/scripting/JSInterface_IGUIObject.h"
#endif
extern CConsole* g_Console;
// Parameters for the table are:
@ -48,7 +51,9 @@ JSFunctionSpec ScriptFunctionTable[] =
{"setTimeout", setTimeout, 2, 0, 0 },
{"setInterval", setInterval, 2, 0, 0 },
{"cancelInterval", cancelInterval, 0, 0, 0 },
#ifndef NO_GUI
{"getGUIObjectByName", JSI_IGUIObject::getByName, 1, 0, 0 },
#endif
{"getGlobal", getGlobal, 0, 0, 0 },
{"getGUIGlobal", getGUIGlobal, 0, 0, 0 },
{"setCursor", setCursor, 1, 0, 0 },

View File

@ -95,7 +95,7 @@ void render(COverlayText* overlaytext)
if (!font) return;
const CStr& str=overlaytext->GetString();
int len=str.Length();
int len=(int)str.Length();
if (len==0) return;
// bind to font texture

File diff suppressed because it is too large Load Diff

View File

@ -441,7 +441,7 @@ void CMainFrame::OnUpdateEditUndo(CCmdUI* pCmdUI)
const char* undoText="&Undo Ctrl+Z";
char buf[64];
strcpy(buf,undoText);
int len=strlen(cmdName);
size_t len=strlen(cmdName);
if (len>32) len=32;
buf[6]='\"';
strncpy(buf+7,cmdName,len);
@ -467,7 +467,7 @@ void CMainFrame::OnUpdateEditRedo(CCmdUI* pCmdUI)
const char* redoText="&Redo Ctrl+Y";
char buf[64];
strcpy(buf,redoText);
int len=strlen(cmdName);
size_t len=strlen(cmdName);
if (len>32) len=32;
buf[6]='\"';
strncpy(buf+7,cmdName,len);
@ -774,8 +774,8 @@ static CObjectEntry* GetRandomActorTemplate()
CObjectEntry* found=0;
int checkloop=250;
do {
u32 type=rand()%g_ObjMan.m_ObjectTypes.size();
u32 actorsoftype=g_ObjMan.m_ObjectTypes[type].m_Objects.size();
u32 type=rand()%(u32)g_ObjMan.m_ObjectTypes.size();
u32 actorsoftype=(u32)g_ObjMan.m_ObjectTypes[type].m_Objects.size();
if (actorsoftype>0) {
found=g_ObjMan.m_ObjectTypes[type].m_Objects[rand()%actorsoftype];
if (found && found->m_Model && found->m_Model->GetModelDef()->GetNumBones()>0) {
@ -794,8 +794,8 @@ static CTextureEntry* GetRandomTexture()
CTextureEntry* found=0;
do {
u32 type=rand()%g_TexMan.m_TerrainTextures.size();
u32 texturesoftype=g_TexMan.m_TerrainTextures[type].m_Textures.size();
u32 type=rand()%(u32)g_TexMan.m_TerrainTextures.size();
u32 texturesoftype=(u32)g_TexMan.m_TerrainTextures[type].m_Textures.size();
if (texturesoftype>0) {
found=g_TexMan.m_TerrainTextures[type].m_Textures[rand()%texturesoftype];
}

View File

@ -6,6 +6,9 @@
#include "ScEd.h"
#include "SimpleEdit.h"
// Slight hack, since this gets undef'd earlier to avoid conflicts with CStr
#define _T(x) x
/////////////////////////////////////////////////////////////////////////////
// CSimpleEdit dialog

View File

@ -19,10 +19,8 @@
//#include "CStr.h"
#undef _WINDOWS_
#undef UNUSED
#undef _T
#undef _istspace
#undef _totlower
#define WINVER 0x0500 // Windows 2000
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
@ -32,6 +30,14 @@
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#undef UNUSED
#undef _T
#undef _istspace
#undef _totlower
#undef _totupper
#undef _ttoi
#undef _ttol
#include "resource.h"
//{{AFX_INSERT_LOCATION}}

View File

@ -54,7 +54,7 @@ void CUnitPropertiesTabCtrl::Init()
{
tcItem.mask = TCIF_TEXT;
tcItem.pszText = pszTabItems[i];
tcItem.cchTextMax = strlen(pszTabItems[i]);
tcItem.cchTextMax = (int)strlen(pszTabItems[i]);
InsertItem(i,&tcItem);
}