Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
exportlog.cpp
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/***********************************************************************************************
20 *** 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 ***
21 ***********************************************************************************************
22 * *
23 * Project Name : Max2W3d *
24 * *
25 * $Archive:: /Commando/Code/Tools/max2w3d/exportlog.cpp $*
26 * *
27 * Original Author:: Greg Hjelstrom *
28 * *
29 * $Author:: Greg_h $*
30 * *
31 * $Modtime:: 11/07/00 3:16p $*
32 * *
33 * $Revision:: 3 $*
34 * *
35 *---------------------------------------------------------------------------------------------*
36 * Functions: *
37 * ExportLog::Init -- Initialize the export logging system *
38 * ExportLog::Shutdown -- Shutdown the export logging system *
39 * ExportLog::printf -- Print a string to the log window *
40 * ExportLog::rprintf -- Print a string over the last line printed *
41 * ExportLog::updatebar -- Set the position of the progress bar *
42 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
43
44#include "exportlog.h"
45#include "logdlg.h"
46#include <assert.h>
47
48
49/*
50** Static variables
51*/
53
54
55/*
56**
57** ExportLog implementation. Note, this is a class which only contains static functions.
58**
59*/
60
61
62/***********************************************************************************************
63 * ExportLog::Init -- Initialize the export logging system *
64 * *
65 * INPUT: *
66 * *
67 * OUTPUT: *
68 * *
69 * WARNINGS: *
70 * *
71 * HISTORY: *
72 * 10/30/2000 gth : Created. *
73 *=============================================================================================*/
74void ExportLog::Init(HWND parent)
75{
76 assert(_LogDialog == NULL);
77 _LogDialog = new LogDataDialogClass(parent);
78}
79
80
81/***********************************************************************************************
82 * ExportLog::Shutdown -- Shutdown the export logging system *
83 * *
84 * INPUT: *
85 * wait_for_ok - should we wait for the user to press OK on the dialog? *
86 * *
87 * OUTPUT: *
88 * *
89 * WARNINGS: *
90 * *
91 * HISTORY: *
92 * 10/30/2000 gth : Created. *
93 *=============================================================================================*/
94void ExportLog::Shutdown(bool wait_for_ok)
95{
96 if (_LogDialog != NULL) {
97
98 if (wait_for_ok) {
99 _LogDialog->Wait_OK();
100 }
101
102 delete _LogDialog;
104 }
105}
106
107
108/***********************************************************************************************
109 * ExportLog::printf -- Print a string to the log window *
110 * *
111 * INPUT: *
112 * *
113 * OUTPUT: *
114 * *
115 * WARNINGS: *
116 * *
117 * HISTORY: *
118 * 10/30/2000 gth : Created. *
119 *=============================================================================================*/
120void ExportLog::printf(char * format, ...)
121{
122 if (_LogDialog != NULL) {
123 va_list arguments;
124 va_start(arguments, format);
125 _LogDialog->printf(format,arguments);
126 }
127}
128
129
130/***********************************************************************************************
131 * ExportLog::rprintf -- Print a string over the last line printed *
132 * *
133 * INPUT: *
134 * *
135 * OUTPUT: *
136 * *
137 * WARNINGS: *
138 * *
139 * HISTORY: *
140 * 10/30/2000 gth : Created. *
141 *=============================================================================================*/
142void ExportLog::rprintf(char * format, ...)
143{
144 if (_LogDialog != NULL) {
145 va_list arguments;
146 va_start(arguments, format);
147 _LogDialog->rprintf(format,arguments);
148 }
149}
150
151
152/***********************************************************************************************
153 * ExportLog::updatebar -- Set the position of the progress bar *
154 * *
155 * INPUT: *
156 * *
157 * OUTPUT: *
158 * *
159 * WARNINGS: *
160 * *
161 * HISTORY: *
162 * 10/30/2000 gth : Created. *
163 *=============================================================================================*/
164void ExportLog::updatebar(float position, float total)
165{
166 if (_LogDialog != NULL) {
167 _LogDialog->updatebar(position,total);
168 }
169}
170
171
#define NULL
Definition BaseType.h:92
static void Init(HWND parent)
Definition exportlog.cpp:74
static void rprintf(char *,...)
static void Shutdown(bool wait_for_ok)
Definition exportlog.cpp:94
static void printf(char *,...)
static void updatebar(float position, float total)
LogDataDialogClass * _LogDialog
Definition exportlog.cpp:52