Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
gamemaps.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/* $Header: /Commando/Code/Tools/max2w3d/gamemaps.h 7 10/28/97 6:08p Greg_h $ */
20/***********************************************************************************************
21 *** Confidential - Westwood Studios ***
22 ***********************************************************************************************
23 * *
24 * Project Name : Commando / G 3D engine *
25 * *
26 * File Name : GAMEMAPS.H *
27 * *
28 * Programmer : Greg Hjelstrom *
29 * *
30 * Start Date : 06/26/97 *
31 * *
32 * Last Update : June 26, 1997 [GH] *
33 * *
34 *---------------------------------------------------------------------------------------------*
35 * Functions: *
36 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
37
38
39#ifndef GAMEMAPS_H
40#define GAMEMAPS_H
41
42#include <Max.h>
43#include "stdmat.h"
44
45
46ClassDesc * Get_Game_Maps_Desc();
47
48
50//
51// TexmapSlotClass
52//
55{
56public:
57
59 float Amount;
60 Texmap * Map;
61
63
64 RGBA Eval(ShadeContext& sc) { return Map->EvalColor(sc); }
65 float EvalMono(ShadeContext& sc) { return Map->EvalMono(sc); }
66 Point3 EvalNormalPerturb(ShadeContext &sc) { return Map->EvalNormalPerturb(sc); }
67 BOOL IsActive() { return (Map && MapOn); }
68 void Update(TimeValue t, Interval &ivalid) { if (IsActive()) Map->Update(t,ivalid); };
69 float GetAmount(TimeValue t) { return Amount; }
70};
71
72
74//
75// Texture Maps for In-Game material
76//
77// This class can contain a collection of all of the maps which
78// MAX uses but the GameMtl plugin will only give the user access
79// to the ones we can actually use in the game.
80//
82class GameMapsClass: public ReferenceTarget
83{
84public:
85
86 MtlBase * Client;
88
90 GameMapsClass(MtlBase *mb) { Client = mb; }
91
92 void DeleteThis() { delete this; }
93 void SetClientPtr(MtlBase *mb) { Client = mb; }
94 TexmapSlotClass & operator[](int i) { return TextureSlot[i]; }
95 Class_ID ClassID();
96 SClass_ID SuperClassID() { return REF_MAKER_CLASS_ID; }
97 int NumSubs() { return NTEXMAPS; }
98 Animatable * SubAnim(int i) { return TextureSlot[i].Map; }
99 TSTR SubAnimName(int i) { return Client->GetSubTexmapTVName(i); }
100 int NumRefs() { return NTEXMAPS; }
101 RefTargetHandle GetReference(int i) { return TextureSlot[i].Map; }
102 void SetReference(int i, RefTargetHandle rtarg) { TextureSlot[i].Map = (Texmap*)rtarg; }
103 int SubNumToRefNum(int subNum) { return subNum; }
104
105
106 BOOL AssignController(Animatable *control,int subAnim);
107 RefTargetHandle Clone(RemapDir &remap);
108 RefResult NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message);
109
110 IOResult Save(ISave * isave);
111 IOResult Load(ILoad * iload);
112};
113
114
115#endif /*GAMEMAPS_H*/
#define NULL
Definition BaseType.h:92
#define FALSE
Definition BaseType.h:113
#define BOOL
Definition Wnd_File.h:57
RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message)
Definition gamemaps.cpp:152
void SetReference(int i, RefTargetHandle rtarg)
Definition gamemaps.h:102
int NumSubs()
Definition gamemaps.h:97
IOResult Load(ILoad *iload)
Definition gamemaps.cpp:247
void SetClientPtr(MtlBase *mb)
Definition gamemaps.h:93
GameMapsClass(MtlBase *mb)
Definition gamemaps.h:90
BOOL AssignController(Animatable *control, int subAnim)
Definition gamemaps.cpp:133
int NumRefs()
Definition gamemaps.h:100
TexmapSlotClass & operator[](int i)
Definition gamemaps.h:94
void DeleteThis()
Definition gamemaps.h:92
int SubNumToRefNum(int subNum)
Definition gamemaps.h:103
SClass_ID SuperClassID()
Definition gamemaps.h:96
RefTargetHandle GetReference(int i)
Definition gamemaps.h:101
MtlBase * Client
Definition gamemaps.h:86
TSTR SubAnimName(int i)
Definition gamemaps.h:99
Animatable * SubAnim(int i)
Definition gamemaps.h:98
TexmapSlotClass TextureSlot[NTEXMAPS]
Definition gamemaps.h:87
IOResult Save(ISave *isave)
Definition gamemaps.cpp:213
RefTargetHandle Clone(RemapDir &remap)
Definition gamemaps.cpp:184
Class_ID ClassID()
Definition gamemaps.cpp:116
float EvalMono(ShadeContext &sc)
Definition gamemaps.h:65
float GetAmount(TimeValue t)
Definition gamemaps.h:69
void Update(TimeValue t, Interval &ivalid)
Definition gamemaps.h:68
Point3 EvalNormalPerturb(ShadeContext &sc)
Definition gamemaps.h:66
Texmap * Map
Definition gamemaps.h:60
RGBA Eval(ShadeContext &sc)
Definition gamemaps.h:64
BOOL IsActive()
Definition gamemaps.h:67
ClassDesc * Get_Game_Maps_Desc()
Definition gamemaps.cpp:101