İletileri Göster

Bu özellik size üyenin attığı tüm iletileri gösterme olanağı sağlayacaktır . Not sadece size izin verilen bölümlerdeki iletilerini görebilirsiniz


Mesajlar - spaztica

Sayfa: 1 ... 95 96 [97] 98 99
1441
coding / Bumpmapping
« : 31.03.2004 07:01:35 »
Alıntı
To really do REAL 2d bump mapping one has to calculate normals for every
pixel in bump map (an image representing "heights" of pixels) and for each
pixel take dot product of light source and this normal (the normal of the
surface (ie. bumpy screen) is <0,0,-1>, ie. directly to the viewer, so it
doesn't affect bump mapping).

This, of course, is awfully slow. And it does not look that good either.

The answer is simple. If we know X and Y of normal, we can calculate it's Z
(as normals are unit vectors. So Z is simply 1-sqrt(X^2 + Y^2) ). Therefore,
we can calculate the lighting value for each X and Y and store it into a
map (which, normally is 256x256). This kind of a map is called enviroment map
(enviroment maps are used to simulate reflecting objects with simple mapping).

Here's some pseudocode to calculate enviroment map:

for (int y=0;y<256;y++)
for (int x=0;x<256;x++)
{
 float nX=(x-128)/128;
 float nY=(y-128)/128;
 float nZ=1-sqrt(nX*nX + nY*nY);
 if (nZ<0) nZ=0;
 enviromentmap
  • [y]=nZ*256; // 256 shades...

};

Of course you can use Phong illumination model as well...

So, by picking value at enviromentmap[normalx+128][normaly+128] (if normals are
in 9.7 fixed point format) we get the correct lighting info for lightsource at
<0,0,-infinity>. This, althought correct, is not what we want. We want light-
source to move and be infinitely close to the surface.

Normalx is simply difference of heights in neighbour pixel on X axis... ie.

normalx = bumpmap[x+1][y] - bumpmap[x-1][y]

and for normaly, we ofcourse do

normaly = bumpmap
  • [y+1] - bumpmap
  • [y-1]


And now, gals and guys, comes the damned easy part :)

We simply pick value from
enviromentmap[(normalx-(lightx-currentx))][(normalx-(lightx-currentx))].
Of course, you have to check that values are within range...

So, here's a simple pseudocode for 2d bump mapper:

for (int y=0;y<200;y++)
for (int x=0;x<320;x++)
{
 int nX=bumpmap[x+1][y]-bumpmap[x-1][y];
 int nY=bumpmap
  • [y+1]-bumpmap
  • [y-1];

 int lX=x-lightx;
 int lY=y-lighty;
 nX-=lX;
 nY-=lY;
 nX+=128;
 nY+=128;
 if (nX<0 || nX>255) nX=0;
 if (nY<0 || nY>255) nY=0;
 screen
  • [y]=enviromentmap[nX][nY];

};

Hope this helps you...

1442
coding / Ateş Efekti
« : 31.03.2004 06:49:51 »
bu da bu efekti temel almış değişik bir rutin:

çalışır halde görmek için exe halini indirebilirsiniz.

Kod: [Seç]
/*

A cool prog in Borland C++. What fire would look like with no gravity!
Could be made faster by converting the pixel checking to assembly.
Also could be make neater by using a separate ASM file instead of
pseudo-assembly for the mouse checking routine, screen mode, etc.
Could easily be converted to a fire routine. Sorry almost no commenting.
Should be pretty easy to understand anyway.

By iNsAnE~aSyLuM

*/

#pragma option -mc
#include <stdlib.h>
#include <dos.h>
#include <mem.h>
#include <conio.h>

// Set this to SIDES for only checking on the sides or
// set this to DIAGONALS for only check on the diagonals or
// set this to ALL for checking of all surrounding pixels

#define SIDES

#if defined(ALL)
#define SIDES
#define DIAGONALS
#endif

const unsigned int screen_w = 320;
const unsigned int screen_h = 200;
const unsigned int offset_x = 0;
const unsigned int offset_y = 0;
const unsigned int bufsize = screen_w*screen_h;

unsigned int mouse_w = 10;
unsigned int mouse_h = 10;

unsigned int decay = 0;

unsigned far char *screen=(unsigned char far*)0xA0000000L;
unsigned far char buffera[bufsize];
unsigned far char bufferb[bufsize];
unsigned far char *buffer1=buffera;
unsigned far char *buffer2=bufferb;
unsigned far char *destline=NULL;
unsigned far char *line=NULL;
unsigned far char *lineup=NULL;
unsigned far char *linedown=NULL;

void setVGAmode(int mode)
{
_AX=mode;
_BX=0;
geninterrupt(0x10);
}

void setVESAmode(int mode)
{
_AH = 0x4f;
_AL = 2;
_BX = mode;
geninterrupt(0x10);
}

void vsync()
{
while((inportb(0x3da)&8));
while(!(inportb(0x3da)&8));
}

void set_color(unsigned char col,unsigned char r,unsigned char g,unsigned char b)
{
outportb(0x3c8,col);
outportb(0x3c9,r%64);
outportb(0x3c9,g%64);
outportb(0x3c9,b%64);
}

void mouse_status(int &x,int &y,int &b)
{
_AX = 3;
geninterrupt(0x33);
b = _BX;
x = _CX/2;
y = _DX;
}

void main()
{
unsigned int x,y;
int temp=0;
int mouse_x=20,mouse_y=20;
int mouse_b=0;
int done=0;
unsigned char resp=0;
setVESAmode(0x13);
for(x=0;x<64;x++)
{
 set_color(x,0,0,0);
 set_color(x+64,x,x/2,0);
 set_color(x+128,63,32+x/2,0);
 set_color(x+192,63,63,x);
}
while(!done)
{
 mouse_status(mouse_x,mouse_y,mouse_b);
 resp=0;
 if(kbhit())resp=getch();
 if(resp=='+'&&mouse_w<318&&mouse_h<198){mouse_w++;mouse_h++;}
 if(resp=='-'&&mouse_w>1&&mouse_h>1){mouse_w--;mouse_h--;}
 if(resp==27||resp=='q'||resp=='x')done=1;
 if(mouse_x<1)mouse_x=1;
 if(mouse_y<1)mouse_y=1;
 if(mouse_x>screen_w-mouse_w-1)mouse_x=screen_w-mouse_w-1;
 if(mouse_y>screen_h-mouse_h-1)mouse_y=screen_h-mouse_h-1;
 for(x=0;x<mouse_w;x++)
  for(y=0;y<mouse_h;y++)
  *(buffer2+(mouse_x+x)+((mouse_y+y)*screen_w))=255;
 for(y=1;y<screen_h-1;y++)
 {
  destline= (buffer1+((y ) *screen_w));
  linedown= (buffer2+((y-1) *screen_w));
  line= (buffer2+((y ) *screen_w));
  lineup= (buffer2+((y+1) *screen_w));
  for(x=1;x<screen_w-1;x++)
  {
  temp=0;
  #if defined(DIAGONALS)
  temp+=*(lineup +x+1);
  temp+=*(lineup +x-1);
  temp+=*(linedown+x+1);
  temp+=*(linedown+x-1);
  #endif
  #if defined(SIDES)
  temp+=*(lineup +x);
  temp+=*(line  +x+1);
  temp+=*(line +x-1);
  temp+=*(linedown+x);
  #endif
  #if defined(SIDES) && defined(DIAGONALS)
  temp = (temp>>3);
  #else
  temp = (temp>>2);
  #endif
  if(temp>=decay)temp-=decay;
  else temp=0;
  *(destline+x)=temp;
  }
 }
 //wait for vertical retrace for no flickering
 //vsync();
 for(y=0;y<screen_h;y++)
 {
  //copy buffer to screen
  _fmemcpy(screen+(offset_x+(offset_y+y)*320),buffer1+(screen_w*y),screen_w);
 }
 //copy buffer to second buffer for later reference
 _fmemcpy(buffer2,buffer1,bufsize);
}
setVESAmode(0x3);
}

1443
coding / Ateş Efekti
« : 31.03.2004 06:44:21 »
Alıntı
Introduction:
This is the first tutorial (of many I hope) on programming various 2d
and 3d effects. I am starting off with the standard fire effect. Often
enough, people who write tutorials start with stuff about mode 13h,
palettes, etc ... by I figure that there is already plenty enough stuff
out there on those topics.
Before you start reading, maybe you will want to download fire.zip from
my homepage (unless you already have) and look at it and the code. Just
so we know what we are talking about here ;) If you feel that the code
is somewhat obscure (I think it is ...) well then read on!

Part I: Generating a cool palette
The first thing your program will have to do, (after setting up video
mode and such) is to create a cool palette for the fire. This turns out
to be a crucial part of the effectiveness of the effect.
To look good, the palette must contain a smooth gradient of colors that
range from white to black, passing by reds, oranges, yellows and maybe
some blues for the top of the fire. As we will see later on, the order
of colors is important. The palette should look like this:
____________________
|Color 0 | Black |
| .   |   |
| .   |   |
| .   |   |
|Color n1 | Blue |
| .   |   |
| .   |   |
| .   |   |
|Color n2 | Red |
| .   |   |
|Color n3 | Orange|
| .   |   |
|Color n4 | Yellow|
| .   |   |
|Color 255 | White |
|__________|_______|
The higher the color index is, the 'hotter' the pixel is. So at the bottom
of the fire everything is white, then it gradually decreases to black.
The trick is to have smooth color runs between the various colors at indexes
0, n1, n2, ... so that the whole thing looks smooth. And the key to smooth
color runs is: LINEAR INTERPOLATION. Remember this one if you haven't already
its one of those things that you will often need in programming (especially
graphics programming). If you already know what this is and are comfortable
with it, just skip a paragraph or two. Its a realy simple formula and
has an incredible number of applications. Here it goes:

Value = Start_Value + t * (End_Value - Start_Value)
where t varies from 0 to 1

Wow, read that over once or twice ;) The parameter t specifies the
position of the value you want to get between Start_Value and End_Value as a
fraction. For example, consider the linear run of numbers:
0,5,10,15,20,25, ...., 100
It is said to be linear because the numbers progress by addition (+5 each
time). Now, what is the number right in the middle of the sequence ?
Easy, with our formula we just write:

Number_in_the_middle = 0 + 0.5 * (100 - 0)
          = 50
And that's the correct answer of course! (write the whole thing out if you're
not sure ;))

Back to palettes and smooth color runs. We know that between color index 0
and 10 for example we want to have a smooth run of colors that goes from
black to blue. All we have to do to get those colors in between is:
Color = Black + t * (Blue - Black)
and since we want to do this from color index 0 to 10: t=i/10 where i is
the index of the color to generate. Colors of course have red, green and blue
components so the real calulation is:

t = i / 10
Color.Red = Black.Red + t * (Blue.Red - Black.Red)
Color.Green = Black.Green + t * (Blue.Green - Black.Green)
Color.Blue = Black.Blue + t * (Blue.Blue - Black.Blue)

The following C code will do the job for you:

void make_gradient (byte start_index, byte red_s, byte green_s,
          byte blue_s, byte end_index, byte red_e,
          byte green_e, byte blue_e)
{
 //Produces smooth gradients from RGB_start to RGB_end
 //(on the variable's names s = start and e = end
 unsigned char index;
 unsigned char max = (end_index - start_index);

 float red_inc, green_inc, blue_inc;

 //Set the two starting values
 set_color(start_index, red_s, green_s, blue_s);
 set_color(end_index, red_e, green_e, blue_e);
 //Compute the RGB increments
 red_inc = (red_e - red_s) / ((float) (max));
 green_inc = (green_e - green_s) / ((float) (max));
 blue_inc = (blue_e - blue_s) / ((float) (max));
 //Set middle colors
 for (index = 1; index < max; index++)
  set_color((start_index + index), (red_s + red_inc * index),
                  (green_s + green_inc * index),
                  (blue_s + blue_inc * index));
}

I assume that you can write the set_color function on your own.
Making a good palette will take a little tweaking, but this function
will make things easier.

Part II: I want to see some flames!

Ok, ok, here it comes ... Lets see how this cool effects is done:
There are several steps to the algorithm:
a) Generate the bottom of the fire (to keep it going)
B) Scroll the fire up
c) Smooth the colors as they move up
d) Display to the screen
We will need at least two arrays the same size of the screen (320x200).
a) The bottom line is filled randomly at various places with white (color
255). Now you will need a random number generator to do this.
At the time I wrote the program, I had no clue as to how to do that, and I
figured it required very complex mathematics. It turns out that it doesn't.
However I didn't know that at the time and I found an alternate solution.
I pregenerated a few random 'bottom line' for the fire and simply copied
them to the bottom line of the fire buffer at run time. That's not the best
way though. Here is a small bit of inline assembly that will generate a
pseudo-random number between 0 and n - 1:
(n should be smaller that 255 even though the parameter is an int)

int seed;
int fast_rand(int n)
{
 asm mov ax, seed
 asm add ax, 1234
 asm xor al, ah
 asm rol ah, l
 asm add ax, 4321
 asm ror al, 1
 asm xor ah, al
 asm mov seed, ax
 asm xor dx, dx
 asm mov cx, n
 asm div cx         ;Divide by n
 asm mov al, ah       ;Save remainder (which ranges from 0 - (n-1))
 asm xor ah, ah
;Return value is in _AX
}

There is no real logic behind this, the idea is just to mess with the value
in the seed variable enough so that it look random. You might want to fool
with that function yourself to make it smaller or whatever. I think you get
the idea.

b/c)This part of the algorithm is what makes the fire realy go. Lets call
our first offscreen buffer, page1 and the other page2. The trick to scroll
upwards is to read pixel (x, y) from page1 and to display it at (x, y-1)
on page2. (Note that special care must be taken not to go beyond the memory
limit of the buffer).
But simple upward scrolling is not what we need. We need to decrease the
pixel color as well. And to do this correctly we must smooth the value that
is being scrolled up. Instead of reading the pixel (x,y), we read the pixels
AROUND (x,y) and put an AVERAGE of those into (x,y-1) on page2. Having a
palette organized linearly helps with this since we don't have to worry
about the rbg values of the colors, we can just average their indexes and
it will look good :)
In order to make the averaging process simpler, we take the 4 or 8
surrounding pixels and use a shift to divide the result.
Thus:
page2(x,y-1)=(page1(x-1,y-1) + page1(x,y-1) + page1(x+1,y-1)
       page1(x-1,y ) +  0    + page1(x+1,y )
       page1(x-1,y+1) + page1(x,y+1) + page1(x+1,y+1)) >> 3;


d)Now that page2 contains a smoothed and moved up page1, we can just copy
it to the screen with our favorite 'rep movsd' intruction and swap around
page1 and page2 so we can repeat the process again. And that's it! You should
have a burning fire on your screen!


Part III: Higher Grounds
- Ok, I got all that, but how can I make this even better ?
There are several variations on this theme. Lets see briefly in theory what
they are.
The first possibility, which I have implemented, is based on a program by
Frank Paxti that I found a while ago on Hornet.org (which is closed now
unfortunately :_( ). The idea is to work on a per-pixel basis. When you move
a pixel up, you randomly displace its x coordinate by -1, 0, or 1. You also
decrease its color randomly based on a decay value. The fire is kept running
by copying to the bottom line a few random colored pixels which are
smoothed (only the bottom line that is) so that the fire will spread left and
right. This really looks real good. I'm not posting the source I've written
to my homepage because its basically a C translation of what that other guy
had done in pascal/asm, mail me (darki@multimania.com) if you desperately
want to have a look at it or browse the ruins of Hornet.org and see if you
can find the original still there...

Other ideas for a better fire effect would be to distort the bitmap with an
image warping algorithm on top of the rest, I don't know if this would really
look good and I haven't tried to implement it. Its up to you to see ...
You might also try to code this effect with high/true color video modes
(15,16,24 and 32bit). It would probably require a color table to emulate the
palette hardware ...

1444
coding / Lens Effect.
« : 31.03.2004 06:36:07 »
ingilizce bir yazı; ama kolay anlaşılabilir.



Alıntı
This is some info on how one could implement a lens.
You should also have the file lens.gif, which contains some pictures to
clarify this text.
The first part is some stuff in general, the real explanation of the lens
transformation is in the second part.


How to implement the transformation
-----------------------------------

The main idea is: I want to transform a fraction of a picture.
Consider the smallest square possible, that contains all pixels affected by the
transformation. That is the 'blue' part of the picture.
I'm considering a precalculated transformation, so the dimensions of the
blue square are know (and constant). Therefore, I also know the total amount of
pixels involved in the transformation. Lets say NPI is a constant, representing
the 'N'umber of 'P'ixels 'I'nvolved. (That is the number of 'blue' pixels)
My program then requires 3 arrays: ORG[NPI], TFM[NPI] and DEST[NPI].

I first copy all 'blue' pixels to the array, called ORG.
[ Suppose the blue square is 10 by 10 pixel, than ORG[0..9] contain the   ]
[ value of the pixels on the first line, ORG[10..11] contain the value of  ]
[ the pixels on the second line, and so on...                ]
So ORG is an array with the original values of the pixels. The copying-routine
depends on the resolution (and the video mode) I'm working in.

I now want to transform the 'blue' picture, that is: I want to transform
the array ORG. For each pixel, I'm gonna determine its new value, and store it
in DEST. To know what its new value is, I use the third array TFM. This array
is a constant, and can therefore by calculated in advance. (You'll see how that
is done for the lens in the second part of this text)

This array says for each pixel: the pixel at position i in the result, should
be the same as the pixel at position TFM in the original.
[ So the formula is DEST = ORG[TMF] for all elements from 0 till NPI-1. ]
The transformation is fast, and does not depend on the resolution/video-mode.

We now copy the array DEST to the blue rectangle on the image, and the
transformation is complete.


If the transformed region is to be connect to the position of the mouse,
then every time the mouse is moved you have to:
1. Copy the original (array ORG) back to the old position,
2. Get the 'blue' region at the new position in the array ORG,
3. Do the transformation from ORG to DEST,
4. Copy the transformed region (DEST) onto the picture.


[ Here are some simple transformations:                   ]
[ ( suppose the blue region has dimensions dX by dY, thus NPI = dX*dY )   ]
[                                      ]
[ for i:=0 to dX*dY-1 do                          ]
[   TFM:=i;                              ]
[ Defines no change at all !                        ]
[ (that is: the transformed picture is the same as the original)      ]
[                                      ]
[ for i:=0 to dX*dY-1 do                          ]
[   TMF:=(dX*dY-1) -i;                         ]
[ This flips the original round both axis (X and Y)             ]
[                                      ]
[ for i:=0 to dY-1 do                            ]
[   for j:=0 to dX-1 do                          ]
[     TFM[i*dX+j] := i*dX + dX-1 - j;                  ]
[ This flips the original round the X-axis only               ]
[                                      ]
[ const M=2;                                ]
[ for i:=0 to dY-1 do                            ]
[   for j:=0 to dX-1 do                          ]
[     TFM[i*dX+j] := (i div M)*dX + (j div M);             ]
[ This magnifies the upper left corner by a factor of M           ]

[ Mind you:                                 ]
[ if you do the copying directly on the screen, you'll get some flickering. ]
[ One way to avoid that is using a virtual screen.             ]
[ That means you use an array, say VirtScr, wich represents the real screen. ]
[ You then perform all action where the screen is involed (loading the image,]
[ getting ORG and writing DEST) on the VirtScr, and than copy that VirtScr ]
[ on the real screen. However, that has 2 disadvantages:          ]
[ 1. You'll use more memory (for the VirtScr)                ]
[ 2. The result will be slower (because you have to copy the VirtScr to the ]
[  real screen)                              ]


How to make the lens transformation
-----------------------------------

Okay. So now the question is how to make the transformation array for the lens.
Consider a sphere S, intersecting with a plane à. This defines a circle C in
the plane. Define Rc as the ray of the circle C, Rs as the ray of the sphere S,
and d as the distance from the centre of the sphere to the plane à.
We know then that:
              Rcı + dı = Rsı     (1)

If you want several lenses with the same radius, but different lens-strength,
then you must preserve the same value for Rc. If the size of the transformed
area is L by L pixels (the lens is circular, so the involved area is a square)
then Rc should be «L. The distance d determines the strength of the lens.
So, knowing Rc and d, we can determine Rs.

Suppose we're given L (so Rc = «L), we made a choice for d, and we calculated
the value of Rs. We now want to transform each pixel in the square (LxL).
We simply check all pixels [2 loops: one for the X-axis and one for the Y-axis]
We call the point we're transforming p. If p lies outside or on C, then the
point isn't transformed. That is: TFM(p)=p; if (x,y) are the coordinates of
p than TFM[x+y*L] := x+y*L.

If p lies within the C, then the point will be transformed:
the effect should be as if all points within the circle were projected from
the centre of the sphere onto the sphere. Hence, for a given point p,
we determine the point q (see picture). That point q is the projection of some
point i within the circle C, so from the point q, we draw a line to the centre
of the sphere, thus defining the point i, which is the intersection of that
line whith the plane. That is the transformation of the point p: TFM(p)=i,
because: if the point i was to be projected on the sphere, it would end up at
the point q. Since we're looking straight onto the plane, the points q and p
are the same. (that is: they end up at the same point on your screen).



When implementing, you can use some shortcuts:
Lets say L and d are given. Then Rc=«L;
Consider the origin of a rectangular system in the centre of the circle C.
The X-axis and the Y-axis are parrallel to the plane à, in such a way that
the square that is to be transformed, is defined as:

         [-Rc,Rc] x [-Rc,Rc]

The orientation of the Z-axis is such that the coordinates of the centre of the
sphere are (0,0,-d). The sphere is given by:

        xı + yı + (z+d)ı = Rsı         (2)

hence: [ (1) ]

        xı + yı + (z+d)ı = Rcı + dı       (3)

Consider the point P within the circle C. Thus, its coordinates are:

     (Px,Py,0)  and   Pxı + Pyı < Rcı    (4)


The coordinates of the point Q can be found through this system:

    | x = Px      Â- defines the line, parrallel to the Z-axis
    | y = Py      Ù through the point P.
    | xı + yı + (z+d)ı = Rcı + dı

We immediatly find Qx and Qy (Qx=Px; Qy=Py), and for Qz we find:

    Pxı + Pyı + Qzı + 2*d*Qz + dı = Rcı + dı

    Qzı + 2*d*Qz - Rcı + Pxı + Pyı = 0

    D = dı - (Pxı + Pyı - Rcı)           (5)

    since Rcı > Pxı + Pyı  [ (4) ], we find D>0, and

    Qz = 1 ñ ûD.

We find 2 solutions (the line intersects the sphere twice !), but consider
only the one with Qz>0. We find coordinates for Q:

    (Qx,Qy,Qz) ğ (Px,Py,1+ûD)     (6)

Finally, we find the coordinates of the point I through :
[ (Sx,Sy,Sz) are the coordinates of the centre of the sphere ]
[ (Sx,Sy,Sz) ğ (0,0,-d)                   ]

    |   ( z - Sz)
    | x = --------- * (Qx-Sx) + Sx    ¿
    |   (Qz - Sz)           Ã defines the line through
    |                   ³ the centre of the sphere
    |   ( z - Sz)           ³ and the point Q
    | y = --------- * (Qy-Sy) + Sy    Ù
    |   (Qz - Sz)
    |
    | z = 0               -- defines the plane à

We find:

         ( 0 - (-d) )
     Ix = ------------ * (Qx-0) + 0
         ( Qz - (-d))

         ( 0 - (-d) )
     Iy = ------------ * (Qy-0) + 0
         ( Qz - (-d))

     Iz = 0


hence:        d
     Ix = --------- Qx
         Qz + d

           d
     Iy = --------- Qy
         Qz + d

     Iz = 0


We know the coordinates of Q (they can be fully determined if the coordinates
of P are known), and we know d, so I can be calculated.
We could than say:

  TFM[ («L+Px) + («L+Py) * L ] := («L+Ix) + («L+Iy) * L;

( Remember: Px,Py,Ix and Iy all are î [-Rc,Rc] and Rc ğ «L )

Now, you can see (by just observing the drawing, or by checking the formulas)
that if we find

  TFM[ p( Px, Py) ] = i( Ix, Iy)

then also

  TFM[ p( Px,-Py) ] = i( Ix,-Iy)
  TFM[ p(-Px, Py) ] = i(-Ix, Iy)
  TFM[ p(-Px,-Py) ] = i(-Ix,-Iy)

so that the entire transformation can be defined be calculating ¬ of the
transformed area.


Joey/SD

1445
demoscene / ölmek Ve Doğmak
« : 31.03.2004 06:28:26 »
hi3s ... hmm anlamı ne ola ki acep? merak ettim.
güzel bir varoluş introsu (çok Sartre gibi oldu bu da) bekliyoruz artık... :)

forumda kullanımınıza yönelik bir bölüm açmamı isterseniz seve seve. tabii kullanacaksanız.

pdf dergiyi de hi3s mi çıkaracak yoksa o hala senin ürünün mü? pdf yerine sade bir 64 kodu ile reader yapsaydın çok şık olurdu aslında... :) ama yine de eline sağlık; sürekliliğini dilerim. bu arada basit bir tool ile doc halinde hazırladığın dergiyi pdf'e direk çeviren programlar mevcut pc'de, haberin yoksa.  B)

1446
coding / Mod Dosyalari
« : 30.03.2004 15:30:18 »
ekstra bir dll kullanmadan direct-x üzerinden bunu yaparsan direk veririm sana hocam...   :P

1447
coding / Mod Dosyalari
« : 29.03.2004 23:16:02 »
bildiğim kadarıyla hemen hemen tüm gruplar bass.dll library'sini kullanıyor. bir bak derim ona; sağlam desteği de var zaten.

1448
demoscene / ölmek Ve Doğmak
« : 26.03.2004 22:52:38 »
tr-scene'e hayırlı olmasını ve nurtopu gibi release'ler olmasını dilerim; en içten dileklerimle.
partiye de bekleriz grubunuzu; forumda bölüm isterseniz de grup isminizi söylediğinizde açarım. :)

1449
demoscene / independent grubu partiye gelmiyor
« : 26.03.2004 03:32:17 »
1- kimse benden INDEPENDENT için bölüm açmamı istemedi. forumda koyulan kurallar uyulmak içindir genelde. :) isteyin, açalım -ve kullanın-.

2- ortalıkta bir velvele koptu anlaşılan. bunun içinde yanlış anlamalar ve anlatmalar olduğu bariz. herkes bu yanlışlıklara girdi; ben de. benim yanlış anlamam, bold ve büyük harfle yazılan partiye katılmayacağız mesajını grupsal bir tavır olarak görmemde ve bunun üzerine sonuçlar çıkarmış olmamda. evet, yazdığınızı dikkate almayıp (!) kendi işimize bakmak ve laf kalabalığına girişmemek daha doğru olurdu. ama önemsedik; niye yaptığımız bir partiye -tr.scene için düşünülmüş bir partiye- bir grup komple katılmama kararı alıyor diye. üzüldük/bozulduk, yanlış birşey mi yaptık da gelmiyorlar diye. gelmeyenler olmasın diye daha önce de zaten bronx ismini çıkarmıştık partiden, şimdi de partiyi mi çıkarmamız gerekiyor partiden? :P

3- kişisel meselelere girmemeye çalıştım, bireylerin yaptıkları değil, ekip olarak söylenenlere önem verdim. ama şimdi bireysel konuşacağım. ASLA bir satır kod bile çalmadım ve çalmayacağım. bazılarınıza lame gelinebilecek (MMTurk ve zoque) yerlerde de bunu savunuyorum ki, birileri daha etik bakış açısı kazansın diye. hep karşısında oldum 2-3 rutin almanın. Bronx'da iken benim tavrım birşeyin mantığını, ince triklerini kendin öğrenmeden asla başkasının kodunu import etme olmuştur. niye? hep kendimi, birgün şu partiye gidersem, başka bir coder da gelip şu nasıl oluyor, nasıl yapıyorsun diye sorarsa, nasıl açıklarıma cevap ararken görmüşümdür aklımın ucunda bir kenarda (çok boktan bir cümle kurduğumun farkındayım, but who cares)... zamanında elimde onlarca source olduğu halde neden onlarca demo yazmadım? 3d vektör olayını tahmin ettiğim, azbuçuk anladığım kadarıyla da bişeyler çıkarabilirdim. ama hayır; master etmediğim birşeyi yapmak bana hep 'onursuzca' -lafım meclisten dışarı- gelmiştir. bu benim kendi görüşüm. nokta.

4- kim ne etmiş, kim nereye nasıl girmişlerle uğraşmayacağım. tarihi deşmenin kimseye yararı yok. sadece yapılan hataları görmek ve ilerlemek için olabilir. seni öncesinde tanımam hades (de aegis de). bu yüzden kimseye garizim de yok, önyargım da. hades'in partiye geldiğindeki enerjisi ve coşkusu çok hoşuma gitmişti. "adama bak, evde iki çocuğu olmuşken gelip hala bizle takılabiliyor, respect total" diye düşünmüştüm. ama o coşku sadece oraya ve o ana özgü imiş, üzüldüm. neden o tarihten sonra 2 sene geçtiği halde tek bir release bile göremedik senden? bu kadar mı zor? hayır! sen daha iyilerini yapabilecek birisin. sadece hepimiz gibi tembellik ve bahane bulma hastalığına kapılmışsın. yapma, etme... üretelim; fark etmez ayrı gruplarda olmak ya da aynı grupta olmak. ortaya ürün çıksın yeter.

5- yazılan hiçbir düşünce ASLA forumu işgal etmek değildir. aksine, forumu bunun için açtım. ayrıca bu forum, neden bronx sitesinden farklı bir adreste? hatta ismi de niye tr-scener? hepimizi ilgilendirdiğini düşünüyorum. commodoreturk'ü geçen gün skate'in verdiği linke kadar bilmiyordum bile. niye? niye duyurulmadı? neden bana ulaşmadı (ben yetkili merci değilim bu soruda, sadece bir commodore fan'iyim).

6- ayrı bir grup kurmanız? olabilir. hatta güzel de olur. farklı sesler iyi olur her zaman. denildiği gibi, tatlı rekabete yol açar. ama bir production olduğu sürece bir grup gruptur... vigo'nun dediği gibi az laf, çok iş... ama en azından bi iş.

7- bir bronx member'ı olarak hala gelmenizi isterim; burada yazılanları negatif değil, pozitif olarak algılamanız umuduyla. hepimiz yüzyüze gelirsek, eminim nette oluşan iletişimsizlik sendromu olmayacak ve eğlenerek keyifle takılacağız. ama küsmek ve gelmemek de sizin tercihiniz olur bu noktadan sonra. kimseye özel davetiye çıkaracak değiliz, gereği de yok. kapımız hep açıktı, hep de açık kalacak. kendini bizden hisseden herkesi aramızda görmekten keyif alırız. her 2 partide de after-words'de hep söylediğim yeni scener nasıl kazandırırız bu ortama idi. hala da aynen düşünüyorum. bu forumu sahiplenmediğiniz sürece (aegis, lafım sana; hala guest gözüküyorsun) bir birlik, yani tr-scene var olamaz ki. bu forumu açma sebebim de zaten bu. bronx member'ı olsam da orada bazı konuları konuşmak hoşuma gitmiyordu. bronx member'ı olsam da tr-scene memberı olarak sorumluluklarım da var; ortak konuları bağımsız bir alanda tartışmak gibi. genele yöenlik mesajları ve duyuruları yine genelin görebileceği bir alanda lanse etmek gibi. bölücülük derken bunları kastetmiştim; belki bilinçli bir bölücülük değil yapılan, ama sonuçta yine bölünüyor community. bence community bir olmalı. tr-scene olmazsak, sadece birer nostalji özlemli grup olarak kalırız. ama bence tr-scene var olmalı, bu kadar ses, bu kadar üreten (??) varken. yine de iyiye gittiğimize eminim.

1450
demoscene / independent grubu partiye gelmiyor
« : 25.03.2004 02:32:19 »
1. kapışmayın bakeem!

2. music disk, adı üstünde music disk. ne gerekir. simple bir player, belki biraz süs, ve güzel müzikler. illa deli bir kodla çkmak gerekmez. yani yapılan bence 'yeterli' bir musicdisk. daha iyi olabilir miydi? evet, her zaman daha iyisi vardır. ama o release'de etkin olanların zamansal sıkışıklığı (di mi lan! sıkışıktınız çok dii mi? konuşun az yaw, 25 web sites, 10 oyun yapmanız gerekiyordu di mi?) olduğunu düşünürsek, iki arada bir derede bir release yapmaları ve müzikleri bir araya derlemeleri güzel olmuş.

3. açıkçası ben de Independent'ı bağımsız olarak algılamıştım. ne bu forumda ne de başka bir yerde grup ismi olarak okumadım. hal böyle olunca netekim, birçok kişi de öyle sanacak, sanıyor da. bir yerde duyursanız, bir release yapıp bizim grubun ismi budur deseniz, anlardık. ama aptalız (ya da -ım) naapalım...

4. vigo'nun (ve belki de birkaç bronx member'ının daha) kızmasına sebep olan olay eleştiri değil, başka bir forumda 7d4 partisini kaale almayan tavrınızdı sanırsam. 3 senedir birşeyler oluşturmaya çalışılıyor burada. trip atmanın, birbirimizi ağağılamanın kimseye birşey getiremeyeceği aşikar. açıkçası ben geçen sene 7d3'de yapmış olduğun çalışma -her ne kadar scene'i ilgilendiren bir olay olmasa da- sırf saygıdan, yapılmış koda üretime respect açısından puan verdim. acaba hangisi daha scene release'i? bir satranç denklemi çözen program mı, yoksa bir musicdisk mi? kaldı ki tr-scene oluşturulmaya çalışılırken aegis ile yapmış olduğunuz 'bölücülük' bence çok çirkin. daha iyisini mi biliyorsunuz? hodri meydan! buyrun yapın; biz de katılalım. bronx'un bu partiyi organize etmesindeki yegane sebep; herkesten önce var olmamız yüzünden herkesi tanımamız idi. bir organizasyon, insanlarla iletişim kurarak gerçekleştirilebilir. hades ya da aegis'e açık çağrım: kendiniz lütfen bir scene partisi organize edin, herşeyiyle ilgilenin ve üzerine bir de release yapmaya da kasın. bunu yapamıyorsanız ister bizim organize ettiğimiz ve HERKESİN olan bu partiye katılın, isterseniz de köşenizde oturup millete çamur atın.
turbo'dan sonra bu scene'de EN ESKİ kişiyim. insanlar daha demo nedir bilmezken ben erman elektronik'ten aldığım stuff'ları başka yerlere dağıtır ve birşeyler oluştururdum. keza asoft'ta az takılıp coder'lığı falan gördük vs vs... bunca zaman içerisinde böyle bir partinin istikrarı bence çok güzel; çok daha önce yapılmalıydı aslında ya... ama yine de birşeyler yapılmaya çalışılıyor. bunu yabana atmayalım, saçma karalama hareketlerinde de bulunmayalım lütfen. nasreddin hoca gibi partisiz de kalırız ortada.

yapılan birşeyleri takdir etmek bu kadar mı zor? eleştirebilir herkes, ama aşağılamak vigo'nun belki düşündüğü gibi 'kaypaklık'tır... hem gel önceki partiye, release'lerini göster, insanlardan takdir bekle, hem de ertesi sene "katılmayacağız" yazısı (bold yazmak netiquette'de bağırmak, karşı çıkmak anlamındadır) yazmak... bence dönekliğin ta kendisi. release yapmamak için bahane bulmak kolay... esas yiğitlik bunca işe rağmen oturup release yapmaktır. scener'lık budur işte!

söylediklerimin hiçbiri kişsel değildir; hepsi Independent isimli grubun genel stratejisine yöneliktir. kavga ederek, aşağılayarak ya da yokmuş gibi davranarak scener olunmaz. parayla da; bunun göstergelerinden biri de güçlü özduman idi. scener'lık bir tavırdır, bir yaşam biçimidir bence.

başarılar dilerim.

not: kimseyi zorlamak gibi bir niyetimiz olmadı; isteyen katılır, isteyen katılmaz. ama kıyıda köşede, varlığını bile duymadığımız bir yerde bunu yazmak yerine (internet trilyonlarca sayfadan oluşuyor ve hangisinde ne yazıldığını takip edemeyiz) gelip buradan bize söyleseydiniz, bize doğrudan iletseydiniz daha 'delikanlı'ca olurdu. edilen ayıp budur.

not2: burada yazdıklarım kişisel görüşlerimdir. ne bronx memba sularını bağlar, ne de grubu. ama katılanlar olabilir tabii...  B)

1451
flash actionscript / Flash+php Ile Chat Server Olayı
« : 25.03.2004 00:04:06 »
php rutin:

Kod: [Seç]
#!/usr/local/bin/php -q

<?php 

set_time_limit 
(0); 
ob_implicit_flush (); 

define ('SOCKET_READ'1024); 
define ('LISTEN_QUEUE'10); 
define ('PORT'9999); 
define ('MAX_CLIENTS'30); 
define ('MAX_ROOMS'4); 

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

function room_join ($room

global 
$client$count$room$rooms$room_position
if (!isset (
$rooms)) 
 { 
 for (
$room_build_count 0$room_build_count MAX_ROOMS$room_build_count++) 
  
$rooms [$room_build_count] = array (); 
 } 
$room_size count ($rooms [$room]); 
if (
$room_size 4
 { 
 
array_push ($rooms [$room], $count); 
 
$room_position [$count] = array ($room$room_size); 
 
socket_write ($client [$count], &quot;You have joined room &quot; . $room . &quot;.&quot; . chr (0)); 
 
socket_write ($client [$count], $room . &quot;#&quot; . ($room_size + 1) . chr (0)); 
 

else 
 
socket_write ($client [$count], &quot;Room &quot; . $room . &quotis currently full.&quot; . chr (0)); 


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

function room_exit () 

global 
$client$count$rooms$room_position
array_splice ($rooms [$room_position [$count] [0]], $room_position [$count] [1], 1); 
socket_write ($client [$count], &quot;You have left room &quot; . $room_position [$count] [0] . &quot;.&quot; . chr (0)); 
$room_position [$count] = null


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

function kill_server () 

global 
$listenfd$client
for (
$count 0$count MAX_CLIENTS$count++) 
 { 
 if (
$client [$count] != null
  { 
  
socket_write ($client [$count], &quot;Server disconnected!&quot; . chr (0)); 
  
socket_close ($client [$count]); 
  } 
 } 
socket_close ($listenfd); 
exit; 


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

function close_client ($count

global 
$client$usernames$remote_host$remote_port
if (isset (
$rooms)) 
 
room_exit (); 
for (
$broadcast_count 0$broadcast_count <= MAX_CLIENTS$broadcast_count++) 
 { 
 if (
$broadcast_count == $count
  
socket_write ($client [$count], &quot; <font color=&quot;#CC0000&quot;>You have disconnected.</font>&quot; . chr (0)); 
 
else if ($client [$broadcast_count] != null
  
socket_write ($client [$broadcast_count], &quot; <font color=&quot;#CC0000&quot;>&quot; . $usernames [$count] . &quot; has disconnected.</font>&quot; . chr (0)); 
 

socket_close ($client [$count]); 
$client [$count] = null
unset (
$remote_host [$count]); 
$client_still_connected false
for (
$count 0$count <= MAX_CLIENTS$count++) 
 { 
 if (
$client [$count] != null
  { 
  
$client_still_connected true
  break; 
  } 
 } 
if (
$client_still_connected == false
 
kill_server (); 


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

$listenfd socket_create (AF_INETSOCK_STREAM0); 
if (
$listenfd
 print &
quot;Listening on port &quot; . PORT . &quot;
&
quot;; 
else 
 { 
 
socket_write ($client [$count], &quot;Socket died!&quot; . chr (0)); 
 die (&
quot;Socket died!
&
quot;); 
 } 
socket_setopt ($listenfdSOL_SOCKETSO_REUSEADDR0); 
if (!
socket_bind ($listenfd, &quot;127.0.0.1&quot;, PORT)) 
 { 
 
socket_close ($listenfd); 
 die (&
quot;Could not bind!
&
quot;); 
 } 
socket_listen ($listenfdLISTEN_QUEUE); 
for (
$count 0$count MAX_CLIENTS$count++) 
 
$client [$count] = null
while (
1
 { 
 
$rfds [0] = $listenfd
  { 
  for (
$count 0$count <= MAX_CLIENTS$count++) 
   if (
$client [$count] != null
    
$rfds [$count 1] = $client [$count]; 
  } 
 
$nready socket_select ($rfds$null$nullnull); 
 if (
in_array ($listenfd$rfds)) 
  { 
  for (
$count 0$count <= MAX_CLIENTS$count++) 
   { 
   if (
$client [$count] == null
    { 
    
$client [$count] = socket_accept ($listenfd); 
    
socket_setopt ($client [$count], SOL_SOCKETSO_REUSEADDR0); 
    
socket_getpeername ($client [$count], $remote_host [$count], $remote_port [$count]); 
    if (
$count MAX_CLIENTS
     { 
     break; 
     } 
    } 
   if (
$count >= MAX_CLIENTS
    { 
    
close_client ($count); 
    break; 
    } 
   } 
  if (--
$nready <= 0
   continue; 
  } 
 for (
$count 0$count <= MAX_CLIENTS$count++) 
  { 
  if (
$client [$count] == null
   continue; 
  if (
in_array ($client [$count], $rfds)) 
   { 
   
$incoming_data trim (socket_read ($client [$count], SOCKET_READ)); 
   if (!
$incoming_data
    
close_client ($count); 
   else 
    { 
    if (
substr ($incoming_data01) == &quot;#&quot;) 
     

     
$call_function explode (&quot;#&quot;, $incoming_data); 
     
if ($call_function [1] == &quot;client_number&quot;) 
      
socket_write ($client [$count], $count chr (0)); 
     else if (
$call_function [1] == &quot;username&quot;) 
      { 
      
$usernames [$count] = $call_function [2]; 
      for (
$broadcast_count 0$broadcast_count <= MAX_CLIENTS$broadcast_count++) 
       { 
       if ((
$client [$broadcast_count] != null) && ($broadcast_count != $count)) 
        
socket_write ($client [$broadcast_count], &quot; <font color=&quot;#CC0000&quot;>&quot; . $usernames [$count] . &quot; has connected.</font>&quot; . chr (0)); 
       

      } 
     else if (
$call_function [1] == &quot;room_join&quot;) 
      { 
      
$room $call_function [2]; 
      
room_join ($room); 
      } 
     else if (
$call_function [1] == &quot;room_exit&quot;) 
      
room_exit (); 
     else if (
$call_function [1] == &quot;close_client&quot;) 
      
close_client ($count); 
     else if (
$call_function [1] == &quot;kill_server&quot;) 
      
kill_server (); 
     } 
    else 
     { 
     for (
$broadcast_count 0$broadcast_count <= MAX_CLIENTS$broadcast_count++) 
      { 
      if (
$broadcast_count == $count
       
socket_write ($client [$count], &quot;<font color=&quot;#999999&quot;>You said: &quot; . $incoming_data . chr (0)); 
      
else if ($client [$broadcast_count] != null
       
socket_write ($client [$broadcast_count], $usernames [$count] . &quot;: &quot; . $incoming_data chr (0)); 
      } 
     } 
    } 
   if (--
$nready <= 0
    break; 
   } 
  } 
 } 
?>


flash kısmı için de test_chat.fla dosyasını çekin.

1452
php / Php Socket Server
« : 24.03.2004 23:33:07 »
Flash'da socket server kullananlar için PHP'de simple sockserver; PHP 4.1+ olmalı ve SafeMode kapalı olmalı. Script timeout'u da 0 yaparak script'in 30 saniyede timeout olmamasına dikkat edin. Script bir client'ın yazdığı herşeyi diğer client'lara echo eder; /quit ise server'ı sonlandırır.

Kod: [Seç]
#!/usr/local/bin/php -q
<?php
//setting this to 0 lets scriphang around for ever
set_time_limit(0);



// defaults...

define('MAXLINE'1024); // how much to read from a socket at a time
define('LISTENQ'5); // listening queue
define('PORT'10000); // the default port to run on
define('FD_SETSIZE'2); // file descriptor set size (max number of concurrent clients)...


// for kill the server

function killDaemon()
{
global 
$listenfd$client;
$msg = &quot;Daemon going down!
&
quot;;
for (
$i 0$i FD_SETSIZE$i++)
{
if (
$client[$i] != null)
{
socket_write($client[$i], $msgstrlen($msg));
socket_close($client[$i]);
}


}
print &
quot;Shutting down the daemon
&quot;;
socket_close($listenfd);
exit;
}


// whenever a client disconnects...

function closeClient($i)
{
global 
$client$remote_host$remote_port;

print &
quot;closing client[$i] ({$remote_host[$i]}:{$remote_port[$i]})
&
quot;;

socket_close($client[$i]);
$client[$i] = null;
unset(
$remote_host[$i]);


//check to see if anyone is still attached, this will shutdown the 
//remove down from here if you want to remove this option
serverremove if unwanted
$someoneconnected 
false;
for (
$i 0$i <= FD_SETSIZE$i++){
if(
$client[$i] != null){
$someoneconnected true;
break;
}
}

if(
$someoneconnected == false){
killDaemon();
}
//stop removing here, for the auto shutdown feature

}


// set up the file descriptors and sockets...

// $listenfd only listens for a connection, it doesn't handle anything
// but initial connections, after which the $client array takes over...

$listenfd socket_create(AF_INETSOCK_STREAM0);
if (
$listenfd)
print &
quot;Listening on port &quot; . PORT . &quot;
&
quot;;
else
die(&
quot;AIEE -- socket died!
&
quot;);

//set servers ip here, leave if using a local host
//socket_setopt($listenfd, SOL_SOCKET, SO_REUSEADDR, 1); - old

socket_setopt($listenfdSOL_SOCKETSO_REUSEADDR0); 
if (!
socket_bind($listenfd, &quot;0.0.0.0&quot;, PORT))
{
socket_close($listenfd);
die(&
quot;AIEE -- Couldn't bind!
&quot;);
}
socket_listen($listenfd, LISTENQ);


// set up our clients. After listenfd receives a connection,
// the connection is handed off to a $client[]. $maxi is the
// set to the highest client being used, which is somewhat
// unnecessary, but it saves us from checking each and every client
// if only, say, the first two are being used.


//for ($i = 0; $i < FD_SETSIZE; $i++) - old

//$client[$i] = null;

//allow spaces for extra users, that will be automatically closed
for ($i = 0; $i < LISTENQ; $i++)
$client[$i] = null;



// the main loop.

while(1)
{
$rfds[0] = $listenfd;

//for ($i = 0; $i < FD_SETSIZE; $i++) - old
{
for ($i = 0; $i <= FD_SETSIZE; $i++)
if ($client[$i] != null)
$rfds[$i + 1] = $client[$i];
}


// block indefinitely until we receive a connection...

$nready = socket_select($rfds, $null, $null, null);


// if we have a new connection, stick it in the $client array,

if (in_array($listenfd, $rfds))
{
print &quot;listenfd heard something, setting up new client
&quot;;

//for ($i = 0; $i < FD_SETSIZE; $i++) - old
for ($i = 0; $i <= FD_SETSIZE; $i++) //pick up the new spot
{
if ($client[$i] == null)
{
$client[$i] = socket_accept($listenfd);
//socket_setopt($client[$i], SOL_SOCKET, SO_REUSEADDR, 1); - old

socket_setopt($client[$i], SOL_SOCKET, SO_REUSEADDR, 0);
socket_getpeername($client[$i], $remote_host[$i], $remote_port[$i]);
print &quot;Accepted {$remote_host[$i]}:{$remote_port[$i]} as client[$i]
&quot;;

// continue the server if connection allowed else allow next step
if ($i < FD_SETSIZE)
{
break;
}

}

if ($i >= FD_SETSIZE)
{
//trigger_error(&quot;too many clients&quot;, E_USER_ERROR);
//exit;
//or close the new socket, 
closeClient($i);
break;// continue the server
}

}

if (--$nready <= 0)
continue;
}


// check the clients for incoming data.

for ($i = 0; $i <= FD_SETSIZE; $i++)
{
if ($client[$i] == null)
continue;

if (in_array($client[$i], $rfds))
{
$n = trim(socket_read($client[$i], MAXLINE));

if (!$n)
closeClient($i);
else
{
// if a client has sent some data, do one of these:

if ($n == &quot;/killme&quot;)
killDaemon();
else if ($n == &quot;/quit&quot;)
closeClient($i);
else
{
// print something on the server, then echo the incoming
// data to all of the clients in the $client array.
//$n is incoming data

print &quot;From {$remote_host[$i]}:{$remote_port[$i]},>client[$i]: $n
&quot;;
for ($j = 0; $j <= FD_SETSIZE; $j++)
{
if ($client[$j] != null)
socket_write($client[$j], &quot;From client[$i]: $n&quot;.chr(0));
//the chr(0) send the nul character required by flash
}
}
}

if (--$nready <= 0)
break;
}
}
}

?>


bu da Flash'dan sockservera teorik bağlantı yapısı:
xml.fla adresinde de çalışan bir örnek bulunuyor.  B)

Kod: [Seç]
on (release) {
_root.mysocket = new XMLSocket();


_root.mysocket.connect(_root.ip, _root.port);
//makes connections

_root.mysocket.onConnect = function(success) {
//on a result
if (success) {- if succedded
_root.status = "Connected";
} else {
_root.status = "Failed";
}
};

_root.mysocket.onClose = function(success) {
//when the connection is closed or lost
_root.status = "Closed";
};


_root.mysocket.onXML = xmlhandler;
//when data is received run this function
function xmlhandler(doc) {
_root.status = "data Recieved";
loadedvars = String(doc);
_root.datain+=loadedvars+" ";

}
}

1453
flash actionscript / Flash<->php Data Takası
« : 24.03.2004 20:29:20 »
Flash'te ilk frame'e şu kod geliyor:

Kod: [Seç]
loader = new LoadVars();
loader.onLoad = function(success) {
        if(success){
                trace(&quot;loaded results&quot;);
                trace(loader.msg);
        }
};
sender = new LoadVars();
sender.page = &quot;3&quot;;
sender.sendAndLoad(&quot;http://127.0.0.1/decoded/pinpon.php&quot;,loader,POST);

PHP'de de karşılayacak kod (swf ile aynı domain altına pinpon.php ismiyle kaydedilmeli):
Kod: [Seç]
header('Expires: Jan 01, 2001 00:00 GMT');
header("Cache-control: no-cache");
header("Pragma: no-cache");
$page=$_POST["page"];
if($page=="3")echo("msg=got it...");
?>

tabii domain uygun girilmeli. swf'nin bulunduğu domain'de durmalı php de...

crossdomain için serverdaki php/asp kod gidip diğer domain'den bilgiyi çekebilir. ya da loadvars yerine loadxml fonkisyonu kullanılarak crossdomain xml dosyasında da aşağıdaki ek ile bu gerçekleştirilebilir:
Kod: [Seç]



 
 
 

1454
pazar yeri / Mini Bi Tool
« : 23.03.2004 21:44:11 »
walla skate'ciğim manüel çözüme kasmışsın da kasmışsın be kardeş. amaç o dediklerini otomatik yapmak bi nevi; elle yapacaksam niye tool önereyim ki, di mi? işleri otomatikleştirmek varken yani...

benim ilk örnekte dir seçimi de vardı; haliyle sadece seçilen dir'ler içinde include listesinde yer alan dosya tipleri sadece history'lenecek, gerisi kaale alınmayacak zaten. sen de bi zahmet .psd dosyalarını eklemeyiver bu listeye. ağırlıkla imaj için kullanılacaksa o başka tabii. :) o zaman filesize kontrolü gerekebilir. ya da büyük dosyalarla çalışırken taskbardan toolun fonksiyonlarını kullanmama işaretlenir.

ama blurise ile konuşmamdan şu plugin olayı çok hoşuma gitti. zip veya CVS bu şekilde seçilerek projenin direk CVS server'a post edilmesi de gayet zekice olur. hatta tool'un en güzel yanlarından biri bu olur bence. CVS'in tatsız yanı herşeyi elle, komutla falan yapılması ve lokal çalışma sırasında rahat edilememesi. yani CVS kullanmak, skate'in yaptığı gibi her gün folder yedeklemek gibi (tabii multiuser environment konusuna girmezsek). Ama proje çalışması sırasında CVS'i kullanmak, hatta lokal network ya da lokal makinada CVS server kurarak bu tool'la birlikte kurmak enteresan bir workgroup yapısı oluşturabilir sanki...

1455
pazar yeri / Mini Bi Tool
« : 23.03.2004 18:04:45 »
blurise nikli bi arkadaşın dediğine göre:
win32SDK'da FindFirstChangeNotification diye bi fonkisyon varmış. bunun sayesinde dir'de bir değişiklik olunca bazı rutinler trig ediliyormuş zaten.

Alıntı
blurise: .Net ile 30 Dk içinde bait bir şey yapılabilir.
 blurise: bir ara şöyle bir şey yapmıştım..
 SpAzTiCa: peki tüm save'lere hook edebilir mi?
 blurise: eder tabi ki.
 blurise: yani şöyleki..
 SpAzTiCa: o zmn prefs de okuyup dir'lere göre işlem ve include exclude file type da yapılabilir?
 blurise: sistem dizin yada dosyada bir değişiklik oldu mu event atat.

Alıntı
blurise: zip olma işini plugin olarak yaparız..
blurise: plugin architecture olursa geliştirilebilir filan.
 SpAzTiCa: evet... o zmn CVS'e adapte etmek de plugin üzerinden olur ilerde.
 blurise: doğru ve mantıklı..

Alıntı
SpAzTiCa: aynı dir'de de durmasına gerek yok aslında history file'ların... tüm history file'lar date/timestamp ile isimlendirilip zip'e de atılabilir.. daha da kolaylaşır iş sanki..

Alıntı
blurise: dedim ya..
dosya yada dizin değişince işletim sistemi bi event atıyor ortalığa..
 blurise: onu yakalayacaz bir.
 blurise: yani dosya save edildikten hemen sonra dosyayı kopyalayacaz.
 blurise: o kadar

Alıntı
blurise: sen notepad de bi dosya kaydettin..
blurise: explorer dizinde hemen gösteriyor dosyayı..
blurise: yani refresh etmiyorsun..
blurise: o event yardımıyla.

probleme farklı bir açıdan yaklaşmak daha olası geldi...

Sayfa: 1 ... 95 96 [97] 98 99