Skip to content

Commit 5b9162d

Browse files
committed
PPEditor: fixed includes and formatted code
+ add stdafx missing in project file
1 parent 2fbddc4 commit 5b9162d

35 files changed

+1357
-1154
lines changed

src/editors/PPEditor/NoiseFGen.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@
88
#pragma package(smart_init)
99
#pragma resource "*.dfm"
1010
TNFGen *NFGen;
11+
1112
//---------------------------------------------------------------------------
12-
__fastcall TNFGen::TNFGen(TComponent* Owner)
13-
: TForm(Owner)
14-
{
15-
}
13+
__fastcall TNFGen::TNFGen(TComponent *Owner)
14+
: TForm(Owner) {}
15+
1616
//---------------------------------------------------------------------------
1717
void __fastcall TNFGen::Button1Click(TObject *Sender)
1818
{
19-
if (Period->Value <= 0.0f || Time->Value <= 0.0f)
20-
{
21-
Application->MessageBox ("Invalid period or time for effect", "Error", MB_OK | MB_ICONSTOP);
22-
return;
23-
}
24-
if (Period->Value >= Time->Value)
25-
{
26-
Application->MessageBox ("Period must be less than time effect", "Error", MB_OK | MB_ICONSTOP);
27-
return;
28-
}
19+
if (Period->Value<=0.0f||Time->Value<=0.0f)
20+
{
21+
Application->MessageBox("Invalid period or time for effect", "Error", MB_OK|MB_ICONSTOP);
22+
return;
23+
}
24+
if (Period->Value>=Time->Value)
25+
{
26+
Application->MessageBox("Period must be less than time effect", "Error", MB_OK|MB_ICONSTOP);
27+
return;
28+
}
2929
ModalResult = mrOk;
3030
}
31+
3132
//---------------------------------------------------------------------------
33+
34+

src/editors/PPEditor/NoiseFGen.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
#include <Forms.hpp>
1010
#include <ExtCtrls.hpp>
1111
#include <Mask.hpp>
12+
1213
//---------------------------------------------------------------------------
1314
class TNFGen : public TForm
1415
{
15-
__published: // IDE-managed Components
16-
TMxLabel *RxLabel1;
16+
__published: // IDE-managed Components
17+
TMxLabel*RxLabel1;
1718
TMxLabel *RxLabel2;
1819
TMxLabel *RxLabel3;
1920
TMxLabel *RxLabel4;
@@ -25,11 +26,13 @@ class TNFGen : public TForm
2526
TButton *Button1;
2627
TButton *Button2;
2728
void __fastcall Button1Click(TObject *Sender);
28-
private: // User declarations
29-
public: // User declarations
30-
__fastcall TNFGen(TComponent* Owner);
29+
private: // User declarations
30+
public: // User declarations
31+
__fastcall TNFGen(TComponent *Owner);
3132
};
33+
3234
//---------------------------------------------------------------------------
33-
extern PACKAGE TNFGen *NFGen;
35+
extern PACKAGE TNFGen * NFGen;
3436
//---------------------------------------------------------------------------
3537
#endif
38+

src/editors/PPEditor/NoiseGen.cpp

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,49 @@
88
#pragma package(smart_init)
99
#pragma resource "*.dfm"
1010
TNGen *NGen;
11+
1112
//---------------------------------------------------------------------------
12-
__fastcall TNGen::TNGen(TComponent* Owner)
13-
: TForm(Owner)
14-
{
15-
}
13+
__fastcall TNGen::TNGen(TComponent *Owner)
14+
: TForm(Owner) {}
15+
1616
//---------------------------------------------------------------------------
1717
void __fastcall TNGen::FColorClick(TObject *Sender)
1818
{
19-
if (ColorDialog->Execute () == false) return;
19+
if (ColorDialog->Execute()==false)
20+
return;
2021
FColor->Color = ColorDialog->Color;
21-
FR->Value = (float)(ColorDialog->Color & 0x0000ff) / 255.0f;
22-
FG->Value = (float)((ColorDialog->Color & 0x00ff00) >> 8) / 255.0f;
23-
FB->Value = (float)((ColorDialog->Color & 0xff0000) >> 16) / 255.0f;
22+
FR->Value = (float)(ColorDialog->Color&0x0000ff)/255.0f;
23+
FG->Value = (float)((ColorDialog->Color&0x00ff00)>>8)/255.0f;
24+
FB->Value = (float)((ColorDialog->Color&0xff0000)>>16)/255.0f;
2425
}
26+
2527
//---------------------------------------------------------------------------
2628
void __fastcall TNGen::SColorClick(TObject *Sender)
2729
{
28-
if (ColorDialog->Execute () == false) return;
30+
if (ColorDialog->Execute()==false)
31+
return;
2932
SColor->Color = ColorDialog->Color;
30-
SR->Value = (float)(ColorDialog->Color & 0x0000ff) / 255.0f;
31-
SG->Value = (float)((ColorDialog->Color & 0x00ff00) >> 8) / 255.0f;
32-
SB->Value = (float)((ColorDialog->Color & 0xff0000) >> 16) / 255.0f;
33+
SR->Value = (float)(ColorDialog->Color&0x0000ff)/255.0f;
34+
SG->Value = (float)((ColorDialog->Color&0x00ff00)>>8)/255.0f;
35+
SB->Value = (float)((ColorDialog->Color&0xff0000)>>16)/255.0f;
3336
}
37+
3438
//---------------------------------------------------------------------------
3539
void __fastcall TNGen::Button1Click(TObject *Sender)
3640
{
37-
if (Period->Value <= 0.0f || Time->Value <= 0.0f)
38-
{
39-
Application->MessageBox ("Invalid period or time for effect", "Error", MB_OK | MB_ICONSTOP);
40-
return;
41-
}
42-
if (Period->Value >= Time->Value)
43-
{
44-
Application->MessageBox ("Period must be less than time effect", "Error", MB_OK | MB_ICONSTOP);
45-
return;
46-
}
41+
if (Period->Value<=0.0f||Time->Value<=0.0f)
42+
{
43+
Application->MessageBox("Invalid period or time for effect", "Error", MB_OK|MB_ICONSTOP);
44+
return;
45+
}
46+
if (Period->Value>=Time->Value)
47+
{
48+
Application->MessageBox("Period must be less than time effect", "Error", MB_OK|MB_ICONSTOP);
49+
return;
50+
}
4751
ModalResult = mrOk;
4852
}
53+
4954
//---------------------------------------------------------------------------
55+
56+

src/editors/PPEditor/NoiseGen.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
#include <ExtCtrls.hpp>
1111
#include <Mask.hpp>
1212
#include <Dialogs.hpp>
13+
1314
//---------------------------------------------------------------------------
1415
class TNGen : public TForm
1516
{
16-
__published: // IDE-managed Components
17-
TGroupBox *GroupBox1;
17+
__published: // IDE-managed Components
18+
TGroupBox*GroupBox1;
1819
TMultiObjSpinEdit *FR;
1920
TMultiObjSpinEdit *FG;
2021
TMultiObjSpinEdit *FB;
@@ -41,11 +42,13 @@ class TNGen : public TForm
4142
void __fastcall FColorClick(TObject *Sender);
4243
void __fastcall SColorClick(TObject *Sender);
4344
void __fastcall Button1Click(TObject *Sender);
44-
private: // User declarations
45-
public: // User declarations
46-
__fastcall TNGen(TComponent* Owner);
45+
private: // User declarations
46+
public: // User declarations
47+
__fastcall TNGen(TComponent *Owner);
4748
};
49+
4850
//---------------------------------------------------------------------------
49-
extern PACKAGE TNGen *NGen;
51+
extern PACKAGE TNGen * NGen;
5052
//---------------------------------------------------------------------------
5153
#endif
54+

src/editors/PPEditor/PPEditor.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<ClInclude Include="NoiseGen.h" />
4848
<ClInclude Include="single_param.h" />
4949
<ClInclude Include="spline.h" />
50+
<ClInclude Include="stdafx.h" />
5051
<ClInclude Include="Unit6.h" />
5152
<ClInclude Include="Unit7.h" />
5253
<ClInclude Include="Unit8.h" />

src/editors/PPEditor/PPEditor.vcxproj.filters

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,6 @@
107107
<ClInclude Include="Unit9.h">
108108
<Filter>Header Files</Filter>
109109
</ClInclude>
110+
<ClInclude Include="stdafx.h" />
110111
</ItemGroup>
111112
</Project>

src/editors/PPEditor/Postprocess.bpr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<MACROS>
55
<VERSION value="BCB.06.00"/>
66
<PROJECT value="..\..\..\bin\editors\Postprocess.exe"/>
7-
<OBJFILES value="..\..\..\intermediate\editors\PPEditor\\Postprocess.obj
8-
..\..\..\intermediate\editors\PPEditor\\main.obj
9-
..\..\..\intermediate\editors\PPEditor\\interp.obj
10-
..\..\..\intermediate\editors\PPEditor\\float_param.obj
11-
..\..\..\intermediate\editors\PPEditor\\float_constructor.obj
12-
..\..\..\intermediate\editors\PPEditor\\color.obj
13-
..\..\..\intermediate\editors\PPEditor\\single_param.obj
14-
..\..\..\intermediate\editors\PPEditor\\Envelope.obj
15-
..\..\..\intermediate\editors\PPEditor\\PostprocessAnimator.obj"/>
7+
<OBJFILES value="..\..\..\intermediate\editors\PPEditor\Postprocess.obj
8+
..\..\..\intermediate\editors\PPEditor\main.obj
9+
..\..\..\intermediate\editors\PPEditor\interp.obj
10+
..\..\..\intermediate\editors\PPEditor\float_param.obj
11+
..\..\..\intermediate\editors\PPEditor\float_constructor.obj
12+
..\..\..\intermediate\editors\PPEditor\color.obj
13+
..\..\..\intermediate\editors\PPEditor\single_param.obj
14+
..\..\..\intermediate\editors\PPEditor\Envelope.obj
15+
..\..\..\intermediate\editors\PPEditor\PostprocessAnimator.obj"/>
1616
<RESFILES value="Postprocess.res"/>
1717
<IDLFILES value=""/>
1818
<IDLGENFILES value=""/>

src/editors/PPEditor/Postprocess.cpp

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,50 +24,52 @@ USEFORM("float_constructor.cpp", frmConstructor);
2424
USEFORM("color.cpp", AddColorForm);
2525
USEFORM("single_param.cpp", AddFloatForm);
2626
//---------------------------------------------------------------------------
27-
FILE *g_LogFileHandle = NULL;
27+
FILE *g_LogFileHandle = NULL;
28+
2829
//---------------------------------------------------------------------------
2930

3031

3132
//---------------------------------------------------------------------------
32-
void log_callback (LPCSTR lpString)
33+
void log_callback(LPCSTR lpString)
3334
{
3435
if (!g_LogFileHandle)
35-
return;
36-
fprintf (g_LogFileHandle, "%s\n", lpString);
36+
return;
37+
fprintf(g_LogFileHandle, "%s\n", lpString);
3738
}
3839

3940

4041
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
4142
{
4243
try
4344
{
44-
g_LogFileHandle = fopen ("postprocess.log", "wt");
45-
Core._initialize ("Postprocess editor", log_callback, FALSE);
46-
FS._initialize (CLocatorAPI::flScanAppRoot, 0, 0);
47-
48-
Application->Initialize();
49-
Application->CreateForm(__classid(TMainForm), &MainForm);
50-
Application->Run();
51-
Core._destroy();
52-
fclose (g_LogFileHandle);
53-
}
54-
catch (Exception &exception)
45+
g_LogFileHandle = fopen("postprocess.log", "wt");
46+
Core._initialize("Postprocess editor", log_callback, FALSE);
47+
FS._initialize(CLocatorAPI::flScanAppRoot, 0, 0);
48+
49+
Application->Initialize();
50+
Application->CreateForm(__classid(TMainForm), &MainForm);
51+
Application->Run();
52+
Core._destroy();
53+
fclose(g_LogFileHandle);
54+
} catch (Exception &exception)
5555
{
56-
fclose (g_LogFileHandle);
57-
Application->ShowException(&exception);
56+
fclose(g_LogFileHandle);
57+
Application->ShowException(&exception);
5858
}
5959
catch (...)
6060
{
61-
try
62-
{
63-
throw Exception("");
64-
}
65-
catch (Exception &exception)
66-
{
67-
fclose (g_LogFileHandle);
68-
Application->ShowException(&exception);
69-
}
61+
try
62+
{
63+
throw Exception("");
64+
} catch (Exception &exception)
65+
{
66+
fclose(g_LogFileHandle);
67+
Application->ShowException(&exception);
68+
}
7069
}
7170
return 0;
7271
}
72+
7373
//---------------------------------------------------------------------------
74+
75+

0 commit comments

Comments
 (0)