public Vector4f[] getConstantsForSpecialEffect(EngineFX specialEffect) { if (specialEffect.darkColor != null) { darkColor = specialEffect.darkColor; brightColor = specialEffect.brightColor; } Vector3f coeff = ClientEngineZildo.ortho.getAmbientColor(); coeffedDark.setAndScale3(darkColor, coeff); coeffedBright.setAndScale3(brightColor, coeff); Vector4f[] tab = {coeffedBright, coeffedDark, colorReplace1, colorReplace2}; return tab; }
// Put a pixel on the screen at desired location, with mask consideration // If the fourth parameter is not zero-valued, this is the RGBA color // without // palettized mode. (useful for blue/green guard) // NOTE: this method alterates the position in pBackBuffer public void pset(int xx, int yy, int colorIndex, Vector4f colorValue) { // Check that pixel coordinates is inside screen if (xx >= 0 && xx <= width && yy >= 0 && yy <= height) { if (colorValue != null) { colPset.set(colorValue); } else { // if (colorIndex!=255) // Enable mask display with alpha key = 0 colPset.set(palette[colorIndex]); colPset.w = 255.0f; // color.x; //|=(255 << 24); } pset(xx, yy, colPset); } }
// ///////////////////////////////////////////////////////////////////////////////////// // outlineBox // ///////////////////////////////////////////////////////////////////////////////////// // -outline a zone // ///////////////////////////////////////////////////////////////////////////////////// public void outlineBox( int xx, int yy, int wx, int wy, int colorIndex1, int colorIndex2, Vector4f colorValue1, Vector4f colorValue2) { Vector4f col1; Vector4f col2; if (colorValue1 == null) { col1 = palette[colorIndex1]; col2 = palette[colorIndex2]; // + (255 << 24); ==> on met A=255 } else { col1 = colorValue1; // & 0xffffff; ==> on supprime le membre A col2 = colorValue2; } for (int i = 0; i < wy; i++) { if (i > 0 && i < (wy - 1)) { for (int j = 0; j < wx; j++) { if (j > 0 && j < (wx - 1)) { Vector4f colorPixel = getPixel(xx + j, yy + i); if (colorPixel.equals(col1)) { if (!getPixel(xx + j - 1, yy + i).equals(col1)) { pset(xx + j - 1, yy + i, col2); } if (!getPixel(xx + j + 1, yy + i).equals(col1)) { pset(xx + j + 1, yy + i, col2); } if (!getPixel(xx + j, yy + i - 1).equals(col1)) { pset(xx + j, yy + i - 1, col2); } if (!getPixel(xx + j, yy + i + 1).equals(col1)) { pset(xx + j, yy + i + 1, col2); } } } } } } }