--- deliantra/server/utils/cfhq2xa.C 2007/05/28 21:21:42 1.2 +++ deliantra/server/utils/cfhq2xa.C 2010/03/26 00:59:22 1.9 @@ -1,24 +1,24 @@ /* - * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. + * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team - * Copyright (©) 2003,2007 MaxSt + * Copyright (©) 2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2003 MaxSt * - * Crossfire TRT 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. + * Deliantra is free software: you can redistribute it and/or modify it under + * the terms of the Affero GNU General Public License as published by the + * Free Software Foundation, either version 3 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. + * 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. * - * You should have received a copy of the GNU General Public License along - * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the Affero GNU General Public License + * and the GNU General Public License along with this program. If not, see + * . * - * The authors can be reached via e-mail to + * The authors can be reached via e-mail to */ // note: the original code was released under the LGPL version 2.1 @@ -68,7 +68,7 @@ return ((((c1 >> shift) & Cmask) * w1 + ((c2 >> shift) & Cmask) * w2 + ((c3 >> shift) & Cmask) * w3 + w / 2) / w) << shift; } -inline void lerp (unsigned char *pc, pixel c1, int w1, pixel c2, int w2, pixel c3 = 0, int w3 = 0) +static inline void lerp (unsigned char *pc, pixel c1, int w1, pixel c2, int w2, pixel c3 = 0, int w3 = 0) { *(pixel *)pc = lerp (c1, w1, c2, w2, c3, w3, Rshift) | lerp (c1, w1, c2, w2, c3, w3, Gshift) @@ -76,37 +76,37 @@ | lerp (c1, w1, c2, w2, c3, w3, Ashift); } -inline void Interp1 (unsigned char *pc, pixel c1, pixel c2) +static inline void Interp1 (unsigned char *pc, pixel c1, pixel c2) { lerp (pc, c1, 3, c2, 1); } -inline void Interp2 (unsigned char *pc, pixel c1, pixel c2, pixel c3) +static inline void Interp2 (unsigned char *pc, pixel c1, pixel c2, pixel c3) { lerp (pc, c1, 2, c2, 1, c3, 1); } -inline void Interp5 (unsigned char *pc, pixel c1, pixel c2) +static inline void Interp5 (unsigned char *pc, pixel c1, pixel c2) { lerp (pc, c1, 1, c2, 1); } -inline void Interp6 (unsigned char *pc, pixel c1, pixel c2, pixel c3) +static inline void Interp6 (unsigned char *pc, pixel c1, pixel c2, pixel c3) { lerp (pc, c1, 5, c2, 2, c3, 1); } -inline void Interp7 (unsigned char *pc, pixel c1, pixel c2, pixel c3) +static inline void Interp7 (unsigned char *pc, pixel c1, pixel c2, pixel c3) { lerp (pc, c1, 6, c2, 1, c3, 1); } -inline void Interp9 (unsigned char *pc, pixel c1, pixel c2, pixel c3) +static inline void Interp9 (unsigned char *pc, pixel c1, pixel c2, pixel c3) { lerp (pc, c1, 2, c2, 3, c2, 3); } -inline void Interp10 (unsigned char *pc, pixel c1, pixel c2, pixel c3) +static inline void Interp10 (unsigned char *pc, pixel c1, pixel c2, pixel c3) { lerp (pc, c1, 14, c2, 1, c3, 1); } @@ -160,7 +160,7 @@ #define PIXEL11_90 Interp9(pOut+BpL + sizeof (pixel), w[5], w[6], w[8]); #define PIXEL11_100 Interp10(pOut+BpL + sizeof (pixel), w[5], w[6], w[8]); -inline pixel RGBAtoYUVA (pixel w) +static inline pixel RGBAtoYUVA (pixel w) { int r = (w >> Rshift) & Cmask; int g = (w >> Gshift) & Cmask; @@ -177,7 +177,7 @@ | (a << Ashift); } -inline bool Diff (pixel w1, pixel w2) +static inline bool Diff (pixel w1, pixel w2) { pixel YUV1 = RGBAtoYUVA (w1); pixel YUV2 = RGBAtoYUVA (w2); @@ -188,23 +188,20 @@ (abs (((YUV1 >> Ashift) & Cmask) - ((YUV2 >> Ashift) & Cmask)) > trA) ); } -void +static void hq2x_32 (unsigned char *pIn, unsigned char *pOut, int Xres, int Yres, int BpL, bool wrap) { int i, j, k; int prevline, nextline; pixel w[10]; - // +----+----+----+ - // | | | | - // | w1 | w2 | w3 | - // +----+----+----+ - // | | | | - // | w4 | w5 | w6 | - // +----+----+----+ - // | | | | - // | w7 | w8 | w9 | - // +----+----+----+ + // +--+--+--+ + // |w1|w2|w3| + // +--+--+--+ + // |w4|w5|w6| + // +--+--+--+ + // |w7|w8|w9| + // +--+--+--+ for (j = 0; j < Yres; j++) {