Is it possible to check if some dialog options are being displayed whilst in a dialog?
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 Menu
function DoEyes(){
ViewFrame *vf = player.GetViewFrame();
if (Prevf != null && (Prevf.View != vf.View || Prevf.Loop != vf.Loop || Prevf.Frame != vf.Frame)) Prevf.Graphic = PrevSprite;
PrevSprite = vf.Graphic;
Prevf = vf;
PlayerSprite = DynamicSprite.CreateFromExistingSprite(vf.Graphic, true);
DrawingSurface *ds = PlayerSprite.GetDrawingSurface();
int x, y;
while (y < PlayerSprite.Width){
while (x < PlayerSprite.Height){
int colour = ds.GetPixel(x, y);
if (colour == 59360){
ds.DrawingColor = EyeColor;
ds.DrawPixel(x, y);
}
x++;
}
x = 0;
y ++;
}
ds.Release();
vf.Graphic = PlayerSprite.Graphic;
}
int AGS_EngineOnEvent (int event, int data) {
if (event == AGSE_PREGUIDRAW) {
IDirect3DDevice9 *dev = (IDirect3DDevice9 *)data;
HRESULT hRes;
IDirect3DPixelShader9* lpPixelShader = NULL;
LPD3DXBUFFER pCode = NULL;
LPD3DXBUFFER pErrorMsgs = NULL;
hRes = D3DXAssembleShaderFromFile(L"simple_texture_map.ps",
NULL,
NULL,
0,
&pCode,
&pErrorMsgs);
hRes = dev->CreatePixelShader((DWORD*)pCode->GetBufferPointer(),
&lpPixelShader); //the problem line
hRes = dev->SetPixelShader(lpPixelShader);
}
return 0;
}
int xytolocale(int x, int y, int width){
return (y * width + x);
}
int BlurHorizontal (int Sprite, int radius) {
BITMAP* src = engine->GetSpriteGraphic(Sprite);
long srcWidth, srcHeight;
engine->GetBitmapDimensions(src, &srcWidth, &srcHeight, NULL);
unsigned char **srccharbuffer = engine->GetRawBitmapSurface (src);
unsigned long **srclongbuffer = (unsigned long**)srccharbuffer;
int negrad = -1 * radius;
//use a 1Dimensional array since the array is on the free store, not the stack
Pixel32 * Pixels = new Pixel32[(srcWidth + (radius * 2)) * (srcHeight + (radius * 2))]; // this defines a copy of the individual channels in class form.
Pixel32 * Dest = new Pixel32[(srcWidth + (radius * 2)) * (srcHeight + (radius * 2))]; // this is the destination sprite. both have a border all the way round equal to the radius for the blurring.
int arraywidth = srcWidth + (radius * 2); //define the array width since its used many times in the algorithm
for (int y = 0; y<srcHeight; y++){ //copy the sprite to the Pixels class array
for (int x = 0; x<srcWidth; x++){
int locale = xytolocale(x + radius, y + radius, arraywidth);
Pixels[locale].red = getb32(srclongbuffer[x][y]);
Pixels[locale].green = getg32(srclongbuffer[x][y]);
Pixels[locale].blue = getr32(srclongbuffer[x][y]);
Pixels[locale].alpha = geta32(srclongbuffer[x][y]);
}
}
// start of the blurring
int numofpixels = (radius * 2 + 1) * (radius * 2 + 1);
for (int y = 0; y < srcHeight; y++) {
for (int x = 0; x < srcWidth; x++) {
int totalr = 0;
int totalg = 0;
int totalb = 0;
int totala = 0;
for (int ky = negrad; ky <= radius; ky++){
for (int kx = negrad; kx <= radius; kx++){
int locale = xytolocale(x + kx + radius, y + ky + radius, arraywidth);
totalr += Pixels[locale].red; //add the pixel values for the surrounding pixels to a total
totalg += Pixels[locale].green;
totalb += Pixels[locale].blue;
totala += Pixels[locale].alpha;
}
}
int locale = xytolocale(x + radius, y + radius, arraywidth);
Dest[locale].red = totalr / numofpixels; // take an average and assign it to the destination array
Dest[locale].green = totalg / numofpixels;
Dest[locale].blue = totalb / numofpixels;
Dest[locale].alpha = totala / numofpixels;
}
}
for (int y = 0; y<srcHeight; y++){
for (int x = 0; x<srcWidth; x++){
int locale = xytolocale(x + radius, y + radius, arraywidth);
srclongbuffer[x][y] = makeacol32(Dest[locale].blue, Dest[locale].green, Dest[locale].red, Dest[locale].alpha); //write the destination array to the main buffer
}
}
engine->ReleaseBitmapSurface(src);
}
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c ags_template.cpp -o ags_template.o -I
"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include
/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -DBUILDING_DLL=1
In file included from ags_template.cpp:10:
agsplugin.h:38: error: conflicting declaration 'typedef int HWND'
C:/Dev-Cpp/include/windef.h:292: error: 'HWND' has a previous declaration as `typedef struct HWND__*HWND'
agsplugin.h:38: error: declaration of `typedef int HWND'
C:/Dev-Cpp/include/windef.h:292: error: conflicts with previous declaration `typedef struct HWND__*HWND'
agsplugin.h:38: error: declaration of `typedef int HWND'
C:/Dev-Cpp/include/windef.h:292: error: conflicts with previous declaration `typedef struct HWND__*HWND'
ags_template.cpp: In function `void AGS_EngineStartup(IAGSEngine*)':
ags_template.cpp:97: error: invalid conversion from `int (*)(int, int)' to `void*'
ags_template.cpp:97: error: initializing argument 2 of `virtual void IAGSEngine::RegisterScriptFunction(const char*, void*)'
ags_template.cpp:98: error: invalid conversion from `int (*)(int, int)' to `void*'
ags_template.cpp:98: error: initializing argument 2 of `virtual void IAGSEngine::RegisterScriptFunction(const char*, void*)'
make.exe: *** [ags_template.o] Error 1
Execution terminated
img[src$=".gif"] { image-rendering: -moz-crisp-edges; -ms-interpolation-mode: nearest-neighbor; }
img[src$=".png"] { image-rendering: -moz-crisp-edges; -ms-interpolation-mode: nearest-neighbor; }
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.127 seconds with 15 queries.