aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt16
-rwxr-xr-xFramestein.exebin874496 -> 912384 bytes
-rw-r--r--Patches/fps.pd4
-rw-r--r--Patches/fs.copy.pd8
-rw-r--r--Patches/fs.main.pd3
-rw-r--r--Plugins/argument-passing.cpp18
-rw-r--r--Plugins/argument-passing.dllbin0 -> 40960 bytes
-rw-r--r--Plugins/argument-passing.expbin0 -> 662 bytes
-rw-r--r--Plugins/argument-passing.libbin0 -> 2200 bytes
-rw-r--r--Plugins/argument-passing.objbin0 -> 2854 bytes
-rw-r--r--Plugins/makefile7
-rw-r--r--Plugins/pixels.h30
-rw-r--r--Plugins/rowca.cpp16
-rw-r--r--Plugins/rowca.dllbin110592 -> 110592 bytes
-rw-r--r--Plugins/rowca.expbin619 -> 619 bytes
-rw-r--r--Plugins/rowca.libbin2042 -> 2042 bytes
-rw-r--r--Plugins/rowca.objbin57594 -> 61510 bytes
-rw-r--r--Plugins/subtract.cpp31
-rw-r--r--Plugins/subtract.dllbin28672 -> 40960 bytes
-rw-r--r--Plugins/subtract.expbin630 -> 630 bytes
-rw-r--r--Plugins/subtract.libbin2080 -> 2080 bytes
-rw-r--r--Plugins/subtract.objbin1409 -> 5262 bytes
-rw-r--r--Source/Framestein.cfg10
-rw-r--r--Source/Framestein.dof34
-rw-r--r--Source/Framestein.dpr41
-rw-r--r--Source/Framestein.resbin4056 -> 6980 bytes
-rw-r--r--Source/configureunit.dfm61
-rw-r--r--Source/configureunit.pas30
-rw-r--r--Source/fscopyunit.pas23
-rw-r--r--Source/fsframeunit.pas13
-rw-r--r--Source/mainunit.pas52
-rw-r--r--Source/pluginunit.pas36
-rw-r--r--Source/pshostunit.pas7
33 files changed, 319 insertions, 121 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 1721b35..cc32c73 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,19 @@
+0.32
+- fs.frame: |title this is the main window(
+- fs.copy: transcolor <r> <g> <b> to set the transparent color
+- better gol algo (Plugins\gol.c)
+- added 1d cell automata where each iteration will add a new row: Plugins\rowca
+- added arguments-class in pixels.h to ease parsing arguments to plugins.
+ example:
+
+ void perform_effect(_frame f, _args a)
+ {
+ arguments ar(a.s);
+
+ // ar.count() return the number of arguments
+ // ar[i] return i'th argument
+ ...
+
0.31
- added plugins by Olaf Matthes: PeRColate and PixelPack. Thanks, Olaf!
- the console is back. It's good for printf():ing from plugins..
diff --git a/Framestein.exe b/Framestein.exe
index 1644f58..13a8fb0 100755
--- a/Framestein.exe
+++ b/Framestein.exe
Binary files differ
diff --git a/Patches/fps.pd b/Patches/fps.pd
index 3e61074..c0731bf 100644
--- a/Patches/fps.pd
+++ b/Patches/fps.pd
@@ -1,10 +1,10 @@
-#N canvas 17 261 466 316 12;
+#N canvas 17 261 472 322 12;
#X obj 307 192 /;
#X obj 319 128 t b f;
#X obj 67 27 inlet;
#X msg 293 157 1000;
#X obj 87 222 outlet;
-#X obj 87 112 metro 1000;
+#X obj 87 111 metro 1000;
#X text 10 -1 sends bangs to make "frames per second";
#X obj 226 62 float \$1;
#X obj 226 32 loadbang;
diff --git a/Patches/fs.copy.pd b/Patches/fs.copy.pd
index cf6a311..c646056 100644
--- a/Patches/fs.copy.pd
+++ b/Patches/fs.copy.pd
@@ -1,4 +1,4 @@
-#N canvas 52 54 934 446 12;
+#N canvas 52 54 936 448 12;
#X obj 173 21 loadbang;
#X obj 208 271 fs_sender;
#X msg 173 204 copy \$1;
@@ -31,9 +31,11 @@ srcpaint whiteness;
;
#X text 468 329 transparent_0/1 mirrorleftright_0/1 mirrorupdown_0/1
;
-#X text 467 358 "plugin_name" (see example-plugins.pd);
+#X text 467 378 "plugin_name" (see example-plugins.pd);
#X obj 173 51 symbol \$0C;
-#X text 467 389 "filter_name" (see example-photoshopfilters.pd);
+#X text 466 404 "filter_name" (see example-photoshopfilters.pd);
+#X text 468 349 transcolor <r> <g> <b> to set the transparent color
+;
#X connect 0 0 29 0;
#X connect 2 0 1 0;
#X connect 3 0 18 0;
diff --git a/Patches/fs.main.pd b/Patches/fs.main.pd
index 845121d..f68015c 100644
--- a/Patches/fs.main.pd
+++ b/Patches/fs.main.pd
@@ -1,4 +1,4 @@
-#N canvas 278 0 700 494 12;
+#N canvas 278 0 702 496 12;
#X obj 27 293 netsend;
#X floatatom 27 322 4 0 0;
#X obj 207 160 loadbang;
@@ -31,6 +31,7 @@ configuring fs likewise (right-click fs).;
#X obj 408 408 r symbolmouseup;
#X text 404 364 ignore some errors;
#X obj 408 431 r symbolfile;
+#X obj 530 207 r fs_reset;
#X connect 0 0 1 0;
#X connect 2 0 6 0;
#X connect 3 0 0 0;
diff --git a/Plugins/argument-passing.cpp b/Plugins/argument-passing.cpp
new file mode 100644
index 0000000..71ec33c
--- /dev/null
+++ b/Plugins/argument-passing.cpp
@@ -0,0 +1,18 @@
+//
+// example of passing arguments to plugin using the arguments-class (defined in pixels.h)
+//
+
+#include "pixels.h"
+
+void perform_effect(_frame f, _args a)
+{
+ arguments ar(a.s);
+
+ //
+ // ar.count() return the number of arguments
+ // ar[i] return i'th argument
+ //
+
+ for(int i=0; i<ar.count(); i++)
+ printf("argument %d: %s\n", i, ar[i]);
+}
diff --git a/Plugins/argument-passing.dll b/Plugins/argument-passing.dll
new file mode 100644
index 0000000..dfa112e
--- /dev/null
+++ b/Plugins/argument-passing.dll
Binary files differ
diff --git a/Plugins/argument-passing.exp b/Plugins/argument-passing.exp
new file mode 100644
index 0000000..d3e522e
--- /dev/null
+++ b/Plugins/argument-passing.exp
Binary files differ
diff --git a/Plugins/argument-passing.lib b/Plugins/argument-passing.lib
new file mode 100644
index 0000000..bc5bbf9
--- /dev/null
+++ b/Plugins/argument-passing.lib
Binary files differ
diff --git a/Plugins/argument-passing.obj b/Plugins/argument-passing.obj
new file mode 100644
index 0000000..2c1a88d
--- /dev/null
+++ b/Plugins/argument-passing.obj
Binary files differ
diff --git a/Plugins/makefile b/Plugins/makefile
index 8a1dd91..928c4b7 100644
--- a/Plugins/makefile
+++ b/Plugins/makefile
@@ -5,7 +5,7 @@ all: noize colortv subtract xbend bend gol shuffle green \
multiply overlay screen shadowcaster softlight \
rgbseek modgain traffic constrain eclipse eclipse02 eclipse03 \
cga keyscreen rene cutout fromage rgbavg rgbavg02 \
- rowca
+ rowca argument-passing
dir *.dll
@@ -26,7 +26,7 @@ colortv:
cl colortv.c $(FLAGS) /link $(BOTH)
subtract:
- cl subtract.cpp $(FLAGS) /link $(EFFECT)
+ cl subtract.cpp $(FLAGS) /GX /link $(EFFECT)
xbend:
cl xbend.c $(FLAGS) /link $(BOTH)
@@ -185,3 +185,6 @@ rgbavg02:
rowca:
cl rowca.cpp $(FLAGS) /GX /link $(EFFECT)
+
+argument-passing:
+ cl argument-passing.cpp $(FLAGS) /GX /link $(EFFECT)
diff --git a/Plugins/pixels.h b/Plugins/pixels.h
index 9557ea8..8ea645c 100644
--- a/Plugins/pixels.h
+++ b/Plugins/pixels.h
@@ -6,11 +6,12 @@
// - dot16() dot24() and dot32() added
// - get/put dot() removed, use above
-#include "plugin.h"
-
#ifndef _PIXELSH
#define _PIXELSH
+#include <vector>
+#include "plugin.h"
+
class pixels
{
private:
@@ -117,4 +118,29 @@ void pixels::updaterowp()
p32 = (pixel32 *)p8;
}
+//
+// arguments-class, to make it easier to parse parameters.
+// using vector<char *> for this might be a bit overkill (??),
+// but I like the ease of it.
+
+class arguments
+{
+private:
+ std::vector<char *> m_ptrs;
+public:
+ arguments(char *s)
+ {
+ char *t = s;
+ if(!t || !t[0]) return;
+ if(t[0]) m_ptrs.push_back(t);
+ while(t = strstr(t+1, " "))
+ {
+ t[0]=0;
+ m_ptrs.push_back(t+1);
+ }
+ }
+ char *operator[](int i) { return m_ptrs[i]; }
+ int count() { return m_ptrs.size(); }
+};
+
#endif // #ifndef _PIXELSH
diff --git a/Plugins/rowca.cpp b/Plugins/rowca.cpp
index 5c776ac..de83933 100644
--- a/Plugins/rowca.cpp
+++ b/Plugins/rowca.cpp
@@ -42,11 +42,19 @@ void draw(const _frame &f);
void perform_effect(_frame f, _args a)
{
- if(!a.s || !a.s[0]) return;
+ arguments ar(a.s);
+ if(!ar.count()) {
+ printf("Usage: rowca <rule of automata, or command>\n");
+ printf("Example rule: 001-010-011-100\n");
+ printf("Commands: draw, clear\n");
+ return;
+ }
+
+ char *t = ar[0];
- if(strstr(a.s, "0") || strstr(a.s, "1")) iterate(a.s); else
- if(strcmp(a.s, "draw")==0) draw(f); else
- if(strcmp(a.s, "clear")==0) sv.clear();
+ if(strstr(t, "0") || strstr(t, "1")) iterate(t); else
+ if(strcmp(t, "draw")==0) draw(f); else
+ if(strcmp(t, "clear")==0) sv.clear();
}
void iterate(const char *arg)
diff --git a/Plugins/rowca.dll b/Plugins/rowca.dll
index eda7177..5302341 100644
--- a/Plugins/rowca.dll
+++ b/Plugins/rowca.dll
Binary files differ
diff --git a/Plugins/rowca.exp b/Plugins/rowca.exp
index be126fa..9fcaa42 100644
--- a/Plugins/rowca.exp
+++ b/Plugins/rowca.exp
Binary files differ
diff --git a/Plugins/rowca.lib b/Plugins/rowca.lib
index 78df6e5..ce2557f 100644
--- a/Plugins/rowca.lib
+++ b/Plugins/rowca.lib
Binary files differ
diff --git a/Plugins/rowca.obj b/Plugins/rowca.obj
index c57f120..5ce3a87 100644
--- a/Plugins/rowca.obj
+++ b/Plugins/rowca.obj
Binary files differ
diff --git a/Plugins/subtract.cpp b/Plugins/subtract.cpp
index 89ba216..3172513 100644
--- a/Plugins/subtract.cpp
+++ b/Plugins/subtract.cpp
@@ -1,3 +1,9 @@
+//
+// subtract - subtract red/green/blue color from image
+//
+// 0.32
+// using arguments-class
+//
// 0.20
// - from c to c++
// - pixelformat-aware
@@ -9,30 +15,35 @@
void perform_effect(_frame f, _args a)
{
- pixels p(f);
- char *t;
- byte tr, tg, tb, r=0, g=0, b=0;
-
- if(!a.s) return;
+ arguments ar(a.s);
- r = atoi(a.s);
- if(t = strstr(a.s, " "))
+ if(ar.count()!=3)
{
- g = atoi(t+1);
- if (t = strstr(t+1, " "))
- b = atoi(t+1);
+ printf("usage: subtract <red> <green> <blue>\n");
+ return;
}
+ byte r, g, b;
+
+ r = atoi(ar[0]);
+ g = atoi(ar[1]);
+ b = atoi(ar[2]);
+
+ pixels p(f);
+ byte tr, tg, tb;
+
while(!p.eof())
{
tr = p.red();
tg = p.green();
tb = p.blue();
+
p.putrgb(
tr>r ? tr-r : 0,
tg>g ? tg-g : 0,
tb>b ? tb-b : 0
);
+
p.next();
}
}
diff --git a/Plugins/subtract.dll b/Plugins/subtract.dll
index 883c541..65383b3 100644
--- a/Plugins/subtract.dll
+++ b/Plugins/subtract.dll
Binary files differ
diff --git a/Plugins/subtract.exp b/Plugins/subtract.exp
index 9a066ba..0c88e2c 100644
--- a/Plugins/subtract.exp
+++ b/Plugins/subtract.exp
Binary files differ
diff --git a/Plugins/subtract.lib b/Plugins/subtract.lib
index 5132561..ad174a2 100644
--- a/Plugins/subtract.lib
+++ b/Plugins/subtract.lib
Binary files differ
diff --git a/Plugins/subtract.obj b/Plugins/subtract.obj
index 8405ccc..bb9e9fa 100644
--- a/Plugins/subtract.obj
+++ b/Plugins/subtract.obj
Binary files differ
diff --git a/Source/Framestein.cfg b/Source/Framestein.cfg
index dc72219..6ee2f15 100644
--- a/Source/Framestein.cfg
+++ b/Source/Framestein.cfg
@@ -6,7 +6,7 @@
-$F-
-$G+
-$H+
--$I+
+-$I-
-$J+
-$K-
-$L+
@@ -33,7 +33,7 @@
-K$00400000
-LE"c:\program files\borland\delphi5\Projects\Bpl"
-LN"c:\program files\borland\delphi5\Projects\Bpl"
--U"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
--O"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
--I"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
--R"g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib"
+-U"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
+-O"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
+-I"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
+-R"E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32"
diff --git a/Source/Framestein.dof b/Source/Framestein.dof
index d2d8419..ddd0c6f 100644
--- a/Source/Framestein.dof
+++ b/Source/Framestein.dof
@@ -7,7 +7,7 @@ E=0
F=0
G=1
H=1
-I=1
+I=0
J=1
K=0
L=1
@@ -43,8 +43,8 @@ OutputDir=
UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
-SearchPath=g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib
-Packages=Vcl50;Vclx50;VclSmp50;Qrpt50;Vcldb50;Vclbde50;ibevnt50;vcldbx50;TeeUI50;TeeDB50;Tee50;TeeQR50;VCLIB50;vclie50;Inetdb50;Inet50;NMFast50;dclocx50;dclaxserver50;temppak;janDrawPack;pdpak
+SearchPath=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32
+Packages=Vcl50;Vclx50;VclSmp50;Qrpt50;Vcldb50;Vclbde50;ibevnt50;vcldbx50;TeeUI50;TeeDB50;Tee50;TeeQR50;VCLIB50;vclie50;Inetdb50;Inet50;NMFast50;dclocx50;dclaxserver50;DelphiX_for5;fspak
Conditionals=
DebugSourceDirs=
UsePackages=0
@@ -56,33 +56,37 @@ ActiveLang=
ProjectLang=$0000040B
RootDir=
[Version Info]
-IncludeVerInfo=1
-AutoIncBuild=1
-MajorVer=0
-MinorVer=1
-Release=1
-Build=79
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
Debug=0
-PreRelease=1
+PreRelease=0
Special=0
Private=0
DLL=0
-Locale=1033
+Locale=1035
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
-FileVersion=0.1.1.79
+FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
-ProductName=Framestein
+ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlSearchPath]
-Count=1
-Item0=g:\lab\common;g:\lab\common\DelphiX2000_0717-2\Source;g:\lab\common\fastlib;g:\lab\common\pshost;g:\lab\common\G32;g:\lab\common\fastlib
+Count=5
+Item0=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32
+Item1=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost;E:\lab\common\G32\Packages
+Item2=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib;E:\lab\common\pshost
+Item3=E:\lab\common\DelphiX2000_0717-2\Source;E:\lab\common\fastlib
+Item4=E:\lab\common\DelphiX2000_0717-2\Source
diff --git a/Source/Framestein.dpr b/Source/Framestein.dpr
index 4dd00b2..f280e75 100644
--- a/Source/Framestein.dpr
+++ b/Source/Framestein.dpr
@@ -1,35 +1,23 @@
-{ Copyright (C) 2001-2002 Juha Vehviläinen
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.}
-
program Framestein;
-{%ToDo 'Framestein.todo'}
-
uses
+ ActiveX,
Forms,
mainunit in 'mainunit.pas' {main},
- fsframeunit in 'fsframeunit.pas' {fsframe},
+ pshostunit in 'pshostunit.pas',
+ effectsunit in 'effectsunit.pas',
+ fsaviunit in 'fsaviunit.pas' {FsAvi},
+ fsbrowserunit in 'fsbrowserunit.pas',
fscopyunit in 'fscopyunit.pas' {fscopy},
- fstextunit in 'fstextunit.pas' {fstext},
- fsformunit in 'fsformunit.pas',
fsdrawunit in 'fsdrawunit.pas' {fsdraw},
- effectsunit in 'effectsunit.pas',
- pluginunit in 'pluginunit.pas',
- logunit in 'logunit.pas' {log},
- fsbrowserunit in 'fsbrowserunit.pas' {fsbrowser},
+ fsformunit in 'fsformunit.pas',
+ fsframeunit in 'fsframeunit.pas' {fsframe},
fsinfounit in 'fsinfounit.pas' {fsinfo},
- configureunit in 'configureunit.pas' {configure},
- pshostunit in 'pshostunit.pas',
- fsaviunit in 'fsaviunit.pas' {FsAvi},
- progressunit in 'progressunit.pas' {Progress};
+ fstextunit in 'fstextunit.pas' {fstext},
+ logunit in 'logunit.pas' {log},
+ pluginunit in 'pluginunit.pas',
+ progressunit in 'progressunit.pas' {Progress},
+ configureunit in 'configureunit.pas' {configure};
{$R *.RES}
@@ -37,10 +25,9 @@ begin
Application.Initialize;
Application.Title := 'Framestein';
Application.CreateForm(Tmain, main);
- Application.CreateForm(Tlog, log);
- Application.CreateForm(Tconfigure, configure);
- Application.CreateForm(TFsAvi, FsAvi);
Application.CreateForm(TProgress, Progress);
+ Application.CreateForm(Tconfigure, configure);
+ Application.CreateForm(Tlog, log);
Application.Run;
end.
diff --git a/Source/Framestein.res b/Source/Framestein.res
index 6b96418..62620b9 100644
--- a/Source/Framestein.res
+++ b/Source/Framestein.res
Binary files differ
diff --git a/Source/configureunit.dfm b/Source/configureunit.dfm
index 5a9e46d..f171463 100644
--- a/Source/configureunit.dfm
+++ b/Source/configureunit.dfm
@@ -21,9 +21,62 @@ object configure: Tconfigure
Top = 0
Width = 427
Height = 275
- ActivePage = TSConnections
+ ActivePage = TSFolders
Align = alClient
TabOrder = 0
+ object TSFolders: TTabSheet
+ Caption = 'Folders'
+ ImageIndex = 2
+ object Label6: TLabel
+ Left = 16
+ Top = 36
+ Width = 83
+ Height = 13
+ Caption = 'Framestein folder:'
+ end
+ object EditFSFolder: TEdit
+ Left = 152
+ Top = 32
+ Width = 225
+ Height = 21
+ Ctl3D = True
+ ParentCtl3D = False
+ TabOrder = 0
+ Text = 'E:\'
+ end
+ object Memo1: TMemo
+ Left = 16
+ Top = 200
+ Width = 389
+ Height = 33
+ BorderStyle = bsNone
+ Enabled = False
+ Lines.Strings = (
+
+ 'Choose the folder where Framestein will find its Plugins and Fil' +
+ 'ters.'
+ '')
+ ReadOnly = True
+ TabOrder = 1
+ end
+ object DirectoryListBox1: TDirectoryListBox
+ Left = 152
+ Top = 88
+ Width = 225
+ Height = 97
+ ItemHeight = 16
+ TabOrder = 2
+ OnChange = DirectoryListBox1Change
+ end
+ object DriveComboBox1: TDriveComboBox
+ Left = 152
+ Top = 64
+ Width = 225
+ Height = 19
+ TabOrder = 3
+ OnChange = DriveComboBox1Change
+ end
+ end
object TSConnections: TTabSheet
Caption = 'Connections'
object Label1: TLabel
@@ -116,7 +169,7 @@ object configure: Tconfigure
Caption = 'General'
ImageIndex = 1
object CBDockMain: TCheckBox
- Left = 16
+ Left = 26
Top = 36
Width = 377
Height = 17
@@ -134,7 +187,7 @@ object configure: Tconfigure
BevelOuter = bvNone
TabOrder = 1
object ButtonOk: TButton
- Left = 8
+ Left = 344
Top = 8
Width = 75
Height = 25
@@ -144,7 +197,7 @@ object configure: Tconfigure
OnClick = ButtonOkClick
end
object ButtonCancel: TButton
- Left = 96
+ Left = 256
Top = 8
Width = 75
Height = 25
diff --git a/Source/configureunit.pas b/Source/configureunit.pas
index 88dff73..b4a1dab 100644
--- a/Source/configureunit.pas
+++ b/Source/configureunit.pas
@@ -4,7 +4,7 @@ interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, ComCtrls;
+ StdCtrls, ExtCtrls, ComCtrls, Buttons, FileCtrl;
type
Tconfigure = class(TForm)
@@ -25,9 +25,17 @@ type
CBEnableFSConns: TCheckBox;
TSGeneral: TTabSheet;
CBDockMain: TCheckBox;
+ TSFolders: TTabSheet;
+ Label6: TLabel;
+ EditFSFolder: TEdit;
+ Memo1: TMemo;
+ DirectoryListBox1: TDirectoryListBox;
+ DriveComboBox1: TDriveComboBox;
procedure ButtonCancelClick(Sender: TObject);
procedure ButtonOkClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
+ procedure DriveComboBox1Change(Sender: TObject);
+ procedure DirectoryListBox1Change(Sender: TObject);
private
{ Private declarations }
public
@@ -59,6 +67,12 @@ begin
main.FSPort := StrToInt(EditFsPort.Text);
main.EnableFSConns := CBEnableFSConns.Checked;
main.DockMain := CBDockMain.Checked;
+ if main.FSFolder <> EditFSFolder.Text then begin
+ main.FSFolder := EditFSFolder.Text;
+ main.Plugins.Clear;
+ main.Plugins.ReLoad;
+ main.SearchPath.Add(main.FSFolder);
+ end;
try
if Reg.OpenKey('\Software\Framestein', True) then begin
@@ -68,6 +82,7 @@ begin
Reg.WriteInteger('FSPort', main.FSPort);
Reg.WriteBool('EnableFSConns', main.EnableFSConns);
Reg.WriteBool('DockMain', main.DockMain);
+ Reg.WriteString('FSFolder', main.FSFolder);
end;
except
end;
@@ -106,6 +121,7 @@ begin
EditFsPort.Text := IntToStr(main.FSPort);
CBEnableFSConns.Checked := main.EnableFSConns;
CBDockMain.Checked := main.DockMain;
+ EditFSFolder.Text := main.FSFolder;
// show
ShowModal;
end;
@@ -116,5 +132,17 @@ begin
Execute;
end;
+procedure Tconfigure.DriveComboBox1Change(Sender: TObject);
+begin
+ DirectoryListBox1.Drive :=
+ (Sender as TDriveComboBox).Drive;
+end;
+
+procedure Tconfigure.DirectoryListBox1Change(Sender: TObject);
+begin
+ EditFSFolder.Text :=
+ (Sender as TDirectoryListBox).Directory;
+end;
+
end.
diff --git a/Source/fscopyunit.pas b/Source/fscopyunit.pas
index 0206d8f..72ab627 100644
--- a/Source/fscopyunit.pas
+++ b/Source/fscopyunit.pas
@@ -37,7 +37,9 @@ type
iAlpha, iAdd, iSub: Integer;
iBlend: Extended;
Transparent, MirrorLeftRight, MirrorUpdown: Boolean;
- iPlugin, iPluginArgs: String;
+ TransColor: Cardinal;
+ iPlugin: Integer;
+ iPluginArgs: String;
iFilter, iFilterArgs: String;
procedure GetFrames(const S: String);
@@ -101,6 +103,7 @@ var
df: TDDBltFX;
ddck: TDDColorKey;
sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2: Integer;
+ r, g, b: Byte;
begin
if (S='') then Exit;
@@ -165,13 +168,19 @@ begin
if s1='TRANSPARENT_0' then begin Transparent := False; Exit; end else
if s1='TRANSPARENT_1' then begin Transparent := True; Exit; end else
+ if s1='TRANSCOLOR' then begin
+ r := MyStrToInt(ExtractWord(2, S, [' ']));
+ g := MyStrToInt(ExtractWord(3, S, [' ']));
+ b := MyStrToInt(ExtractWord(4, S, [' ']));
+ TransColor := RGB(r, g, b);
+ Exit;
+ end else
if s1='MIRRORLEFTRIGHT_0' then begin MirrorLeftRight := False; Exit; end else
if s1='MIRRORLEFTRIGHT_1' then begin MirrorLeftRight := True; Exit; end else
if s1='MIRRORUPDOWN_0' then begin MirrorUpDown := False; Exit; end else
if s1='MIRRORUPDOWN_1' then begin MirrorUpDown := True; Exit; end else
- if main.Plugins.IsPlugin(s1) then begin
+ if main.Plugins.IsPlugin(iPlugin, s1) then begin
DrawStyle := dsPlugin;
- iPlugin := s1;
iPluginArgs := Copy(S, Length(s1)+2, 255);
Exit;
end else
@@ -182,7 +191,6 @@ begin
Exit;
end;
-
GetFrames(S);
if (f1=nil) or (f2=nil) then Exit;
if (f1.d1=nil) or (f2.d1=nil) then Exit;
@@ -257,15 +265,15 @@ begin
case DrawStyle of
dsCopy: begin
- ddck.dwColorSpaceLowValue := 0;
- ddck.dwColorSpaceHighValue := 0;
+ ddck.dwColorSpaceLowValue := TransColor;
+ ddck.dwColorSpaceHighValue := TransColor;
DF.dwsize := SizeOf(DF);
DF.dwROP := cmSrcCopy;
DF.dwDDFX := 0;
DF.ddckSrcColorkey := ddck;
DF.ddckDestColorkey := ddck;
bltFlags := DDBLT_DDFX;
- if Transparent then bltFlags := bltFlags or DDBLT_KEYSRCOVERRIDE;
+ if Transparent then bltFlags := bltFlags or DDBLT_KEYSRCOVERRIDE;//OVERRIDE;
if MirrorLeftRight then
DF.dwDDFX := DF.dwDDFX or DDBLTFX_MIRRORLEFTRIGHT;
if MirrorUpDown then
@@ -341,6 +349,7 @@ begin
DestType := rtAll;
iAlpha := 50; iAdd := 255; iSub := 255;
Transparent := False;
+ TransColor := 0;
MirrorLeftRight := False;
MirrorUpDown := False;
end;
diff --git a/Source/fsframeunit.pas b/Source/fsframeunit.pas
index e3316a7..449d8fc 100644
--- a/Source/fsframeunit.pas
+++ b/Source/fsframeunit.pas
@@ -1,4 +1,4 @@
-{ Copyright (C) 2001 Juha Vehviläinen
+{ Copyright (C) 2001-2002 Juha Vehviläinen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
@@ -646,10 +646,14 @@ begin
ExtractWord(4, s1, [' ']) // caption
);
end else
+ if s1='TITLE' then begin
+ s1 := Copy(S, Length(s1)+2, 255);
+ Caption := s1;
+ end else
if False{your new effect here} then begin
end else
- if main.Plugins.IsPlugin(s1) then begin
- if main.Plugins.CallEffect(d1.Surface, s1, Copy(S, Length(s1)+2, 255)) then
+ if main.Plugins.IsPlugin(i, s1) then begin
+ if main.Plugins.CallEffect(d1.Surface, i, Copy(S, Length(s1)+2, 255)) then
FlipRequest;
end else
if pshostunit.IsFilter(s1) then begin
@@ -954,9 +958,6 @@ begin
end;
procedure Tfsframe.HandleDroppedFile(const S: String);
-var
- i: Integer;
- St: String;
begin
Parse(S);
main.SendReturnValues(PdName+'bang=1');
diff --git a/Source/mainunit.pas b/Source/mainunit.pas
index 2cb7500..8a4a495 100644
--- a/Source/mainunit.pas
+++ b/Source/mainunit.pas
@@ -74,9 +74,9 @@ type
function ItemCount( const ClassName: String ): Integer;
procedure Reset;
procedure minimizeall;
- procedure ExceptionHandler(Sender: TObject; E: Exception);
procedure DropFileHandler(const h: HWND; const DroppedFileName: String);
procedure AppMessage(var Msg: Tmsg; var Handled: Boolean);
+ procedure ExceptionHandler(Sender: TObject; E: Exception);
public
{ Public declarations }
RunConfig: Boolean;
@@ -89,6 +89,7 @@ type
logstate: Boolean;
Plugins: TPlugins;
SearchPath: TStringList;
+ FSFolder: String;
function CompName(const S: String): String;
procedure Parse(const S: String); override;
@@ -102,9 +103,20 @@ type
function FileExistsInSearchPath(var S: String): Boolean; // modifying S allowed!
end;
+{$IFDEF FSDLL}
+ TMainThread = class(TThread)
+ public
+ procedure Execute; override;
+ end;
+{$ENDIF}
+
const
- STARTMSG = 'Framestein 0.31 running...';
- MCAPTION = 'Framestein 0.31';
+{$IFDEF FSDLL}
+ STARTMSG = 'FramesteinLib 0.32 DLL TEST 1 running...';
+{$ELSE}
+ STARTMSG = 'Framestein 0.32 dev running...';
+{$ENDIF}
+ MCAPTION = 'Framestein 0.32';
SocketBufferSize = 100000;
var
@@ -112,6 +124,10 @@ var
DockTitle: String;
DockHandle: HWND;
+{$IFDEF FSDLL}
+ MainT: TMainThread;
+{$ENDIF}
+
function WinEnumerator(h: HWND; i: LongInt): BOOL; stdcall;
function WinEnumerator_Exact(h: HWND; i: LongInt): BOOL; stdcall;
function WinEnumerator_SubStr(h: HWND; i: LongInt): BOOL; stdcall;
@@ -125,7 +141,23 @@ uses
fscopyunit, fstextunit, fsdrawunit, fsbrowserunit,
fsinfounit, fsaviunit,
fastfiles,
- Strz, logunit, configureunit;
+ Strz, logunit, configureunit, progressunit;
+
+{$IFDEF FSDLL}
+procedure TMainThread.Execute;
+begin
+ Application.Initialize;
+ Application.Title := '';
+ Application.CreateForm(Tmain, main);
+ Application.CreateForm(Tlog, log);
+ Application.CreateForm(Tconfigure, configure);
+ Application.CreateForm(TProgress, Progress);
+ Application.Run;
+// ???
+ Application.OnException := nil;
+ Application.OnMessage := nil;
+end;
+{$ENDIF}
function WinEnumerator(h: HWND; i: LongInt): BOOL; stdcall;
var
@@ -354,6 +386,7 @@ end;
procedure Tmain.FormCreate(Sender: TObject);
begin
+ FSFolder := ExtractFilePath(Application.Exename);
Randomize;
RunConfig:=False;
PdHost := 'localhost';
@@ -384,7 +417,7 @@ begin
logstate := False;
SearchPath := TStringList.Create;
- SearchPath.Add(ExtractFilePath(Application.ExeName));
+ SearchPath.Add(FSFolder);
Application.OnException := ExceptionHandler;
Application.OnMessage := AppMessage;
@@ -462,6 +495,9 @@ begin
FSPort := Reg.ReadInteger('FSPort');
EnableFSConns := Reg.ReadBool('EnableFSConns');
DockMain := Reg.ReadBool('DockMain');
+ FSFolder := Reg.ReadString('FSFolder');
+ if FSFolder='' then
+ FSFolder := ExtractFilePath(Application.Exename);
end;
except
RunConfig := True;
@@ -790,6 +826,8 @@ var
i: Integer;
f: TFsFrame;
begin
+ if main=nil then Exit;
+ with main do
if Pos('1400', E.Message)>0 then begin // invalid window handle
// check any fs.frames with invalid window handles
// (due to closing a patch with docked fs.frames)
@@ -897,6 +935,10 @@ begin
if main.ParentWindow<>0 then begin
main.ParentWindow:=0;
end;
+ Action := caFree;
+{$IFDEF FSDLL}
+ MainT.Terminate;
+{$ENDIF}
end;
end.
diff --git a/Source/pluginunit.pas b/Source/pluginunit.pas
index d4fd51e..e238f09 100644
--- a/Source/pluginunit.pas
+++ b/Source/pluginunit.pas
@@ -1,4 +1,4 @@
-{ Copyright (C) 2001 Juha Vehviläinen
+{ Copyright (C) 2001-2002 Juha Vehviläinen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
@@ -49,12 +49,13 @@ type
procedure Load;
procedure Reload;
procedure Clear;
- function IsPlugin(const s: String): Boolean;
+ // IsPlugins sets Index if S is a plugin
+ function IsPlugin(var Index: Integer; const s: String): Boolean;
function CallEffect(const d: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
function CallCopy(const d1: TDirectDrawSurface;
const d2: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
end;
implementation
@@ -141,7 +142,7 @@ var
begin
sd := TScanDir.Create(Self);
sd.OnHandleFile := LoadHandleFile;
- sd.Scan(ExtractFilePath(Application.ExeName)+'\Plugins');
+ sd.Scan(main.FSFolder+'\Plugins');
sd.Free;
if Names.Count>0 then begin
s := '';
@@ -159,27 +160,25 @@ begin
Load;
end;
-function TPlugins.IsPlugin(const s: String): Boolean;
+function TPlugins.IsPlugin(var Index: Integer; const s: String): Boolean;
begin
- Result := Names.IndexOf(s)<>-1;
+ Index := Names.IndexOf(s);
+ Result := Index<>-1;
end;
var
argsBuf: array[0..255] of Char;
function TPlugins.CallEffect(const d: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
var
- i: Integer;
Proc: TEffectProc;
sd: TDDSurfaceDesc;
P: PChar;
begin
Result := False;
- if (Names.Count=0) or (d.Width=0) or (d.Height=0) then Exit;
- i := Names.IndexOf(procname);
- if (i=-1) or (i>=EffectProcs.Count) then Exit;
- @Proc := EffectProcs[i];
+ if (procIndex=-1) or (procIndex>=EffectProcs.Count) then Exit;
+ @Proc := EffectProcs[procIndex];
if @Proc=nil then Exit;
P:=@argsBuf;
P[0]:=#0;
@@ -193,21 +192,16 @@ begin
end;
function TPlugins.CallCopy(const d1, d2: TDirectDrawSurface;
- const procname: String; const args: String): Boolean;
+ const procIndex: Integer; const args: String): Boolean;
var
- i: Integer;
Proc: TCopyProc;
sd1: TDDSurfaceDesc;
sd2: TDDSurfaceDesc;
P: PChar;
begin
Result := False;
- if (Names.Count=0) or
- (d1.Width=0) or (d1.Height=0) or
- (d2.Width=0) or (d2.Height=0) then Exit;
- i := Names.IndexOf(procname);
- if (i=-1) or (i>=CopyProcs.Count) then Exit;
- @Proc := CopyProcs[i];
+ if (procIndex=-1) or (procIndex>=CopyProcs.Count) then Exit;
+ @Proc := CopyProcs[procIndex];
if @Proc=nil then Exit;
P:=@argsBuf;
P[0]:=#0;
diff --git a/Source/pshostunit.pas b/Source/pshostunit.pas
index 42868c3..720e24c 100644
--- a/Source/pshostunit.pas
+++ b/Source/pshostunit.pas
@@ -22,12 +22,9 @@ uses
Windows, Graphics, DIB,
mainunit;
-var
- FilterPath: String;
-
function FullFilterPath(const S: String): String;
begin
- Result := FilterPath+'\'+S;
+ Result := main.FSFolder+'\Filters\'+S;
if Uppercase(ExtractFileExt(S))<>'.8BF' then
Result := Result+'.8BF';
end;
@@ -139,7 +136,5 @@ begin
Active := False;
end;
-begin
- FilterPath := ExtractFilePath(Application.ExeName)+'\Filters'
end.