summaryrefslogtreecommitdiff
path: root/hammer/globalfunctions.h
blob: b6682b22cddf134cb83cb20823284325abd3609a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef GLOBALFUNCTIONS_H
#define GLOBALFUNCTIONS_H
#ifdef _WIN32
#pragma once
#endif

#include "MapClass.h"	// For CMapObjectList


class CMapSolid;
class CMainFrame;
class CMapWorld;
class CMapDoc;
class IWorldEditDispMgr;
class CSubdivMesh;


CMapWorld *GetActiveWorld(void);

IWorldEditDispMgr *GetActiveWorldEditDispManager( void );

//
// misc.cpp:
//
void randomize();
DWORD random();

void NotifyDuplicates(CMapSolid *pSolid);
void NotifyDuplicates(const CMapObjectList *pList);

bool IsWorldObject(CMapAtom *pObject);

BOOL AddLeavesToListCallback(CMapClass *pObject, CMapObjectList *pList);

void WriteDebug(char *pszStr);
LPCTSTR GetDefaultTextureName();
void SetDefaultTextureName( const char *szTexName );
LPCTSTR GetNullTextureName();
int mychdir(LPCTSTR pszDir);

//
// Message window interface.
//
class CMessageWnd;

enum MWMSGTYPE
{	mwStatus,
	mwError,
	mwWarning
};

extern CMessageWnd *g_pwndMessage;

void Msg(int type, PRINTF_FORMAT_STRING const char *fmt, ...);


//
// timing functions
//
double I_FloatTime( void );
void I_BeginTime( void );
double I_EndTime( void );

// noise function
float PerlinNoise2D( float x, float y, float rockiness );
float PerlinNoise2DScaled( float x, float y, float rockiness );

void DBG(PRINTF_FORMAT_STRING const char *fmt, ...);

#endif // GLOBALFUNCTIONS_H