CHEWY: More janitorial work around CppCheck

This commit is contained in:
Strangerke 2022-02-20 18:22:25 +01:00 committed by Paul Gilbert
parent 8ba4c1b29c
commit 239f53a104
3 changed files with 129 additions and 166 deletions

View File

@ -76,14 +76,12 @@ void McgaGraphics::set_mono() {
}
void McgaGraphics::calc_mono(byte *palette, int16 startcol, int16 anz) {
int16 i, k;
uint8 r, g, b, grau;
k = startcol * 3;
for (i = 0; i < anz; i++) {
r = palette[k];
g = palette[k + 1];
b = palette[k + 2];
grau = (((float)r) * 0.30) + (((float)g) * 0.59) + (((float)b) * 0.11);
int16 k = startcol * 3;
for (int16 i = 0; i < anz; i++) {
uint8 r = palette[k];
uint8 g = palette[k + 1];
uint8 b = palette[k + 2];
uint8 grau = (((float)r) * 0.30) + (((float)g) * 0.59) + (((float)b) * 0.11);
palette[k] = grau;
palette[k + 1] = grau;
palette[k + 2] = grau;
@ -92,8 +90,7 @@ void McgaGraphics::calc_mono(byte *palette, int16 startcol, int16 anz) {
}
void McgaGraphics::set_palette(byte *palette) {
int16 i;
for (i = 0; i < 768; i++)
for (int16 i = 0; i < 768; i++)
_palTable[i] = palette[i];
if (_mono)
calc_mono(palette, 0, 256);
@ -109,8 +106,7 @@ void McgaGraphics::rest_palette() {
}
void McgaGraphics::raster_col(int16 c, int16 r, int16 g, int16 b) {
int16 index;
index = c * 3;
int16 index = c * 3;
_palTable[index] = r;
_palTable[index + 1] = g;
_palTable[index + 2] = b;
@ -120,20 +116,17 @@ void McgaGraphics::raster_col(int16 c, int16 r, int16 g, int16 b) {
}
void McgaGraphics::einblenden(byte *palette, int16 frames) {
int16 i, j, k;
int16 r, g, b;
int16 r1, g1, b1;
if (_mono)
calc_mono(palette, 0, 256);
for (j = 63; j >= 0; j--) {
k = 0;
for (i = 0; i < 256; i++) {
r = palette[k];
g = palette[k + 1];
b = palette[k + 2];
r1 = r - j;
g1 = g - j;
b1 = b - j;
for (int16 j = 63; j >= 0; j--) {
int16 k = 0;
for (int16 i = 0; i < 256; i++) {
int16 r = palette[k];
int16 g = palette[k + 1];
int16 b = palette[k + 2];
int16 r1 = r - j;
int16 g1 = g - j;
int16 b1 = b - j;
if ((r1 > 0) && (r1 <= r))
_palTable[k] = r1;
if ((g1 > 0) && (r1 <= r))
@ -146,21 +139,17 @@ void McgaGraphics::einblenden(byte *palette, int16 frames) {
}
}
void McgaGraphics::aufhellen(byte *palette, int16 startcol, int16 anz, int16 stufen, int16
frames) {
int16 i = 0, j, k;
int16 r, g, b;
int16 endcol = 0;
void McgaGraphics::aufhellen(byte *palette, int16 startcol, int16 anz, int16 stufen, int16 frames) {
if (_mono)
calc_mono(palette, startcol, anz);
endcol = startcol + anz;
for (j = stufen; j >= 0; j--) {
int16 endcol = startcol + anz;
for (int16 j = stufen; j >= 0; j--) {
endcol = startcol + anz;
k = startcol * 3;
for (i = startcol; i < endcol; i++) {
r = _palTable[k];
g = _palTable[k + 1];
b = _palTable[k + 2];
int16 k = startcol * 3;
for (int16 i = startcol; i < endcol; i++) {
int16 r = _palTable[k];
int16 g = _palTable[k + 1];
int16 b = _palTable[k + 2];
if ((r + 1) <= palette[k]) ++r;
if ((g + 1) <= palette[k + 1]) ++g;
if ((b + 1) <= palette[k + 2]) ++b;
@ -174,14 +163,12 @@ void McgaGraphics::aufhellen(byte *palette, int16 startcol, int16 anz, int16 stu
}
void McgaGraphics::ausblenden(int16 frames) {
int16 i, j, k;
int16 r, g, b;
for (j = 0; j < 64; j++) {
k = 0;
for (i = 0; i < 256; i++) {
r = _palTable[k];
g = _palTable[k + 1];
b = _palTable[k + 2];
for (int16 j = 0; j < 64; j++) {
int16 k = 0;
for (int16 i = 0; i < 256; i++) {
int16 r = _palTable[k];
int16 g = _palTable[k + 1];
int16 b = _palTable[k + 2];
if (r > 0) --r;
if (g > 0) --g;
if (b > 0) --b;
@ -195,16 +182,13 @@ void McgaGraphics::ausblenden(int16 frames) {
}
void McgaGraphics::abblenden(int16 startcol, int16 anz, int16 stufen, int16 frames) {
int16 i, j, k;
int16 r, g, b;
int16 endcol = 0;
endcol = startcol + anz;
for (j = 0; j < stufen; j++) {
k = startcol * 3;
for (i = startcol; i < endcol; i++) {
r = _palTable[k];
g = _palTable[k + 1];
b = _palTable[k + 2];
int16 endcol = startcol + anz;
for (int16 j = 0; j < stufen; j++) {
int16 k = startcol * 3;
for (int16 i = startcol; i < endcol; i++) {
int16 r = _palTable[k];
int16 g = _palTable[k + 1];
int16 b = _palTable[k + 2];
if (r > 0) --r;
if (g > 0) --g;
if (b > 0) --b;
@ -218,11 +202,9 @@ void McgaGraphics::abblenden(int16 startcol, int16 anz, int16 stufen, int16 fram
}
void McgaGraphics::set_teilpalette(const byte *palette, int16 startcol, int16 anz) {
int16 i;
int16 k, endcol;
k = startcol * 3;
endcol = startcol + anz;
for (i = startcol; i < endcol; i++) {
int16 k = startcol * 3;
int16 endcol = startcol + anz;
for (int16 i = startcol; i < endcol; i++) {
_palTable[k] = palette[k];
_palTable[k + 1] = palette[k + 1];
_palTable[k + 2] = palette[k + 2];
@ -242,8 +224,7 @@ void McgaGraphics::punkt(int16 xpos, int16 ypos, int16 farbn) {
}
uint8 McgaGraphics::get_pixel(int16 xpos, int16 ypos) {
uint8 pix;
pix = getpix(xpos, ypos);
uint8 pix = getpix(xpos, ypos);
return pix;
}
@ -260,17 +241,15 @@ void McgaGraphics::box(int16 x1, int16 y1, int16 x2, int16 y2, int16 farbe) {
}
void McgaGraphics::box_fill(int16 x1, int16 y1, int16 x2, int16 y2, int16 farbe) {
int16 h, i;
if (x2 == x1)x2++;
h = abs(y2 - y1);
int16 h = abs(y2 - y1);
if (h == 0)
h = 1;
for (i = 0; i < h; i++)
for (int16 i = 0; i < h; i++)
line_mcga(x1, y1 + i, x2, y1 + i, farbe);
}
void McgaGraphics::pop_box(int16 x, int16 y, int16 x1, int16 y1,
int16 col1, int16 col2, int16 back_col) {
void McgaGraphics::pop_box(int16 x, int16 y, int16 x1, int16 y1, int16 col1, int16 col2, int16 back_col) {
if (back_col < 255)
box_fill(x, y, x1, y1, back_col);
linie(x, y1, x1, y1, col2);
@ -280,13 +259,12 @@ void McgaGraphics::pop_box(int16 x, int16 y, int16 x1, int16 y1,
}
void McgaGraphics::kreis(int16 x, int16 y, int16 r, int16 farbe) {
int16 a = 0, b = 0, alt = 0, diff;
int16 w, i;
for (w = 0; w <= 91; w++) {
int16 a = 0, b = 0, alt = 0;
for (int16 w = 0; w <= 91; w++) {
a = (int16)(_sines[w] * ((float)r * 0.85));
if ((a - alt) > 1) {
diff = a - alt;
for (i = 0; i <= diff; i++) {
int16 diff = a - alt;
for (int16 i = 0; i <= diff; i++) {
setpixel_mcga(x - b, (y - (alt + i)), farbe);
setpixel_mcga(x + b, (y - (alt + i)), farbe);
setpixel_mcga(x - b, (y + (alt + i)), farbe);
@ -304,8 +282,7 @@ void McgaGraphics::kreis(int16 x, int16 y, int16 r, int16 farbe) {
void McgaGraphics::fkreis(int16 x, int16 y, int16 r, int16 farbe) {
int16 a = 0, b = 0, alt = 0, i = 0, diff;
int16 w;
for (w = 0; w <= 90; w++) {
for (int16 w = 0; w <= 90; w++) {
a = (int16)(_sines[w] * ((float)r * 0.85));
if ((a - alt) > 1) {
diff = a - alt;
@ -337,8 +314,7 @@ void McgaGraphics::screen2back(byte *ptr) {
mcga2mem(ptr);
}
void McgaGraphics::sprite_save(byte *sptr, int16 x,
int16 y, int16 breite, int16 hoehe, int16 scrwidth) {
void McgaGraphics::sprite_save(byte *sptr, int16 x, int16 y, int16 breite, int16 hoehe, int16 scrwidth) {
if (breite < 4)
breite = 4;
if (hoehe <= 0)
@ -372,9 +348,8 @@ void McgaGraphics::blockcopy(byte *sptr, int16 x, int16 y, int16 scrwidth) {
}
void McgaGraphics::map_spr2screen(byte *sptr, int16 x, int16 y) {
int16 br, h;
br = ((int16 *)sptr)[0];
h = ((int16 *)sptr)[1];
int16 br = ((int16 *)sptr)[0];
int16 h = ((int16 *)sptr)[1];
if ((br >= 320) || (h >= 200))
map_spr_2screen(sptr, x, y);
}
@ -790,8 +765,7 @@ int16 McgaGraphics::scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_c
}
}
switch (ende) {
case 1:
if (ende == 1) {
switch (mode) {
case 1:
intzahl[0] = atoi(zstring);
@ -805,11 +779,9 @@ int16 McgaGraphics::scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_c
case 4:
intzahl1[0] = atoi(zstring);
break;
default:
break;
}
break;
case 2:
break;
}
if (_svga == ON)
@ -820,14 +792,12 @@ int16 McgaGraphics::scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_c
return ret;
}
void McgaGraphics::plot_scan_cur(int16 x, int16 y, int16 fcol, int16 bcol, int16 scrwidth,
char cursor_z) {
void McgaGraphics::plot_scan_cur(int16 x, int16 y, int16 fcol, int16 bcol, int16 scrwidth, char cursor_z) {
move(x, y);
putz(cursor_z, fcol, bcol, scrwidth);
}
void McgaGraphics::printxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 scrwidth,
const char *string, ...) {
void McgaGraphics::printxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 scrwidth, const char *string, ...) {
int16 i = 0, k = 0, l;
char zstring[35];
int16 diff;
@ -957,19 +927,19 @@ void McgaGraphics::printxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 scr
}
break;
default:
break;
}
}
}
} while ((i < MAXSTRING) && (nextChar != 0));
}
void McgaGraphics::speed_printxy(int16 x, int16 y, int16 fgCol, int16 bgCol,
int16 scrwidth, const char *string) {
int16 i = 0;
void McgaGraphics::speed_printxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 scrwidth, const char *string) {
char zeichen;
_G(gcurx) = x;
_G(gcury) = y;
i = 0;
int16 i = 0;
do {
zeichen = string[i];
++i;
@ -980,20 +950,16 @@ void McgaGraphics::speed_printxy(int16 x, int16 y, int16 fgCol, int16 bgCol,
} while ((i < MAXSTRING) && (zeichen != 0));
}
void McgaGraphics::print(int16 fgCol, int16 bgCol, int16 scrwidth,
const char *string, ...) {
int16 i = 0, k = 0, l;
void McgaGraphics::print(int16 fgCol, int16 bgCol, int16 scrwidth, const char *string, ...) {
int16 k = 0, l;
char zeichen, zstring[35];
char *tempptr;
int16 izahl, count, diff;
uint16 uzahl;
long lzahl;
uint32 luzahl;
int16 diff;
va_list parptr;
va_start(parptr, string);
_crlfx = _G(gcurx);
_crlfy = _G(gcury) + _fontH + 2;
i = 0;
int16 i = 0;
do {
zeichen = string[i];
++i;
@ -1033,7 +999,7 @@ void McgaGraphics::print(int16 fgCol, int16 bgCol, int16 scrwidth,
vors();
} else {
zeichen = string[i];
count = 0;
int16 count = 0;
if ((zeichen >= 0x30) && (zeichen <= 0x39))
count = atoi(string + i);
while ((zeichen >= 0x30) && (zeichen <= 0x39)) {
@ -1050,10 +1016,10 @@ void McgaGraphics::print(int16 fgCol, int16 bgCol, int16 scrwidth,
case 'd':
case 'u':
if (zeichen == 'd') {
izahl = va_arg(parptr, int);
int16 izahl = va_arg(parptr, int);
itoa(izahl, zstring, 10);
} else {
uzahl = va_arg(parptr, unsigned int);
uint16 uzahl = va_arg(parptr, unsigned int);
itoa(uzahl, zstring, 10);
}
k = 0;
@ -1073,10 +1039,10 @@ void McgaGraphics::print(int16 fgCol, int16 bgCol, int16 scrwidth,
case 'l':
if (string[i] != 'u') {
lzahl = va_arg(parptr, long);
long lzahl = va_arg(parptr, long);
ltoa(lzahl, zstring, 10);
} else {
luzahl = va_arg(parptr, unsigned long);
uint32 luzahl = va_arg(parptr, unsigned long);
ultoa(luzahl, zstring, 10);
++i;
}
@ -1122,12 +1088,9 @@ void McgaGraphics::print(int16 fgCol, int16 bgCol, int16 scrwidth,
void McgaGraphics::printnxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 menge,
int16 scrwidth, const char *string, ...) {
int16 i = 0, k = 0, l;
char zeichen, zstring[35];
char zstring[35];
char *tempptr;
int16 izahl, count, diff;
uint16 uzahl;
long lzahl;
uint32 luzahl;
int16 diff;
va_list parptr;
va_start(parptr, string);
_G(gcurx) = x;
@ -1135,7 +1098,7 @@ void McgaGraphics::printnxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 me
_crlfx = _G(gcurx);
_crlfy = y + _fontH + 2;
for (i = 0; i < menge;) {
zeichen = string[i];
char zeichen = string[i];
++i;
if ((zeichen < 32) || (zeichen == 127)) {
switch (zeichen) {
@ -1165,15 +1128,13 @@ void McgaGraphics::printnxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 me
putz(zeichen, fgCol, bgCol, scrwidth);
break;
}
}
else if ((zeichen >= _G(fontFirst)) && (zeichen <= _G(fontLast))) {
} else if ((zeichen >= _G(fontFirst)) && (zeichen <= _G(fontLast))) {
if (zeichen != '%') {
putz(zeichen, fgCol, bgCol, scrwidth);
vors();
}
else {
} else {
zeichen = string[i];
count = 0;
int16 count = 0;
if ((zeichen >= 0x30) && (zeichen <= 0x39))
count = atoi(string + i);
while ((zeichen >= 0x30) && (zeichen <= 0x39)) {
@ -1190,10 +1151,10 @@ void McgaGraphics::printnxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 me
case 'd':
case 'u':
if (zeichen == 'd') {
izahl = va_arg(parptr, int);
int16 izahl = va_arg(parptr, int);
itoa(izahl, zstring, 10);
} else {
uzahl = va_arg(parptr, unsigned int);
uint16 uzahl = va_arg(parptr, unsigned int);
itoa(uzahl, zstring, 10);
}
k = 0;
@ -1213,10 +1174,10 @@ void McgaGraphics::printnxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 me
case 'l':
if (string[i] != 'u') {
lzahl = va_arg(parptr, long);
long lzahl = va_arg(parptr, long);
ltoa(lzahl, zstring, 10);
} else {
luzahl = va_arg(parptr, uint32);
uint32 luzahl = va_arg(parptr, uint32);
ultoa(luzahl, zstring, 10);
++i;
} k
@ -1254,14 +1215,15 @@ void McgaGraphics::printnxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 me
break;
default:
break;
}
}
}
}
}
void McgaGraphics::printcharxy(int16 x, int16 y, char zeichen, int16 fgCol, int16 bgCol,
int16 scrwidth) {
void McgaGraphics::printcharxy(int16 x, int16 y, char zeichen, int16 fgCol, int16 bgCol, int16 scrwidth) {
_crlfx = x;
_crlfy = y + _fontH + 2;
if ((zeichen < 32) || (zeichen == 127)) {
@ -1287,6 +1249,9 @@ void McgaGraphics::printcharxy(int16 x, int16 y, char zeichen, int16 fgCol, int1
case 127:
putcxy(x, y, 32, fgCol, bgCol, scrwidth);
break;
default:
break;
}
} else if ((zeichen >= _G(fontFirst)) && (zeichen <= _G(fontLast)) && (zeichen != 127)) {
putcxy(x, y, zeichen, fgCol, bgCol, scrwidth);
@ -1320,6 +1285,9 @@ void McgaGraphics::printchar(char zeichen, int16 fgCol, int16 bgCol, int16 scrwi
case 127:
putz(32, fgCol, bgCol, scrwidth);
break;
default:
break;
}
} else if ((zeichen >= _G(fontFirst)) && (zeichen <= _G(fontLast)) && (zeichen != 127)) {
putz(zeichen, fgCol, bgCol, scrwidth);
@ -1361,8 +1329,7 @@ void McgaGraphics::exit_mausmode() {
}
int16 McgaGraphics::devices() {
int16 i;
i = 0;
int16 i = 0;
if (_mausMode != false) {
if (i > 1) {
i = 27;
@ -1376,10 +1343,11 @@ int16 McgaGraphics::devices() {
}
int16 McgaGraphics::check_stellen_anz(char *zstring, int16 *pos, int16 stellen) {
int16 k, diff;
k = 0;
int16 diff;
int16 k = 0;
while (zstring[k] != 0)
++k;
if (k >= stellen) {
while ((k) && (stellen)) {
--k;

View File

@ -30,8 +30,9 @@ namespace Chewy {
#define RIGHT_VECT 1
#define UP_VECT -_gpkt->Breite
#define DOWN_VECT _gpkt->Breite
#define GEFUNDEN 1
#define UNBEGEHBAR 2
#define MOV_START 0
#define MOV_FOUND 1
#define MOV_UNPASSABLE 2
#define Y_DOWN 1
#define Y_UP 2
#define SOURCE_COL 14
@ -287,12 +288,12 @@ short MovClass::calc_go(int16 src_feld, int16 *dst_feld) {
mi.XyzStart[0] = om.Xypos[0];
mi.XyzStart[1] = om.Xypos[1];
get_mov_vector(mi.XyzStart, mi.Vorschub, &om);
int16 ende = 0;
bool endFl = false;
int16 mov_ok = 0;
int16 steps = 0;
int16 abbruch = 0;
int16 abbruch = MOV_START;
while (!ende && !abbruch) {
while (!endFl && !abbruch) {
if (om.Count > 0) {
--om.Count;
int16 tmpx = om.Xyvo[0];
@ -342,21 +343,21 @@ short MovClass::calc_go(int16 src_feld, int16 *dst_feld) {
om.Xypos[1] + tmpy + tmpz,
_gpkt->Breite, _gpkt->Mem)) {
abbruch = UNBEGEHBAR;
abbruch = MOV_UNPASSABLE;
} else {
if (!tmpy) {
abbruch = UNBEGEHBAR;
abbruch = MOV_UNPASSABLE;
} else if (abs(om.Xypos[1] - mi.XyzEnd[1]) <= abs(tmpy)) {
abbruch = GEFUNDEN;
abbruch = MOV_FOUND;
} else {
mov_ok = MOV_Y;
}
}
} else {
if (!tmpx) {
abbruch = UNBEGEHBAR;
abbruch = MOV_UNPASSABLE;
} else if (abs(om.Xypos[0] - mi.XyzEnd[0]) <= abs(tmpx)) {
abbruch = GEFUNDEN;
abbruch = MOV_FOUND;
} else {
mov_ok = MOV_X;
}
@ -374,7 +375,7 @@ short MovClass::calc_go(int16 src_feld, int16 *dst_feld) {
}
if (om.Count == 0) {
abbruch = GEFUNDEN;
abbruch = MOV_FOUND;
}
}
@ -397,14 +398,14 @@ short MovClass::calc_go(int16 src_feld, int16 *dst_feld) {
}
if (om.Count == 0) {
abbruch = GEFUNDEN;
abbruch = MOV_FOUND;
}
mov_ok = false;
}
} else
ende = 1;
endFl = true;
}
if (abbruch == UNBEGEHBAR)
if (abbruch == MOV_UNPASSABLE)
*dst_feld = get_feld_nr(om.Xypos[0], om.Xypos[1]);
return steps;
@ -446,7 +447,7 @@ void MovClass::get_mov_line() {
}
vector = RIGHT_VECT;
} else {
abbruch = UNBEGEHBAR;
abbruch = MOV_UNPASSABLE;
}
}
@ -466,7 +467,7 @@ void MovClass::get_mov_line() {
}
}
} else {
abbruch = UNBEGEHBAR;
abbruch = MOV_UNPASSABLE;
}
}
++count;

View File

@ -306,8 +306,6 @@ int16 ged_user_func(int16 idx_nr) {
}
void enter_room(int16 eib_nr) {
int16 i;
load_room_music(_G(spieler).PersonRoomNr[P_CHEWY]);
load_chewy_taf(_G(spieler).ChewyAni);
_G(atds)->stop_aad();
@ -315,7 +313,7 @@ void enter_room(int16 eib_nr) {
_G(spieler).DiaAMov = -1;
_G(zoom_mov_fak) = 1;
for (i = 0; i < MAX_PERSON; i++) {
for (int16 i = 0; i < MAX_PERSON; i++) {
_G(spieler_mi)[i].Vorschub = 8;
_G(spieler).ZoomXy[i][0] = 0;
_G(spieler).ZoomXy[i][1] = 0;
@ -453,10 +451,7 @@ void enter_room(int16 eib_nr) {
}
void exit_room(int16 eib_nr) {
int16 *xy;
int16 x, y;
int16 no_exit;
no_exit = false;
bool no_exit = false;
_G(det)->disable_room_sound();
switch (_G(spieler).PersonRoomNr[P_CHEWY]) {
@ -512,6 +507,8 @@ void exit_room(int16 eib_nr) {
_G(spieler).R25GleiterExit = true;
break;
default:
break;
}
_G(menu_item) = CUR_WALK;
cursor_wahl(_G(menu_item));
@ -555,8 +552,8 @@ void exit_room(int16 eib_nr) {
break;
}
x = -1;
y = -1;
int16 x = -1;
int16 y = -1;
switch (eib_nr) {
case 0:
@ -598,10 +595,11 @@ void exit_room(int16 eib_nr) {
case 119:
case 123:
case 125:
case 135:
xy = (int16 *)_G(ablage)[_G(room_blk).AkAblage];
case 135: {
int16 *xy = (int16 *)_G(ablage)[_G(room_blk).AkAblage];
x = xy[0] + 30;
y = _G(spieler_vector)[P_CHEWY].Xypos[1];
}
break;
case 10:
@ -613,10 +611,11 @@ void exit_room(int16 eib_nr) {
case 78:
case 92:
case 122:
case 131:
xy = (int16 *)_G(ablage)[_G(room_blk).AkAblage];
case 131: {
int16 *xy = (int16 *)_G(ablage)[_G(room_blk).AkAblage];
x = _G(spieler_vector)[P_CHEWY].Xypos[0];
y = xy[1] + 3;
}
break;
case 6:
@ -776,25 +775,21 @@ void exit_room(int16 eib_nr) {
}
void print_rows(int16 id) {
int16 txt_anz, len;
char *txtStr, *s;
_G(out)->set_fontadr(_G(font8x8));
_G(out)->set_vorschub(_G(fvorx8x8), _G(fvory8x8));
txtStr = _G(atds)->ats_get_txt(id, TXT_MARK_NAME, &txt_anz, ATS_DATEI);
int16 txt_anz;
char *txtStr = _G(atds)->ats_get_txt(id, TXT_MARK_NAME, &txt_anz, ATS_DATEI);
_G(out)->set_pointer(nullptr);
for (int i = 0; i < txt_anz; ++i) {
s = _G(txt)->str_pos(txtStr, i);
len = (strlen(s) * _G(fvorx8x8)) / 2;
char *s = _G(txt)->str_pos(txtStr, i);
int16 len = (strlen(s) * _G(fvorx8x8)) / 2;
_G(out)->printxy(160 - len, 50 + i * 10, 14, 300, 0, "%s", s);
}
}
int16 flic_user_function(int16 keys) {
int ret;
if (_G(atds)->aad_get_status() != -1) {
switch (_G(flic_val1)) {
case 579:
@ -814,7 +809,7 @@ int16 flic_user_function(int16 keys) {
if (_G(flic_val1) == 594 && keys == 18)
_G(atds)->stop_aad();
ret = _G(in)->get_switch_code() == Common::KEYCODE_ESCAPE ? -1 : 0;
int ret = _G(in)->get_switch_code() == Common::KEYCODE_ESCAPE ? -1 : 0;
if (_G(flic_val2) == 140 && keys == 15)
ret = -2;
if (_G(flic_val2) == 144 && keys == 7)
@ -1742,8 +1737,7 @@ uint16 exit_flip_flop(int16 ani_nr, int16 eib_nr1, int16 eib_nr2,
}
int16 sib_event_no_inv(int16 sib_nr) {
int16 ret;
ret = true;
int16 ret = true;
switch (sib_nr) {
case SIB_KABEL_R1: