This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenubigSave=DynamicSprite.CreateFromFile(String.Format("$SAVEGAMEDIR$/saveHD%d.bmp",getSlot));
function TakeScreenShot()
{
int getGraphic=FakeScreenUpdate();
DynamicSprite*screenshot=DynamicSprite.CreateFromExistingSprite(getGraphic,false);
int setSlot=5;
screenshot.SaveToFile(String.Format("$SAVEGAMEDIR$/%d.bmp",setSlot));
}
//this will draw a replica of the screen and save it
Overlay*screenlay;
function repeatedly_execute_always()
{
int getgraph = FakeScreenUpdate();
DrawBoxBlur(getgraph, 3);
screenlay=Overlay.CreateGraphical(0, 0, getgraph, true);
}
//this will box blur with 3 iterations your entire screen every frame.
Controller*gamepad;
function game_start()
{
gamepad = Controller.Open(0);
}
if (gamepad.GetAxis(0) < -200)
{
//LEFT
}
else if (gamepad.GetAxis(0) > 200)
{
//RIGHT
}
if (gamepad.GetPOV() == ePOVUp)
{
cEgo.y--;
}
int i=0;
String app="";
while (i < gamepad.ButtonCount+2)
{
app = app.Append(String.Format("button %d is %d[",i, gamepad.IsButtonDown(i)));
i++;
}
cEgo.SayBackground(app);
//this will parse all the buttons' states and print them on the screen.
if (gamepad.IsButtonDownOnce(11))
{
//click on UI
}
if (gamepad.IsButtonDownOnce(11))
{
gamepad.Rumble(65535, 65535, 40);
}
lblstatus.Text=String.Format("BATTERY STATUS: %d",gamepad.BatteryStatus());
while (gamepad.PressAnyKey()==-1)
{
Wait(1);
}
player.Say("Button pressed is button %d",gamepad.PressAnyKey());
const char*GameDatavalue[40000];
void SaveVariable(const char*value,int id)
{
GameDatavalue[id]=value;
}
const char* ReadVariable(int id)
{
if (GameDatavalue[id]==NULL)
{
return engine->CreateScriptString("");
}
else
{
return engine->CreateScriptString(GameDatavalue[id]);
}
}
File*output = File.Open("$SAVEGAMEDIR$/den.dat",eFileWrite);
int i=25100;
while (i < 30000)
{
if (ReadVariable(i)==null) output.WriteString("");
else
{
Display("Writing %s",ReadVariable(i));
output.WriteString(ReadVariable(i));//WriteRawLine(i);
}
i++;
}
output.Close();
File*output = File.Open("$SAVEGAMEDIR$/den.dat",eFileRead);
int i=25100;
if (output!= null)
{
while (i<30000)
{
Display(output.ReadStringBack());
SaveVariable(output.ReadStringBack(), i);
i++;
}
output.Close();
}
int store_mx=-1;
int store_my=-1;
bool StarfishAnimation=false;
bool StarfisherPrice=false;
int cPrompt=0;
String PromptOrder;
AudioClip*Hold;
struct Hint
{
bool Given;
int wasgiven;
bool Active;
};
Hint Hints[39];
void AGS_EngineInitGfx(const char *driverID, void *data)
{
}
D3DPRESENT_PARAMETERS dsp;
IDirect3DDevice9*d3ddev9;
IDirect3DSurface9*_surface;
void DirectDraw(int data)
{
//run a check to disable it from DIRECTDRAW
//= (IDirect3DDevice9 *)data;
d3ddev9=NULL;
d3ddev9 = (IDirect3DDevice9 *)data;
d3ddev9->GetRenderTarget(0, &_surface);
d3ddev9->BeginScene();
D3DLOCKED_RECT lockedRect;
_surface->LockRect(&lockedRect, 0, 0); // no lock flags specified
int width = 640;
int height = 360;
int totalA;
int totalR;
int totalG;
int totalB;
DWORD* imageData = (DWORD*)lockedRect.pBits;
for(int y = 0; y < height; y++)
{
for(int x = 0; x < width; x++)
{
// index into texture, note we use the pitch and divide
// by four since the pitch is given in bytes and there
// are 4 bytes per DWORD.
int b=-1;
while (b <2)
{
int a=-1;
while (a < 2)
{
int setY=y + b;
int setX=x + a;
if (setX <0) setX=0;
if (setY <0) setY=0;
if (setX > width) setX=width;
if (setY > height) setY=height;
int index = setY * lockedRect.Pitch / 4 + setX;
DWORD dwColor=imageData[index];
int b = dwColor % 256; dwColor /= 256;
int g = dwColor % 256; dwColor /= 256;
int r = dwColor % 256; dwColor /= 256;
//int alpha = dwColor % 256;
if (r<0)r=0;
if (g<0)g=0;
if (b<0)b=0;
if (r>255)r=255;
if (g>255)g=255;
if (b>255)b=255;
totalR+=r;
totalG+=g;
totalB+=b;
a++;
}
b++;
}
int index = y * lockedRect.Pitch / 4 + x;
totalR=totalR/9;
totalG=totalG/9;
totalB=totalB/9;
if (totalR<0)totalR=0;
if (totalG<0)totalG=0;
if (totalB<0)totalB=0;
if (totalR>255)totalR=255;
if (totalG>255)totalG=255;
if (totalB>255)totalB=255;
int value=((256 + totalR) * 256 + totalG) * 256 + totalB;
imageData[index] = value;//(totalA << 24) | (totalR << 16) | (totalG << 8) | totalB;
}
}
_surface->UnlockRect();
d3ddev9->EndScene();
d3ddev9->Present(NULL, NULL, NULL, NULL); //Swaps the back and front buffers. Displays all drawing on the screen..
d3ddev9->Release();
d3ddev9->Reset(&dsp);
_surface=NULL;
}
int AGS_EngineOnEvent(int event, int data)
{
if (event == AGSE_PREGUIDRAW)
{
Update();
DirectDraw(data);
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.188 seconds with 15 queries.