Skip to content

Commit

Permalink
PPEditor: fixed includes and formatted code
Browse files Browse the repository at this point in the history
+ add stdafx missing in project file
  • Loading branch information
Xottab-DUTY committed Dec 4, 2015
1 parent 2fbddc4 commit 5b9162d
Show file tree
Hide file tree
Showing 35 changed files with 1,357 additions and 1,154 deletions.
31 changes: 17 additions & 14 deletions src/editors/PPEditor/NoiseFGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@
#pragma package(smart_init)
#pragma resource "*.dfm"
TNFGen *NFGen;

//---------------------------------------------------------------------------
__fastcall TNFGen::TNFGen(TComponent* Owner)
: TForm(Owner)
{
}
__fastcall TNFGen::TNFGen(TComponent *Owner)
: TForm(Owner) {}

//---------------------------------------------------------------------------
void __fastcall TNFGen::Button1Click(TObject *Sender)
{
if (Period->Value <= 0.0f || Time->Value <= 0.0f)
{
Application->MessageBox ("Invalid period or time for effect", "Error", MB_OK | MB_ICONSTOP);
return;
}
if (Period->Value >= Time->Value)
{
Application->MessageBox ("Period must be less than time effect", "Error", MB_OK | MB_ICONSTOP);
return;
}
if (Period->Value<=0.0f||Time->Value<=0.0f)
{
Application->MessageBox("Invalid period or time for effect", "Error", MB_OK|MB_ICONSTOP);
return;
}
if (Period->Value>=Time->Value)
{
Application->MessageBox("Period must be less than time effect", "Error", MB_OK|MB_ICONSTOP);
return;
}
ModalResult = mrOk;
}

//---------------------------------------------------------------------------


15 changes: 9 additions & 6 deletions src/editors/PPEditor/NoiseFGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Mask.hpp>

//---------------------------------------------------------------------------
class TNFGen : public TForm
{
__published: // IDE-managed Components
TMxLabel *RxLabel1;
__published: // IDE-managed Components
TMxLabel*RxLabel1;
TMxLabel *RxLabel2;
TMxLabel *RxLabel3;
TMxLabel *RxLabel4;
Expand All @@ -25,11 +26,13 @@ class TNFGen : public TForm
TButton *Button1;
TButton *Button2;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TNFGen(TComponent* Owner);
private: // User declarations
public: // User declarations
__fastcall TNFGen(TComponent *Owner);
};

//---------------------------------------------------------------------------
extern PACKAGE TNFGen *NFGen;
extern PACKAGE TNFGen * NFGen;
//---------------------------------------------------------------------------
#endif

51 changes: 29 additions & 22 deletions src/editors/PPEditor/NoiseGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,49 @@
#pragma package(smart_init)
#pragma resource "*.dfm"
TNGen *NGen;

//---------------------------------------------------------------------------
__fastcall TNGen::TNGen(TComponent* Owner)
: TForm(Owner)
{
}
__fastcall TNGen::TNGen(TComponent *Owner)
: TForm(Owner) {}

//---------------------------------------------------------------------------
void __fastcall TNGen::FColorClick(TObject *Sender)
{
if (ColorDialog->Execute () == false) return;
if (ColorDialog->Execute()==false)
return;
FColor->Color = ColorDialog->Color;
FR->Value = (float)(ColorDialog->Color & 0x0000ff) / 255.0f;
FG->Value = (float)((ColorDialog->Color & 0x00ff00) >> 8) / 255.0f;
FB->Value = (float)((ColorDialog->Color & 0xff0000) >> 16) / 255.0f;
FR->Value = (float)(ColorDialog->Color&0x0000ff)/255.0f;
FG->Value = (float)((ColorDialog->Color&0x00ff00)>>8)/255.0f;
FB->Value = (float)((ColorDialog->Color&0xff0000)>>16)/255.0f;
}

//---------------------------------------------------------------------------
void __fastcall TNGen::SColorClick(TObject *Sender)
{
if (ColorDialog->Execute () == false) return;
if (ColorDialog->Execute()==false)
return;
SColor->Color = ColorDialog->Color;
SR->Value = (float)(ColorDialog->Color & 0x0000ff) / 255.0f;
SG->Value = (float)((ColorDialog->Color & 0x00ff00) >> 8) / 255.0f;
SB->Value = (float)((ColorDialog->Color & 0xff0000) >> 16) / 255.0f;
SR->Value = (float)(ColorDialog->Color&0x0000ff)/255.0f;
SG->Value = (float)((ColorDialog->Color&0x00ff00)>>8)/255.0f;
SB->Value = (float)((ColorDialog->Color&0xff0000)>>16)/255.0f;
}

//---------------------------------------------------------------------------
void __fastcall TNGen::Button1Click(TObject *Sender)
{
if (Period->Value <= 0.0f || Time->Value <= 0.0f)
{
Application->MessageBox ("Invalid period or time for effect", "Error", MB_OK | MB_ICONSTOP);
return;
}
if (Period->Value >= Time->Value)
{
Application->MessageBox ("Period must be less than time effect", "Error", MB_OK | MB_ICONSTOP);
return;
}
if (Period->Value<=0.0f||Time->Value<=0.0f)
{
Application->MessageBox("Invalid period or time for effect", "Error", MB_OK|MB_ICONSTOP);
return;
}
if (Period->Value>=Time->Value)
{
Application->MessageBox("Period must be less than time effect", "Error", MB_OK|MB_ICONSTOP);
return;
}
ModalResult = mrOk;
}

//---------------------------------------------------------------------------


15 changes: 9 additions & 6 deletions src/editors/PPEditor/NoiseGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
#include <ExtCtrls.hpp>
#include <Mask.hpp>
#include <Dialogs.hpp>

//---------------------------------------------------------------------------
class TNGen : public TForm
{
__published: // IDE-managed Components
TGroupBox *GroupBox1;
__published: // IDE-managed Components
TGroupBox*GroupBox1;
TMultiObjSpinEdit *FR;
TMultiObjSpinEdit *FG;
TMultiObjSpinEdit *FB;
Expand All @@ -41,11 +42,13 @@ class TNGen : public TForm
void __fastcall FColorClick(TObject *Sender);
void __fastcall SColorClick(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TNGen(TComponent* Owner);
private: // User declarations
public: // User declarations
__fastcall TNGen(TComponent *Owner);
};

//---------------------------------------------------------------------------
extern PACKAGE TNGen *NGen;
extern PACKAGE TNGen * NGen;
//---------------------------------------------------------------------------
#endif

1 change: 1 addition & 0 deletions src/editors/PPEditor/PPEditor.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<ClInclude Include="NoiseGen.h" />
<ClInclude Include="single_param.h" />
<ClInclude Include="spline.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="Unit6.h" />
<ClInclude Include="Unit7.h" />
<ClInclude Include="Unit8.h" />
Expand Down
1 change: 1 addition & 0 deletions src/editors/PPEditor/PPEditor.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@
<ClInclude Include="Unit9.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h" />
</ItemGroup>
</Project>
18 changes: 9 additions & 9 deletions src/editors/PPEditor/Postprocess.bpr
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="..\..\..\bin\editors\Postprocess.exe"/>
<OBJFILES value="..\..\..\intermediate\editors\PPEditor\\Postprocess.obj
..\..\..\intermediate\editors\PPEditor\\main.obj
..\..\..\intermediate\editors\PPEditor\\interp.obj
..\..\..\intermediate\editors\PPEditor\\float_param.obj
..\..\..\intermediate\editors\PPEditor\\float_constructor.obj
..\..\..\intermediate\editors\PPEditor\\color.obj
..\..\..\intermediate\editors\PPEditor\\single_param.obj
..\..\..\intermediate\editors\PPEditor\\Envelope.obj
..\..\..\intermediate\editors\PPEditor\\PostprocessAnimator.obj"/>
<OBJFILES value="..\..\..\intermediate\editors\PPEditor\Postprocess.obj
..\..\..\intermediate\editors\PPEditor\main.obj
..\..\..\intermediate\editors\PPEditor\interp.obj
..\..\..\intermediate\editors\PPEditor\float_param.obj
..\..\..\intermediate\editors\PPEditor\float_constructor.obj
..\..\..\intermediate\editors\PPEditor\color.obj
..\..\..\intermediate\editors\PPEditor\single_param.obj
..\..\..\intermediate\editors\PPEditor\Envelope.obj
..\..\..\intermediate\editors\PPEditor\PostprocessAnimator.obj"/>
<RESFILES value="Postprocess.res"/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
Expand Down
54 changes: 28 additions & 26 deletions src/editors/PPEditor/Postprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,50 +24,52 @@ USEFORM("float_constructor.cpp", frmConstructor);
USEFORM("color.cpp", AddColorForm);
USEFORM("single_param.cpp", AddFloatForm);
//---------------------------------------------------------------------------
FILE *g_LogFileHandle = NULL;
FILE *g_LogFileHandle = NULL;

//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
void log_callback (LPCSTR lpString)
void log_callback(LPCSTR lpString)
{
if (!g_LogFileHandle)
return;
fprintf (g_LogFileHandle, "%s\n", lpString);
return;
fprintf(g_LogFileHandle, "%s\n", lpString);
}


WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
g_LogFileHandle = fopen ("postprocess.log", "wt");
Core._initialize ("Postprocess editor", log_callback, FALSE);
FS._initialize (CLocatorAPI::flScanAppRoot, 0, 0);

Application->Initialize();
Application->CreateForm(__classid(TMainForm), &MainForm);
Application->Run();
Core._destroy();
fclose (g_LogFileHandle);
}
catch (Exception &exception)
g_LogFileHandle = fopen("postprocess.log", "wt");
Core._initialize("Postprocess editor", log_callback, FALSE);
FS._initialize(CLocatorAPI::flScanAppRoot, 0, 0);

Application->Initialize();
Application->CreateForm(__classid(TMainForm), &MainForm);
Application->Run();
Core._destroy();
fclose(g_LogFileHandle);
} catch (Exception &exception)
{
fclose (g_LogFileHandle);
Application->ShowException(&exception);
fclose(g_LogFileHandle);
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
fclose (g_LogFileHandle);
Application->ShowException(&exception);
}
try
{
throw Exception("");
} catch (Exception &exception)
{
fclose(g_LogFileHandle);
Application->ShowException(&exception);
}
}
return 0;
}

//---------------------------------------------------------------------------


Loading

0 comments on commit 5b9162d

Please sign in to comment.